question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage with TaskEither or ReaderTaskEither

See original GitHub issue

A complete n00b question, here as I am really struggling and I can’t find any usage of hyper-ts in ‘real life’.

Is it possible to use MiddlewareTask with TaskEither or ReaderTaskEither? Or would I have to define a MiddlewareTaskEither? (which I think is beyond my current capability).

Thanks for any help.

EDIT: fixed spelling TaskReader -> TaskEither

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mlegenhausencommented, Nov 22, 2018

@wmaurer I think you mean TaskEither?

Yes you can for example you can lift any TaskEither value by using

// lift from MiddlewareTask
lift<StatusOpen, Either<Error, string>>(someTaskEither.value);

or if you want access the Conn you can use

new MiddlewareTask(c => myRetuningTaskEitherFn(c).value.map(r => tuple(r, c)))

your last question about MiddlewareTaskEither would be very interesting. @gcanti do you have any thoughts about it? Would it be possible? Would it need something like an ifold function?

0reactions
sledorzecommented, Mar 23, 2019

readertaskeither would help a lot structuring dependencies. (the zio way) However, stacking the transformers has a cost…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Usage with TaskEither or ReaderTaskEither #13 - GitHub
A complete n00b question, here as I am really struggling and I can't find any usage of hyper-ts in 'real life'. Is it...
Read more >
TypeScript + fp-ts: ReaderTaskEither Foundations - Andy White
If you are dealing with an async operation that has the possibility of failure, you should use TaskEither<E, A> instead.
Read more >
ReaderTaskEither.ts - fp-ts
The default ApplicativePar instance returns the first error, if you want to get all errors you need to provide a way to concatenate...
Read more >
Functional programming in typescript using fp-ts
Reader + Task + Either = ReaderTaskEither. Now let's put the parts together to create a functional data structure that we can use...
Read more >
Practical Guide to Fp-ts P3: Task, Either, TaskEither
Learn how to use Fp-ts practically. Introduces the task, either, and taskEither operators. No mathematical knowledge required.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found