All Projects → Jozty → Fae

Jozty / Fae

Licence: MIT license
A functional module for Deno inspired from Ramda.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Fae

dataStructure
Implement different Data Structures using TypeScript and JavaScript. Deno Third-party Module.
Stars: ✭ 24 (-45.45%)
Mutual labels:  deno, denoland, deno-module
make-deno-edition
Automatically makes package.json projects (such as npm packages and node.js modules) compatible with Deno.
Stars: ✭ 39 (-11.36%)
Mutual labels:  deno, denoland
deno deploy versailles
凡尔赛语录(部署在 Deno Deploy)
Stars: ✭ 18 (-59.09%)
Mutual labels:  deno, deno-module
nebuchadnezzar
on the way to cleanest react architechture
Stars: ✭ 15 (-65.91%)
Mutual labels:  ramda, ramdajs
carol
A Deno port of carlo
Stars: ✭ 63 (+43.18%)
Mutual labels:  deno, deno-module
ssvm-deno-starter
A template project to run Rust functions in Deno through the Second State WebAssembly engine.
Stars: ✭ 50 (+13.64%)
Mutual labels:  deno, denoland
cnpj
🇧🇷 Format, validate and generate CNPJ numbers in Node & Deno
Stars: ✭ 26 (-40.91%)
Mutual labels:  deno, denoland
deno-mongo-api
Example for building REST APIS with deno and MongoDB
Stars: ✭ 17 (-61.36%)
Mutual labels:  deno, denoland
ramda
🦋Practical functional Go
Stars: ✭ 14 (-68.18%)
Mutual labels:  functional, ramda
Nspl
Non-Standard PHP Library - functional primitives toolbox and more
Stars: ✭ 365 (+729.55%)
Mutual labels:  functional, ramda
denoliver
A simple, dependency free static file server for Deno with possibly the worst name ever.
Stars: ✭ 94 (+113.64%)
Mutual labels:  deno, denoland
deno install
Deno 安装器(国内加速)
Stars: ✭ 58 (+31.82%)
Mutual labels:  deno, deno-module
logrocket deno api
A functional CRUD-like API with Deno and Postgres
Stars: ✭ 23 (-47.73%)
Mutual labels:  deno, denoland
deno-x-ranking
🦕 Deno Third Party Modules Ranking 👑
Stars: ✭ 28 (-36.36%)
Mutual labels:  deno, denoland
Ramtuary
Ramda + Ramda Fantasy + Sanctuary REPL 🌿
Stars: ✭ 72 (+63.64%)
Mutual labels:  functional, ramda
typeorm
Forked from https://github.com/typeorm/typeorm
Stars: ✭ 107 (+143.18%)
Mutual labels:  deno, deno-module
kafkaSaur
Apache Kafka client for Deno
Stars: ✭ 42 (-4.55%)
Mutual labels:  deno, denoland
deno serverless aliyun
为阿里云 serverless 平台添加 Deno Runtime
Stars: ✭ 60 (+36.36%)
Mutual labels:  deno, deno-module
hookuspocus
hooks for all the functions!
Stars: ✭ 60 (+36.36%)
Mutual labels:  functional, functional-js
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (+2.27%)
Mutual labels:  functional, ramda

Fae

CodeFactor GitHub release (latest by date) GitHub Workflow Status GitHub codecov

Fae is a fully-fledged library that supports the functional style of programming in Deno and is inspired from Ramda. This style provides many benefits like it never mutates input data and is used to create function pipelines. Fae functions are automatically curried. The data to be operated on is generally supplied last. It results in easy to build functions as sequences of simpler or atomic functions (pipelines), each of which transforms the data and passes it along to the next.

Fae provides over 110 functions that help programmers to write clean and concise code.

Installing

Deno allows you to directly import modules from URLs!

To import and use the client in your file, add the following import statement:

import * as Fae from 'https://deno.land/x/[email protected]/mod.ts';

Function usage and documentation can be found here

Running tests

deno test
# for coverage tests
deno test --coverage --unstable

Usage

import * as Fae from 'https://deno.land/x/[email protected]/mod.ts';

// arithmetic functions
Fae.add(10, 20); // 30
Fae.add(10)(20); // 30

const add20 = Fae.add(20);
add20(10); // 30
add20(125); // 145

// Expression - (2*5+5-10)/2
const double = Fae.multiply(2);
const half = Fae.divide(Fae._, 2);
const add5 = Fae.add(5);
const subtract10 = Fae.subtract(Fae._, 10);

half(subtract10(add5(double(15)))); // 12.5
Fae.compose(half, subtract10, add5, double)(15); // 12.5
Fae.pipe(double, add5, subtract10, half)(15); // 12.5

With lenses

import {
  inc,
  lens,
  over,
  set,
  view,
} from 'https://deno.land/x/[email protected]/mod.ts';

const array = [1, 2, 3, 4, 5, 6, 7, 8];

// gets element at index `0`
function getter(a: number[]) {
  return a[0];
}

// returns a new array by setting passed value `val` at index `0`
function setter(val: number, a: number[]) {
  const x = [...a];
  x[0] = val;
  return x;
}

const l = lens(getter, setter);

const viewResult = view(l, array);
const overResult = over(l, inc, array);
const setResult = set(l, 12, array);

console.log(viewResult); // 1
console.log(overResult); // [2, 2, 3, 4, 5, 6, 7, 8]
console.log(setResult); // [12, 2, 3, 4, 5, 6, 7, 8]
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].