1
1
mirror of https://github.com/tweag/nickel.git synced 2024-09-20 08:05:15 +03:00

Flip strings.join

This commit is contained in:
silverraven691 2021-11-25 17:20:17 +01:00
parent 42f9df51e1
commit eec04735f0

View File

@ -121,17 +121,17 @@
%blame% (%tag% "not a string" l),
// using a contract instead of type for now because of https://github.com/tweag/nickel/issues/226
join | List Str -> Str -> Str
join | Str -> List Str -> Str
| doc m#"
Joins a list of strings given a seperator.
For example:
```nickel
join [ "Hello", "World!" ] ", " =>
join ", " [ "Hello", "World!" ] =>
"Hello, World!"
```
"#m
= fun l sep =>
= fun sep l =>
if %length% l == 0 then
""
else