empty_list: Construct an empty list

Description Usage Arguments Details Value

Description

This is a base "object" for building lists.

Usage

1
empty_list(selector)

Arguments

selector

A function to return either the head, tail or empty status of a list

Details

To quote Steve Losh, a list is a function that knows how to return its head, tail and whether it's empty. Empty lists serve an important part of this construction, since it gives us the ability to mark the "end" of our nested functions that create the list. In practice, we don't usually call the function with its argument. Instead, other functions will need to access this argument to implement various properties of lists.

Value

A closure with the fl class added. The closure can be used to access different properties of the list: either the head, tail or its empty status.


michaelquinn32/lambdaList documentation built on May 22, 2019, 9:52 p.m.