Proposal: Strict types

Roman Leshchinskiy rl at cse.unsw.edu.au
Fri Feb 18 12:47:06 CET 2011


Edward Z. Yang wrote:
>
> 3. Syntax extension for strict pairs
>
>
> We extend syntax to allow a way of specifying strict pairs (maybe
> (! 1, 2, 3 !), with operator (!,) (!,,) etc).  These are distinct from
> normal pairs and have their own set of functions.

FWIW, we thought about this when we were just starting out with DPH. In
the end, we decided that the gains are not worth the new syntax. Now, we
don't even use strict pairs (or other types) in DPH any longer because
they interact rather horribly with fusion and other optimisations.

BTW, the following works now:

data family Strict a
data instance Strict (a,b) = SPair !a !b
data instance Strict (Maybe a) = SJust !a | SNothing
...

I was going to add this to the strict package at some point but it never
happened.

Roman






More information about the Libraries mailing list