But we can do next:
Prelude> :set XPostfixOperators
Prelude> let z = (\y -> True) :: a -> Bool
Prelude> :t (True `z`)
But still
`z` True ~\a -> a `z` True~ \a -> z a True
and `z` must be a function with minimum 2 arguments
--
View this message in context:
http://haskell.
On Fri, Sep 06, 2013 at 05:04:12PM +0200, Johannes Emerich wrote:
> Weirdly, however, infix notation can also be used for unary functions with
> polymorphic types, as the following ghci session shows:
>
>Prelude> :t (`id` 1)
>(`id` 1) :: Num a => (a -> t) -> t
>Prelude> (`id` 1) (\y ->
The observation that this only applies to functions with a polymorphic
return type is key.
id :: a -> a
This can be instantiated at
id' :: (a->b) -> (a->b)
id' :: (a->b) -> a -> b-- these are the same
What this means is that id is a function with arity-2 whenever the first
argument is
On Fri, Sep 6, 2013 at 11:04 AM, Johannes Emerich wrote:
> Desugaring of an equivalent source file shows that id is applied to the
> anonymous function, which is then applied to 1.
>
> The following example of a function that is not polymorphic in its return
> type behaves closer to what I would h