{-# LANGUAGE OverloadedStrings #-}
module Funcons.Core.Values.Composite.Graphs.Graphs where
import Funcons.EDSL
import Funcons.Operations hiding (Values,libFromList)
entities :: [a]
entities = []
types :: TypeRelation
types = [(Name, DataTypeMembers)] -> TypeRelation
typeEnvFromList
[]
funcons :: FunconLibrary
funcons = [(Name, EvalFunction)] -> FunconLibrary
libFromList
[(Name
"directed-graphs",NonStrictFuncon -> EvalFunction
NonStrictFuncon NonStrictFuncon
stepDirected_graphs)]
directed_graphs_ :: [Funcons] -> Funcons
directed_graphs_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"directed-graphs" ([Funcons]
fargs)
stepDirected_graphs :: NonStrictFuncon
stepDirected_graphs [Funcons]
fargs =
[Rewrite Rewritten] -> [MSOS StepRes] -> Rewrite Rewritten
evalRules [Rewrite Rewritten
rewrite1] []
where rewrite1 :: Rewrite Rewritten
rewrite1 = do
let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
Env
env <- [Funcons] -> [FPattern] -> Env -> Rewrite Env
fsMatch [Funcons]
fargs [MetaVar -> FPattern
PMetaVar MetaVar
"GT"] Env
forall k a. Map k a
env
FTerm -> Env -> Rewrite Rewritten
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"maps" [MetaVar -> FTerm
TVar MetaVar
"GT",Name -> [FTerm] -> FTerm
TApp Name
"sets" [MetaVar -> FTerm
TVar MetaVar
"GT"]]) Env
env