summaryrefslogtreecommitdiff
path: root/events/src/Events/Spec.hs
blob: f0b1456015a40087eb8100bd36cab8bd1ec8b0ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# LANGUAGE RankNTypes #-}

module Events.Spec
       ( interpret
       , Spec, Expr(..), Elem(..)
       , module Events.Spec.Parse
       , module Events.Spec.Eval
       ) where

import Events.Spec.Types
import Events.Spec.Eval

import Events.Spec.Parse


import Data.Conduit

import Data.Text (Text)
import qualified Data.Text as T

import Control.Monad.Catch (MonadThrow)


interpret :: MonadThrow m => Producer m Text -> Eval m ()
interpret source = evalExpr =<< lift (connect source parse)