query
On this page

concatImapStringsSep

lib.strings.concatImapStringsSep

Docs pulled from | This Revision | 10 minutes 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

Aliases

Implementation

The following is the current implementation of this function.

concatImapStringsSep =
    sep: f: list:
    concatStringsSep sep (lib.imap1 f list);