[[project @ 2001-03-13 15:45:26 by simonpj] simonpj**20010313154526 Add beginning of docs for implicit params, and functional deps; I hope formatting is ok ] { hunk ./ghc/docs/users_guide/glasgow_exts.sgml 37 +Type system extensions: + + GHC supports a large number of extensions to Haskell's type +system. Specifically: + + + + hunk ./ghc/docs/users_guide/glasgow_exts.sgml 48 -GHC's type system supports extended type classes with multiple -parameters. Please see . + + + + + + +Functional dependencies: + + + + + + + + +Implicit parameters: + + + hunk ./ghc/docs/users_guide/glasgow_exts.sgml 75 -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 . + hunk ./ghc/docs/users_guide/glasgow_exts.sgml 84 -Some or all of the type variables in a datatype declaration may be -existentially quantified. More details in . + hunk ./ghc/docs/users_guide/glasgow_exts.sgml 99 + + hunk ./ghc/docs/users_guide/glasgow_exts.sgml 2311 + +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. + + + + hunk ./ghc/docs/users_guide/glasgow_exts.sgml 2365 -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: }