MCPcopy Index your code
hub / github.com/Jozty/Fae

github.com/Jozty/Fae @v1.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.1 ↗ · + Follow
433 symbols 1,198 edges 260 files 2 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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/fae@v1.0.0/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/fae@v1.0.0/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/fae@v1.0.0/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]

Extension points exported contracts — how you extend this code

Curry1 (Interface)
(no doc)
utils/types.ts
Curry2 (Interface)
(no doc)
utils/types.ts
Curry3 (Interface)
(no doc)
utils/types.ts

Core symbols most depended-on inside this repo

eq
called by 1733
specs/utils/utils.ts
curryN
called by 107
utils/curry_n.ts
typ
called by 32
typ.ts
flip
called by 29
flip.ts
pipe
called by 25
pipe.ts
transduce
called by 25
transduce.ts
thr
called by 24
specs/utils/utils.ts
strictEq
called by 22
specs/utils/utils.ts

Shape

Function 318
Method 60
Class 52
Interface 3

Languages

TypeScript100%

Modules by API surface

specs/equals.test.ts16 symbols
utils/is.ts14 symbols
equals.ts12 symbols
utils/Transformers/transformers.ts10 symbols
run-utils/declarations.ts8 symbols
utils/Transformers/dropRepeatsWith.ts7 symbols
utils/Transformers/dropLastWhile.ts7 symbols
specs/indexOf.test.ts7 symbols
utils/get.ts6 symbols
utils/Transformers/dropLast.ts6 symbols
utils/Transformers/aperture.ts6 symbols
specs/both.test.ts6 symbols

For agents

$ claude mcp add Fae \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact