On Wed, Dec 21, 2011 at 10:53 AM, Matthew Farkas-Dyck
<strake...@gmail.com> wrote:
> With GHC 7.0.3:
>
> $ cat test.hs
> class ℝ a where {
>  test :: a;
> };
>
> (∈) :: Eq a => a -> [a] -> Bool;
> x ∈ (y:ys) = x == y || x ∈ ys;
>
> main = putStrLn "Two of three ain't bad (^_~)";
> $ runhaskell test.hs
> Two of three ain't bad (^_~)
> $

Why not expand it even further?

class Monoid m where
    (•) :: m -> m -> m
    (∅) :: m

(∈) :: (Foldable t, Eq a) => a -> t a -> Bool

(∘) :: (b -> c) -> (a -> b) -> (a -> c)

(∧) :: Bool -> Bool -> Bool

etc.

We can write a whole Haskell library full of these aliases --
"syntactic-heroin" perhaps? ;)

(http://www.haskell.org/haskellwiki/Syntactic_sugar/Cons#Syntactic_heroin)

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

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

Reply via email to