1--compiling the script requires the IO monad because it must load modules from the filesystem, so we create the function and generate the requisite DatabaseExpr here.
2module TutorialD.Interpreter.DatabaseContextIOOperator where
5import TutorialD.Interpreter.Base
6import TutorialD.Interpreter.Types
8import Text.Megaparsec.Text
11addAtomFunctionExprP :: Parser DatabaseContextIOExpr
12addAtomFunctionExprP = dbioexprP "addatomfunction" AddAtomFunction
14addDatabaseContextFunctionExprP :: Parser DatabaseContextIOExpr
15addDatabaseContextFunctionExprP = dbioexprP "adddatabasecontextfunction" AddDatabaseContextFunction
17dbioexprP :: String -> (Text -> [TypeConstructor] -> Text -> DatabaseContextIOExpr) -> Parser DatabaseContextIOExpr
20 funcName <- quotedString
21 funcType <- atomTypeSignatureP
22 funcScript <- quotedString
23 pure $ adt funcName funcType funcScript
25atomTypeSignatureP :: Parser [TypeConstructor]
26atomTypeSignatureP = sepBy typeConstructorP arrow
28dbContextIOExprP :: Parser DatabaseContextIOExpr
29dbContextIOExprP = addAtomFunctionExprP <|> addDatabaseContextFunctionExprP
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list