Skip to content

Instantly share code, notes, and snippets.

@kgadek
Created January 29, 2015 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgadek/be334e27f4a45c21ba92 to your computer and use it in GitHub Desktop.
Save kgadek/be334e27f4a45c21ba92 to your computer and use it in GitHub Desktop.
How to force typechecker not to instantiate `id` ?
{-# LANGUAGE RankNTypes, ImpredicativeTypes, ScopedTypeVariables #-}
main = return ()
data Lam f = Lam f
helper =
let a = Lam undefined :: Lam (forall a. a -> a)
--b = Lam id :: Lam (forall a. a -> a)
--c = Lam id2 :: Lam (forall a. a -> a)
in ()
id2 :: forall a. a -> a
id2 x = x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment