Implementing Strict Core

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


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list