**Paste:**#108358**Author(s):**1HaskellADay**Language:**Haskell**Channel:**-**Created:**2014-07-29 13:07:29 UTC**Revisions:**- 2014-07-29 21:28:58 UTC #108388 (diff): No title (1HaskellADay)
- 2014-07-29 13:07:29 UTC #108358: Readin' 'Ritin' 'Rithmetic (1HaskellADay)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import Control.Boolean -- http://lpaste.net/108295 {-- The meta language: Given the operators from yesterday (and, or, not, etc), and only one data type, Bool, okay: two data types, you can string the bool values together with whatever array-like structure you choose (list, deque, vector, array, pick one). Define the arithmetic operators: addition, subtraction, multiplication, exponentiation. Bonus, define division. The machine language: Reduce the arithmetic operators to a set of combinations of a single boolean operator. How are these arithmetic operators defined? How did you manage carry? A solution is posted at http://lpaste.net/108387 --} |