So, today I played with Haskell, thinking about auto-generating function definitions defined by a type.
For example, a function definition
twoply :: (a -> b, a -> c) -> a -> (b, c)
obvious to me, given the type (if I exclude the use undefined :: a).
So, I came up with the following:
ยข :: a -> (a ->b) -> b
ยข = flip ($)
What has an interesting property, that
(ยข) ยข ($) :: a -> (a -> b) -> b
This brings me to my question. If the relation =::=for "has the same type as", then does the operator x =::= x x ($)uniquely determine the type x? Should x =::= ยข, or is there another possible type for x?
I tried to back away x =::= x x ($)to get out x :: a -> (a -> b) -> b, but got bogged down.
source
share