From: simonpj Date: Fri, 8 Mar 2002 16:03:13 +0000 (+0000) Subject: [project @ 2002-03-08 16:03:13 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~2291 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7fc19edc1a604c30159113404d02489142c84d42;p=ghc-hetmet.git [project @ 2002-03-08 16:03:13 by simonpj] Documentation for more liberal class-method types --- diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index 1893765..e5202b8 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -39,6 +39,13 @@ Executive summary of our extensions: + Class method types: + + + + + + Multi-parameter type classes: @@ -628,6 +635,27 @@ qualifier list has just one element, a boolean expression. + +Class method types + + +Haskell 98 prohibits class method types to mention constraints on the +class type variable, thus: + + class Seq s a where + fromList :: [a] -> s a + elem :: Eq a => a -> s a -> Bool + +The type of elem is illegal in Haskell 98, because it +contains the constraint Eq a, constrains only the +class type variable (in this case a). + + +With the GHC lifts this restriction. + + + + Multi-parameter type classes