Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data IdrisCommand
- supportedCommands :: HashMap ByteString IdrisCommand
- matchSupported :: ByteString -> Maybe IdrisCommand
- chooseCommand :: ExternalInterpreterSettings -> InterpreterRequest -> Either () IdrisCommand -> ByteString -> IO (IO (ExitCode, String, String))
- textResponse :: String -> IO (ExitCode, String, String)
- withResource :: ExternalInterpreterSettings -> InterpreterRequest -> (FilePath -> IO (ExitCode, String, String)) -> IO (IO (ExitCode, String, String))
- runProcess :: ExternalInterpreterSettings -> String -> FilePath -> IO (ExitCode, String, String)
- validateCmd :: ByteString -> ByteString
Documentation
data IdrisCommand Source #
Supported sub-commands for Idris 2.
Instances
Eq IdrisCommand Source # | |
Defined in Idris.Interaction.Command (==) :: IdrisCommand -> IdrisCommand -> Bool # (/=) :: IdrisCommand -> IdrisCommand -> Bool # | |
Show IdrisCommand Source # | |
Defined in Idris.Interaction.Command showsPrec :: Int -> IdrisCommand -> ShowS # show :: IdrisCommand -> String # showList :: [IdrisCommand] -> ShowS # | |
Generic IdrisCommand Source # | |
Defined in Idris.Interaction.Command type Rep IdrisCommand :: Type -> Type # from :: IdrisCommand -> Rep IdrisCommand x # to :: Rep IdrisCommand x -> IdrisCommand # | |
type Rep IdrisCommand Source # | |
Defined in Idris.Interaction.Command type Rep IdrisCommand = D1 ('MetaData "IdrisCommand" "Idris.Interaction.Command" "proof-assistant-bot-0.2.0-inplace" 'False) (C1 ('MetaCons "Load" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "TypeOf" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Help" 'PrefixI 'False) (U1 :: Type -> Type))) |
supportedCommands :: HashMap ByteString IdrisCommand Source #
Map of supported Idris 2 sub-commands. We use it instead of parser.
matchSupported :: ByteString -> Maybe IdrisCommand Source #
Check user input to identify IdrisCommand
.
chooseCommand :: ExternalInterpreterSettings -> InterpreterRequest -> Either () IdrisCommand -> ByteString -> IO (IO (ExitCode, String, String)) Source #
Choose an action based on either IdrisCommand
or raw input.
textResponse :: String -> IO (ExitCode, String, String) Source #
Helper to wrap given text as stdout.
withResource :: ExternalInterpreterSettings -> InterpreterRequest -> (FilePath -> IO (ExitCode, String, String)) -> IO (IO (ExitCode, String, String)) Source #
Wrapper around temp directory that will try to identify whether associated file exists. And if file exists given action will be performed.
runProcess :: ExternalInterpreterSettings -> String -> FilePath -> IO (ExitCode, String, String) Source #
Wrapper around CLI execution.
validateCmd :: ByteString -> ByteString Source #
We are trying to filter out some potentially dangerous operations such as :x
.