Ticket #3503 (closed feature request: wontfix)

Opened 4 years ago

Last modified 4 years ago

Add __attribute__((constructor))-equivalent pragma

Reported by: pumpkin Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.11
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

It would be nice to let one's library perform initialization tasks at load time. Then the integer-gmp allocation functions could be changed from within haskell and various other FFI libraries would be easier to bind to. As for syntax, maybe something like the following would work?

{-# CONSTRUCTOR f #-} f :: IO () f = ...

Change History

Changed 4 years ago by duncan

This is like the top level (safe) IO and top level reference proposals and is generally quite controversial.

Changed 4 years ago by igloo

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to wontfix

I'm going to close this ticket, due to the lack of consensus that it should be done, and what the design should be. As Duncan says, there have been some discussions about it on the lists.

Note: See TracTickets for help on using tickets.