[Haskell-cafe] Type synonyms considered harmful?
sk at k-hornz.de
Mon Jan 19 10:16:05 UTC 2015
On 19/01/2015 01:02, Christopher Done wrote:
> 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 find type synonyms mostly useful during prototyping, i.e. when what I
want is actually a newtype for safer interfaces but I don't want to
bother with wrapping/unwrapping or figuring out how to derive instances;
this is especially true for monad transformer stacks. later, after the
code has settled a bit, it's straight forward, if tedious, to change the
type to a newtype and fix the resulting type errors.
More information about the Haskell-Cafe