fp-ts icon indicating copy to clipboard operation
fp-ts copied to clipboard

Meaning of the S, R, E, and A type parameters

Open JohnTasto opened this issue 5 years ago • 3 comments

📖 Documentation

Where do the letters S, R, E, and A that are used as type parameters throughout fp-ts come from? I understand what they're for and how higher kinded types work in fp-ts, but why those specific letters? I can make a guess for A, but the rest seem kind of random, at least to a native English speaker with no prior functional programming experience.

Also, what does URI stand for? I keep thinking Uniform Resource Identifier, but it doesn't follow the spec so I'm not really sure.

Apologies if this isn't the right place to ask. I can't find an answer anywhere, and individual letters are impossible to search for. Feel free to close whenever.

JohnTasto avatar Apr 23 '20 00:04 JohnTasto

If I recall correctly

  • A: just the first alphabet letter
  • E: Error (for example Either<E, A>)
  • R: not sure, Resource? (for example ReaderTaskEither<R, E, A>). Haskell uses r too
  • S: State (for example StateReaderTaskEither<S, R, E, A>)
  • URI: Unique Resource Idefntifier (but Uniform Resource Identifier would be pertinent as well IMO)

gcanti avatar Apr 23 '20 05:04 gcanti

This is a great question and response. Can we have this added to the docs under guides?

https://gcanti.github.io/fp-ts/guides/

waynevanson avatar Jun 16 '20 03:06 waynevanson

todo: label as docs, implement

We should have a list of letters to come next. Currently I've seen for 3.0 we have E1 and E2 when there are duplicates, which should also be documented.

waynevanson avatar Apr 11 '21 07:04 waynevanson