4-Bit Ripple Carry Adder in Haskell
rippleCarryAdder is very hard to read. We can make it a lot easier to read if we use local bindings with let … in …:

rippleCarryAdder :: Nibble -&gt; Nibble -&gt; Nibble
rippleCarryAdder (a0, a1, a2, a3) (b0, b1, b2, b3) =
   let (r3, c3) = fulladder a3 b3 False
       (r2, c2) = fulladder a2 b2 c3
       (r1, c1) = fulladder a1 b1 c2
       (r0, _ ) = fulladder a0 b0 c1
   in (r0, r1, r2, r3)


We also don't have to recalculate fulladder a3 b3 False four times.



The functions faccess and saccess already exist and are called fst and snd.