[Haskell-cafe] Re: Re: typeclass namespace rational?
Maciej Piechotka
uzytkownik2 at gmail.com
Tue Nov 16 18:32:23 EST 2010
On Tue, 2010-11-16 at 00:55 -0500, Daniel Peebles wrote:
> If I were to guess, I'd say it's because there are two major "spaces"
> in Haskell, the type level and the value level. They never interact
> directly (their terms are never juxtaposed) so there's not much chance
> for confusion. "Typeclass constructors" and type constructors do
> however live in the same space. The fact that you propose "instance
> String String" might be odd to some. It's still unambiguous, but isn't
> necessarily the most clear:
>
>
> (with higher-sorted kind polymorphism, MPTCs, type families, and
> GADTs)
>
>
> instance String String String String String where
> data String String String String String where String :: String
> String String String String
>
>
> :-)
data Buffalo = Buffalo
class Buffalo b where
type familly Buffalo b
instance Buffalo Buffalo where
type familly Buffalo Buffalo = Buffalo
instance Buffalo b => Buffalo (Buffalo b) where
type familly Buffalo (Buffalo b) = b
But:
data Buffalo b = Buffalo b
class Buffalo b where
type familly Buffalo b
-- Is it about Buffalo (type) b being buffalo or result of
-- Buffalo (type function) being Buffalo?
instance Buffalo b => Buffalo (Buffalo b) where
type familly Buffalo (Buffalo b) = b
Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20101116/3c107353/attachment.bin
More information about the Haskell-Cafe
mailing list