Skip to content

Instantly share code, notes, and snippets.

Created Feb 13, 2019
What would you like to do?
Pattern synonym existential scoping weirdness
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Bug where
import Data.Kind
import Data.Proxy
data T = forall k (a :: k). MkT (Proxy a)
-- Uncomment `k` and it typechecks
pattern P :: forall. () => forall {-k-} (a :: k). Proxy a -> T
pattern P x = MkT (x :: Proxy (a :: k))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment