Changes between Version 13 and Version 14 of PolymorphicComponents


Ignore:
Timestamp:
Jan 20, 2007 12:03:18 AM (9 years ago)
Author:
ijones
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PolymorphicComponents

    v13 v14  
    4040}}}
    4141 1. hugs vs. ghc treatment as keyword (see below)
    42  1. design choice: only wildcard & variables required in patterns (ghc allows as-patterns, hugs doesn't) allowed for polymorphic fields
     42 1. design choice: only wildcard & variables are allowed when pattern matching on polymorphic components (ghc allows as-patterns, hugs doesn't)
    4343
    4444== Tickets ==
     
    7777        | C2 { x :: forall a. (Eq a,Show a) => a -> a }
    7878}}}
    79  1. ''note'' when you pattern-match on a field w/ a polymorphic type, the bound variables also have a polymorphic type
    80    1. but case is different; it instantiates the forall to a monomorphic type as below:
     79 1. ''note'' you can name polymorphic components (see design choice above)
     80   1. when you match on ''x'' it instantiates the forall to a monomorphic type as below:
    8181{{{
    8282data S    = C (forall a. [a])
     
    9090f (C []) = True
    9191}}}
     92   1. desugaring...
     93{{{
     94f (C []) = e1 -- illegal
     95}}}
     96  would desugar to
     97{{{
     98f x = case x of
     99       C [] -> e 1 -- illegal
     100       _ -> error ...
     101}}}
     102  would desugar to
     103{{{
     104case x of
     105 C y -> case y of -- NOT illegal
     106         [] -> e1
     107         _ -> error...
     108 _ -> error...
     109
     110}}}
     111  which is a little funny.
     112 1. where is explanation of type checking...
     113 1. where to put the bangs in strict polymorphic fields, hugs and GHC differ - can't figure it out in Hugs