2

In a Reader<E, A> the E parameter represents the environment to read a value of type A from.

If I have a reader and an environment and would like to read the value from a reader via pipe, one way of doing it is via:

const a = pipe(rdr, I.ap(e))

I wonder if the operation I.ap(e) has a particular name in the scope of a reader that makes the intend more obvious?

Carsten
  • 468
  • 4
  • 16
  • People won't be able to help if you don't provide more context. What is rdr defined as? What is e? Give a concrete example please. – Dennis Yang Jun 02 '23 at 19:07
  • What do you mean by "read the value from a reader"? When inside a reader context, you can access the environment `E` by using methods like ask (https://gcanti.github.io/fp-ts/modules/Reader.ts.html#ask). You can't "read the value" of `A`. The only way to do so is to actually execute the Reader i.e. `myReader(environment)` – cdimitroulas Jul 04 '23 at 07:05

0 Answers0