diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-08 00:00:20 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-08 00:00:20 +0200 |
| commit | 99b12580b0ef0592dbfb5da04070114314e9b7f8 (patch) | |
| tree | 59b2f7132aa969db1912480a78940046cdf77aa1 /src/Utils.hs | |
| parent | 6ceaff1e8e111d6b025bd725ee93edb354c535f6 (diff) | |
| download | 2017-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.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 | ||
