{-# LANGUAGE Haskell2010 #-} -- reset extensions so we know what's going on {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} module M where foo0 (f :: a -> b) (xs :: [a]) = case xs of [] -> [] y:ys -> f y : foo0 @a @b f ys foo1 :: (a -> b) -> [a] -> [b] foo1 (f :: a -> b) (xs :: [a]) = case xs of [] -> [] y:ys -> f y : foo1 @a @b f ys foo2 :: forall a b. (a -> b) -> [a] -> [b] foo2 (f :: a -> b) (xs :: [a]) = case xs of [] -> [] y:ys -> f y : foo2 @a @b f ys foo3 :: forall {a} {b}. (a -> b) -> [a] -> [b] foo3 (f :: a -> b) (xs :: [a]) = case xs of [] -> [] y:ys -> f y : foo3 @a @b f ys