Proposal: Strict types

Edward Z. Yang ezyang at MIT.EDU
Mon Feb 21 03:11:36 CET 2011


Hello Roman,

The strict data family idea sounds like a very easy, programmatic way
to generate usable strict versions of data types, and corresponds to
the explicit coercion method.  With some judicious name hiding,
we could keep the constructors named the same too, ala:

data instance Strict (Prelude.Maybe a) = Just !a | Nothing

I'd be in favor adding this to the strict package, though I'd want
to try playing around with it a little to make sure it's not too
clunky (one annoyance maybe having to declare instances for
all types, which sounds like a good job for deriving.)

I'm curious about how strict types interact horribly with fusion
and other optimisations; I know strictness limits your optimisation
ability, but my impression is that it shouldn't blow up too horribly
unless you're trying to implement extremely clever optimisations.

Cheers,
Edward



More information about the Libraries mailing list