Maybe (Lens' ab) type type Maybe (Lens' ab) does not work, because Lens' is under a hood of type Rank-2, t be wrapped in a type constructor without the extension -XImpredicativeTypes (which is not supported in GHC).
So the best type is to give a function that morally would have a type
foo :: A -> Maybe (Lens' BC)
Perhaps it would be possible to postpone Maybe to continue
foo' :: β y . A -> (Lens' BC -> y) -> Maybe y
but I donβt particularly like it.
source share