Closed setsunica closed 3 years ago
Also, ComonadAsk
instead of ComonadEnv
may be sufficient.
:+1: to both suggestions.
I'd say asks
's type is a bug even, it makes no sense to require w e1
, probably makes the function unusable most of the time.
The current definition is more restrictive than necessary. Modify as follows.
from
asks :: forall e1 e2 w. ComonadEnv e1 w => (e1 -> e2) -> w e1 -> e2
toasks :: forall e1 e2 w a. ComonadEnv e1 w => (e1 -> e2) -> w a -> e2
The Haskell definition is as follows.
asks :: ComonadEnv e w => (e -> e') -> w a -> e'