Commit 316afaf2 authored by simonpj's avatar simonpj
Browse files

Update deriving test for type families/gadts

parent 035d2a9b
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilies, StandaloneDeriving, FlexibleInstances, GADTs #-}
module Main where
-- Tests that deriving works for data families
data family Foo a
data instance Foo Int
......@@ -12,4 +13,12 @@ f A = True
f B = False
f _ = True
main = print (map f [B .. D])
-- Tests that deriving works for GADTs
data Bar a where
P :: Int -> Bar Int
Q :: Bar Int
deriving instance (Eq (Bar Int))
main = do { print (map f [B .. D])
; print [P 3 == P 3, P 4 == Q] }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment