packages feed

arithmatic 0.1.0.2 → 0.1.0.3

raw patch · 2 files changed

+26/−1 lines, 2 files

Files

+ Math/Arithmatic.hs view
@@ -0,0 +1,24 @@+module Math.Arithmatic where++{-# LANGUAGE NoMonomorphismRestriction #-}++inc = (+1)+dec = (subtract 1)++add 0 b = b+add a b = add (dec a) (inc b)++multiply _ 0 = 0+multiply a b = add a (multiply a (dec b))++division _ 0 = error "divide by zero error"+division a 1 = 1+division a n | a > 0 = 1 + division (a-n) n+             | otherwise = 0 ++power a 0 = 1+power a b = multiply a (power a (dec b))++logarithm _ 0 = 1+logarithm _ 1 = 0+logarithm base number = 1 + logarithm base (division number base)
arithmatic.cabal view
@@ -1,5 +1,5 @@ name: arithmatic-version: 0.1.0.2+version: 0.1.0.3 synopsis: do things with numbers description: a library which implements arithmatic functions cabal-version: >=1.10@@ -19,5 +19,6 @@ library     build-depends: base < 10000     default-language: Haskell2010+    exposed-modules: Math.Arithmatic