-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_history.patch
55 lines (45 loc) · 1.31 KB
/
local_history.patch
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Index: src/User.elm
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/User.elm (date 1567315520787)
+++ src/User.elm (date 1567315520787)
@@ -80,25 +80,14 @@
| Leaf a
-traverseTree : Tree Int -> D.Decoder (Tree a)
-traverseTree schema =
- sequenceTree <|
- case schema of
- Node schemas ->
- Node <| List.map traverseTree schemas
-
- Leaf count ->
- Leaf <| D.bytes count
+traverseTree : Tree Int -> D.Decoder (Tree Bytes)
+traverseTree =
+ traverse D.bytes
sequenceTree : Tree (D.Decoder a) -> D.Decoder (Tree a)
-sequenceTree tree =
- case tree of
- Node trees ->
- Node >> D.succeed <| List.map sequenceTree trees
-
- Leaf decoder ->
- D.map Leaf decoder
+sequenceTree =
+ sequence
sequence : Tree (D.Decoder a) -> D.Decoder (Tree a)
@@ -110,10 +99,14 @@
traverse f tree =
case tree of
Node trees ->
- Debug.todo ""
+ let
+ listOfDecoders =
+ List.map (traverse f) trees
+ in
+ D.succeed (Node listOfDecoders)
Leaf value ->
- f value |> D.map
+ D.map Leaf <| f value