fp-ts
immutable-js
Our great sponsors
fp-ts | immutable-js | |
---|---|---|
96 | 38 | |
10,386 | 32,843 | |
- | 0.1% | |
7.5 | 7.2 | |
7 days ago | 28 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
fp-ts
-
Type-Safe Printf() in TypeScript
While I certainly agree, I've found that this is often an indication of too-complex an architecture, and a fundamental re-think being necessary. I've had projects that depend on [fp-ts], which end up incredibly generic-heavy, but still make it entirely through a typecheck(not build- typescript's just worse at that than other tools like esbuild) in seconds-at-worse.
Obviously depends on your organization/project/application, but I do like these things as complexity-smells.
[fp-ts]: https://gcanti.github.io/fp-ts/
-
Introducing fp-utils a functional utility library for Deno / Node
Unlike more comprehensive functional libraries like fp-ts, each module can be imported and resolved separately. If you just need options, simply add the option module and you're good to go.
-
Blog post: graphs and monads with Typescript
While it's quite abstract, I believe it may be useful to those of you who is interested to learn more about functional programming [in Typescript] and also get more intuition on diverse programming ideas. I use fp-ts as a functional programming library there.
-
Functional Programming Library for Golang by IBM
The library for TypeScript that this is influenced by is here:
https://github.com/gcanti/fp-ts
Interesting how both languages with this library converge to a similar syntax, due to heavy use of functions.
-
Is Scala worth learning in 2023?
Learn something that pays the bill first - nowadays it's Golang/Rust react/typescript. Then you can try some pure fp libs like fp-ts and fp-core.rs, and look through existing scala cats docs. If you'll feel bad about it - that's totally fine and expectable, fp takes a paradigm shift and not that many dev able to shift their brains way of thought due to basic psychological rigidity) (inability to change habits and to modify concepts/attitudes once developed). And that's purely a staffing and management issue - folks hired randoms out of the blue, and called 'em a team.
-
Application Bootstrapping with fp-ts
fp-ts, a library that caters to functional programming in TypeScript, comes with some micro-abstractions that already solve a few of our needs.
-
Error Handling Patterns
looks like more ergonomic/focused version of fp-ts[1]
-
To`class` or not to `class`?
The approach of checked errors is making a comeback. See Swift, Rust, Kotlin + Arrow.kt, and several takes on it in TypeScript: purify, fp-ts, etc.
-
For Production Users: Haskell in an age of Rust and Python
Yeah, TypeScript is shockingly good for a language that is so compatible with JavaScript. For example fp-ts. The main problem with TypeScript is pervasive mutability and side-effects.
-
Why I use Typescript nominal types [3via series part 3]
Back at my last job I was lucky enough to stumble upon some pretty awesome colleagues thanks to which I found even greater depths in Typescript which cemented the love even more. We used FP-TS to rewrite a legacy Feathers.js application and I learned many principles I later applied to my own full-stack "framework".
immutable-js
-
Yet another introduction to Functional Programming
immutable for JavaScript.
-
Imutability, react and typescrip: how to do it the clean way?
Check out Object.freeze. There's also Immutable.js for working with immutable data.
-
How To Scale Your React Applications
Use immutability to manage state updates When updating state in your React application, it's important to ensure that you are not mutating the original state object. Instead, you should create a new copy of the state object with the updated values. Immutability makes it easier to manage state updates and ensures that the updates are performed in a predictable and safe manner. Libraries like Immutable.js provide a set of functions that simplify working with immutable data in React applications.
-
Functional immutable game state
Enter Immutable.js, a library for creating and updating immutable state in JavaScript. With usual mutable JavaScript objects you might write something like:
The Immutable.js README has a much more complete description of immutability and why you might want to use the library. Also worth mentioning that Immer is an alternative which is a bit easier to get started with.
-
"console.log" Sometimes Print Wrong Data
Examples: immutable-js Immer
-
Immutable Collections should be Your Default
I can't speak to C# and Java, but the suggestion in this post: ImmutableJS already uses Persistent data structures. (It's the second sentence of their introduction)
-
immutable-js VS riux - a user suggested alternative
2 projects | 12 Aug 2022
-
Twitter Clone Part 3: Adding Tweet Reactions and Showing Notifications
feed.feedManager.state.activities is an immutable Map (created with Immutabe.js), so you get the activity object using getIn and toJS methods.
-
How do I handle objects with shared references in React?
You could create explicitly immutable references and state by using a tool like Immer.js or Immutable.js and do something like your example using their API.
What are some alternatives?
Immer - Create the next immutable state by mutating the current one
effect - A fully-fledged functional effect system for TypeScript with a rich standard library
mori - ClojureScript's persistent data structures and supporting API from the comfort of vanilla JavaScript
ramda - :ram: Practical functional Javascript
lodash - A modern JavaScript utility library delivering modularity, performance, & extras.
RxJS
immutability-helper - mutate a copy of data without changing the original source
proposal-pattern-matching - Pattern matching syntax for ECMAScript
purescript - A strongly-typed language that compiles to JavaScript
io-ts - Runtime type system for IO decoding/encoding
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.