Module

Data.Iterable

Package
purescript-iterable
Repository
Risto-Stevcev/purescript-iterable

#Iterable Source

class Iterable iterable value | iterable -> value where

The Iterable class corresponds to the Iterable interface in JS. Instances should have a canonical Iterator returned.

Members

Instances

#unsafeIterator Source

unsafeIterator :: forall value iterable. iterable -> Iterator value

Assume the iterable value has a property with the Symbol.iterator as the key, which is a nullary function returning the Iterator.

#Iterator Source

data Iterator :: Type -> Type

Corresponds to an Iterator object in JS.

#next Source

next :: forall value. Iterator value -> Effect (Maybe value)

next() is an effectful function, treating a Iterator value similarly to a Ref.

#traverse_ Source

traverse_ :: forall value. (value -> Effect Unit) -> Iterator value -> Effect Unit

Consumes all values in the Iterator.

#toArray Source

toArray :: forall value. Iterator value -> Effect (Array value)

Consumes all values in the Iterator, and turns it into an array.

Modules
Data.Iterable