Closed AshleyYakeley closed 4 years ago
Related to #26.
Consider:
bodyweight :: Animal ~> Mass;
name :: Human ~> Text;
Human <= Animal;
myDog :: Animal;
myHuman :: Human;
then
bn :: {-Human,+Animal} ~> (Mass,Text)
bn = bodyweight !** name
bn !$% pureRef myHuman :: Ref (Mass,Text)
bn !$% pureRef myDog -- type error
It's now
!** :: ({-ap,+Entity,+aq} ~> {-bp,+bq}) -> ({-ap,+Entity,+aq} ~> {-cp,+cq}) -> {-ap,+aq} ~> {-(bp, cp),+(bq, cq)}
!++ :: ({-ap,+aq} ~> c) -> ({-bp,+bq} ~> c) -> {-(Either ap bp),+(Either aq bq)} ~> c
OK, now they're both correct:
!** :: ({-ap,+Entity,+aq} ~> {-bp,+bq}) -> ({-ap,+Entity,+aq} ~> {-cp,+cq}) -> {-ap,+aq} ~> {-(bp, cp),+(bq, cq)}
!++ :: ({-ap,+aq} ~> {-cp,+cq}) -> ({-bp,+bq} ~> {-cp,+cq}) -> {-(Either ap bp),+(Either aq bq)} ~> {-cp,+cq}
Currently we have:
Would prefer: