Exam spec
This commit is contained in:
commit
1c9c9422e2
17
polynom.hs
Normal file
17
polynom.hs
Normal 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
|
Loading…
x
Reference in New Issue
Block a user