js-sdk-stack

0.1.1 • Public • Published

js-sdk-stack

Build Status Coverage Status

Simple stack type.

library

$ Stack(init || []) : Stack
 
// Create a new stack.
 
 
$ Stack.push(item : a) : ()
 
// Pushes a value to the stack.
 
 
$ Stack.pop() : a
 
// Pops a value from the stack.
 
 
$ Stack.length() : Number
 
// The length of the stack.
 
 
$ Stack.map(f (item : a) -> b) : Stack
 
// Maps each value of the stack returning a new Stack.
 
 
$ Stack.filter(f (item : a) -> Boolean) : Stack
 
// Returns a filtered Stack.
 
 
$ Stack.reduce(f (acc : b, item : a) -> b, initial : b) -> b
 
// If no initial value is passed, it will use Stack.

license

See license.md or visit Unlicense.

Readme

Keywords

Package Sidebar

Install

npm i js-sdk-stack

Weekly Downloads

0

Version

0.1.1

License

Unlicense

Last publish

Collaborators

  • diasbruno