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

Copyright (c) Colin Woodbury 2012 - 2020 GPL3 Colin Woodbury None Haskell2010

Aura.Utils

Description

Utility functions specific to Aura.

Synopsis

# Strings

data Pattern Source #

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

Constructors

 Pattern Fields_pattern :: !Text _target :: !Text

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

Find lines which contain some given Text.

# Network

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
 Source # Instance detailsDefined in Aura.Utils Methodsbimap :: (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 detailsDefined 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.