Skip to content

Commit b0184e6

Browse files
committed
28
1 parent fdf2a4d commit b0184e6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

HumanEvalLean/HumanEval28.lean

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
module
22

3-
def concatenate : Unit :=
4-
()
3+
def concatenate (strings : List String) : String :=
4+
String.join strings
5+
6+
theorem toList_concatenate {strings : List String} :
7+
(concatenate strings).toList = strings.flatMap String.toList := by
8+
-- https://github.com/leanprover/lean4/pull/13091
9+
simp [concatenate]
510

611
/-!
712
## Prompt
@@ -41,4 +46,4 @@ def check(candidate):
4146
assert candidate(['x', 'y', 'z']) == 'xyz'
4247
assert candidate(['x', 'y', 'z', 'w', 'k']) == 'xyzwk'
4348
```
44-
-/
49+
-/

0 commit comments

Comments
 (0)