Why Download Tutorial Reference

Lists

map

Packagebios
Source filebios._util.mcy
NatureFunction
Typefun list a1 (fun a1 -> a2) -> list a2

Usage

map

Type
list a1 A list
fun a1 -> a2 A function which is applied to the elements of the list and returns any element
list a2 A list whose elements are the of the function on the elements of the list

Description

This function converts the elements of the list , by applying to each of them.

When returns nil, the element is ignored.

> map 1:2:3:nil (lambda val = if val!>2 then val*10 else nil) 
-> list Int: 
   Int: 10 (0xA) 
   Int: 30 (0x1E) 

On the same topic