From: sof Date: Thu, 30 Apr 1998 20:36:11 +0000 (+0000) Subject: [project @ 1998-04-30 20:36:09 by sof] X-Git-Tag: Approx_2487_patches~736 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9d91014f07d4418ce4a91f2b0cc7f0a7aa89ba70;p=ghc-hetmet.git [project @ 1998-04-30 20:36:09 by sof] new local universal quant test --- diff --git a/ghc/tests/typecheck/should_compile/tc096.stderr b/ghc/tests/typecheck/should_compile/tc096.stderr new file mode 100644 index 0000000..a5e5580 --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc096.stderr @@ -0,0 +1,6 @@ +ghc: module version changed to 1; reason: no old .hi file +_exports_ +ShouldSucceed main x; +_declarations_ +1 main _:_ PrelIOBase.IO PrelBase.() ;; +1 x _:_ PrelBase.Double ;; diff --git a/ghc/tests/typecheck/should_compile/tc097.hs b/ghc/tests/typecheck/should_compile/tc097.hs new file mode 100644 index 0000000..fac0101 --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc097.hs @@ -0,0 +1,10 @@ +--!!! Local universal quantification. +module ShouldSucceed where + +import PrelGHC -- to get at All + +data Monad2 m = MkMonad2 (All a => a -> m a) + ((All a, All b) => m a -> (a -> m b) -> m b) + +halfListMonad :: ((All a, All b) => [a] -> (a -> [b]) -> [b]) -> Monad2 [] +halfListMonad b = MkMonad2 (\x -> [x]) b diff --git a/ghc/tests/typecheck/should_compile/tc097.stderr b/ghc/tests/typecheck/should_compile/tc097.stderr new file mode 100644 index 0000000..19704af --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc097.stderr @@ -0,0 +1,9 @@ +ghc: module version changed to 1; reason: no old .hi file +_exports_ +ShouldSucceed halfListMonad Monad2(MkMonad2); +_instances_ +instance _forall_ [a :: (* -> *)] => {PrelBase.Eval (Monad2 a)} = $dEvalMonad20; +_declarations_ +1 $dEvalMonad20 _:_ _forall_ [a :: (* -> *)] => {PrelBase.Eval (Monad2 a)} ;; +1 data Monad2 m :: (* -> *) = MkMonad2 (_forall_ [a] => a -> m a) (_forall_ [a b] => m a -> (a -> m b) -> m b) ; +1 halfListMonad _:_ (_forall_ [a b] => [a] -> (a -> [b]) -> [b]) -> Monad2 PrelBase.[] ;;