Changes between Version 12 and Version 13 of PolymorphicComponents


Ignore:
Timestamp:
Jan 19, 2007 11:37:42 PM (9 years ago)
Author:
ijones
Comment:

notes about semantics of binding

Legend:

Unmodified
Added
Removed
Modified
  • PolymorphicComponents

    v12 v13  
    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
    4243
    4344== Tickets ==
     
    7677        | C2 { x :: forall a. (Eq a,Show a) => a -> a }
    7778}}}
     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:
     81{{{
     82data S    = C (forall a. [a])
     83
     84f (C x)   = (show (x::[Int]), show (x::String))
     85           
     86-- f (C []) = ("[]","\"\"")
     87}}}
     88   1. this is not allowed: (see open issue above, iavor thinks GHC tried this and it was really tricky)
     89{{{
     90f (C []) = True
     91}}}