1 {-# LANGUAGE DataKinds #-}
2 {-# LANGUAGE ExistentialQuantification #-}
3 {-# LANGUAGE FlexibleContexts #-}
4 {-# LANGUAGE RankNTypes #-}
5 {-# LANGUAGE TypeFamilies #-}
8 import Data.Text (Text)
9 import Data.Functor ((<$>))
11 import qualified Symantic.Parser as P
14 -- | Existential type to gather machines
15 -- returning different values in the same @('machines')@ list.
16 data M = forall a. M (
17 forall repr inp. inp ~ Text =>
18 P.Machine (P.InputToken inp) repr =>
23 machines = (\(G g) -> M (P.machine g)) <$> grammars