Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- 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)
- matchAttr :: Text -> Binding a -> Maybe a
- exprText :: NExprLoc -> Either Warning Text
- exprSpan :: NExprLoc -> SrcSpan
- parseISO8601DateToDay :: Text -> Either Warning Day
- formatWarning :: Warning -> String
Documentation
data RepoLocation Source #
A repo is either specified by URL or by Github owner/repo.
Instances
Data RepoLocation Source # | |
Defined in Update.Nix.FetchGit.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RepoLocation -> c RepoLocation # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RepoLocation # toConstr :: RepoLocation -> Constr # dataTypeOf :: RepoLocation -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RepoLocation) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RepoLocation) # gmapT :: (forall b. Data b => b -> b) -> RepoLocation -> RepoLocation # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RepoLocation -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RepoLocation -> r # gmapQ :: (forall d. Data d => d -> u) -> RepoLocation -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RepoLocation -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RepoLocation -> m RepoLocation # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RepoLocation -> m RepoLocation # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RepoLocation -> m RepoLocation # | |
Show RepoLocation Source # | |
Defined in Update.Nix.FetchGit.Types showsPrec :: Int -> RepoLocation -> ShowS # show :: RepoLocation -> String # showList :: [RepoLocation] -> ShowS # |
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.
matchAttr :: Text -> Binding a -> Maybe a Source #
Returns 'Just value' if this attribute's key matches the text, otherwise Nothing.
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
formatWarning :: Warning -> String Source #