Open anthonyjoeseph opened 3 years ago
So, another note is that ts-adt
doesn't depend on fp-ts
, so copy/pasting the Prism
interface wouldn't be enough, since we'd still need access to Option
... I'm thinking it might make sense to make a ts-adt-fp-ts
package that includes fp-ts, monocle and any other fp-ts ecosystem libs
Oh ok - my mistake. I think it could also be ok to copy/paste the Option
interface by the same rationale, esp since that seems unlikely to change, but I understand that it feels gross and might introduce bugs.
Do you know of/have ideas for other stuff that might find a home in a ts-adt-fp-ts
package?
Not sure if this is desired or out of scope, but it might be handy!
A Prism is an optic used to select part of a Sum type (source) so it seems like a natural fit in this ADT library.
We would probably want to avoid a dependency on monocle-ts, so we'd copy and paste the
Prism
type. It seems unorthodox, but it's how Elm implemented prisms with the original RemoteData typeSpec:
Implementation: