Skip to content

Instantly share code, notes, and snippets.

@Lysxia
Created May 22, 2019 15:26
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 Lysxia/38de0028bad0ac86cb594da7e122f1da to your computer and use it in GitHub Desktop.
Save Lysxia/38de0028bad0ac86cb594da7e122f1da to your computer and use it in GitHub Desktop.
{-# LANGUAGE RankNTypes, GADTs #-}
data Foo a = B ((a ~ Int) => a)
-- Doesn't check
-- f :: Foo a -> Int
-- f (B n) = n
data Foo' a where
B' :: (a ~ Int) => a -> Foo' a
g :: Foo' a -> Int
g (B' n) = n
main = main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment