Skip to content
/ fpish Public
forked from fossabot/ahana-fp

FP-friendly classes for Typescript

License

Notifications You must be signed in to change notification settings

dancrumb/fpish

This branch is 630 commits ahead of fossabot/ahana-fp:main.

Folders and files

NameName
Last commit message
Last commit date
May 25, 2024
May 7, 2024
Jan 17, 2025
May 25, 2024
Jul 31, 2024
May 4, 2024
Sep 25, 2022
Oct 17, 2022
May 25, 2024
May 4, 2024
May 7, 2024
Jul 31, 2024
Nov 25, 2019
Jul 30, 2024
May 5, 2024
Jan 17, 2025
May 7, 2024
May 6, 2024
Jul 31, 2024
Jan 17, 2025

Repository files navigation

FP-ish

FOSSA Status Build Status Known Vulnerabilities

This package contains a series of "FP-friendly" classes for use in your code.

API Documentation

See https://dancrumb.com/fpish/

What is "FP-friendly"?

An “FP-friendly’ object can be defined as an instance of the class with immutable internal property and a set of methods that are all ‘pure’ with the caveat that they are able to read internal fields without treating that as a side effect?

Put another way, in a purely FP language, the set of functions F that can operate on a type T can be reasonably modeled in a hybrid or OO language as a class T, where each of the functions in F becomes a method on the class T, with the initial parameter of each function being replaced by an internal property of T.

Says who?

Well, me. I don't think this definition should cause anyone by the most hardened purist any real concern.

Implementing these in a purely FP style would still result in the functions being packaged someway, probably in some kind of namespace. This is just another way to manage this.

About

FP-friendly classes for Typescript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.0%
  • JavaScript 2.0%