-
-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prelude file #952
Comments
Here's something I'm using in a import * as Ar from "fp-ts/lib/Array";
import * as E from "fp-ts/lib/Either";
import * as Eq from "fp-ts/lib/Eq";
import * as Ma from "fp-ts/lib/Map";
import * as An from "fp-ts/lib/NonEmptyArray";
import * as O from "fp-ts/lib/Option";
import * as Ord from "fp-ts/lib/Ord";
import * as R from "fp-ts/lib/Record";
import * as Te from "fp-ts/lib/TaskEither";
import * as io from "io-ts";
import * as nt from "newtype-ts";
export * from "fp-ts/lib/function";
export * from "fp-ts/lib/pipeable";
export { An, Ar, E, Eq, Ma, O, Ord, R, Te, io, nt }; Also, there's fp-ts-ramda, which @giogonzo is experimenting with, that uses |
I wrote my own prelude package for my current projects. It doesn't contain all of fp-ts and io-ts. Just the main stuff I'm using. Below is an example of how I use the imports in a project. import * as P from 'maasglobal-prelude-ts';
P.Either // static type
P.Either // io-ts codec
P.Either_ // fp-ts utils
P.Either__ // fp-ts type class implementations |
🚀 Feature request
Hi guys, the project is awesome, but for newcomers from other FP languages would be much easier to start coding if there was some
Prelude
file with all basic types and combinators, like Array, Option, map, flatMap, filter, find, etc. This would drammatically decrease effort necessary to adapt to new syntax, would remove necessity to grep the repo to find how to apply, for instance,Filterable
type class. This is all basic stuff which usually works out-of-the-box in Scala or Haskell without any imports.Current Behavior
Necessary to import a lot of files to write something like this (in plain TS):
Desired Behavior
Would be awesome if the snippet above would be implementable without more than 1-2 imports and several method renamings.
Who does this impact? Who is this for?
For newcomers from other FP languages like Scala or Haskell.
Describe alternatives you've considered
To add docs page how to import all the core stuff.
The text was updated successfully, but these errors were encountered: