{-# LANGUAGE UndecidableInstances #-}

module Blucontrol.Monad.PrepareValue.Const (
  PrepareValueConstT
, runPrepareValueConstT
) where

import Control.Monad.Base
import Control.Monad.Trans
import Control.Monad.Trans.Control
import Control.Monad.Reader

import Blucontrol.Monad.PrepareValue

newtype PrepareValueConstT c m a = PrepareValueConstT { PrepareValueConstT c m a -> ReaderT c m a
unPrepareValueConstT :: ReaderT c m a }
  deriving (Functor (PrepareValueConstT c m)
a -> PrepareValueConstT c m a
Functor (PrepareValueConstT c m)
-> (forall a. a -> PrepareValueConstT c m a)
-> (forall a b.
    PrepareValueConstT c m (a -> b)
    -> PrepareValueConstT c m a -> PrepareValueConstT c m b)
-> (forall a b c.
    (a -> b -> c)
    -> PrepareValueConstT c m a
    -> PrepareValueConstT c m b
    -> PrepareValueConstT c m c)
-> (forall a b.
    PrepareValueConstT c m a
    -> PrepareValueConstT c m b -> PrepareValueConstT c m b)
-> (forall a b.
    PrepareValueConstT c m a
    -> PrepareValueConstT c m b -> PrepareValueConstT c m a)
-> Applicative (PrepareValueConstT c m)
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m a
PrepareValueConstT c m (a -> b)
-> PrepareValueConstT c m a -> PrepareValueConstT c m b
(a -> b -> c)
-> PrepareValueConstT c m a
-> PrepareValueConstT c m b
-> PrepareValueConstT c m c
forall a. a -> PrepareValueConstT c m a
forall a b.
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m a
forall a b.
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
forall a b.
PrepareValueConstT c m (a -> b)
-> PrepareValueConstT c m a -> PrepareValueConstT c m b
forall a b c.
(a -> b -> c)
-> PrepareValueConstT c m a
-> PrepareValueConstT c m b
-> PrepareValueConstT c m c
forall c (m :: * -> *).
Applicative m =>
Functor (PrepareValueConstT c m)
forall c (m :: * -> *) a.
Applicative m =>
a -> PrepareValueConstT c m a
forall c (m :: * -> *) a b.
Applicative m =>
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m a
forall c (m :: * -> *) a b.
Applicative m =>
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
forall c (m :: * -> *) a b.
Applicative m =>
PrepareValueConstT c m (a -> b)
-> PrepareValueConstT c m a -> PrepareValueConstT c m b
forall c (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> PrepareValueConstT c m a
-> PrepareValueConstT c m b
-> PrepareValueConstT c m c
forall (f :: * -> *).
Functor f
-> (forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
<* :: PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m a
$c<* :: forall c (m :: * -> *) a b.
Applicative m =>
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m a
*> :: PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
$c*> :: forall c (m :: * -> *) a b.
Applicative m =>
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
liftA2 :: (a -> b -> c)
-> PrepareValueConstT c m a
-> PrepareValueConstT c m b
-> PrepareValueConstT c m c
$cliftA2 :: forall c (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> PrepareValueConstT c m a
-> PrepareValueConstT c m b
-> PrepareValueConstT c m c
<*> :: PrepareValueConstT c m (a -> b)
-> PrepareValueConstT c m a -> PrepareValueConstT c m b
$c<*> :: forall c (m :: * -> *) a b.
Applicative m =>
PrepareValueConstT c m (a -> b)
-> PrepareValueConstT c m a -> PrepareValueConstT c m b
pure :: a -> PrepareValueConstT c m a
$cpure :: forall c (m :: * -> *) a.
Applicative m =>
a -> PrepareValueConstT c m a
$cp1Applicative :: forall c (m :: * -> *).
Applicative m =>
Functor (PrepareValueConstT c m)
Applicative, a -> PrepareValueConstT c m b -> PrepareValueConstT c m a
(a -> b) -> PrepareValueConstT c m a -> PrepareValueConstT c m b
(forall a b.
 (a -> b) -> PrepareValueConstT c m a -> PrepareValueConstT c m b)
-> (forall a b.
    a -> PrepareValueConstT c m b -> PrepareValueConstT c m a)
-> Functor (PrepareValueConstT c m)
forall a b.
a -> PrepareValueConstT c m b -> PrepareValueConstT c m a
forall a b.
(a -> b) -> PrepareValueConstT c m a -> PrepareValueConstT c m b
forall c (m :: * -> *) a b.
Functor m =>
a -> PrepareValueConstT c m b -> PrepareValueConstT c m a
forall c (m :: * -> *) a b.
Functor m =>
(a -> b) -> PrepareValueConstT c m a -> PrepareValueConstT c m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> PrepareValueConstT c m b -> PrepareValueConstT c m a
$c<$ :: forall c (m :: * -> *) a b.
Functor m =>
a -> PrepareValueConstT c m b -> PrepareValueConstT c m a
fmap :: (a -> b) -> PrepareValueConstT c m a -> PrepareValueConstT c m b
$cfmap :: forall c (m :: * -> *) a b.
Functor m =>
(a -> b) -> PrepareValueConstT c m a -> PrepareValueConstT c m b
Functor, Applicative (PrepareValueConstT c m)
a -> PrepareValueConstT c m a
Applicative (PrepareValueConstT c m)
-> (forall a b.
    PrepareValueConstT c m a
    -> (a -> PrepareValueConstT c m b) -> PrepareValueConstT c m b)
-> (forall a b.
    PrepareValueConstT c m a
    -> PrepareValueConstT c m b -> PrepareValueConstT c m b)
-> (forall a. a -> PrepareValueConstT c m a)
-> Monad (PrepareValueConstT c m)
PrepareValueConstT c m a
-> (a -> PrepareValueConstT c m b) -> PrepareValueConstT c m b
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
forall a. a -> PrepareValueConstT c m a
forall a b.
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
forall a b.
PrepareValueConstT c m a
-> (a -> PrepareValueConstT c m b) -> PrepareValueConstT c m b
forall c (m :: * -> *).
Monad m =>
Applicative (PrepareValueConstT c m)
forall c (m :: * -> *) a. Monad m => a -> PrepareValueConstT c m a
forall c (m :: * -> *) a b.
Monad m =>
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
forall c (m :: * -> *) a b.
Monad m =>
PrepareValueConstT c m a
-> (a -> PrepareValueConstT c m b) -> PrepareValueConstT c m b
forall (m :: * -> *).
Applicative m
-> (forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
return :: a -> PrepareValueConstT c m a
$creturn :: forall c (m :: * -> *) a. Monad m => a -> PrepareValueConstT c m a
>> :: PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
$c>> :: forall c (m :: * -> *) a b.
Monad m =>
PrepareValueConstT c m a
-> PrepareValueConstT c m b -> PrepareValueConstT c m b
>>= :: PrepareValueConstT c m a
-> (a -> PrepareValueConstT c m b) -> PrepareValueConstT c m b
$c>>= :: forall c (m :: * -> *) a b.
Monad m =>
PrepareValueConstT c m a
-> (a -> PrepareValueConstT c m b) -> PrepareValueConstT c m b
$cp1Monad :: forall c (m :: * -> *).
Monad m =>
Applicative (PrepareValueConstT c m)
Monad, MonadBase b, MonadBaseControl b, m a -> PrepareValueConstT c m a
(forall (m :: * -> *) a.
 Monad m =>
 m a -> PrepareValueConstT c m a)
-> MonadTrans (PrepareValueConstT c)
forall c (m :: * -> *) a.
Monad m =>
m a -> PrepareValueConstT c m a
forall (m :: * -> *) a. Monad m => m a -> PrepareValueConstT c m a
forall (t :: (* -> *) -> * -> *).
(forall (m :: * -> *) a. Monad m => m a -> t m a) -> MonadTrans t
lift :: m a -> PrepareValueConstT c m a
$clift :: forall c (m :: * -> *) a.
Monad m =>
m a -> PrepareValueConstT c m a
MonadTrans, MonadTrans (PrepareValueConstT c)
m (StT (PrepareValueConstT c) a) -> PrepareValueConstT c m a
MonadTrans (PrepareValueConstT c)
-> (forall (m :: * -> *) a.
    Monad m =>
    (Run (PrepareValueConstT c) -> m a) -> PrepareValueConstT c m a)
-> (forall (m :: * -> *) a.
    Monad m =>
    m (StT (PrepareValueConstT c) a) -> PrepareValueConstT c m a)
-> MonadTransControl (PrepareValueConstT c)
(Run (PrepareValueConstT c) -> m a) -> PrepareValueConstT c m a
forall c. MonadTrans (PrepareValueConstT c)
forall c (m :: * -> *) a.
Monad m =>
m (StT (PrepareValueConstT c) a) -> PrepareValueConstT c m a
forall c (m :: * -> *) a.
Monad m =>
(Run (PrepareValueConstT c) -> m a) -> PrepareValueConstT c m a
forall (m :: * -> *) a.
Monad m =>
m (StT (PrepareValueConstT c) a) -> PrepareValueConstT c m a
forall (m :: * -> *) a.
Monad m =>
(Run (PrepareValueConstT c) -> m a) -> PrepareValueConstT c m a
forall (t :: (* -> *) -> * -> *).
MonadTrans t
-> (forall (m :: * -> *) a. Monad m => (Run t -> m a) -> t m a)
-> (forall (m :: * -> *) a. Monad m => m (StT t a) -> t m a)
-> MonadTransControl t
restoreT :: m (StT (PrepareValueConstT c) a) -> PrepareValueConstT c m a
$crestoreT :: forall c (m :: * -> *) a.
Monad m =>
m (StT (PrepareValueConstT c) a) -> PrepareValueConstT c m a
liftWith :: (Run (PrepareValueConstT c) -> m a) -> PrepareValueConstT c m a
$cliftWith :: forall c (m :: * -> *) a.
Monad m =>
(Run (PrepareValueConstT c) -> m a) -> PrepareValueConstT c m a
$cp1MonadTransControl :: forall c. MonadTrans (PrepareValueConstT c)
MonadTransControl)

instance Monad m => MonadPrepareValue (PrepareValueConstT c m) where
  type PreparedValue (PrepareValueConstT c m) = c
  preparedValue :: PrepareValueConstT c m (PreparedValue (PrepareValueConstT c m))
preparedValue = ReaderT c m c -> PrepareValueConstT c m c
forall c (m :: * -> *) a. ReaderT c m a -> PrepareValueConstT c m a
PrepareValueConstT ReaderT c m c
forall r (m :: * -> *). MonadReader r m => m r
ask

runPrepareValueConstT :: c -> PrepareValueConstT c m a -> m a
runPrepareValueConstT :: c -> PrepareValueConstT c m a -> m a
runPrepareValueConstT !c
rgb PrepareValueConstT c m a
tma = ReaderT c m a -> c -> m a
forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
runReaderT (PrepareValueConstT c m a -> ReaderT c m a
forall c (m :: * -> *) a. PrepareValueConstT c m a -> ReaderT c m a
unPrepareValueConstT PrepareValueConstT c m a
tma) c
rgb