Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
sv2v
Commits
7f0c33ab
Commit
7f0c33ab
authored
Aug 16, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
constant fold adjacent adds through association
parent
8a8b089a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/Convert/ExprUtils.hs
+2
-0
No files found.
src/Convert/ExprUtils.hs
View file @
7f0c33ab
...
...
@@ -74,6 +74,8 @@ simplifyBinOp Add (UniOp UniSub e1) e2 = BinOp Sub e2 e1
simplifyBinOp
Sub
e1
(
UniOp
UniSub
e2
)
=
BinOp
Add
e1
e2
simplifyBinOp
Sub
(
UniOp
UniSub
e1
)
e2
=
UniOp
UniSub
$
BinOp
Add
e1
e2
simplifyBinOp
Add
(
BinOp
Add
e
(
n1
@
Number
{}))
(
n2
@
Number
{})
=
BinOp
Add
e
(
BinOp
Add
n1
n2
)
simplifyBinOp
Sub
(
n1
@
Number
{})
(
BinOp
Sub
(
n2
@
Number
{})
e
)
=
BinOp
Add
(
BinOp
Sub
n1
n2
)
e
simplifyBinOp
Sub
(
n1
@
Number
{})
(
BinOp
Sub
e
(
n2
@
Number
{}))
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment