• batterseapower's avatar
    Implement associated type defaults · de8c8d68
    batterseapower authored
    Basically, now you can write:
      class Cls a where
        type Typ a
        type Typ a = Just a
    And now if an instance does not specify an explicit associated type
    instance, one will be generated afresh based on that default. So for
    example this instance:
      instance Cls Int where
    Will be equivalent to this one:
      instance Cls Int where
        type Typ Int = Just Int
HsDecls.lhs 39.9 KB