Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data RepoLocation
- ourParseNixFile :: FilePath -> IO (Either Warning NExprLoc)
- extractUrlString :: RepoLocation -> Text
- quoteString :: Text -> Text
- extractFuncName :: NExprLoc -> Maybe Text
- extractAttr :: Text -> [Binding a] -> Either Warning a
- findAttr :: Text -> [Binding a] -> Either Warning (Maybe a)
- exprText :: NExprLoc -> Either Warning Text
- exprSpan :: NExprLoc -> SourceSpan
- parseISO8601DateToDay :: Text -> Either Warning Day
- formatWarning :: Warning -> String
Documentation
data RepoLocation Source #
A repo is either specified by URL or by Github owner/repo.
extractUrlString :: RepoLocation -> Text Source #
Get the url from either a nix expression for the url or a repo and owner expression.
quoteString :: Text -> Text Source #
extractFuncName :: NExprLoc -> Maybe Text Source #
Given an expression that is supposed to represent a function, extracts the name of the function. If we cannot figure out the function name, returns Nothing.
extractAttr :: Text -> [Binding a] -> Either Warning a Source #
Extract a named attribute from an attrset.
findAttr :: Text -> [Binding a] -> Either Warning (Maybe a) Source #
Find a named attribute in an attrset. This is appropriate for the case when a missing attribute is not an error.
exprText :: NExprLoc -> Either Warning Text Source #
Get the string value of a particular expression, returns a Warning
if
the expression is not a string value.
TODO: Use evalExpr
here
exprSpan :: NExprLoc -> SourceSpan Source #
Get the SourceSpan
covering a particular expression.
formatWarning :: Warning -> String Source #