You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the signature in the module documentation uses the javascript signature. This is harder to read compared to HM style type signature used by e.g. haskell, ramda.
I've been introducing fp-ts at work to a team including some only traditionally experienced with Java. So, not devs familiar with Haskell et al.
On the one hand, TypeScript's type signatures are horribly verbose and hard to read, and there's definitely room for improvement. I'm pleasantly surprised to see that Ramda has already done this.
On the other hand, this library and its documentation is already challenging to get to grips with for those less FP-acquainted. I've said "you should learn Haskell type signature syntax" to someone before when trying to explain monad binding to them, and, well, understandably, that feels like a bit of a bait and switch. It's like: here's this cool library so we can adopt FP in our TS codebase, oh but by the way you now need to go and learn a little Haskell to actually be able to understand how these type classes work.
I'm not really offering any sort of solution here, just another perspective. 🙂
Just to add that this suggestion might be better placed over in docs-ts which this repo uses for docs generation (same author).
On reflection I'd love if it could be toggled, defaulting to TypeScript syntax. I've seen that somewhere for side-by-sides of TypeScript and Haskell code but I can't recall where.
Documentation
Currently, the signature in the module documentation uses the javascript signature. This is harder to read compared to HM style type signature used by e.g. haskell, ramda.
https://gcanti.github.io/fp-ts/modules/
Current Behavior
example taken from https://gcanti.github.io/fp-ts/modules/IO.ts.html :
export declare const chain: <A, B>(f: (a: A) => IO<B>) => (ma: IO<A>) => IO<B>
Suggested Behavior
IO a -> (a -> IO b) -> IO b
The text was updated successfully, but these errors were encountered: