Closed evincarofautumn closed 10 years ago
Why not this?
def trip (a a (a a -> a) -> (a & a & a)):
-> { a b f }
a b f@ // fat
dup dup
pair pair
Or is it just a bad example?
There is already a workaround for it:
def trip (a a (a a -> a) -> (a & a & a)): -> { a b c } a b f@ -> x a b f@ -> y a b f@ -> z x y z pair pair
But the behavior that most would probably expect would be for invocations of f
to still be valid when applied multiple times, the same way any normal local can be pushed onto the stack multiple times after it is bound.
It should be possible to write this function:
But its type is:
When it should be the rank-2:
So the compiler complains because
f
is applied to different stack types.