From 6a183d556bd8af746b3d43c64af4e6668767dca6 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 13 Mar 2001 15:45:26 +0000 Subject: [PATCH 1/1] [project @ 2001-03-13 15:45:26 by simonpj] Add beginning of docs for implicit params, and functional deps; I hope formatting is ok --- ghc/docs/users_guide/glasgow_exts.sgml | 93 ++++++++++++++++++++++++++++---- 1 file changed, 84 insertions(+), 9 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index bedbc08..d71941e 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -34,11 +34,36 @@ of Bytes). Please see and following. +Type system extensions: + + GHC supports a large number of extensions to Haskell's type +system. Specifically: + + + + Multi-parameter type classes: -GHC's type system supports extended type classes with multiple -parameters. Please see . + + + + + + +Functional dependencies: + + + + + + + + +Implicit parameters: + + + @@ -47,9 +72,7 @@ parameters. Please see . Local universal quantification: -GHC's type system supports explicit universal quantification in -constructor fields and function arguments. This is useful for things -like defining runST from the state-thread world. See . + @@ -58,8 +81,7 @@ like defining runST from the state-thread world. See Extistentially quantification in data types: -Some or all of the type variables in a datatype declaration may be -existentially quantified. More details in . + @@ -74,6 +96,8 @@ for some nested declarations, where this would not be legal in Haskell + + Pattern guards @@ -2284,13 +2308,64 @@ with N. + +Implicit parameters + + + Implicit paramters are implemented as described in +"Implicit parameters: dynamic scoping with static types", +J Lewis, MB Shields, E Meijer, J Launchbury, +27th ACM Symposium on Principles of Programming Languages (POPL'00), +Boston, Jan 2000. + + + +There should be more documentation, but there isn't (yet). Yell if you need it. + + + + You can't have an implicit parameter in the context of a class or instance +declaration. For example, both these declarations are illegal: + + class (?x::Int) => C a where ... + instance (?x::a) => Foo [a] where ... + +Reason: exactly which implicit parameter you pick up depends on exactly where +you invoke a function. But the ``invocation'' of instance declarations is done +behind the scenes by the compiler, so it's hard to figure out exactly where it is done. +Easiest thing is to outlaw the offending types. + + + + + + + + +Functional dependencies + + + Functional dependencies are implemented as described by Mark Jones +in "Type Classes with Functional Dependencies", Mark P. Jones, +In Proceedings of the 9th European Symposium on Programming, +ESOP 2000, Berlin, Germany, March 2000, Springer-Verlag LNCS 1782. + + + +There should be more documentation, but there isn't (yet). Yell if you need it. + + + + Explicit universal quantification -GHC now allows you to write explicitly quantified types. GHC's -syntax for this now agrees with Hugs's, namely: +GHC's type system supports explicit universal quantification in +constructor fields and function arguments. This is useful for things +like defining runST from the state-thread world. +GHC's syntax for this now agrees with Hugs's, namely: -- 1.7.10.4