Exam spec

This commit is contained in:
Pal Kerecsenyi 2024-05-08 09:41:51 +01:00
commit 1c9c9422e2
Signed by: palk
GPG Key ID: 6891661E25394C2C

17
polynom.hs Normal file
View File

@ -0,0 +1,17 @@
data Atree = Number Int | Variable String | Plus Atree Atree | Minus Atree | Times Atree Atree
t :: Atree
t =
Times
(Plus (Number 5) (Minus (Variable "x")))
( Plus
(Times (Number 2) (Variable "y"))
(Minus (Plus (Variable "x") (Number 7)))
)
type Polynomial = [Monomial]
type Monomial = (Int, [String])
polynomial :: Atree -> Polynomial
polynomial = undefined