On Tue, Sep 29, 2009 at 7:40 PM, Olex P <hoknam...@gmail.com> wrote:

> Hi everyone,
>
> Dumb question about declaring a function and type synonyms.
> There are to different declarations of the same function:
>
> attrNames :: String -> AttrDict -> [String]
>
> attrNames :: AttrClass -> AttrDict -> AttrNames
>
> First gives you the idea about exact types it expects (except AttrDict for
> which user has to take a look into the docs or sources) while the second one
> gives you the idea about meaning of parameters.
> Both reasons make sense. The question is when which one should be used? I'm
> using type synonyms everywhere and possibly without too much reasons...
> Maybe I should stop doing it? :)
>
>
I like type synonyms. You can always look up what the type synonym boils
down to, while the reverse cannot be done. Of course, some Haddock markup
can also solve the problem.

Michael
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to