diff options
Diffstat (limited to 'events/src/Main.hs')
-rw-r--r-- | events/src/Main.hs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/events/src/Main.hs b/events/src/Main.hs index 0454f22..a4ffa5a 100644 --- a/events/src/Main.hs +++ b/events/src/Main.hs | |||
@@ -11,18 +11,23 @@ import Control.Lens | |||
11 | import Control.Monad | 11 | import Control.Monad |
12 | import Control.Monad.Trans | 12 | import Control.Monad.Trans |
13 | import Data.Aeson.Lens | 13 | import Data.Aeson.Lens |
14 | import Data.Aeson | ||
15 | 14 | ||
16 | import Debug.Trace | 15 | import Debug.Trace |
17 | 16 | ||
17 | import Data.Maybe (isJust) | ||
18 | |||
18 | import qualified ListT | 19 | import qualified ListT |
20 | import qualified Events.Types.NDT as NDT | ||
19 | 21 | ||
20 | main :: IO () | 22 | main :: IO () |
21 | -- main = test $ [ Nop | 23 | main = test $ do |
22 | -- , Override [("blub", String "Haha!")] | 24 | n <- lift $ NDT.fromFoldable ([1..] :: [Integer]) |
23 | -- , Occurs True | 25 | -- objOccurs .= (n <= 5) |
24 | -- , Occurs False | 26 | objOccurs .= (n >= 2) |
25 | -- ] | 27 | objPayload ?= [ ("num", Yaml.Number $ fromIntegral n) |
26 | -- where | 28 | ] |
27 | -- test = CBS.putStr . Yaml.encode <=< evaluate . interpret | 29 | where |
28 | main = undefined | 30 | test = CBS.putStr . Yaml.encode <=< evaluate predicate |
31 | predicate :: Monad m => Maybe Yaml.Object -> m Bool | ||
32 | predicate Nothing = return True | ||
33 | predicate (Just obj) = return . maybe False (<= 5) . traceShowId $ obj ^. at "num" . asDouble | ||