Changes between Version 6 and Version 7 of Ticket #57


Ignore:
Timestamp:
Jan 21, 2007 10:15:39 PM (7 years ago)
Author:
guest
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57 – Description

    v6 v7  
    7474 
    7575Again, we treat schemes as if they belong to category 'type'. 
     76 
    7677Examples: 
    7778{{{ 
     
    8081}}} 
    8182In the second example we need the parens to turn 'type' into 'atype'. 
     83 
     84One issue with labelled fields is that Haskell 98 requers that if a label appears in different constructors of a datatype, then the labelled fields should have the same type.   In the presences of polymorphic components, this translates to deciding if two schemas are equal, so we need to decide how that should work.  It seems that at present, Hugs and GHC consider two schemas to be the same if they are syntactically the same (up to alpha renaming).    
     85 
     86Examples: 
     87{{{ 
     88forall a. a -> a 
     89=== 
     90forall b. a -> b 
     91}}} 
     92{{{ 
     93forall a. (Eq a, Show a) => a -> a 
     94=/= 
     95forall a. (Show a, Eq a) => a -> a 
     96}}} 
     97 
     98The second example might be a bit surprising.  Other options: 
     99  * Allow syntactic permutations of the predicates (i.e., compare them as sets of predicates rather then lists of predicates) 
     100  * Use entailment: 
     101{{{ 
     102(forall as. ps => s) === (forall bs. qs => t) 
     103iff 
     1041) forall bs. exist as. (qs |- ps) /\ (s = t), and 
     1052) forall as. exist bs. (ps |- qs) /\ (s = t) 
     106}}} 
     107 
     108PROPOSAL: Use syntactic equivalence modulo 
     109  * alpha renamimng 
     110  * order/repetition of predicates (i.e. compare predicates as sets) 
    82111 
    83112== Constructors == 
     
    105134as a pattern, we allow only variable and wild-card patterns in the 
    106135positions corresponding to the polymorphic fields. 
     136 
    107137Example: 
    108138{{{