Commit 4e0d33c1 authored by Jan-Hendrik Matthes's avatar Jan-Hendrik Matthes 😄

Add a new test for the dollar operator

parent 2ee5494c
......@@ -245,6 +245,14 @@ failInfos = map (uncurry mkFailTest)
, "Module Prelude does not export bar"
]
)
, ("ImpredDollar",
[ "Type error in infix application"
, "constFun x $ f"
, "Cannot instantiate unification variable"
, "with a type involving foralls:"
, "Impredicative polymorphism isn't yet supported."
]
)
, ("ImpredPoly",
[ "Illegal polymorphic type (Bool, forall b. a -> b, Int)"
, "Illegal polymorphic type [forall a. a -> a]"
......
{-# LANGUAGE RankNTypes #-}
import Prelude hiding (($))
infixr 0 $
($) :: (a -> b) -> a -> b
f $ x = f x
constFun :: a -> (forall b. b -> b) -> a
constFun x _ = x
constFunTest :: a -> (forall b. b -> b) -> a
constFunTest x f = constFun x $ f
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment