[Haskell-cafe] Re: [Haskell] Re: Proposal: unification of style of function/data/type/class definitions

Neil Mitchell ndmitchell at gmail.com
Sun Sep 10 06:57:10 EDT 2006


Hi

> I don't see the problem. You can read all of Bulat's
> examples as "'thing being declared' 'relationship' 'value'
> given that 'context'", so this one is ""sequence" has type
> "[m a] -> m [a]" given that "m" is a "Monad"". So viewed
> that way, they're all consistent with each other.

How about name, context, value as the three elements:

class <name> | <context> where <value>

data <name> | <context> = <value>

type <name> | <context> = <value>

<name> | <context> :: <value>

For class and data, you can argue that it isn't really a <value>, its
<inner> or something. But type definately has a <value>. And if you
want data and type consistent, you need to put them like that. And
then, if you want functions consistent with types, you have to do the
above.

Or at least thats what my brain interprets as logical, and on the plus
side it changes data/type/class which I personally don't like, but
doesn't change function declarations, which I am not aware of anyone
having issue with.

Thanks

Neil


More information about the Haskell-Cafe mailing list