All Projects → roobie → Mori Ext

roobie / Mori Ext

Licence: other
Function bind syntax wrappers for mori

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mori Ext

Pfun
Functional, composable, asynchronous, type-safe Python.
Stars: ✭ 75 (+400%)
Mutual labels:  immutable, functional-programming
Imlazy
😴 Functional programming with lazy immutable iterables
Stars: ✭ 89 (+493.33%)
Mutual labels:  immutable, functional-programming
Immutable Tuple
Immutable finite list objects with constant-time equality testing (===) and no memory leaks.
Stars: ✭ 29 (+93.33%)
Mutual labels:  immutable, functional-programming
Bqn
An APL-like programming language. Self-hosted!
Stars: ✭ 100 (+566.67%)
Mutual labels:  immutable, functional-programming
Python Lenses
A python lens library for manipulating deeply nested immutable structures
Stars: ✭ 179 (+1093.33%)
Mutual labels:  immutable, functional-programming
Unchanged
A tiny, fast, unopinionated handler for updating JS objects and arrays immutably
Stars: ✭ 237 (+1480%)
Mutual labels:  immutable, functional-programming
Imtools
Fast and memory-efficient immutable collections and helper data structures
Stars: ✭ 85 (+466.67%)
Mutual labels:  immutable, functional-programming
List
🐆 An immutable list with unmatched performance and a comprehensive functional API.
Stars: ✭ 1,604 (+10593.33%)
Mutual labels:  immutable, functional-programming
Optics Ts
Type-safe, ergonomic, polymorphic optics for TypeScript
Stars: ✭ 132 (+780%)
Mutual labels:  immutable, functional-programming
Hamt
Immutable and Memory-Efficient Maps and Sets in Go
Stars: ✭ 213 (+1320%)
Mutual labels:  immutable, functional-programming
Koazee
A StreamLike, Immutable, Lazy Loading and smart Golang Library to deal with slices.
Stars: ✭ 446 (+2873.33%)
Mutual labels:  immutable, functional-programming
Clif
Binding generator to wrap C++ for Python using LLVM.
Stars: ✭ 845 (+5533.33%)
Mutual labels:  wrapper
Simple Bigtable
Stars: ✭ 24 (+60%)
Mutual labels:  wrapper
Elm Cheat Sheet
An overview of Elm syntax and features
Stars: ✭ 928 (+6086.67%)
Mutual labels:  functional-programming
Puddles
Tiny vdom app framework. Pure Redux. No boilerplate.
Stars: ✭ 24 (+60%)
Mutual labels:  functional-programming
Revery Playground
Live, interactive playground for Revery examples
Stars: ✭ 14 (-6.67%)
Mutual labels:  functional-programming
Purify
Functional programming library for TypeScript - https://gigobyte.github.io/purify/
Stars: ✭ 843 (+5520%)
Mutual labels:  functional-programming
Headercollapsiblelayout
A wrapper layout that can easily split your current layout into header and body, and provides smooth header collapsing action with related event callbacks.
Stars: ✭ 24 (+60%)
Mutual labels:  wrapper
Union Js
🏷️ Tagged unions for vanilla JavaScript!
Stars: ✭ 24 (+60%)
Mutual labels:  functional-programming
J8plus
Library containing useful tools for Java 8
Stars: ✭ 23 (+53.33%)
Mutual labels:  functional-programming

mori-ext

Function bind syntax wrappers for mori

immutable data structures + LINQ in javascript

\__   __ \_______ \______   \___         \_______ \__  \__ \_______
|  |_|  ||       ||    _ |  |   |        |       ||  |_|  ||       |
|       ||   _   ||   | ||  |   |  ____  |    ___||       ||_     _|
|       ||  | |  ||   |_||_ |   | |____| |   |___ |       |  |   |  
|       ||  |_|  ||    __  ||   |        |    ___| |     |   |   |  
| ||_|| ||       ||   |  | ||   |        |   |___ |   _   |  |   |  
|_|   |_||_______||___|  |_||___|        |_______||__| |__|  |___|  

thanks http://patorjk.com/software/taag

Quick example

import { vector } from 'mori';
import { assoc, equals } from 'mori-ext';

const v1 = vector('foo', 'bar', 'baz');
const v2 = v1::assoc(1, 'quux');
const v3 = vector('foo', 'quux', 'baz');
v2::equals(v3); // => true

How?

Using babeljs everyone can use this syntax.

Look at an example using gulp

Also, copy the .babelrc file, in order to enable the required language features in babeljs.

This effort is inspired by trine

Installation

npm install --save mori-ext

see https://www.npmjs.com/package/mori-ext

runtime dependencies

mori, babel-runtime,

Usage

Review the spec (covers the majority of the API)

API

mori-ext's API is mostly based on collections being the first argument to mori functions, i.e.

import mori from 'mori';
import { equals, isList } from 'mori-ext';

const coll = mori.vector(1, 2, 3);

mori.isList(coll);
// is equivalent to
coll::isList();

// and

mori.equals(coll1, coll2);
// is equivalent to
coll1::equals(coll2);

However, not all functions operate on a single collection, or even, on collections at all, so some consideration has been taken into account, e.g.

import { list, vector, seq } from 'mori';
import { mapcat, cons } from 'mori-ext';
// mapcat
((x, y) => list(x, x + y))
  ::mapcat(seq('abc'), seq('123'));
// => ('a' 'a1' 'b' 'b2' 'c' 'c3')

// cons (converts collection into seq)
1::cons(vector(2, 3))
// => (1 2 3)

Exported values

Fundamentals

equals
hash

Type Predicates

isList
isSeq
isVector
isMap
isSet
isCollection
isSequential
isAssociative
isCounted
isIndexed
isReduceable
isSeqable
isReversible

Collections

list
vector
hashMap
set
sortedSet
range
queue

Collection Operations

conj
into
assoc
dissoc
distinct
empty
get
getIn
hasKey
find
nth
last
assocIn
updateIn
count
isEmpty
peek
pop
zipmap
reverse

Vector Operations

subvec

Hash Map Operations

keys
vals
merge

Set Operations

disj
union
intersection
difference
isSubset
isSuperset

Sequences

first
rest
seq
cons
concat
flatten
intoArray
each
map
mapcat
filter
remove
reduce
reduceKV
take
takeWhile
drop
dropWhile
some
every
sort
sortBy
interpose
interleave
iterate
repeat
repeatedly
partition
partitionBy
groupBy

Helpers

primSeq
identity
constantly
inc
dec
sum
isEven
isOdd
comp
juxt
knit
pipeline
partial
curry
fnil
toClj
toJs
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].