Comments (3)
There is a Sequential Apply for Task here. The only difference between apply and applicative is the of constructor. I can see how you'd need the Applicative module for traverse and should be able to implement it this weekend. I'd also welcome a PR if you're up to it. Unfortunately, Deno 1.10 generates better coverage reports (that show functional missing some branches in testing) so I was hoping to fix that first. Anyway, thanks for the find!
from fun.
I quickly whippped up:
import { ApplySeq } from "https://deno.land/x/[email protected]/task.ts";
import type * as TC from "https://deno.land/x/[email protected]/type_classes.ts";
const URI = "Task";
type URI = typeof URI;
const Functor: TC.Functor<URI> = {
map: (fab) => (ta) => () => ta().then(fab),
};
export const ApplicativeSeq: TC.Applicative<URI> = {
of: (a) => () => Promise.resolve(a),
ap: ApplySeq.ap,
map: Functor.map,
};
But then didn't end up testing or actually even using it haha 😅 .
I'm a bit tight on time right now. Next time I need it, if it isn't there, I'm happy to take a shot.
Perhaps this already helps someone else.
from fun.
Yeah, I'd do basically the same thing:
import type * as TC from "https://deno.land/x/[email protected]/type_classes.ts";
import * as T from "https://deno.land/x/[email protected]/task.ts";
const ApplicativeSeq: TC.Applicative<T.URI> = {
of: T.of,
ap: ApplySeq.ap,
map: T.map,
}
from fun.
Related Issues (20)
- Traversable 2.0
- Traversal 2.0
- Tree 2.0
- Types 2.0
- March to 2.0! HOT 1
- Build an outline of something like https://github.com/MostlyAdequate/mostly-adequate-guide HOT 1
- Update the README (or build a script to automatically up date it) with links to all documentation. HOT 1
- DecodeError 2.0
- Pair 2.0
- Predicate 2.0
- Refinement 2.0
- NonEmptyArray - Post 2.0 HOT 1
- Kind: Implement variance for kind.ts
- Free - Post 2.0
- ReadableStream - Post 2.0 HOT 1
- Partition and Filterable - Post 2.0 HOT 1
- Remove null from PartialSchemable
- Move all type and interface definitions out of types.ts
- Rename some ADTS HOT 4
- Moving Primary Development off Github HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fun.