X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fusers_guide%2Fglasgow_exts.xml;h=fd6e32286d894c3b685ee68215ceedeb8c4cd2ec;hb=5e418599f051ecb88d9d2dbeea96563cf438b065;hp=f803f6dcb5fb775e5b77d4c7544fe724b5dad653;hpb=f6d61129f955dd92f96aa6fccbcc12193703c6e9;p=ghc-hetmet.git diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index f803f6d..fd6e322 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -128,6 +128,45 @@ documentation describes all the libraries that come with GHC. + : + + + + + As an experimental change, we are exploring the possibility of + making pattern bindings monomorphic; that is, not generalised at all. + A pattern binding is a binding whose LHS has no function arguments, + and is not a simple variable. For example: + + f x = x -- Not a pattern binding + f = \x -> x -- Not a pattern binding + f :: Int -> Int = \x -> x -- Not a pattern binding + + (g,h) = e -- A pattern binding + (f) = e -- A pattern binding + [x] = e -- A pattern binding + +Experimentally, GHC now makes pattern bindings monomorphic by +default. Use to recover the +standard behaviour. + + + + + + + : + + + + Use GHCi's extended default rules in a regular module (). + Independent of the + flag. + + + + + @@ -2022,6 +2061,11 @@ something more specific does not: op = ... -- Default +You can find lots of background material about the reason for these +restrictions in the paper +Understanding functional dependencies via Constraint Handling Rules. + @@ -2466,7 +2510,7 @@ function that called it. For example, our sort function might to pick out the least value in a list: least :: (?cmp :: a -> a -> Bool) => [a] -> a - least xs = fst (sort xs) + least xs = head (sort xs) Without lifting a finger, the ?cmp parameter is propagated to become a parameter of least as well. With explicit