summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt/gadt20.hs
blob: c754831ce5e970e02bf0dee3a3dc5edaea8df69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE GADTs, KindSignatures #-}

-- Test for trac #810
-- Should be able to infer bool :: Bool and integer :: Integer, so
-- we should know that they both have Show instances.

module Foo where

data Pair :: (* -> *) -> * where
    Pair :: a b -> b -> Pair a

data Sel :: * -> * where
    A :: Sel Bool
    B :: Sel Integer

showSnd :: Pair Sel -> String
showSnd (Pair A bool)    = show bool
showSnd (Pair B integer) = show integer