Description Usage Arguments Examples
the order of parameters is different from Haskell. The first argument is a lazy steram which enable you to use magrittr's pipe smoothly.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ltake(x, n)
ldrop(x, n)
lsplitAt(x, n)
ltakeWhile(x, f)
ldropWhile(x, f)
lspan(x, f)
lbreak(x, f)
|
x |
a lazy stream |
n |
intege |
f |
predicate function (a' -> Boolean) |
1 2 3 4 5 6 7 8 | x <- 1 %..% 10
ltake(x, 5) # => llist(1, 2, 3, 4, 5)
ldrop(x, 7) # => llist(8, 9, 10)
lsplitAt(x, 4) # => list(1%..%3, 4%..%10)
ltakeWhile(x, function(x) x < 4) # => 1%..%3
ldropWhile(x, function(x) x < 4) # => 4%..%10
lspan(x, function(x) x < 4) # => list(1%..%3, 4%..%10)
lbreak(x, function(x) x >= 4) # => list(1%..%3, 4%..%10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.