Skip to content

Commit 6247545

Browse files
authored
Update 009_datatypes.md
Fixing the Haskell code for expression evaluation
1 parent d6e49d1 commit 6247545

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

009_datatypes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ data T
204204
eval :: T -> Int
205205
eval x = case x of
206206
Add a b -> eval a + eval b
207-
Mul a b -> eval a + eval b
208-
Div a b -> eval a + eval b
209-
Sub a b -> eval a + eval b
207+
Mul a b -> eval a * eval b
208+
Div a b -> eval a / eval b
209+
Sub a b -> eval a - eval b
210210
Num a -> a
211211
```
212212

0 commit comments

Comments
 (0)