diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-18 22:44:19 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-20 16:22:07 +0200 |
commit | 46ff80f26d1892e1b50e3f10c5d3fded33da6e81 (patch) | |
tree | c53fd835b689b6b64a729a42e4cc6482d8fb5215 /testsuite/tests/cpranal | |
parent | 7e7094f166b6e475a49e20b98cbca851334aedaf (diff) | |
download | haskell-46ff80f26d1892e1b50e3f10c5d3fded33da6e81.tar.gz |
Testsuite: tabs -> spaces [skip ci]
Diffstat (limited to 'testsuite/tests/cpranal')
-rw-r--r-- | testsuite/tests/cpranal/should_compile/Cpr001.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/cpranal/should_compile/Cpr001_imp.hs | 40 |
2 files changed, 21 insertions, 21 deletions
diff --git a/testsuite/tests/cpranal/should_compile/Cpr001.hs b/testsuite/tests/cpranal/should_compile/Cpr001.hs index 0871205bb7..e94db4c49c 100644 --- a/testsuite/tests/cpranal/should_compile/Cpr001.hs +++ b/testsuite/tests/cpranal/should_compile/Cpr001.hs @@ -5,7 +5,7 @@ import Cpr001_imp -- ------------------------------------------------------------------- -intpInstr :: Instr -> MST () +intpInstr :: Instr -> MST () intpInstr (SysCall "exit") = setMTerminated diff --git a/testsuite/tests/cpranal/should_compile/Cpr001_imp.hs b/testsuite/tests/cpranal/should_compile/Cpr001_imp.hs index 22352ead05..e5175b658d 100644 --- a/testsuite/tests/cpranal/should_compile/Cpr001_imp.hs +++ b/testsuite/tests/cpranal/should_compile/Cpr001_imp.hs @@ -5,13 +5,13 @@ module Cpr001_imp where import Control.Applicative (Applicative(..)) import Control.Monad (liftM, ap) -data MS = MS { instr :: String - , pc :: Int - , mem :: String - , stack :: String - , frames :: [String] - , status :: Maybe String - } +data MS = MS { instr :: String + , pc :: Int + , mem :: String + , stack :: String + , frames :: [String] + , status :: Maybe String + } newtype StateTrans s a = ST ( s -> (s, Maybe a)) @@ -30,23 +30,23 @@ instance Applicative (StateTrans s) where instance Monad (StateTrans s) where (ST p) >>= k - = ST (\s0 -> let - (s1, r0) = p s0 - in - case r0 of - Just v -> let + = ST (\s0 -> let + (s1, r0) = p s0 + in + case r0 of + Just v -> let (ST q) = k v - in - q s1 - Nothing -> (s1, Nothing) - ) + in + q s1 + Nothing -> (s1, Nothing) + ) return v - = ST (\s -> (s, Just v)) + = ST (\s -> (s, Just v)) -- machine state transitions -type MachineStateTrans = StateTrans MS +type MachineStateTrans = StateTrans MS type MST = MachineStateTrans @@ -60,6 +60,6 @@ setMSvc call -- ------------------------------------------------------------------- data Instr - = LoadI Int -- load int const - | SysCall String -- system call (svc) + = LoadI Int -- load int const + | SysCall String -- system call (svc) |