[Haskell-cafe] Where does ~> come from?
Wolfgang Jeltsch
g9ks157k at acme.softbase.org
Tue Feb 19 16:15:57 EST 2008
Am Dienstag, 19. Februar 2008 18:26 schrieben Sie:
> […]
> However, I was told this: ~> a b is a ~> b, but if I write c a b and
> wish the effect of a `c` b. This would not work. ~> as an infix operator
> has a special place in GHC. It is not "just a type variable".
Sorry, but I don’t understand fully what you mean. :-( But nevertheless,
a ~> b is not the same as ~> a b but as (~>) a b. It’s just like with
ordinary operators where a + b is the same as (+) a b.
~> is not special in GHC. You could use, for example, ### instead of ~> and
get the same results. However, GHC accepts type operators only if you tell
it to do so. Give GHC the option -XTypeOperators or insert
{-# LANGUAGE TypeOperators #-}
at the beginning of your source file.
> […]
Best wishes,
Wolfgang
More information about the Haskell-Cafe
mailing list