[Haskell-cafe] Type synonyms considered harmful?
chrisdone at gmail.com
Mon Jan 19 00:02:45 UTC 2015
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.
On 17 January 2015 at 20:06, Julian Ospald <hasufell at posteo.de> wrote:
> I've recently had a discussion about type synonyms and when to use them
> in haskell.
> On the one hand, they make reading type signatures easier and tell you
> what is meant, not just what is inside. On the other hand they also sort
> of hide what is inside, although you will probably need to know exactly
> that when using them. This might make reading code for new collaborators
> more difficult if they have to memorize all type synonyms first.
> So there are basically a few questions:
> * What do you think is a good policy for when and how to use them? Or
> would you say just not use them at all and put equivalent information in
> parameter documentation?
> * What are the upsides, downsides, pitfalls and also alternatives? (for
> completeness, also since
> https://www.haskell.org/haskellwiki/Type_synonym is a bit sparse)
> * Can we do something to improve the downsides? Or is there already
> something? (e.g. editor/IDE that can tell me the underlying type, error
> messages etc.)
> Julian Ospald
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe