Commit b0318d3
committed
Implemented real world haskell IO (chapter 7) demonstration, implementing
interact for IO. Various changes to support lazy IO and infinite streams.
Made P1 toString lazy, this was causing problems in the debugger using infinite structures.
Made LazyString.toString lazy, returning the first character. Added map, bind and eval methods to LazyString.
Added IO wrapper, implementing static methods from IOFunctions as instance methods.
Made Stream.take evaluate one less element, made toString lazy.
Added Strings methods lines and unlines.
Implemented IOFunctions interact and getContents. Made sequenceWhile lazy, suitable for IO.
Test that toString for an infinite stream is lazy.
Demonstrate lazy use of sequenceWhile.
Refactor from changes to IOFunctions.
Test converting an infinite stream of lazy strings to a string. Ensure no stack overflow occurs as in version 4.3.
Added demonstrations of IOFunctions.interact1 parent 1ba2f25 commit b0318d3
File tree
12 files changed
+707
-377
lines changed- core/src
- main/java/fj
- data
- function
- test/java/fj/data
- demo/src/main/java/fj/demo
- realworld
12 files changed
+707
-377
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
425 | 433 | | |
426 | 434 | | |
427 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
0 commit comments