Closed FintanH closed 6 years ago
With these functions in place, does it make sense to leave convenience functions in the package.dhall
modules, or try to factor out all method usage in terms of extract*
?
i.e. Applicative/Type
would lose map = applicative.map
and then usage would change from applicative.map
to (extractFunctor f applicative).map
EDIT: Ah, nvm. I misinterpreted some of what this is
Add functions to extract out subclasses for more safety.
For example if
foo
takes anApplicative
, i.e.{ map = ..., ap = ..., pure ... }
and aMonad
is in scope the current approach is to domonad.{ map, ap, pure }
. This should be available asMonad/extractApplicative
. It should also exist for other typeclasses:Applicative/extractFunctor
Monad/extractApplicative
Traversable/extractFunctor
Traversable/extractFoldable
Monoid/extractSemigroup