concatImapStringsSep
lib.strings.concatImapStringsSep
Docs pulled from | This Revision | about 1 hour ago
Same as concatMapStringsSep, but the mapping function
additionally receives the position of its argument.
Inputs
sep- Separator to add between elements
f- Function that receives elements and their positions
list- List of input strings
Type
concatIMapStringsSep :: String -> (Int -> a -> String) -> [a] -> String
Examples
lib.strings.concatImapStringsSep usage example
concatImapStringsSep "-" (pos: x: toString (x / pos)) [ 6 6 6 ]
=> "6-3-2"
Noogle detected
Implementation
The following is the current implementation of this function.
concatImapStringsSep =
sep: f: list:
concatStringsSep sep (lib.imap1 f list);