module Blucontrol.Main ( blucontrol , BlucontrolConstraints , ConfigControl (..) ) where import Control.Monad.Trans.Control import Blucontrol.Main.Control import Blucontrol.Main.CLI import Blucontrol.Monad.ApplyValue import Blucontrol.Monad.Control import Blucontrol.Monad.PrepareValue import Blucontrol.Value type BlucontrolConstraints mc mp ma = ( CompatibleValues (PreparedValue mp) (ApplicableValue ma) , ControlConstraint mc (StM mp (StM ma ())) , MonadBaseControl IO mp , MonadBaseControl IO ma , MonadApplyValue ma , MonadControl mc , MonadPrepareValue mp ) blucontrol :: BlucontrolConstraints mc mp ma => ConfigControl mc mp ma -> IO (StM mc (StM mp (StM ma ()))) blucontrol :: ConfigControl mc mp ma -> IO (StM mc (StM mp (StM ma ()))) blucontrol ConfigControl { forall a. mc a -> IO (StM mc a) runControl :: forall (mc :: * -> *) (mp :: * -> *) (ma :: * -> *). ConfigControl mc mp ma -> forall a. mc a -> IO (StM mc a) runControl :: forall a. mc a -> IO (StM mc a) runControl, forall a. mp a -> IO (StM mp a) runPrepareValue :: forall (mc :: * -> *) (mp :: * -> *) (ma :: * -> *). ConfigControl mc mp ma -> forall a. mp a -> IO (StM mp a) runPrepareValue :: forall a. mp a -> IO (StM mp a) runPrepareValue, forall a. ma a -> IO (StM ma a) runApplyValue :: forall (mc :: * -> *) (mp :: * -> *) (ma :: * -> *). ConfigControl mc mp ma -> forall a. ma a -> IO (StM ma a) runApplyValue :: forall a. ma a -> IO (StM ma a) runApplyValue } = do IO () launch mc (StM mp (StM ma ())) -> IO (StM mc (StM mp (StM ma ()))) forall a. mc a -> IO (StM mc a) runControl (mc (StM mp (StM ma ())) -> IO (StM mc (StM mp (StM ma ())))) -> mc (StM mp (StM ma ())) -> IO (StM mc (StM mp (StM ma ()))) forall a b. (a -> b) -> a -> b $ ((forall a. mc a -> IO (StM mc a)) -> IO (StM mp (StM ma ()))) -> mc (StM mp (StM ma ())) forall (b :: * -> *) (m :: * -> *) a. MonadBaseControl b m => (RunInBase m b -> b a) -> m a liftBaseWith (((forall a. mc a -> IO (StM mc a)) -> IO (StM mp (StM ma ()))) -> mc (StM mp (StM ma ()))) -> ((forall a. mc a -> IO (StM mc a)) -> IO (StM mp (StM ma ()))) -> mc (StM mp (StM ma ())) forall a b. (a -> b) -> a -> b $ \ forall a. mc a -> IO (StM mc a) runC -> mp (StM ma ()) -> IO (StM mp (StM ma ())) forall a. mp a -> IO (StM mp a) runPrepareValue (mp (StM ma ()) -> IO (StM mp (StM ma ()))) -> mp (StM ma ()) -> IO (StM mp (StM ma ())) forall a b. (a -> b) -> a -> b $ ((forall a. mp a -> IO (StM mp a)) -> IO (StM ma ())) -> mp (StM ma ()) forall (b :: * -> *) (m :: * -> *) a. MonadBaseControl b m => (RunInBase m b -> b a) -> m a liftBaseWith (((forall a. mp a -> IO (StM mp a)) -> IO (StM ma ())) -> mp (StM ma ())) -> ((forall a. mp a -> IO (StM mp a)) -> IO (StM ma ())) -> mp (StM ma ()) forall a b. (a -> b) -> a -> b $ \ forall a. mp a -> IO (StM mp a) runP -> ma () -> IO (StM ma ()) forall a. ma a -> IO (StM ma a) runApplyValue (ma () -> IO (StM ma ())) -> ma () -> IO (StM ma ()) forall a b. (a -> b) -> a -> b $ ((forall a. ma a -> IO (StM ma a)) -> IO ()) -> ma () forall (b :: * -> *) (m :: * -> *) a. MonadBaseControl b m => (RunInBase m b -> b a) -> m a liftBaseWith (((forall a. ma a -> IO (StM ma a)) -> IO ()) -> ma ()) -> ((forall a. ma a -> IO (StM ma a)) -> IO ()) -> ma () forall a b. (a -> b) -> a -> b $ \ forall a. ma a -> IO (StM ma a) runA -> (forall a. mc a -> IO (StM mc a)) -> (forall a. mp a -> IO (StM mp a)) -> (forall a. ma a -> IO (StM ma a)) -> (PreparedValue mp -> ApplicableValue ma) -> IO () forall (mc :: * -> *) (mp :: * -> *) (ma :: * -> *). (ControlConstraint mc (StM mp (StM ma ())), MonadBaseControl IO mc, MonadBaseControl IO mp, MonadBaseControl IO ma, MonadApplyValue ma, MonadControl mc, MonadPrepareValue mp) => RunInBase mc IO -> RunInBase mp IO -> RunInBase ma IO -> (PreparedValue mp -> ApplicableValue ma) -> IO () loopRecolor forall a. mc a -> IO (StM mc a) runC forall a. mp a -> IO (StM mp a) runP forall a. ma a -> IO (StM ma a) runA PreparedValue mp -> ApplicableValue ma forall a b. CompatibleValues a b => a -> b convertValue data ConfigControl mc mp ma = ConfigControl { ConfigControl mc mp ma -> forall a. mc a -> IO (StM mc a) runControl :: forall a. mc a -> IO (StM mc a) , ConfigControl mc mp ma -> forall a. mp a -> IO (StM mp a) runPrepareValue :: forall a. mp a -> IO (StM mp a) , ConfigControl mc mp ma -> forall a. ma a -> IO (StM ma a) runApplyValue :: forall a. ma a -> IO (StM ma a) }