Skip to content

Commit e49214f

Browse files
authored
Merge pull request #49 from coq-ext-lib/string-fold-direction
Fixing the fold direction for string to be consistent with list
2 parents f2d4360 + 3845f96 commit e49214f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

theories/Data/String.v

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ repeat constructor.
123123
Defined.
124124

125125
Global Instance Foldable_string : Foldable string ascii :=
126-
fun _ f =>
127-
fix go acc ls :=
126+
fun _ f base =>
127+
fix go ls :=
128128
match ls with
129-
| EmptyString => acc
130-
| String l ls =>
131-
go (f l acc) ls
129+
| EmptyString => base
130+
| String l ls =>
131+
f l (go ls)
132132
end.
133133

134134
Section string.

0 commit comments

Comments
 (0)