summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt/gadt20.hs
blob: f2f4503c31d83322bb281b9689f9167b94cde61f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# 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

import Data.Kind (Type)

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

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

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