diff options
author | David Terei <davidterei@gmail.com> | 2011-07-20 11:09:03 -0700 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-07-20 11:26:35 -0700 |
commit | 16514f272fb42af6e9c7674a9bd6c9dce369231f (patch) | |
tree | e4f332b45fe65e2a7a2451be5674f887b42bf199 /testsuite/tests/typecheck/should_run/T2722.hs | |
parent | ebd422aed41048476aa61dd4c520d43becd78682 (diff) | |
download | haskell-16514f272fb42af6e9c7674a9bd6c9dce369231f.tar.gz |
Move tests from tests/ghc-regress/* to just tests/*
Diffstat (limited to 'testsuite/tests/typecheck/should_run/T2722.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_run/T2722.hs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/T2722.hs b/testsuite/tests/typecheck/should_run/T2722.hs new file mode 100644 index 0000000000..3912c840e7 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/T2722.hs @@ -0,0 +1,34 @@ +module Main (main, arid1, arid2) where + +import Prelude hiding (id, (.)) +import qualified Prelude +import Control.Category +import Control.Arrow +import System.IO +import Debug.Trace + + +main = do { xs <- runXIOState arid1 -- Works with arid2 + ; print xs } + +runXIOState :: IOSLA () c -> IO [c] +runXIOState f = runIOSLA f () + +newtype IOSLA a b = IOSLA { runIOSLA :: a -> IO [b] } + +instance Arrow IOSLA where + arr f = IOSLA $ \ x -> return [f x] + +instance Category IOSLA where + id = arr id + +-- arr :: Arrow m => (b->c) -> m b c +-- id :: Category m => m b b +-- (arr id) :: Arrow m => m a a + +arid1 :: Arrow m => m a a +arid1 = arr id + +arid2 :: Arrow m => m a a +arid2 = arr Prelude.id + |