purescript
fp-ts
Our great sponsors
- CodiumAI - TestGPT | Generating meaningful tests for busy devs
- SonarQube - Static code analysis for 29 languages.
- InfluxDB - Access the most powerful time series database as a service
- ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
purescript | fp-ts | |
---|---|---|
47 | 90 | |
8,135 | 9,466 | |
0.8% | - | |
6.1 | 9.1 | |
5 days ago | 2 days ago | |
Haskell | TypeScript | |
BSD 3-clause "New" or "Revised" 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.
purescript
- (strongly typed) functional language compilers running in browser
-
purescript VS purs-eval - a user suggested alternative
2 projects | 2 Mar 2023
- Por que Elm é uma linguagem tão deliciosa?
-
My main beef with Haskell/JS
Assuming this is a PS knock, fwiw this went away a good bit ago: https://github.com/purescript/purescript/releases/tag/v0.14.2
- 10 years of Scala.js
-
purerl - Integrating PureScript into Elixir projects
PureScript is a Haskell-like language aimed at providing an alternative to TypeScript for statically typed programming in the JavaScript space. I highly recommend taking a look at PureScript for your compile-to-JavaScript needs outside of the use case we'll be talking about in this post.
-
Ask HN: Uncommon Web Languages?
Tons of them, but I am most interested in the following for various reasons:
PureScript[1] — been around a long time. Looks a lot like Haskell to me.
Derw[2] — Elm-like, interesting integration with Typescript
Amber[3] — smalltalk for js
Rescript[4] — its been awhile since i last looked at this project (during a catastrophic rebrand) so I'm not sure where this project is at, but it did seem very promising to me at one point.
[1]: https://www.purescript.org/
-
2022 State of Haskell Survey
Thinking about "tools" in a more general sense, there is Pandoc,¹ which is an end-user application, and PureScirpt,² a programming language.
-
Is there an Elm like framework for cross-platform apps?
There's Purescript with two libraries implementing the Elm architecture, flame and elmish (on React). Purescript only targets JS, but that can be embedded in mobile and desktop apps.
- Can I skip the classes in node without having any major disadvantages?
fp-ts
-
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".
-
TypeScript: why you shouldn't throw errors to control the program flow
Those familiar with more functional languages might be screaming about monads at their screens now. Indeed, if we want to go a step further than using discriminated unions, we can apply Either monads. Those come with a whole lot of useful tooling with them, like the possibility of monadic pattern matching and chaining operations. We have good experiences of using fp-ts in my team at Swappie, and even thought the initial learning curve can be steep, the benefits are useful. You can read more about monads in various blog posts all over the web, this one being a good example of Either specifically.
- [AskJS] I've often read a lot of "if" statements can quickly turn into an anti pattern and convolute code. What are some strategies to avoid unnecessary "if" statements and ways to notice when you start to introduce this anti pattern?
-
John Carmack on Functional Programming in C++ (2018)
It's not just the ADTs but the exhaustive pattern matching that help make sure you've covered all of the cases in your ADT. You'll see JavaScripters use objects as a poor man's ADT where they'll use the key name as a the constructor or a { tag: key, ... }, but that has caveats (aside from feeling less first-class): 1) JavaScript can't do exhaustive pattern matching so you'll always need to handle null cases, 2) checks must all happen at runtime which means you'll end up having to throw/catch exceptions and nothing will hold your hand to say that you've missed a case. TypeScripters can handle 1 & 2 for safety, but the ergonomics are bad and verbose so you'll see a lot of folks skip it. Similar languages will have pattern matching, safety, but lack the lightweight/dense ergonomics. When you dive into a language in the ML family (Haskell, OCaml, Standard ML, et. al.), the ergonomics make you want to use them, and they are idiomatic to the ecosystem and you'll want to use them for just about everything--either the ones in the Preludes/stdlib like Maybe, Either, List, etc. or by building them yourself.
An example in the wild that demonstrates this `fp-ts`'s explanation of how to do ADTs in TypeScript where you can see the comparison in PureScript is a one-liner: https://github.com/gcanti/fp-ts/blob/master/docs/guides/pure...
-
Ask HN: What is the “proper” way to do error-handling in TypeScript?
I use fp-ts with its Result type, works great.
- libraries you are happy that you discovered them
-
ts-belt - Fast, modern, and practical utility library for FP in TypeScript / Flow / JavaScript. (Faster than ramda, rambda, remeda and lodash/fp.)
Why not just https://gcanti.github.io/fp-ts/?
What are some alternatives?
effect - A fully-fledged functional effect system for TypeScript with a rich standard library
ramda - :ram: Practical functional Javascript
proposal-pattern-matching - Pattern matching syntax for ECMAScript
io-ts - Runtime type system for IO decoding/encoding
reason - Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
immutable-js - Immutable persistent data collections for Javascript which increase efficiency and simplicity.
elm-reactor
Elm - Compiler for Elm, a functional language for reliable webapps.
Idris2 - A purely functional programming language with first class types
zod - TypeScript-first schema validation with static type inference
polysemy - :gemini: higher-order, no-boilerplate monads