aura-3.1.5: A secure package manager for Arch Linux and the AUR.

Copyright(c) Colin Woodbury 2012 - 2020
LicenseGPL3
MaintainerColin Woodbury <colin@fosskers.ca>
Safe HaskellNone
LanguageHaskell2010

Aura.Utils

Contents

Description

Utility functions specific to Aura.

Synopsis

Strings

data Pattern Source #

For regex-like find-and-replace in some Text.

Constructors

Pattern 

Fields

searchLines :: Text -> [Text] -> [Text] Source #

Find lines which contain some given Text.

Network

urlContents :: Manager -> String -> IO (Maybe ByteString) Source #

Assumes the given URL is correctly formatted.

Semigroupoids

foldMap1 :: Semigroup m => (a -> m) -> NonEmpty a -> m Source #

Borrowed from semigroupoids.

fold1 :: Semigroup m => NonEmpty m -> m Source #

Borrowed from semigroupoids.

Errors

hush :: Either a b -> Maybe b Source #

note :: a -> Maybe b -> Either a b Source #

Compactable

fmapEither :: (a -> Either b c) -> [a] -> ([b], [c]) Source #

Borrowed from Compactable.

traverseEither :: Applicative f => (a -> f (Either b c)) -> [a] -> f ([b], [c]) Source #

Borrowed from Compactable.

These

data These a b Source #

Constructors

This a 
That b 
These a b 
Instances
Bifunctor These Source # 
Instance details

Defined in Aura.Utils

Methods

bimap :: (a -> b) -> (c -> d) -> These a c -> These b d #

first :: (a -> b) -> These a c -> These b c #

second :: (b -> c) -> These a b -> These a c #

(Semigroup a, Semigroup b) => Semigroup (These a b) Source # 
Instance details

Defined in Aura.Utils

Methods

(<>) :: These a b -> These a b -> These a b #

sconcat :: NonEmpty (These a b) -> These a b #

stimes :: Integral b0 => b0 -> These a b -> These a b #

these :: (a -> t) -> (b -> t) -> (a -> b -> t) -> These a b -> t Source #

Directory

edit :: FilePath -> FilePath -> IO () Source #

Edit some file in-place with the user's specified editor.

Lens

type Traversal' s a = forall f. Applicative f => (a -> f a) -> s -> f s Source #

Simple Traversals compatible with both lens and microlens.

Misc.

maybe' :: b -> Maybe a -> (a -> b) -> b Source #

maybe with the function at the end.

groupsOf :: Int -> [a] -> [[a]] Source #

Break a list into groups of n elements. The last item in the result is not guaranteed to have the same length as the others.

partNonEmpty :: (a -> These b c) -> NonEmpty a -> These (NonEmpty b) (NonEmpty c) Source #

Partition a NonEmpty based on some function.