2 ms·
I don't think HKTs are the solution here. The problem is that functions have curried type signatures (ie., they are typed st. all the arguments "come together",
by mjburgess 8y ago
I don't think HKTs are the solution here. The problem is that functions have curried type signatures (ie., they are typed st. all the arguments "come together", so the arity is part of the type).
In Haskell I believe when you write fn :: a -> b
a can be inferred to be (Int -> Int -> Int), say.
Here when you write pipe<A, B>(A => B): A => B
'A => B' just means a function from one-arg A to one-arg B.
The solution is some sort of type-level function, but it also requires new sorts of type variables.
- ratmice 8y agoOne can do this sort of thing in Ur i believe, which uses system F-omega with row polymorphic types, http://www.impredicative.com/ur/ http://www.impredicative.com/ur/