Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Haskell class type simulation
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Johan Baltié <johan.baltie@w...>
Subject: [Caml-list] Haskell class type simulation
Hi !

I'm currently looking for a way to simulate  the Haskell "class type" notion 
in OCaml i.e. the same kind of :

class Eq a where
    (==), (/=) :: a -> a -> Bool

class (Eq a) => Ord a where
    compare                :: a -> a -> Ordering
    (<), (<=), (>=), (>)   :: a -> a -> Bool
    max, min               :: a -> a -> a

For me it's a bit like module signature with an abstract type and an 
"extending" semantic and a type constraint.

Any hint ?
-- 
Ciao

Jo

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners