From 731f4046bba741d654acf0c4d1ab3bbe985ceeb7 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 5 Feb 2009 09:20:14 +0100 Subject: [PATCH] Make the arguments of the alu function curried. --- Alu.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.30.2