3 ms·
It is possible to derive Applicative. The next release of GHC is able to derive Applicative for product types: `deriving Applicative via Generically1 F`. If y
by Iceland_jack 4y ago
It is possible to derive Applicative.
The next release of GHC is able to derive Applicative for product types: `deriving Applicative via Generically1 F`.
If you have a sum type you can derive Applicative as well, but as you mention there are often multiple options so this requires user assistance: `deriving Applicative via Idiomatically F '[LeftBias Id]`.
Here is the library that allows that: https://hackage.haskell.org/package/idiomatic https://hackage.haskell.org/package/idiomatic