Rob Rix
4fb38d612e
Add a constructor for Free over arbitrary TermType.
2015-10-14 13:52:43 -04:00
Rob Rix
6188a5a2d7
Move FreeConvertible to Free.swift.
2015-10-14 13:34:29 -04:00
Rob Rix
34258b98b8
Generalize Patch
from Fix<A>
to A
.
2015-10-14 12:17:39 -04:00
Rob Rix
964204a3e6
Rename the PatchConvertible associated type to Element.
2015-10-14 12:02:57 -04:00
Rob Rix
d32ac4c789
Use Prelude’s id.
2015-10-13 00:55:20 -04:00
Rob Rix
3cf5ce3b43
Construct Fix directly in discardNullTerms
.
2015-10-09 18:05:50 -04:00
Rob Rix
da8d51e9ee
Free is SyntaxConvertible.
2015-10-09 18:04:29 -04:00
Rob Rix
d33703fd00
Flatten the Free representation.
2015-10-09 14:31:10 -05:00
Rob Rix
a9dcb801f2
Free has a JSON property when A is CustomJSONConvertible and B is Patch<A>.
2015-10-09 09:11:48 -05:00
Rob Rix
b422f7d9e4
Free has a unary JSON method when A is CustomJSONConvertible.
2015-10-09 09:08:35 -05:00
Rob Rix
ed9dfd2f34
Construct Free.JSON using dictionary literals.
2015-10-09 08:43:32 -04:00
Rob Rix
3e47d529cc
Change Free’s JSON heading.
2015-10-09 08:39:57 -04:00
Rob Rix
0ebed9599b
Free.Roll encodes its case explicitly.
2015-10-08 07:30:34 -04:00
Rob Rix
7dd861169f
Free.Pure encodes its case explicitly.
2015-10-08 07:30:02 -04:00
Rob Rix
22b77ecd76
Parametric JSON conversion for Free.
2015-10-08 07:21:08 -04:00
Rob Rix
2a8e017282
Free is CustomDocConvertible.
2015-10-07 17:20:09 -04:00
Rob Rix
7852d8a515
Diffs have an inverse.
2015-10-07 08:43:30 -04:00
Rob Rix
8a9f74a0ff
Use discardNullTerms to compute both states.
2015-10-06 21:39:11 -04:00
Rob Rix
321622d553
Extract the discarding of null terms into a private helper function.
2015-10-06 21:38:44 -04:00
Rob Rix
e1dd859db9
Implicit parameters.
2015-10-06 21:36:22 -04:00
Rob Rix
ee969a75fa
Compute the after state of diffs.
2015-10-06 21:35:47 -04:00
Rob Rix
b04d71ede3
Compute the before-state of diffs.
...
This is `Optional`, as some diffs have unrecoverable before states. For
example, the insertion of a term has no before state, but can still
produce a valid before state if it occurs within the context of an
`Indexed` or `Keyed` node.
However, certain malformed diffs (such as `.Pure(.Insert(…))` in
isolation) may lack a valid before state, and thus the public API has
to reflect this.
2015-10-06 21:35:19 -04:00
Rob Rix
75aaebe834
Free
has a Term
typealias when appropriate.
2015-10-06 21:32:38 -04:00
Rob Rix
22773917a3
Construct Free
with Fix
.
2015-10-06 17:45:24 -04:00
Rob Rix
29d889ef95
Free is CustomDebugStringConvertible.
2015-10-06 16:43:20 -04:00
Rob Rix
900d364057
Link to @patrickt’s tutorials on recursion schemes.
2015-10-06 12:53:30 -04:00
Rob Rix
675d355b96
Document iterate
.
2015-10-06 12:47:33 -04:00
Rob Rix
286ff11f79
Rename iter
to iterate
.
2015-10-06 11:05:02 -04:00
Rob Rix
8800c57ca7
Oh yeah, method dispatch works too.
2015-10-06 11:04:36 -04:00
Rob Rix
8226285153
Implement iter
as a method.
2015-10-06 11:04:14 -04:00
Rob Rix
c0edc77185
Implement iter
by case analysis.
2015-10-06 11:03:03 -04:00
Rob Rix
3d06b533bc
Implement iter
over Free
.
2015-10-06 11:02:15 -04:00
Rob Rix
24e113d2f0
The hash
property on Free
is public.
2015-10-06 11:00:47 -04:00
Rob Rix
277757e3a2
Free implements hash
when A and B are Hashable.
2015-10-02 16:27:44 -04:00
Rob Rix
e4d0a41093
Express flatMap
with analysis
.
2015-10-02 14:36:01 -04:00
Rob Rix
b4479e3854
Express map
with analysis
.
2015-10-02 14:35:18 -04:00
Rob Rix
2b5b85e0b4
Define Free hashing.
2015-10-02 14:35:07 -04:00
Rob Rix
334bb3017e
The roll function doesn’t escape.
2015-10-02 14:29:45 -04:00
Rob Rix
7d49895796
Section headers for functor/monad instances.
2015-10-02 14:27:37 -04:00
Rob Rix
7e00f9297e
Implement case analysis for Free.
2015-10-02 14:26:53 -04:00
Rob Rix
de2dcf4bf4
== over Free.
2015-10-02 14:18:43 -04:00
Rob Rix
87994c824f
Free Equality.
2015-10-02 14:15:17 -04:00
Rob Rix
f8c37695ae
Document Fix’s case.
2015-10-02 14:08:03 -04:00
Rob Rix
b2219feed7
Document Free’s cases.
2015-10-02 14:07:29 -04:00
Rob Rix
0a64dc8741
Free is indeed a Monad.
2015-10-02 14:03:34 -04:00
Rob Rix
97686157f3
Free is a Functor.
2015-10-02 13:59:55 -04:00
Rob Rix
e63ccff83f
Documentation for Free.
2015-10-02 13:54:39 -04:00
Rob Rix
0ff70be000
Stub in Free.
2015-10-02 13:43:43 -04:00