[GHC] #8347: Add a Strict LANGUAGE pragma

GHC ghc-devs at haskell.org
Mon Aug 10 19:04:49 UTC 2015


#8347: Add a Strict LANGUAGE pragma
-------------------------------------+-------------------------------------
        Reporter:  tibbe             |                   Owner:  adamse
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  7.6.3
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
                                     |  Phab:D1033, Phab:D1142
-------------------------------------+-------------------------------------
Changes (by adamse):

 * owner:  tibbe => adamse
 * differential:  Phab:D1033 => Phab:D1033, Phab:D1142


Old description:

> A `Strict` `LANGUAGE` pragma would allow us to experiment with writing in
> a strict sub-language. Since this pragma works on a per module basis, it
> needs to be modular. I propose the following semantics:
>
>  * Patterns are strict at the top-level, as if they had a top-level bang,
> unless an explicit ~ is used to make the pattern lazy.
>  * Functions evaluate their parameters to WHNF.
>  * Data type fields are strict (as if they had a bang-pattern).

New description:

 A `Strict` `LANGUAGE` pragma would allow us to experiment with writing in
 a strict sub-language. Since this pragma works on a per module basis, it
 needs to be modular. I propose the following semantics:

  * Patterns are strict at the top-level, as if they had a top-level bang,
 unless an explicit ~ is used to make the pattern lazy.
  * Functions evaluate their parameters to WHNF.
  * Data type fields are strict (as if they had a bang-pattern).

 Design page: StrictPragma

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8347#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list