Skip to content

purerl/purescript-erl-lists

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

purescript-erl-lists

This library provides FFI definitions for native Erlang lists and associated helper functions and type class instances.

Many of the basic functions are implemented by the Erlang native versions.

Usage

-- Construct
list :: List Int
list = 1 : 2 : 3 : nil -- Erlang representation is [1, 2, 3], i.e. a standard list

-- Destructure

-- (note that length exists...)
evenLength :: forall a. List a -> Boolean
evenLength lst =
  case uncons lst of
    Nothing -> true
    Just { head, tail } -> not (evenLength tail)

Instances are provided as per Data.List. Conversion to other datatypes can be achived with toUnfoldable and fromFoldable.

Documentation

Erl.Data.List

Licensing

Much of this code is derived from purescript-lists.

Some of this code is derived from GHC's standard libraries (base); according to its terms, we have included GHC's license in the file LICENSE-GHC.md.

About

PureScript Erlang native lists

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-GHC.md

Stars

Watchers

Forks

Packages

No packages published