From: Matthijs Kooijman Date: Thu, 5 Feb 2009 08:20:14 +0000 (+0100) Subject: Make the arguments of the alu function curried. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=commitdiff_plain;h=731f4046bba741d654acf0c4d1ab3bbe985ceeb7 Make the arguments of the alu function curried. --- diff --git a/Alu.hs b/Alu.hs index b888fc9..f444abc 100644 --- a/Alu.hs +++ b/Alu.hs @@ -45,9 +45,9 @@ register_bank (addr, High, d) s = -- Write type AluOp = Bit -alu :: (AluOp, Bit, Bit) -> Bit -alu (High, a, b) = a `hwand` b -alu (Low, a, b) = a `hwor` b +alu :: AluOp -> Bit -> Bit -> Bit +alu High a b = a `hwand` b +alu Low a b = a `hwor` b type ExecState = (RegisterBankState, Bit, Bit) exec :: (RegAddr, Bit, AluOp) -> ExecState -> (ExecState, ()) @@ -58,7 +58,7 @@ exec (addr, Low, op) s = where (reg_s, t, z) = s (reg_s', t') = register_bank (addr, Low, DontCare) reg_s - z' = alu (op, t', t) + z' = alu op t' t s' = (reg_s', t', z') -- Write