diff options
Diffstat (limited to 'src/Utils.hs')
-rw-r--r-- | src/Utils.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Utils.hs b/src/Utils.hs index 2254fde..945c6b7 100644 --- a/src/Utils.hs +++ b/src/Utils.hs | |||
@@ -3,16 +3,23 @@ | |||
3 | module Utils | 3 | module Utils |
4 | ( showEntity | 4 | ( showEntity |
5 | , apply, apply' | 5 | , apply, apply' |
6 | , entities | ||
6 | ) where | 7 | ) where |
7 | 8 | ||
8 | import Data.Text (Text) | 9 | import Data.Text (Text) |
9 | import qualified Data.Text as Text | 10 | import qualified Data.Text as Text |
10 | 11 | ||
12 | import Data.PQueue.Prio.Max (MaxPQueue) | ||
13 | import qualified Data.PQueue.Prio.Max as MaxPQueue | ||
14 | |||
11 | import Data.Monoid (Monoid(..), (<>)) | 15 | import Data.Monoid (Monoid(..), (<>)) |
12 | 16 | ||
13 | import Control.Monad.State.Class | 17 | import Control.Monad.State.Class |
14 | import Control.Monad.Writer.Class | 18 | import Control.Monad.Writer.Class |
15 | 19 | ||
20 | import Data.Set (Set) | ||
21 | import qualified Data.Set as Set | ||
22 | |||
16 | import Types | 23 | import Types |
17 | 24 | ||
18 | showEntity :: Entity -> Text | 25 | showEntity :: Entity -> Text |
@@ -28,3 +35,6 @@ apply' alteration = do | |||
28 | 35 | ||
29 | apply :: Alteration -> Sequence -> (Sequence, History) | 36 | apply :: Alteration -> Sequence -> (Sequence, History) |
30 | apply alteration seq = undefined | 37 | apply alteration seq = undefined |
38 | |||
39 | entities :: MonadState Sequence m => m (Set Entity) | ||
40 | entities = Set.fromList . MaxPQueue.keys <$> get | ||