Skip to content

Instantly share code, notes, and snippets.

@RyanGlScott
Created February 13, 2019 16:36
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 RyanGlScott/b031e7f37e8884fdf29b1422da1f2e3e to your computer and use it in GitHub Desktop.
Save RyanGlScott/b031e7f37e8884fdf29b1422da1f2e3e to your computer and use it in GitHub Desktop.
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