Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Colocated l a = Colocated {
- unColocated :: Reader l a
- data Located l a = Located {
- _locatedLoc :: !l
- _locatedVal :: a
- askColocated :: Colocated l l
- colocated :: (l -> a) -> Colocated l a
- runColocated :: Colocated l a -> l -> a
Documentation
newtype Colocated l a Source #
Because we defined a unique left adjoint, we have to define the unique right.
Colocated | |
|
Instances
MonadReader l (Colocated l) Source # | |
Monad (Colocated l) Source # | |
Functor (Colocated l) Source # | |
Applicative (Colocated l) Source # | |
Defined in Blanks.Located | |
Distributive (Colocated l) Source # | |
Defined in Blanks.Located | |
Representable (Colocated l) Source # | |
Adjunction (Located l) (Colocated l) Source # | |
type Rep (Colocated l) Source # | |
This is basically the Env
comonad, but with the env strict.
It's also basically the Writer
monad in certain contexts.
We define a new, non-transforming datatype so we can pattern-match.
Located | |
|
Instances
askColocated :: Colocated l l Source #
runColocated :: Colocated l a -> l -> a Source #