| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Instances for the state monad |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Effect.Monad.State.Instances where |
| 10 |
|
| 11 |
open import Effect.Monad.State.Transformer |
| 12 |
|
| 13 |
instance |
| 14 |
stateTFunctor = λ {s} {S} {f} {M} {{fun}} → functor {s} {S} {f} {M} fun |
| 15 |
stateTApplicative = λ {s} {S} {f} {M} {{mon}} → applicative {s} {S} {f} {M} mon |
| 16 |
stateTEmpty = λ {s} {S} {f} {M} {{e}} → empty {s} {S} {f} {M} e |
| 17 |
stateTChoice = λ {s} {S} {f} {M} {{ch}} → choice {s} {S} {f} {M} ch |
| 18 |
stateTApplicativeZero = λ {s} {S} {f} {M} {{mon}} → applicativeZero {s} {S} {f} {M} mon |
| 19 |
stateTAlternative = λ {s} {S} {f} {M} {{mpl}} → alternative {s} {S} {f} {M} mpl |
| 20 |
stateTMonad = λ {s} {S} {f} {M} {{mon}} → monad {s} {S} {f} {M} mon |
| 21 |
stateTMonadZero = λ {s} {S} {f} {M} {{mz}} → monadZero {s} {S} {f} {M} mz |
| 22 |
stateTMonadPlus = λ {s} {S} {f} {M} {{mpl}} → monadPlus {s} {S} {f} {M} mpl |
| 23 |
stateTMonadT = λ {s} {S} {f} {M} {{mon}} → monadT {s} {S} {f} {M} mon |
| 24 |
stateTMonadState = λ {s} {S} {f} {M} {{mon}} → monadState {s} {S} {f} {M} mon |
| 25 |
stateTLiftReaderT = λ {R} {s} {S} {f} {M} {{ms}} → liftReaderT {R} {s} {S} {f} {M} ms |
| 26 |
stateTLiftWriterT = λ {R} {s} {S} {f} {M} {{fun}} {{mo}} {{ms}} → liftWriterT {R} {s} {S} {f} {M} mo fun ms |
| 27 |
-- the following instances conflicts with stateTMonadState so we don't include it |
| 28 |
-- stateTLiftStateT = λ {s} {S₁} {S₂} {f} {M} {{mon}} {{ms}} → liftStateT {s} {S₁} {S₂} {f} {M} mon ms |