Constant fixes.
:: ::
:::: /sys/hoon ::
:: ::
-!:
=< ride
=> %143 =>
:: ::
:: ::
::
++ aftr |*(a/$-(* *) |*(b/$-(* *) (pair b a))) :: pair after
-++ cork |*({a/_|=(* **) b/gate} (corl b a)) :: compose forward
+++ cork |*({a/$-(* *) b/$-(* *)} (corl b a)) :: compose forward
++ corl :: compose backwards
- |* {a/gate b/_|=(* **)}
+ |* {a/$-(* *) b/$-(* *)}
=< +:|.((a (b))) :: type check
- |* c/_+<.b
- (a (b c))
+ =+ c=+<.b
+ |% +- $ (a (b c))
+ --
::
++ cury :: curry left
|* {a/$-(^ *) b/*}
|*(a/$-(* *) $@($~ {$~ u/a}))
::
:: ::
-:::: 2o: normalizing containers ::
+:::: 2o: containers ::
:: ::
::
-++ jar |*({a/mold b/mold} (map a (list b))) :: map of lists
-++ jug |*({a/mold b/mold} (map a (set b))) :: map of sets
-++ map |* {a/mold b/mold} :: table
- %+ cork (tree (pair a b)) ::
- |= c/(tree (pair a b)) ^+ c ::
- :: ?.(~(apt by c) ~ c) :: XX verify
- c
-++ qeu |*(a/mold (tree a)) :: queue
-++ set |* a/mold :: set
- %+ cork (tree a) ::
- |= b/(tree a) ^+ b ::
- :: ?.(~(apt in b) ~ b) :: XX verify
- b
+++ jar |*({a/$-(* *) b/$-(* *)} (map a (list b))) :: map of lists
+++ jug |*({a/$-(* *) b/$-(* *)} (map a (set b))) :: map of sets
+++ map |*({a/$-(* *) b/$-(* *)} (tree (pair a b))) :: table
+++ qeu |*(a/$-(* *) (tree a)) :: queue
+++ set |*(a/$-(* *) (tree a)) :: set
::
:::: 2q: molds and mold builders ::
:: ::
::
++ reel :: right fold
~/ %reel
- |* {a/(list) b/_|=({* *} +<+)}
+ |* {a/(list) b/_=>(~ |=({* *} +<+))}
|- ^+ ,.+<+.b
?~ a
+<+.b
::
++ roll :: left fold
~/ %roll
- |* {a/(list) b/_|=({* *} +<+)}
+ |* {a/(list) b/_=>(~ |=({* *} +<+))}
|- ^+ ,.+<+.b
?~ a
+<+.b
[i.a $(a (skim t.a |:(c=i.a !(b c i.a))))]
::
++ spin
- |* {a/(list) b/_|=({* *} [** +<+]) c/*}
+ |* {a/(list) b/_=>(~ |=({* *} [** +<+])) c/*}
:: ?< ?=($-([_?<(?=($~ a) i.a) _c] [* _c]) b)
|-
?~ a
[i=-.v t=$(a t.a, c +.v)]
::
++ spun
- |* {a/(list) b/_|=({* *} [** +<+])}
+ |* {a/(list) b/_=>(~ |=({* *} [** +<+]))}
=| c/_+<+.b
|-
?~ a
