Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- unaryFunc :: forall m h p. Monad m => (GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h)
- binaryFunc :: forall m h p. Monad m => (GVal (Run p m h) -> GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h)
- ignoreArgNames :: ([a] -> b) -> [(c, a)] -> b
- variadicNumericFunc :: Monad m => Scientific -> ([Scientific] -> Scientific) -> [(Maybe Text, GVal (Run p m h))] -> Run p m h (GVal (Run p m h))
- unaryNumericFunc :: Monad m => Scientific -> (Scientific -> Scientific) -> [(Maybe Text, GVal (Run p m h))] -> Run p m h (GVal (Run p m h))
- variadicStringFunc :: Monad m => ([Text] -> Text) -> [(Maybe Text, GVal (Run p m h))] -> Run p m h (GVal (Run p m h))
- extractArgs :: [Text] -> [(Maybe Text, a)] -> (HashMap Text a, [a], HashMap Text a, [Text])
- extractArgsT :: ([Maybe a] -> b) -> [Text] -> [(Maybe Text, a)] -> Either ([a], HashMap Text a, [Text]) b
- extractArgsL :: [Text] -> [(Maybe Text, a)] -> Either ([a], HashMap Text a, [Text]) [Maybe a]
- extractArgsDefL :: [(Text, a)] -> [(Maybe Text, a)] -> Either ([a], HashMap Text a, [Text]) [a]
- injectDefaults :: [a] -> [Maybe a] -> [a]
Documentation
unaryFunc :: forall m h p. Monad m => (GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h) Source #
binaryFunc :: forall m h p. Monad m => (GVal (Run p m h) -> GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h) Source #
ignoreArgNames :: ([a] -> b) -> [(c, a)] -> b Source #
variadicNumericFunc :: Monad m => Scientific -> ([Scientific] -> Scientific) -> [(Maybe Text, GVal (Run p m h))] -> Run p m h (GVal (Run p m h)) Source #
unaryNumericFunc :: Monad m => Scientific -> (Scientific -> Scientific) -> [(Maybe Text, GVal (Run p m h))] -> Run p m h (GVal (Run p m h)) Source #
variadicStringFunc :: Monad m => ([Text] -> Text) -> [(Maybe Text, GVal (Run p m h))] -> Run p m h (GVal (Run p m h)) Source #
extractArgs :: [Text] -> [(Maybe Text, a)] -> (HashMap Text a, [a], HashMap Text a, [Text]) Source #
Match args according to a given arg spec, Python style.
The return value is a triple of (matched, args, kwargs, unmatchedNames)
,
where matches
is a hash map of named captured arguments, args is a list of
remaining unmatched positional arguments, kwargs is a list of remaining
unmatched named arguments, and unmatchedNames
contains the argument names
that haven't been matched.
extractArgsT :: ([Maybe a] -> b) -> [Text] -> [(Maybe Text, a)] -> Either ([a], HashMap Text a, [Text]) b Source #
Parse argument list into type-safe argument structure.
extractArgsL :: [Text] -> [(Maybe Text, a)] -> Either ([a], HashMap Text a, [Text]) [Maybe a] Source #
Parse argument list into flat list of matched arguments.
extractArgsDefL :: [(Text, a)] -> [(Maybe Text, a)] -> Either ([a], HashMap Text a, [Text]) [a] Source #
injectDefaults :: [a] -> [Maybe a] -> [a] Source #