From 7fc19edc1a604c30159113404d02489142c84d42 Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 8 Mar 2002 16:03:13 +0000 Subject: [PATCH] [project @ 2002-03-08 16:03:13 by simonpj] Documentation for more liberal class-method types --- ghc/docs/users_guide/glasgow_exts.sgml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 -- 1.7.10.4