【发布时间】:2013-12-27 06:11:14
【问题描述】:
假设我有以下功能:
infixr 0 <|
{-# INLINE (<|) #-}
(<|) :: (a -> b) -> a -> b
f <| x = f x
foo :: a -> (forall b. b -> b) -> a
foo x f = f x
以下不检查类型:
ghci> foo 3 <| id
Couldn't match expected type `forall b. b -> b'
with actual type `a0 -> a0'
In the second argument of `(<|)', namely `id'
In the expression: f 3 <| id
In an equation for `it': it = f 3 <| id
但是,foo 3 $ id 确实。
(
【问题讨论】:
标签: haskell