Safe Haskell | None |
---|---|
Language | Haskell2010 |
Command utilities
Documentation
type TypedCommandC ps a r = (ApplyTupRes a (CommandSemType r) ~ CommandForParsers ps r, a ~ ParamsFromParsers ps, BuildTypedCommandParser ps r, ApplyTup a (CommandSemType r)) Source #
type family CommandForParsers (ps :: [Type]) r where ... Source #
CommandForParsers '[] r = Sem (Fail ': r) () | |
CommandForParsers (x ': xs) r = ParserResult x -> CommandForParsers xs r |
buildCommand :: forall ps a r. (Member (Final IO) r, TypedCommandC ps a r) => Text -> Maybe Group -> [Check] -> (Context -> Text) -> (Context -> CommandForParsers ps r) -> Sem r Command Source #
buildCommand' :: Member (Final IO) r => Text -> Maybe Group -> [Check] -> (Context -> Text) -> (Context -> Sem r (Either CommandError a)) -> ((Context, a) -> Sem (Fail ': r) ()) -> Sem r Command Source #
buildParser :: Member (Final IO) r => Text -> (Context -> Sem r (Either CommandError a)) -> Sem r (Context -> IO (Either CommandError a)) Source #
buildCallback :: Member (Final IO) r => ((Context, a) -> Sem (Fail ': r) ()) -> Sem r ((Context, a) -> IO (Maybe Text)) Source #
runCommand :: Member (Embed IO) r => Context -> Command -> Sem r (Either CommandError ()) Source #
invokeCommand :: Member (Embed IO) r => Context -> Command -> Sem r (Either CommandError ()) Source #