-
Notifications
You must be signed in to change notification settings - Fork 4
/
notes.txt
28 lines (17 loc) · 1.73 KB
/
notes.txt
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
Profiling:
- The program was throwing Stack Overflows during the quick-checks.
- To diagnose these I wished to compile the tests with profiling activated.
- This required the use of '-prof' and '-fprof-auto' flags in the 'ghc make' command.
- This command failed because profiling wasn't enabled in ghc as well as in any of the other packages being used.
To Enable Profiling:
- sudo apt-get install ghc-prof # A variant of ghc with profiling enabled. This provides the 'base' module (which includes Prelude) with profiling
- To upgrade any Haskell package to use profiling issue: sudo cabal install -p <package> --reinstall
- If any of the dependencies of the package doesn't have profiling enabled then this command will fail and one will have to reinstall the dependency (with profiling enabled) first.
- To insist that cabal install all libraries with profiling enabled edit ~/.cabal/config and add the line 'library-profiling: True' (uncomment the default False valued line and change it)
To-Do:
- Automate the rule that Sum [] = Const 0 (sum over zero elements is equal to zero - the additive identity)
- Automate the rule that Sum [e] = e (sum over single element is the element itself)
- Investigate making Sum [list] behave like a list that is treat Sum as a concatenation of Expr elements e1:e2:e3:[]. This will greatly simplify pattern matching
- Possibly use "View Patterns" to implement pattern matching complicated by the large number of constructors for Expr
- Possibly consolidate Sum and Prod in to a single type with two constructors of its own. This will consolidate their similarities.
- Some good ideas on CAS as a DSL: http://tom.lokhorst.eu/2009/09/deeply-embedded-dsls