|
|
|
|
|
by mjburgess
2655 days 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. |
|