summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/TyAppPat_UniversalMulti2.hs
blob: f01b6067991c9036ee009a9ec8c25a7fb078d3fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE KindSignatures #-}

module Main where

data Foo a b where
  MkFoo :: forall b a. a -> (a -> b -> String) -> Foo a b

foo :: Foo a b -> b -> String
foo (MkFoo @c @d x f) t = f (x :: d) (t :: c)

main = do
  print (foo (MkFoo True (\x y -> show x ++ show y) :: Foo Bool Integer) (6 :: Integer))