Fixing Fix

David Feuer david.feuer at gmail.com
Mon Mar 23 03:01:47 UTC 2015


There are a good number of different packages that define either

newtype Fix f = Fix (f (Fix f))

or something equivalent except for naming. Most of the name variation
is in the name of the data constructor and/or record selector. This
does not look like an ideal situation to me. Most problematically, the
only way to convert one to another is with unsafeCoerce.

I think it would be rather nice to choose one canonical place for this
definition, and let everyone else use it. Ideally, it would be nice to
use some GHC pattern magic and such to paper over the differences
between the data constructor names, but I don't know if that's
possible or not.

David Feuer


More information about the Libraries mailing list