Changes between Version 5 and Version 6 of PolymorphicComponents


Ignore:
Timestamp:
Dec 2, 2005 11:44:06 PM (8 years ago)
Author:
ross@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PolymorphicComponents

    v5 v6  
    1515MkSwizzle :: (forall a. Ord a => [a] -> [a]) -> Swizzle 
    1616}}} 
     17If [wiki:RankNTypes] are not supported, these data constructors are subject to similar restrictions to [wiki:Rank2Types functions with rank-2 types]: 
     18 * polymorphic arguments can only be matched by a variable or wildcard (`_`) pattern 
     19 * when the costructor is used, it must be applied to the polymorphic arguments 
     20 
    1721This feature also makes it possible to create explicit dictionaries, e.g. 
    1822{{{ 
     
    2731bind :: MyMonad m -> m a -> (a -> m b) -> m b 
    2832}}} 
     33 
    2934== References == 
    3035 * [http://www.cse.ogi.edu/~mpj/pubs/haskwork95.html From Hindley-Milner Types to First-Class Structures] by Mark P. Jones, Haskell Workshop, 1995. 
     
    3237 
    3338== Pros == 
    34  * type inference seems to be a simple extension of Hindley-Milner. 
     39 * type inference is a simple extension of Hindley-Milner. 
     40 * offered by GHC and Hugs for years 
    3541 * large increment in expressiveness: types become impredicative, albeit with an intervening data constructor, enabling Church encodings and similar System F tricks. 
    3642   Functions with [wiki:Rank2Types rank-2 types] may be trivially encoded. 
    3743   Functions with [wiki:RankNTypes rank-n types] may also be encoded, at the cost of packing and unpacking `newtype`s. 
    38  * used by the [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-ParserCombinators-ReadP.html ReadP] type, which figures in a [wiki:ReadClass proposed replacement for the Read  class]. 
     44 * useful for polymorphic continuation types, like the [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text-ParserCombinators-ReadP.html ReadP] type used in a [wiki:ReadClass proposed replacement for the Read  class]. 
    3945 
    4046== Cons ==