Implementing Strict Core

Johan Tibell johan.tibell at gmail.com
Tue May 7 18:38:08 CEST 2013


Hi,

All very good questions. Here's my current thinking on the matter:

`a` and `!a` are compatible types. The compiler will insert the `seq`s
where needed. I don't think this is useless.

First, it serves as good documentation. Documenting strictness properties,
e.g. as we do in the container library today, is awkward. Strictness
annotations on types would make the documentation precise and succinct.

Second, it's a bit more declarative than having put manually put bang
patterns at the right places in the function definition and having to
remember (and teach beginners) how to do that correctly..

Third, it might help use generate better code, especially if we also
implement Strict Core.

I believe this is analogous to what Scala does for their by-value
parameters, which types are preceded with a => annotation.

Cheers,
Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130507/2bb72ca1/attachment.htm>


More information about the ghc-devs mailing list