(no title)
kvb | 9 years ago
twice : forall a,b,c. ((a->b)&(b->c)) -> a -> c
(e.g. in MLSub, the type for twice (fun x -> x::[]) 1
is the unsatisfying (rec a = (a list | int) list)
rather than the expected (int list) list
)kvb | 9 years ago
twice : forall a,b,c. ((a->b)&(b->c)) -> a -> c
(e.g. in MLSub, the type for twice (fun x -> x::[]) 1
is the unsatisfying (rec a = (a list | int) list)
rather than the expected (int list) list
)
tomp|9 years ago
[1] https://github.com/tomprimozic/type-systems/tree/master/firs...
Edit: although on second thought, just first-class polymorphism isn't enough to fix this... any type system where the function `twice` has the same type as the function `three_times` will exhibit the same problem!
kvb|9 years ago
Jweb_Guru|9 years ago
(Actually, I think it conceivably might just be a bug in the current typechecker; ascription isn't working for records AFAICT which makes me think they might not be fully baked).