[Haskell-cafe] Type synonyms considered harmful?
allbery.b at gmail.com
Mon Jan 19 00:06:37 UTC 2015
On Sun, Jan 18, 2015 at 7:02 PM, Christopher Done <chrisdone at gmail.com>
> I personally really dislike type synonyms, 9 times out of 10 I would
> prefer to just read a full type than the obscured synonym which hides
> useful structure from me.
I'm actually inclined to agree with this; the examples where they are
intended to clarify an API strike me as places where said API would likely
benefit from using actual types anyway so you don't mix things that
shouldn't be mixed. (In my experience, most of those are FFI imports or
thin wrappers over same, and a higher level Haskelly interface built on top
is a better answer than weird synonyms. On the other hand, internal type
synonyms to help the author of such an interface keep the FFI parameters
straight likely make sense; sadly, there's no way to fix C....)
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe