{-# LANGUAGE CPP #-}
module CabalFmt.Prelude (
(&&&),
when, unless, void,
bimap,
toLower,
partitionEithers,
toList, traverse_, asum, for_,
on, (&),
intercalate, sortOn, sortBy, nub,
catMaybes,
fromMaybe,
isJust,
isNothing,
ByteString,
C.fromUTF8BS, C.toUTF8BS,
pack', unpack',
Set,
dropExtension, splitDirectories,
catchError, throwError,
traverseOf,
over, view,
_1,
fstOf3,
sndOf3,
trdOf3,
) where
import Control.Arrow ((&&&))
import Control.Monad (unless, void, when)
import Control.Monad.Except (catchError, throwError)
import Data.Bifunctor (bimap)
import Data.ByteString (ByteString)
import Data.Char (toLower)
import Data.Either (partitionEithers)
import Data.Foldable (asum, for_, toList, traverse_)
import Data.Function (on, (&))
import Data.List (intercalate, nub, sortBy, sortOn)
import Data.Maybe (catMaybes, fromMaybe, isJust, isNothing)
import Data.Set (Set)
import Distribution.Compat.Lens (over, view)
import Distribution.Compat.Newtype (pack', unpack')
import System.FilePath (dropExtension, splitDirectories)
import qualified Distribution.Utils.Generic as C
#ifdef MIN_VERSION_base_orphans
import Data.Orphans ()
#endif
traverseOf
:: Applicative f
=> ((a -> f b) -> s -> f t)
-> (a -> f b) -> s -> f t
traverseOf :: forall (f :: * -> *) a b s t.
Applicative f =>
((a -> f b) -> s -> f t) -> (a -> f b) -> s -> f t
traverseOf = ((a -> f b) -> s -> f t) -> (a -> f b) -> s -> f t
forall a. a -> a
id
_1 :: Functor f => (a -> f b) -> (a, c) -> f (b, c)
_1 :: forall (f :: * -> *) a b c.
Functor f =>
(a -> f b) -> (a, c) -> f (b, c)
_1 a -> f b
f (a
a, c
c) = (\b
b -> (b
b, c
c)) (b -> (b, c)) -> f b -> f (b, c)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f b
f a
a
fstOf3 :: (a,b,c) -> a
fstOf3 :: forall a b c. (a, b, c) -> a
fstOf3 (a
a,b
_,c
_) = a
a
sndOf3 :: (a,b,c) -> b
sndOf3 :: forall a b c. (a, b, c) -> b
sndOf3 (a
_,b
b,c
_) = b
b
trdOf3 :: (a,b,c) -> c
trdOf3 :: forall a b c. (a, b, c) -> c
trdOf3 (a
_,b
_,c
c) = c
c