1
0
forked from GitHub/gf-core

added commands create cat & drop cat

This commit is contained in:
krangelov
2021-12-23 19:21:55 +01:00
parent f03779dfed
commit b000b80159
9 changed files with 155 additions and 10 deletions

View File

@@ -236,9 +236,18 @@ transactionCommand (CreateFun opts f ty) pgf = do
Left msg -> putStrLnE msg
Right ty -> do lift $ modifyPGF pgf (createFunction f ty 0 [] prob)
return ()
transactionCommand (CreateCat opts c ctxt) pgf = do
let prob = realToFrac (valFltOpts "prob" (1/0) opts)
case checkContext pgf ctxt of
Left msg -> putStrLnE msg
Right ty -> do lift $ modifyPGF pgf (createCategory c ctxt prob)
return ()
transactionCommand (DropFun opts f) pgf = do
lift $ modifyPGF pgf (dropFunction f)
return ()
transactionCommand (DropCat opts c) pgf = do
lift $ modifyPGF pgf (dropCategory c)
return ()
-- | Commands that work on 'GFEnv'
moreCommands = [