Changes between Version 3 and Version 4 of MultiParamTypeClasses


Ignore:
Timestamp:
Dec 2, 2005 11:59:03 PM (10 years ago)
Author:
ross@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MultiParamTypeClasses

    v3 v4  
    66== Brief Explanation ==
    77
     8Classes take one or more arguments, becoming relations between types.
     9
    810== References ==
    911
     
    1214 * [http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#multi-param-type-classes GHC documentation]
    1315
    14 Multiparameter type classes are used twice in the `base` package of the
    15 [http://www.haskell.org/ghc/docs/latest/html/libraries/index.html Haskell hierarchical libraries]:
     16== Pros ==
     17 * offered by GHC and Hugs for years
     18 * express more interesting relationships, as in the two occurrences in the `base` package of the [http://www.haskell.org/ghc/docs/latest/html/libraries/index.html Haskell hierarchical libraries]:
    1619{{{
    1720class HasBounds a => IArray a e
    1821class (HasBounds a, Monad m) => MArray a e m
    1922}}}
    20 The instances supplied do not overlap.
    21 
    22 They also seem to be needed, with OverlappingInstances, for container and monad classes.
    23 
    24 == Pros ==
    25 
     23   The instances supplied do not overlap.
    2624
    2725== Cons ==
    28  * Are these useful without FunctionalDependencies?
     26 * not very usable without FlexibleInstances or UndecidableInstances
     27 * often lead to OverlappingInstances and ambiguity, though these can sometimes be avoided using FunctionalDependencies or AssociatedTypes. Examples include container and monad classes.