{-# LANGUAGE UnicodeSyntax #-}
module GraphRewriting.Pattern.Internal where
import GraphRewriting.Graph.Types
import Control.Monad.Reader
import Control.Monad.List
newtype PatternT n m a = PatternT {forall n (m :: * -> *) a.
PatternT n m a -> Match -> ReaderT (Graph n) (ListT m) (Match, a)
patternT ∷ Match → ReaderT (Graph n) (ListT m) (Match, a)}
runPatternT' ∷ Match → PatternT n m a → Graph n → m [(Match,a)]
runPatternT' :: forall n (m :: * -> *) a.
Match -> PatternT n m a -> Graph n -> m [(Match, a)]
runPatternT' Match
h PatternT n m a
p = forall (m :: * -> *) a. ListT m a -> m [a]
runListT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
runReaderT (forall n (m :: * -> *) a.
PatternT n m a -> Match -> ReaderT (Graph n) (ListT m) (Match, a)
patternT PatternT n m a
p Match
h)
type Match = [Node]