Add the haskell book

This commit is contained in:
2025-12-09 16:32:32 +01:00
parent c95abc31d6
commit 3624c712d7
67 changed files with 1576 additions and 0 deletions

13
Haskell-book/11/Hutton.hs Normal file
View File

@@ -0,0 +1,13 @@
module Hutton where
data Expr
= Lit Integer
| Add Expr Expr
eval :: Expr -> Integer
eval (Lit x) = x
eval (Add x y) = (eval x) + (eval y)
printExpr :: Expr -> String
printExpr (Lit x) = show x
printExpr (Add x y) = (printExpr x) ++ " + " ++ (printExpr y)