import qualified Data.Functor as Functor
import qualified Language.Haskell.TH as TH
-import Symantic.Derive
+import Symantic.Syntaxes.Derive
import Symantic.Parser.Grammar
import Symantic.Parser.Machine.Input
import Symantic.Parser.Machine.Instructions
type instance Derived (Instr instr repr inp vs) = repr inp vs
-- | Convenient utility to pattern-match a 'SomeInstr'.
-pattern Instr :: Typeable comb =>
- Instr comb repr inp vs a ->
+pattern Instr :: Typeable instr =>
+ Instr instr repr inp vs a ->
SomeInstr repr inp vs a
pattern Instr x <- (unSomeInstr -> Just x)
-- As in 'SomeComb', a first pass of optimizations
-- is directly applied in it
-- to avoid introducing an extra newtype,
--- this also gives a more undestandable code.
+-- this also gives a more understandable code.
data SomeInstr repr inp vs a =
forall instr.
( Derivable (Instr instr repr inp vs)
instance Derivable (SomeInstr repr inp vs) where
derive (SomeInstr x) = derive x
--- | @(unSomeInstr i :: 'Maybe' ('Instr' comb repr inp vs a))@
+-- | @(unSomeInstr i :: 'Maybe' ('Instr' instr repr inp vs a))@
-- extract the data-constructor from the given 'SomeInstr'
--- iif. it belongs to the @('Instr' comb repr a)@ data-instance.
+-- iif. it belongs to the @('Instr' instr repr a)@ data-instance.
unSomeInstr ::
forall instr repr inp vs a.
Typeable instr =>