{-# LANGUAGE DataKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} module Machine where -- import Data.Char (Char) import Data.Text (Text) import Data.Functor ((<$>)) import System.IO (IO) import qualified Symantic.Parser as P import Grammar -- | Existential type to gather machines -- returning different values in the same @('machines')@ list. data M = forall a. M ( forall repr inp. inp ~ Text => P.Machine (P.InputToken inp) repr => IO (repr inp '[] a) ) machines :: [M] machines = (\(G g) -> M (P.optimizeMachine g)) <$> grammars {- e1 = P.fixByName (P.analysisByLet (P.machine @[Char] g1)) h1 = P.runAnalysis (P.machine @[Char] g1) e13 = P.fixByName (P.analysisByLet (P.machine @[Char] g13)) h2 = P.runAnalysis (P.machine @[Char] g2) h3 = P.runAnalysis (P.machine @[Char] g3) h4 = P.runAnalysis (P.machine @[Char] g4) h13 = P.runAnalysis (P.machine @[Char] g13) h14 = P.runGenAnalysis (P.genAnalysisByLet (P.machine @[Char] g14)) -}