1
1
mirror of https://github.com/tweag/nickel.git synced 2024-11-10 10:46:49 +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), %blame% (%tag% "not a string" l),
// using a contract instead of type for now because of https://github.com/tweag/nickel/issues/226 // 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#" | doc m#"
Joins a list of strings given a seperator. Joins a list of strings given a seperator.
For example: For example:
```nickel ```nickel
join [ "Hello", "World!" ] ", " => join ", " [ "Hello", "World!" ] =>
"Hello, World!" "Hello, World!"
``` ```
"#m "#m
= fun l sep => = fun sep l =>
if %length% l == 0 then if %length% l == 0 then
"" ""
else else