diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-11 20:38:57 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-11 20:38:57 +0000 |
commit | a86e55bbcc6d5b23ab11312d3ca94a745bea5ed9 (patch) | |
tree | 29b605c03503df709a1bf700dd9aae7f30209772 | |
parent | d6d19a127f84ea737ed9d3d9103f34c7fe20f394 (diff) | |
download | thermoprint-a86e55bbcc6d5b23ab11312d3ca94a745bea5ed9.tar thermoprint-a86e55bbcc6d5b23ab11312d3ca94a745bea5ed9.tar.gz thermoprint-a86e55bbcc6d5b23ab11312d3ca94a745bea5ed9.tar.bz2 thermoprint-a86e55bbcc6d5b23ab11312d3ca94a745bea5ed9.tar.xz thermoprint-a86e55bbcc6d5b23ab11312d3ca94a745bea5ed9.zip |
MonadState instance for QueueManager
-rw-r--r-- | server/src/Thermoprint/Server/Queue.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/Thermoprint/Server/Queue.hs b/server/src/Thermoprint/Server/Queue.hs index 832b876..d5ab42b 100644 --- a/server/src/Thermoprint/Server/Queue.hs +++ b/server/src/Thermoprint/Server/Queue.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | {-# LANGUAGE FlexibleInstances, FlexibleContexts #-} | 1 | {-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses #-} |
2 | {-# LANGUAGE ViewPatterns #-} | 2 | {-# LANGUAGE ViewPatterns #-} |
3 | {-# LANGUAGE RecordWildCards #-} | 3 | {-# LANGUAGE RecordWildCards #-} |
4 | {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-} | 4 | {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-} |
@@ -125,6 +125,9 @@ toZipper = Set.foldr' insert def | |||
125 | type QueueManager t = QueueManagerM t (Extended Micro) | 125 | type QueueManager t = QueueManagerM t (Extended Micro) |
126 | type QueueManagerM t = ComposeT (StateT Queue) t STM | 126 | type QueueManagerM t = ComposeT (StateT Queue) t STM |
127 | 127 | ||
128 | instance (Monad (StateT s (g m)), Monad (g m)) => MonadState s (ComposeT (StateT s) g m) where | ||
129 | state = ComposeT . state | ||
130 | |||
128 | runQM :: ( HasQueue q | 131 | runQM :: ( HasQueue q |
129 | , MFunctor t | 132 | , MFunctor t |
130 | , MonadTrans t | 133 | , MonadTrans t |