summaryrefslogtreecommitdiff
path: root/src/Utils.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-05-08 00:00:20 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-05-08 00:00:20 +0200
commit99b12580b0ef0592dbfb5da04070114314e9b7f8 (patch)
tree59b2f7132aa969db1912480a78940046cdf77aa1 /src/Utils.hs
parent6ceaff1e8e111d6b025bd725ee93edb354c535f6 (diff)
download2017-01-16_17:13:37-99b12580b0ef0592dbfb5da04070114314e9b7f8.tar
2017-01-16_17:13:37-99b12580b0ef0592dbfb5da04070114314e9b7f8.tar.gz
2017-01-16_17:13:37-99b12580b0ef0592dbfb5da04070114314e9b7f8.tar.bz2
2017-01-16_17:13:37-99b12580b0ef0592dbfb5da04070114314e9b7f8.tar.xz
2017-01-16_17:13:37-99b12580b0ef0592dbfb5da04070114314e9b7f8.zip
framework for command parsing
Diffstat (limited to 'src/Utils.hs')
-rw-r--r--src/Utils.hs10
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 @@
3module Utils 3module Utils
4 ( showEntity 4 ( showEntity
5 , apply, apply' 5 , apply, apply'
6 , entities
6 ) where 7 ) where
7 8
8import Data.Text (Text) 9import Data.Text (Text)
9import qualified Data.Text as Text 10import qualified Data.Text as Text
10 11
12import Data.PQueue.Prio.Max (MaxPQueue)
13import qualified Data.PQueue.Prio.Max as MaxPQueue
14
11import Data.Monoid (Monoid(..), (<>)) 15import Data.Monoid (Monoid(..), (<>))
12 16
13import Control.Monad.State.Class 17import Control.Monad.State.Class
14import Control.Monad.Writer.Class 18import Control.Monad.Writer.Class
15 19
20import Data.Set (Set)
21import qualified Data.Set as Set
22
16import Types 23import Types
17 24
18showEntity :: Entity -> Text 25showEntity :: Entity -> Text
@@ -28,3 +35,6 @@ apply' alteration = do
28 35
29apply :: Alteration -> Sequence -> (Sequence, History) 36apply :: Alteration -> Sequence -> (Sequence, History)
30apply alteration seq = undefined 37apply alteration seq = undefined
38
39entities :: MonadState Sequence m => m (Set Entity)
40entities = Set.fromList . MaxPQueue.keys <$> get