diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2016-02-22 21:32:51 +0100 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2016-02-23 12:27:57 +0100 |
commit | 6074c108b66ec9cd2230852addb60782a8b17e0a (patch) | |
tree | f63eca7bf384b63a70fa19888c4288ab1243ce12 /testsuite/tests/gadt/rw.hs | |
parent | 754a2f2bb7416bd7fe453ba7bcb7c089f5ef3b8f (diff) | |
download | haskell-6074c108b66ec9cd2230852addb60782a8b17e0a.tar.gz |
Testsuite: delete Windows line endings [skip ci] (#11631)
Diffstat (limited to 'testsuite/tests/gadt/rw.hs')
-rw-r--r-- | testsuite/tests/gadt/rw.hs | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/testsuite/tests/gadt/rw.hs b/testsuite/tests/gadt/rw.hs index 0d0018ac30..081dc3643b 100644 --- a/testsuite/tests/gadt/rw.hs +++ b/testsuite/tests/gadt/rw.hs @@ -1,29 +1,29 @@ -{-# LANGUAGE GADTs #-}
-
-module Main where
-
-import Data.IORef
-
-data T a where
- Li:: Int -> T Int
- Lb:: Bool -> T Bool
- La:: a -> T a
-
-writeInt:: T a -> IORef a -> IO ()
-writeInt v ref = case v of
- ~(Li x) -> writeIORef ref (1::Int)
-
-readBool:: T a -> IORef a -> IO ()
-readBool v ref = case v of
- ~(Lb x) ->
- readIORef ref >>= (print . not)
-
-tt::T a -> IO ()
-tt v = case v of
- ~(Li x) -> print "OK"
-
-main = do
- tt (La undefined)
- ref <- newIORef undefined
- writeInt (La undefined) ref
- readBool (La undefined) ref
+{-# LANGUAGE GADTs #-} + +module Main where + +import Data.IORef + +data T a where + Li:: Int -> T Int + Lb:: Bool -> T Bool + La:: a -> T a + +writeInt:: T a -> IORef a -> IO () +writeInt v ref = case v of + ~(Li x) -> writeIORef ref (1::Int) + +readBool:: T a -> IORef a -> IO () +readBool v ref = case v of + ~(Lb x) -> + readIORef ref >>= (print . not) + +tt::T a -> IO () +tt v = case v of + ~(Li x) -> print "OK" + +main = do + tt (La undefined) + ref <- newIORef undefined + writeInt (La undefined) ref + readBool (La undefined) ref |