diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-12-09 16:32:32 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-12-09 16:32:32 +0100 |
| commit | 3624c712d72d246f21d4e710cec7c11e052e0326 (patch) | |
| tree | f385cb51c72a0c5eeb2057609b75f5f8c6c4f272 /Haskell-book/02/src | |
| parent | c95abc31d62e296db4f1b537e3de440dd40defd1 (diff) | |
| download | book-exercises-3624c712d72d246f21d4e710cec7c11e052e0326.tar.gz | |
Add the haskell book
Diffstat (limited to 'Haskell-book/02/src')
| -rw-r--r-- | Haskell-book/02/src/Main.purs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Haskell-book/02/src/Main.purs b/Haskell-book/02/src/Main.purs new file mode 100644 index 0000000..feb0fd2 --- /dev/null +++ b/Haskell-book/02/src/Main.purs @@ -0,0 +1,28 @@ +module Main where + +import Prelude +import Control.Monad.Eff (Eff) +import Control.Monad.Eff.Console (CONSOLE, log) +import Math (pi) + +-- +-- 2.5 Comprehensive check +-- +mulSquare :: Number -> Number +mulSquare x = pi * (x * x) + +waxOn :: Int +waxOn = x * 5 + where x = y * y + y = z + 8 + z = 7 + +triple :: Int -> Int +triple x = x * 3 + +waxOff :: Int -> Int +waxOff = triple + +main :: forall e. Eff (console :: CONSOLE | e) Unit +main = do + log "Hello sailor!" |
