-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simplify.hs
65 lines (49 loc) · 2.01 KB
/
Simplify.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
module Simplify where
-- Write all of your code in this file!
import Expr
import Poly
--------------------------------------------------------------------------------
-- * Task 1
-- Define add, which adds 2 expressions together without introducing
-- any 'junk'.
add :: Expr -> Expr -> Expr
add expr1 expr2 = error "Implement me!"
--------------------------------------------------------------------------------
-- * Task 2
-- Define mul, which multiplies 2 expressions together without introducing
-- any 'junk'.
mul :: Expr -> Expr -> Expr
mul expr1 expr2 = error "Implement me!"
--------------------------------------------------------------------------------
-- * Task 3
-- Define addAll, which adds a list of expressions together into
-- a single expression without introducing any 'junk'.
addAll :: [Expr] -> Expr
addAll exprs = error "Implement me!"
--------------------------------------------------------------------------------
-- * Task 4
-- Define mulAll, which multiplies a list of expressions together into
-- a single expression without introducing any 'junk'.
mulAll :: [Expr] -> Expr
mulAll exprs = error "Implement me!"
--------------------------------------------------------------------------------
-- * Task 5
-- Define exprToPoly, which converts an expression into a polynomial.
exprToPoly :: Expr -> Poly
exprToPoly expr = error "Implement me!"
--------------------------------------------------------------------------------
-- * Task 6
-- Define polyToExpr, which converts a polynomial into an expression.
polyToExpr :: Poly -> Expr
polyToExpr poly = error "Implement me!"
--------------------------------------------------------------------------------
-- * Task 7
-- Define a function which simplifies an expression by converting it to a
-- polynomial and back again.
simplify :: Expr -> Expr
simplify expr = error "Implement me!"
--------------------------------------------------------------------------------