File tree Expand file tree Collapse file tree 5 files changed +16
-16
lines changed
experiments/idris/src/Fathom Expand file tree Collapse file tree 5 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,10 @@ namespace FormatOf
68
68
69
69
export
70
70
encode : {0 A, S : Type } -> (f : FormatOf A) -> Encode A (Colist S)
71
- encode End () = Just []
72
- encode (Pure x) (MkSing _ ) = Just []
71
+ encode End () = pure []
72
+ encode (Pure x) (MkSing _ ) = pure []
73
73
encode (Ignore f def) () = encode f def
74
- encode (Repeat Z f) [] = Just []
74
+ encode (Repeat Z f) [] = pure []
75
75
encode (Repeat (S len) f) (x :: xs) =
76
76
[| encode f x <+> encode (Repeat len f) xs | ]
77
77
encode (Bind f1 f2) (x ** y) =
Original file line number Diff line number Diff line change @@ -83,10 +83,10 @@ namespace FormatOf
83
83
84
84
export
85
85
encode : {0 A : Type } -> (f : FormatOf A) -> Encode A ByteStream
86
- encode End () = Just []
87
- encode (Pure x) (MkSing _ ) = Just []
86
+ encode End () = pure []
87
+ encode (Pure x) (MkSing _ ) = pure []
88
88
encode (Ignore f def) () = encode f def
89
- encode (Repeat Z f) [] = Just []
89
+ encode (Repeat Z f) [] = pure []
90
90
encode (Repeat (S len) f) (x :: xs) =
91
91
[| encode f x <+> encode (Repeat len f) xs | ]
92
92
encode (Bind f1 f2) (x ** y) =
Original file line number Diff line number Diff line change @@ -100,13 +100,13 @@ namespace Format
100
100
101
101
export
102
102
encode : (f : Format) -> Encode (Rep f) (Colist a)
103
- encode End () = Just []
104
- encode (Pure x) (MkSing _ ) = Just []
103
+ encode End () = pure []
104
+ encode (Pure x) (MkSing _ ) = pure []
105
105
encode (Ignore f def) () = encode f def
106
- encode (Repeat Z f) [] = Just []
107
- encode (Repeat (S len) f) (x :: xs) = do
106
+ encode (Repeat Z f) [] = pure []
107
+ encode (Repeat (S len) f) (x :: xs) =
108
108
[| encode f x <+> encode (Repeat len f) xs | ]
109
- encode (Bind f1 f2) (x ** y) = do
109
+ encode (Bind f1 f2) (x ** y) =
110
110
[| encode f1 x <+> encode (f2 x) y | ]
111
111
112
112
Original file line number Diff line number Diff line change @@ -97,10 +97,10 @@ namespace Format
97
97
98
98
export
99
99
encode : (f : Format) -> Encode (Rep f) ByteStream
100
- encode End () = Just []
101
- encode (Pure x) (MkSing _ ) = Just []
100
+ encode End () = pure []
101
+ encode (Pure x) (MkSing _ ) = pure []
102
102
encode (Ignore f def) () = encode f def
103
- encode (Repeat Z f) [] = Just []
103
+ encode (Repeat Z f) [] = pure []
104
104
encode (Repeat (S len) f) (x :: xs) =
105
105
[| encode f x <+> encode (Repeat len f) xs | ]
106
106
encode (Bind f1 f2) (x ** y) =
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ namespace Format
72
72
decode = pure (MkSing x)
73
73
74
74
encode : Encode Rep ByteStream
75
- encode (MkSing _ ) = Just []
75
+ encode (MkSing _ ) = pure []
76
76
77
77
78
78
public export
@@ -106,7 +106,7 @@ namespace Format
106
106
encode : Encode Rep ByteStream
107
107
encode = go len where
108
108
go : (len : Nat ) -> Encode (Vect len f.Rep) ByteStream
109
- go 0 [] = Just []
109
+ go 0 [] = pure []
110
110
go (S len) (x :: xs) =
111
111
[| f. encode x <+> go len xs | ]
112
112
You can’t perform that action at this time.
0 commit comments