packages feed

imm 1.4.0.0 → 1.5.0.0

raw patch · 25 files changed

+187/−287 lines, 25 filesdep +base-nopreludedep +refineddep +reludedep −lifted-basedep −monad-controldep −mono-traversabledep ~atom-conduitdep ~opml-conduitPVP ok

version bump matches the API change (PVP)

Dependencies added: base-noprelude, refined, relude

Dependencies removed: lifted-base, monad-control, mono-traversable

Dependency ranges changed: atom-conduit, opml-conduit

API changes (from Hackage documentation)

- Imm.Prelude: (!!) :: () => [a] -> Int -> a
- Imm.Prelude: ($!) :: () => (a -> b) -> a -> b
- Imm.Prelude: ($) :: () => (a -> b) -> a -> b
- Imm.Prelude: (&&) :: Bool -> Bool -> Bool
- Imm.Prelude: (*) :: Num a => a -> a -> a
- Imm.Prelude: (**) :: Floating a => a -> a -> a
- Imm.Prelude: (*>) :: Applicative f => f a -> f b -> f b
- Imm.Prelude: (+) :: Num a => a -> a -> a
- Imm.Prelude: (++) :: () => [a] -> [a] -> [a]
- Imm.Prelude: (-) :: Num a => a -> a -> a
- Imm.Prelude: (.) :: () => (b -> c) -> (a -> b) -> a -> c
- Imm.Prelude: (/) :: Fractional a => a -> a -> a
- Imm.Prelude: (/=) :: Eq a => a -> a -> Bool
- Imm.Prelude: (<$) :: Functor f => a -> f b -> f a
- Imm.Prelude: (<$>) :: Functor f => (a -> b) -> f a -> f b
- Imm.Prelude: (<) :: Ord a => a -> a -> Bool
- Imm.Prelude: (<*) :: Applicative f => f a -> f b -> f a
- Imm.Prelude: (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- Imm.Prelude: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
- Imm.Prelude: (<=) :: Ord a => a -> a -> Bool
- Imm.Prelude: (<>) :: Semigroup a => a -> a -> a
- Imm.Prelude: (<|>) :: Alternative f => f a -> f a -> f a
- Imm.Prelude: (=<<) :: Monad m => (a -> m b) -> m a -> m b
- Imm.Prelude: (==) :: Eq a => a -> a -> Bool
- Imm.Prelude: (>) :: Ord a => a -> a -> Bool
- Imm.Prelude: (>=) :: Ord a => a -> a -> Bool
- Imm.Prelude: (>>) :: Monad m => m a -> m b -> m b
- Imm.Prelude: (>>=) :: Monad m => m a -> (a -> m b) -> m b
- Imm.Prelude: (^) :: (Num a, Integral b) => a -> b -> a
- Imm.Prelude: (^^) :: (Fractional a, Integral b) => a -> b -> a
- Imm.Prelude: (||) :: Bool -> Bool -> Bool
- Imm.Prelude: -- e.g., the <a>IsMap</a> instance of associated lists.
- Imm.Prelude: -- | Type of the key set.
- Imm.Prelude: AppendMode :: IOMode
- Imm.Prelude: Const :: a -> Const a
- Imm.Prelude: Down :: a -> Down a
- Imm.Prelude: EQ :: Ordering
- Imm.Prelude: False :: Bool
- Imm.Prelude: GT :: Ordering
- Imm.Prelude: Just :: a -> Maybe a
- Imm.Prelude: LT :: Ordering
- Imm.Prelude: Left :: a -> Either a b
- Imm.Prelude: Nothing :: Maybe a
- Imm.Prelude: ReadMode :: IOMode
- Imm.Prelude: ReadWriteMode :: IOMode
- Imm.Prelude: Right :: b -> Either a b
- Imm.Prelude: StringException :: String -> CallStack -> StringException
- Imm.Prelude: True :: Bool
- Imm.Prelude: WrapArrow :: a b c -> WrappedArrow b c
- Imm.Prelude: WrapMonad :: m a -> WrappedMonad a
- Imm.Prelude: WriteMode :: IOMode
- Imm.Prelude: ZipList :: [a] -> ZipList a
- Imm.Prelude: [AsyncExceptionWrapper] :: forall e. Exception e => e -> AsyncExceptionWrapper
- Imm.Prelude: [Handler] :: forall (m :: Type -> Type) a e. Exception e => (e -> m a) -> Handler m a
- Imm.Prelude: [SomeAsyncException] :: forall e. Exception e => e -> SomeAsyncException
- Imm.Prelude: [SomeException] :: forall e. Exception e => e -> SomeException
- Imm.Prelude: [SyncExceptionWrapper] :: forall e. Exception e => e -> SyncExceptionWrapper
- Imm.Prelude: [getConst] :: Const a -> a
- Imm.Prelude: [getZipList] :: ZipList a -> [a]
- Imm.Prelude: [unwrapArrow] :: WrappedArrow b c -> a b c
- Imm.Prelude: [unwrapMonad] :: WrappedMonad a -> m a
- Imm.Prelude: abs :: Num a => a -> a
- Imm.Prelude: acos :: Floating a => a -> a
- Imm.Prelude: acosh :: Floating a => a -> a
- Imm.Prelude: adjustMap :: IsMap map => (MapValue map -> MapValue map) -> ContainerKey map -> map -> map
- Imm.Prelude: adjustWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map) -> ContainerKey map -> map -> map
- Imm.Prelude: all :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool
- Imm.Prelude: alterMap :: IsMap map => (Maybe (MapValue map) -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- Imm.Prelude: and :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
- Imm.Prelude: any :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool
- Imm.Prelude: appendFile :: FilePath -> String -> IO ()
- Imm.Prelude: asTypeOf :: () => a -> a -> a
- Imm.Prelude: asin :: Floating a => a -> a
- Imm.Prelude: asinh :: Floating a => a -> a
- Imm.Prelude: assert :: () => Bool -> a -> a
- Imm.Prelude: atan :: Floating a => a -> a
- Imm.Prelude: atan2 :: RealFloat a => a -> a -> a
- Imm.Prelude: atanh :: Floating a => a -> a
- Imm.Prelude: bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
- Imm.Prelude: bracket :: MonadMask m => m a -> (a -> m b) -> (a -> m c) -> m c
- Imm.Prelude: bracketOnError :: MonadMask m => m a -> (a -> m b) -> (a -> m c) -> m c
- Imm.Prelude: bracketOnError_ :: MonadMask m => m a -> m b -> m c -> m c
- Imm.Prelude: bracketWithError :: MonadMask m => m a -> (Maybe SomeException -> a -> m b) -> (a -> m c) -> m c
- Imm.Prelude: bracket_ :: MonadMask m => m a -> m b -> m c -> m c
- Imm.Prelude: break :: IsSequence seq => (Element seq -> Bool) -> seq -> (seq, seq)
- Imm.Prelude: breakLine :: Textual t => t -> (t, t)
- Imm.Prelude: breakWord :: Textual t => t -> (t, t)
- Imm.Prelude: catMaybes :: (IsSequence (f (Maybe t)), Functor f, Element (f (Maybe t)) ~ Maybe t) => f (Maybe t) -> f t
- Imm.Prelude: catch :: (MonadCatch m, Exception e) => m a -> (e -> m a) -> m a
- Imm.Prelude: catchAny :: MonadCatch m => m a -> (SomeException -> m a) -> m a
- Imm.Prelude: catchAnyDeep :: (MonadCatch m, MonadIO m, NFData a) => m a -> (SomeException -> m a) -> m a
- Imm.Prelude: catchAsync :: (MonadCatch m, Exception e) => m a -> (e -> m a) -> m a
- Imm.Prelude: catchDeep :: (MonadCatch m, MonadIO m, Exception e, NFData a) => m a -> (e -> m a) -> m a
- Imm.Prelude: catchIO :: MonadCatch m => m a -> (IOException -> m a) -> m a
- Imm.Prelude: catchIOError :: MonadCatch m => m a -> (IOError -> m a) -> m a
- Imm.Prelude: catchJust :: (MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a
- Imm.Prelude: catches :: (MonadCatch m, MonadThrow m) => m a -> [Handler m a] -> m a
- Imm.Prelude: catchesAsync :: (MonadCatch m, MonadThrow m) => m a -> [Handler m a] -> m a
- Imm.Prelude: catchesDeep :: (MonadCatch m, MonadThrow m, MonadIO m, NFData a) => m a -> [Handler m a] -> m a
- Imm.Prelude: ceiling :: (RealFrac a, Integral b) => a -> b
- Imm.Prelude: class Applicative f => Alternative (f :: Type -> Type)
- Imm.Prelude: class Functor f => Applicative (f :: Type -> Type)
- Imm.Prelude: class BiPolyMap (map :: Type -> Type -> Type) where {
- Imm.Prelude: class Bifunctor (p :: Type -> Type -> Type)
- Imm.Prelude: class Bounded a
- Imm.Prelude: class Enum a
- Imm.Prelude: class Eq a
- Imm.Prelude: class (Typeable e, Show e) => Exception e
- Imm.Prelude: class Fractional a => Floating a
- Imm.Prelude: class Foldable (t :: Type -> Type)
- Imm.Prelude: class Num a => Fractional a
- Imm.Prelude: class Functor (f :: Type -> Type)
- Imm.Prelude: class SetContainer set => HasKeysSet set where {
- Imm.Prelude: class (Real a, Enum a) => Integral a
- Imm.Prelude: class (MonoTraversable map, SetContainer map) => IsMap map where {
- Imm.Prelude: class (Monoid seq, MonoTraversable seq, SemiSequence seq, MonoPointed seq) => IsSequence seq
- Imm.Prelude: class (SetContainer set, Element set ~ ContainerKey set) => IsSet set
- Imm.Prelude: class IsString a
- Imm.Prelude: class (IsSequence lazy, IsSequence strict) => LazySequence lazy strict | lazy -> strict, strict -> lazy
- Imm.Prelude: class Applicative m => Monad (m :: Type -> Type)
- Imm.Prelude: class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: Type -> Type) (m :: Type -> Type) | m -> b
- Imm.Prelude: class MonadThrow m => MonadCatch (m :: Type -> Type)
- Imm.Prelude: class Monad m => MonadIO (m :: Type -> Type)
- Imm.Prelude: class MonadCatch m => MonadMask (m :: Type -> Type)
- Imm.Prelude: class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
- Imm.Prelude: class Monad m => MonadThrow (m :: Type -> Type)
- Imm.Prelude: class MonoFunctor mono => MonoZip mono
- Imm.Prelude: class Semigroup a => Monoid a
- Imm.Prelude: class Num a
- Imm.Prelude: class Eq a => Ord a
- Imm.Prelude: class PolyMap (map :: Type -> Type)
- Imm.Prelude: class Read a
- Imm.Prelude: class (Num a, Ord a) => Real a
- Imm.Prelude: class (RealFrac a, Floating a) => RealFloat a
- Imm.Prelude: class (Real a, Fractional a) => RealFrac a
- Imm.Prelude: class (Integral Index seq, GrowingAppend seq) => SemiSequence seq where {
- Imm.Prelude: class Semigroup a
- Imm.Prelude: class (Monoid set, Semigroup set, MonoFoldable set, Eq ContainerKey set, GrowingAppend set) => SetContainer set where {
- Imm.Prelude: class Show a
- Imm.Prelude: class (IsSequence t, IsString t, Element t ~ Char) => Textual t
- Imm.Prelude: class (IsString t, LeftReductiveMonoid t, LeftGCDMonoid t, FactorialMonoid t) => TextualMonoid t
- Imm.Prelude: class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
- Imm.Prelude: class Typeable (a :: k)
- Imm.Prelude: class (Textual textual, IsSequence binary) => Utf8 textual binary | textual -> binary, binary -> textual
- Imm.Prelude: compare :: Ord a => a -> a -> Ordering
- Imm.Prelude: compareLength :: (MonoFoldable mono, Integral i) => mono -> i -> Ordering
- Imm.Prelude: comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- Imm.Prelude: concat :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- Imm.Prelude: concatMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m
- Imm.Prelude: cons :: SemiSequence seq => Element seq -> seq -> seq
- Imm.Prelude: const :: () => a -> b -> a
- Imm.Prelude: cos :: Floating a => a -> a
- Imm.Prelude: cosh :: Floating a => a -> a
- Imm.Prelude: curry :: () => ((a, b) -> c) -> a -> b -> c
- Imm.Prelude: cycle :: () => [a] -> [a]
- Imm.Prelude: data AsyncExceptionWrapper
- Imm.Prelude: data Bool
- Imm.Prelude: data Char
- Imm.Prelude: data Double
- Imm.Prelude: data Either a b
- Imm.Prelude: data Float
- Imm.Prelude: data Handler (m :: Type -> Type) a
- Imm.Prelude: data IO a
- Imm.Prelude: data IOException
- Imm.Prelude: data IOMode
- Imm.Prelude: data Int
- Imm.Prelude: data Integer
- Imm.Prelude: data Maybe a
- Imm.Prelude: data Ordering
- Imm.Prelude: data SomeAsyncException
- Imm.Prelude: data SomeException
- Imm.Prelude: data StringException
- Imm.Prelude: data SyncExceptionWrapper
- Imm.Prelude: data Word
- Imm.Prelude: decodeFloat :: RealFloat a => a -> (Integer, Int)
- Imm.Prelude: decodeUtf8 :: Utf8 textual binary => binary -> textual
- Imm.Prelude: defaultCons :: IsSequence seq => Element seq -> seq -> seq
- Imm.Prelude: defaultFind :: MonoFoldable seq => (Element seq -> Bool) -> seq -> Maybe (Element seq)
- Imm.Prelude: defaultIntersperse :: IsSequence seq => Element seq -> seq -> seq
- Imm.Prelude: defaultReverse :: IsSequence seq => seq -> seq
- Imm.Prelude: defaultSnoc :: IsSequence seq => seq -> Element seq -> seq
- Imm.Prelude: defaultSortBy :: IsSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seq
- Imm.Prelude: defaultSplitWhen :: IsSequence seq => (Element seq -> Bool) -> seq -> [seq]
- Imm.Prelude: delete :: (IsSequence seq, Eq (Element seq)) => Element seq -> seq -> seq
- Imm.Prelude: deleteBy :: (IsSequence seq, Eq (Element seq)) => (Element seq -> Element seq -> Bool) -> Element seq -> seq -> seq
- Imm.Prelude: deleteMap :: IsMap map => ContainerKey map -> map -> map
- Imm.Prelude: deleteSet :: IsSet set => Element set -> set -> set
- Imm.Prelude: difference :: SetContainer set => set -> set -> set
- Imm.Prelude: differenceMap :: PolyMap map => map value1 -> map value2 -> map value1
- Imm.Prelude: displayException :: Exception e => e -> String
- Imm.Prelude: div :: Integral a => a -> a -> a
- Imm.Prelude: divMod :: Integral a => a -> a -> (a, a)
- Imm.Prelude: drop :: IsSequence seq => Index seq -> seq -> seq
- Imm.Prelude: dropEnd :: IsSequence seq => Index seq -> seq -> seq
- Imm.Prelude: dropPrefix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq
- Imm.Prelude: dropSuffix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq
- Imm.Prelude: dropWhile :: IsSequence seq => (Element seq -> Bool) -> seq -> seq
- Imm.Prelude: either :: () => (a -> c) -> (b -> c) -> Either a b -> c
- Imm.Prelude: elem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool
- Imm.Prelude: empty :: Alternative f => f a
- Imm.Prelude: encodeFloat :: RealFloat a => Integer -> Int -> a
- Imm.Prelude: encodeUtf8 :: Utf8 textual binary => textual -> binary
- Imm.Prelude: ensurePrefix :: (Eq (Element seq), IsSequence seq) => seq -> seq -> seq
- Imm.Prelude: ensureSuffix :: (Eq (Element seq), IsSequence seq) => seq -> seq -> seq
- Imm.Prelude: enumFrom :: Enum a => a -> [a]
- Imm.Prelude: enumFromThen :: Enum a => a -> a -> [a]
- Imm.Prelude: enumFromThenTo :: Enum a => a -> a -> a -> [a]
- Imm.Prelude: enumFromTo :: Enum a => a -> a -> [a]
- Imm.Prelude: error :: HasCallStack => [Char] -> a
- Imm.Prelude: errorWithoutStackTrace :: () => [Char] -> a
- Imm.Prelude: even :: Integral a => a -> Bool
- Imm.Prelude: exp :: Floating a => a -> a
- Imm.Prelude: exponent :: RealFloat a => a -> Int
- Imm.Prelude: fail :: Monad m => String -> m a
- Imm.Prelude: filter :: IsSequence seq => (Element seq -> Bool) -> seq -> seq
- Imm.Prelude: filterM :: (IsSequence seq, Monad m) => (Element seq -> m Bool) -> seq -> m seq
- Imm.Prelude: filterMap :: IsMap map => (MapValue map -> Bool) -> map -> map
- Imm.Prelude: finally :: MonadMask m => m a -> m b -> m a
- Imm.Prelude: find :: SemiSequence seq => (Element seq -> Bool) -> seq -> Maybe (Element seq)
- Imm.Prelude: findWithDefault :: IsMap map => MapValue map -> ContainerKey map -> map -> MapValue map
- Imm.Prelude: first :: Bifunctor p => (a -> b) -> p a c -> p b c
- Imm.Prelude: flip :: () => (a -> b -> c) -> b -> a -> c
- Imm.Prelude: floatDigits :: RealFloat a => a -> Int
- Imm.Prelude: floatRadix :: RealFloat a => a -> Integer
- Imm.Prelude: floatRange :: RealFloat a => a -> (Int, Int)
- Imm.Prelude: floor :: (RealFrac a, Integral b) => a -> b
- Imm.Prelude: fmap :: Functor f => (a -> b) -> f a -> f b
- Imm.Prelude: fold :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono
- Imm.Prelude: foldM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a
- Imm.Prelude: foldMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m
- Imm.Prelude: foldMap1Ex :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> mono -> m
- Imm.Prelude: foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Imm.Prelude: foldl' :: MonoFoldable mono => (a -> Element mono -> a) -> a -> mono -> a
- Imm.Prelude: foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
- Imm.Prelude: foldl1Ex' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- Imm.Prelude: foldlM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a
- Imm.Prelude: foldr :: MonoFoldable mono => (Element mono -> b -> b) -> b -> mono -> b
- Imm.Prelude: foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
- Imm.Prelude: foldr1Ex :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono
- Imm.Prelude: for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- Imm.Prelude: forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- Imm.Prelude: forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- Imm.Prelude: for_ :: (MonoFoldable mono, Applicative f) => mono -> (Element mono -> f b) -> f ()
- Imm.Prelude: fromChunks :: LazySequence lazy strict => [strict] -> lazy
- Imm.Prelude: fromEnum :: Enum a => a -> Int
- Imm.Prelude: fromException :: Exception e => SomeException -> Maybe e
- Imm.Prelude: fromInteger :: Num a => Integer -> a
- Imm.Prelude: fromIntegral :: (Integral a, Num b) => a -> b
- Imm.Prelude: fromJust :: () => Maybe a -> a
- Imm.Prelude: fromLeft :: () => a -> Either a b -> a
- Imm.Prelude: fromList :: IsSequence seq => [Element seq] -> seq
- Imm.Prelude: fromMaybe :: () => a -> Maybe a -> a
- Imm.Prelude: fromRational :: Fractional a => Rational -> a
- Imm.Prelude: fromRight :: () => b -> Either a b -> b
- Imm.Prelude: fromStrict :: LazySequence lazy strict => strict -> lazy
- Imm.Prelude: fromString :: IsString a => String -> a
- Imm.Prelude: fromText :: TextualMonoid t => Text -> t
- Imm.Prelude: fst :: () => (a, b) -> a
- Imm.Prelude: gcd :: Integral a => a -> a -> a
- Imm.Prelude: generalBracket :: MonadMask m => m a -> (a -> ExitCase b -> m c) -> (a -> m b) -> m (b, c)
- Imm.Prelude: getChar :: IO Char
- Imm.Prelude: getContents :: IO String
- Imm.Prelude: getLine :: IO Text
- Imm.Prelude: group :: (IsSequence seq, Eq (Element seq)) => seq -> [seq]
- Imm.Prelude: groupAll :: (IsSequence seq, Eq (Element seq)) => seq -> [seq]
- Imm.Prelude: groupAllOn :: (IsSequence seq, Eq b) => (Element seq -> b) -> seq -> [seq]
- Imm.Prelude: groupBy :: IsSequence seq => (Element seq -> Element seq -> Bool) -> seq -> [seq]
- Imm.Prelude: handleAny :: MonadCatch m => (SomeException -> m a) -> m a -> m a
- Imm.Prelude: handleAnyDeep :: (MonadCatch m, MonadIO m, NFData a) => (SomeException -> m a) -> m a -> m a
- Imm.Prelude: handleAsync :: (MonadCatch m, Exception e) => (e -> m a) -> m a -> m a
- Imm.Prelude: handleDeep :: (MonadCatch m, Exception e, MonadIO m, NFData a) => (e -> m a) -> m a -> m a
- Imm.Prelude: handleIO :: MonadCatch m => (IOException -> m a) -> m a -> m a
- Imm.Prelude: handleIOError :: MonadCatch m => (IOError -> m a) -> m a -> m a
- Imm.Prelude: handleJust :: (MonadCatch m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a
- Imm.Prelude: head :: () => [a] -> a
- Imm.Prelude: id :: () => a -> a
- Imm.Prelude: impureThrow :: Exception e => e -> a
- Imm.Prelude: index :: IsSequence seq => seq -> Index seq -> Maybe (Element seq)
- Imm.Prelude: indexEx :: IsSequence seq => seq -> Index seq -> Element seq
- Imm.Prelude: infix 4 <=
- Imm.Prelude: infixl 1 >>
- Imm.Prelude: infixl 3 <|>
- Imm.Prelude: infixl 4 <**>
- Imm.Prelude: infixl 6 -
- Imm.Prelude: infixl 7 *
- Imm.Prelude: infixl 9 !!
- Imm.Prelude: infixr 0 $!
- Imm.Prelude: infixr 1 =<<
- Imm.Prelude: infixr 2 ||
- Imm.Prelude: infixr 3 &&
- Imm.Prelude: infixr 5 ++
- Imm.Prelude: infixr 6 <>
- Imm.Prelude: infixr 8 ^
- Imm.Prelude: infixr 9 .
- Imm.Prelude: init :: () => [a] -> [a]
- Imm.Prelude: initDef :: IsSequence seq => seq -> seq
- Imm.Prelude: initEx :: IsSequence seq => seq -> seq
- Imm.Prelude: initMay :: IsSequence seq => seq -> Maybe seq
- Imm.Prelude: insertLookupWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> (Maybe (MapValue map), map)
- Imm.Prelude: insertMap :: IsMap map => ContainerKey map -> MapValue map -> map -> map
- Imm.Prelude: insertSet :: IsSet set => Element set -> set -> set
- Imm.Prelude: insertWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map
- Imm.Prelude: insertWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map
- Imm.Prelude: interact :: (String -> String) -> IO ()
- Imm.Prelude: intercalate :: (MonoFoldable mono, Monoid (Element mono)) => Element mono -> mono -> Element mono
- Imm.Prelude: intersection :: SetContainer set => set -> set -> set
- Imm.Prelude: intersectionMap :: PolyMap map => map value1 -> map value2 -> map value1
- Imm.Prelude: intersectionWithMap :: PolyMap map => (value1 -> value2 -> value3) -> map value1 -> map value2 -> map value3
- Imm.Prelude: intersperse :: SemiSequence seq => Element seq -> seq -> seq
- Imm.Prelude: io :: MonadIO m => IO a -> m a
- Imm.Prelude: ioError :: () => IOError -> IO a
- Imm.Prelude: isAsyncException :: Exception e => e -> Bool
- Imm.Prelude: isDenormalized :: RealFloat a => a -> Bool
- Imm.Prelude: isIEEE :: RealFloat a => a -> Bool
- Imm.Prelude: isInfinite :: RealFloat a => a -> Bool
- Imm.Prelude: isInfixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool
- Imm.Prelude: isJust :: () => Maybe a -> Bool
- Imm.Prelude: isLeft :: () => Either a b -> Bool
- Imm.Prelude: isNaN :: RealFloat a => a -> Bool
- Imm.Prelude: isNegativeZero :: RealFloat a => a -> Bool
- Imm.Prelude: isNothing :: () => Maybe a -> Bool
- Imm.Prelude: isPrefixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool
- Imm.Prelude: isRight :: () => Either a b -> Bool
- Imm.Prelude: isSuffixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool
- Imm.Prelude: isSyncException :: Exception e => e -> Bool
- Imm.Prelude: iterate :: () => (a -> a) -> a -> [a]
- Imm.Prelude: keys :: SetContainer set => set -> [ContainerKey set]
- Imm.Prelude: keysSet :: HasKeysSet set => set -> KeySet set
- Imm.Prelude: last :: () => [a] -> a
- Imm.Prelude: lcm :: Integral a => a -> a -> a
- Imm.Prelude: lefts :: () => [Either a b] -> [a]
- Imm.Prelude: length :: MonoFoldable mono => mono -> Int
- Imm.Prelude: length64 :: MonoFoldable mono => mono -> Int64
- Imm.Prelude: lengthIndex :: IsSequence seq => seq -> Index seq
- Imm.Prelude: lex :: ReadS String
- Imm.Prelude: lift :: (MonadTrans t, Monad m) => m a -> t m a
- Imm.Prelude: liftA :: Applicative f => (a -> b) -> f a -> f b
- Imm.Prelude: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
- Imm.Prelude: liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- Imm.Prelude: liftBase :: MonadBase b m => b α -> m α
- Imm.Prelude: liftBaseDefault :: (MonadTrans t, MonadBase b m) => b α -> t m α
- Imm.Prelude: liftIO :: MonadIO m => IO a -> m a
- Imm.Prelude: lines :: Textual t => t -> [t]
- Imm.Prelude: listToMaybe :: () => [a] -> Maybe a
- Imm.Prelude: logBase :: Floating a => a -> a -> a
- Imm.Prelude: lookup :: IsMap map => ContainerKey map -> map -> Maybe (MapValue map)
- Imm.Prelude: many :: Alternative f => f a -> f [a]
- Imm.Prelude: map :: () => (a -> b) -> [a] -> [b]
- Imm.Prelude: mapFromList :: IsMap map => [(ContainerKey map, MapValue map)] -> map
- Imm.Prelude: mapKeysWith :: (BiPolyMap map, BPMKeyConstraint map k1, BPMKeyConstraint map k2) => (v -> v -> v) -> (k1 -> k2) -> map k1 v -> map k2 v
- Imm.Prelude: mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- Imm.Prelude: mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- Imm.Prelude: mapMaybe :: () => (a -> Maybe b) -> [a] -> [b]
- Imm.Prelude: mapToList :: IsMap map => map -> [(ContainerKey map, MapValue map)]
- Imm.Prelude: mapWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map) -> map -> map
- Imm.Prelude: mappend :: Monoid a => a -> a -> a
- Imm.Prelude: mask :: MonadMask m => ((forall a. () => m a -> m a) -> m b) -> m b
- Imm.Prelude: mask_ :: MonadMask m => m a -> m a
- Imm.Prelude: max :: Ord a => a -> a -> a
- Imm.Prelude: maxBound :: Bounded a => a
- Imm.Prelude: maximum :: (Foldable t, Ord a) => t a -> a
- Imm.Prelude: maybe :: () => b -> (a -> b) -> Maybe a -> b
- Imm.Prelude: maybeToList :: () => Maybe a -> [a]
- Imm.Prelude: mconcat :: Monoid a => [a] -> a
- Imm.Prelude: member :: SetContainer set => ContainerKey set -> set -> Bool
- Imm.Prelude: mempty :: Monoid a => a
- Imm.Prelude: min :: Ord a => a -> a -> a
- Imm.Prelude: minBound :: Bounded a => a
- Imm.Prelude: minimum :: (Foldable t, Ord a) => t a -> a
- Imm.Prelude: mod :: Integral a => a -> a -> a
- Imm.Prelude: mplus :: MonadPlus m => m a -> m a -> m a
- Imm.Prelude: mzero :: MonadPlus m => m a
- Imm.Prelude: negate :: Num a => a -> a
- Imm.Prelude: newtype Down a
- Imm.Prelude: newtype Const a (b :: k) :: forall k. () => Type -> k -> Type
- Imm.Prelude: newtype WrappedArrow (a :: Type -> Type -> Type) b c
- Imm.Prelude: newtype WrappedMonad (m :: Type -> Type) a
- Imm.Prelude: newtype ZipList a
- Imm.Prelude: not :: Bool -> Bool
- Imm.Prelude: notElem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool
- Imm.Prelude: notMember :: SetContainer set => ContainerKey set -> set -> Bool
- Imm.Prelude: null :: MonoFoldable mono => mono -> Bool
- Imm.Prelude: odd :: Integral a => a -> Bool
- Imm.Prelude: omapKeysWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> (ContainerKey map -> ContainerKey map) -> map -> map
- Imm.Prelude: onException :: MonadMask m => m a -> m b -> m a
- Imm.Prelude: optional :: Alternative f => f a -> f (Maybe a)
- Imm.Prelude: or :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool
- Imm.Prelude: otherwise :: Bool
- Imm.Prelude: ounzip :: MonoZip mono => [(Element mono, Element mono)] -> (mono, mono)
- Imm.Prelude: ozip :: MonoZip mono => mono -> mono -> [(Element mono, Element mono)]
- Imm.Prelude: ozipWith :: MonoZip mono => (Element mono -> Element mono -> Element mono) -> mono -> mono -> mono
- Imm.Prelude: pack :: IsSequence seq => [Element seq] -> seq
- Imm.Prelude: partition :: IsSequence seq => (Element seq -> Bool) -> seq -> (seq, seq)
- Imm.Prelude: partitionEithers :: () => [Either a b] -> ([a], [b])
- Imm.Prelude: permutations :: IsSequence seq => seq -> [seq]
- Imm.Prelude: pi :: Floating a => a
- Imm.Prelude: point :: MonoPointed mono => Element mono -> mono
- Imm.Prelude: pred :: Enum a => a -> a
- Imm.Prelude: print :: Show a => a -> IO ()
- Imm.Prelude: product :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- Imm.Prelude: properFraction :: (RealFrac a, Integral b) => a -> (b, a)
- Imm.Prelude: pure :: Applicative f => a -> f a
- Imm.Prelude: putChar :: Char -> IO ()
- Imm.Prelude: putStr :: Text -> IO ()
- Imm.Prelude: putStrLn :: Text -> IO ()
- Imm.Prelude: quot :: Integral a => a -> a -> a
- Imm.Prelude: quotRem :: Integral a => a -> a -> (a, a)
- Imm.Prelude: read :: Read a => String -> a
- Imm.Prelude: readIO :: Read a => String -> IO a
- Imm.Prelude: readList :: Read a => ReadS [a]
- Imm.Prelude: readLn :: Read a => IO a
- Imm.Prelude: readParen :: () => Bool -> ReadS a -> ReadS a
- Imm.Prelude: reads :: Read a => ReadS a
- Imm.Prelude: readsPrec :: Read a => Int -> ReadS a
- Imm.Prelude: realToFrac :: (Real a, Fractional b) => a -> b
- Imm.Prelude: recip :: Fractional a => a -> a
- Imm.Prelude: rem :: Integral a => a -> a -> a
- Imm.Prelude: repack :: (MonoFoldable a, IsSequence b, Element a ~ Element b) => a -> b
- Imm.Prelude: repeat :: () => a -> [a]
- Imm.Prelude: replaceSeq :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq -> seq
- Imm.Prelude: replaceSeqLazyText :: Text -> Text -> Text -> Text
- Imm.Prelude: replaceSeqStrictText :: Text -> Text -> Text -> Text
- Imm.Prelude: replicate :: IsSequence seq => Index seq -> Element seq -> seq
- Imm.Prelude: replicateM :: (IsSequence seq, Monad m) => Index seq -> m (Element seq) -> m seq
- Imm.Prelude: return :: Monad m => a -> m a
- Imm.Prelude: reverse :: SemiSequence seq => seq -> seq
- Imm.Prelude: rights :: () => [Either a b] -> [b]
- Imm.Prelude: round :: (RealFrac a, Integral b) => a -> b
- Imm.Prelude: scaleFloat :: RealFloat a => Int -> a -> a
- Imm.Prelude: scanl :: () => (b -> a -> b) -> b -> [a] -> [b]
- Imm.Prelude: scanl1 :: () => (a -> a -> a) -> [a] -> [a]
- Imm.Prelude: scanr :: () => (a -> b -> b) -> b -> [a] -> [b]
- Imm.Prelude: scanr1 :: () => (a -> a -> a) -> [a] -> [a]
- Imm.Prelude: second :: Bifunctor p => (b -> c) -> p a b -> p a c
- Imm.Prelude: seq :: () => a -> b -> b
- Imm.Prelude: sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- Imm.Prelude: sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
- Imm.Prelude: sequence_ :: (Applicative m, MonoFoldable mono, Element mono ~ m ()) => mono -> m ()
- Imm.Prelude: setFromList :: IsSet set => [Element set] -> set
- Imm.Prelude: setToList :: IsSet set => set -> [Element set]
- Imm.Prelude: show :: (Show a, IsString b) => a -> b
- Imm.Prelude: showChar :: Char -> ShowS
- Imm.Prelude: showList :: Show a => [a] -> ShowS
- Imm.Prelude: showParen :: Bool -> ShowS -> ShowS
- Imm.Prelude: showString :: String -> ShowS
- Imm.Prelude: shows :: Show a => a -> ShowS
- Imm.Prelude: showsPrec :: Show a => Int -> a -> ShowS
- Imm.Prelude: significand :: RealFloat a => a -> a
- Imm.Prelude: signum :: Num a => a -> a
- Imm.Prelude: sin :: Floating a => a -> a
- Imm.Prelude: singleton :: MonoPointed seq => Element seq -> seq
- Imm.Prelude: singletonMap :: IsMap map => ContainerKey map -> MapValue map -> map
- Imm.Prelude: singletonSet :: IsSet set => Element set -> set
- Imm.Prelude: sinh :: Floating a => a -> a
- Imm.Prelude: snd :: () => (a, b) -> b
- Imm.Prelude: snoc :: SemiSequence seq => seq -> Element seq -> seq
- Imm.Prelude: some :: Alternative f => f a -> f [a]
- Imm.Prelude: sort :: (SemiSequence seq, Ord (Element seq)) => seq -> seq
- Imm.Prelude: sortBy :: SemiSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seq
- Imm.Prelude: sortOn :: (Ord o, SemiSequence seq) => (Element seq -> o) -> seq -> seq
- Imm.Prelude: span :: IsSequence seq => (Element seq -> Bool) -> seq -> (seq, seq)
- Imm.Prelude: splitAt :: IsSequence seq => Index seq -> seq -> (seq, seq)
- Imm.Prelude: splitElem :: (IsSequence seq, Eq (Element seq)) => Element seq -> seq -> [seq]
- Imm.Prelude: splitElemStrictBS :: Word8 -> ByteString -> [ByteString]
- Imm.Prelude: splitSeq :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> [seq]
- Imm.Prelude: splitSeqLazyBS :: Word8 -> ByteString -> [ByteString]
- Imm.Prelude: splitSeqLazyText :: Text -> Text -> [Text]
- Imm.Prelude: splitSeqStrictText :: Text -> Text -> [Text]
- Imm.Prelude: splitWhen :: IsSequence seq => (Element seq -> Bool) -> seq -> [seq]
- Imm.Prelude: sqrt :: Floating a => a -> a
- Imm.Prelude: stderr :: Handle
- Imm.Prelude: stdout :: Handle
- Imm.Prelude: stripPrefix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Maybe seq
- Imm.Prelude: stripPrefixLazyBS :: ByteString -> ByteString -> Maybe ByteString
- Imm.Prelude: stripPrefixStrictBS :: ByteString -> ByteString -> Maybe ByteString
- Imm.Prelude: stripSuffix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Maybe seq
- Imm.Prelude: stripSuffixLazyBS :: ByteString -> ByteString -> Maybe ByteString
- Imm.Prelude: stripSuffixStrictBS :: ByteString -> ByteString -> Maybe ByteString
- Imm.Prelude: subsequences :: IsSequence seq => seq -> [seq]
- Imm.Prelude: subtract :: Num a => a -> a -> a
- Imm.Prelude: succ :: Enum a => a -> a
- Imm.Prelude: sum :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
- Imm.Prelude: tail :: () => [a] -> [a]
- Imm.Prelude: tailDef :: IsSequence seq => seq -> seq
- Imm.Prelude: tailEx :: IsSequence seq => seq -> seq
- Imm.Prelude: tailMay :: IsSequence seq => seq -> Maybe seq
- Imm.Prelude: take :: IsSequence seq => Index seq -> seq -> seq
- Imm.Prelude: takeWhile :: IsSequence seq => (Element seq -> Bool) -> seq -> seq
- Imm.Prelude: tan :: Floating a => a -> a
- Imm.Prelude: tanh :: Floating a => a -> a
- Imm.Prelude: throw :: (MonadThrow m, Exception e) => e -> m a
- Imm.Prelude: throwIO :: (MonadThrow m, Exception e) => e -> m a
- Imm.Prelude: throwM :: (MonadThrow m, Exception e) => e -> m a
- Imm.Prelude: throwString :: (MonadThrow m, HasCallStack) => String -> m a
- Imm.Prelude: throwTo :: (Exception e, MonadIO m) => ThreadId -> e -> m ()
- Imm.Prelude: toAsyncException :: Exception e => e -> SomeException
- Imm.Prelude: toCaseFold :: Textual t => t -> t
- Imm.Prelude: toChunks :: LazySequence lazy strict => lazy -> [strict]
- Imm.Prelude: toEnum :: Enum a => Int -> a
- Imm.Prelude: toException :: Exception e => e -> SomeException
- Imm.Prelude: toInteger :: Integral a => a -> Integer
- Imm.Prelude: toList :: MonoFoldable mono => mono -> [Element mono]
- Imm.Prelude: toLower :: Textual t => t -> t
- Imm.Prelude: toRational :: Real a => a -> Rational
- Imm.Prelude: toStrict :: LazySequence lazy strict => lazy -> strict
- Imm.Prelude: toSyncException :: Exception e => e -> SomeException
- Imm.Prelude: toUpper :: Textual t => t -> t
- Imm.Prelude: traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
- Imm.Prelude: traverse_ :: (MonoFoldable mono, Applicative f) => (Element mono -> f b) -> mono -> f ()
- Imm.Prelude: truncate :: (RealFrac a, Integral b) => a -> b
- Imm.Prelude: try :: (MonadCatch m, Exception e) => m a -> m (Either e a)
- Imm.Prelude: tryAny :: MonadCatch m => m a -> m (Either SomeException a)
- Imm.Prelude: tryAnyDeep :: (MonadCatch m, MonadIO m, NFData a) => m a -> m (Either SomeException a)
- Imm.Prelude: tryAsync :: (MonadCatch m, Exception e) => m a -> m (Either e a)
- Imm.Prelude: tryDeep :: (MonadCatch m, MonadIO m, Exception e, NFData a) => m a -> m (Either e a)
- Imm.Prelude: tryIO :: MonadCatch m => m a -> m (Either IOException a)
- Imm.Prelude: tryJust :: (MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)
- Imm.Prelude: type ByteString = ByteString
- Imm.Prelude: type FilePath = String
- Imm.Prelude: type IOError = IOException
- Imm.Prelude: type LByteString = ByteString
- Imm.Prelude: type LText = Text
- Imm.Prelude: type Rational = Ratio Integer
- Imm.Prelude: type ReadS a = String -> [(a, String)]
- Imm.Prelude: type ShowS = String -> String
- Imm.Prelude: type String = [Char]
- Imm.Prelude: type Text = Text
- Imm.Prelude: type family KeySet set :: Type;
- Imm.Prelude: uncons :: IsSequence seq => seq -> Maybe (Element seq, seq)
- Imm.Prelude: uncurry :: () => (a -> b -> c) -> (a, b) -> c
- Imm.Prelude: undefined :: HasCallStack => a
- Imm.Prelude: uninterruptibleMask :: MonadMask m => ((forall a. () => m a -> m a) -> m b) -> m b
- Imm.Prelude: uninterruptibleMask_ :: MonadMask m => m a -> m a
- Imm.Prelude: union :: SetContainer set => set -> set -> set
- Imm.Prelude: unionWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> map -> map -> map
- Imm.Prelude: unionWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> map -> map -> map
- Imm.Prelude: unions :: (SetContainer set, MonoFoldable mono, Element mono ~ set) => mono -> set
- Imm.Prelude: unionsWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> [map] -> map
- Imm.Prelude: unless :: Applicative f => Bool -> f () -> f ()
- Imm.Prelude: unlines :: (Textual t, Element seq ~ t, MonoFoldable seq) => seq -> t
- Imm.Prelude: unpack :: MonoFoldable mono => mono -> [Element mono]
- Imm.Prelude: unsafeDrop :: IsSequence seq => Index seq -> seq -> seq
- Imm.Prelude: unsafeIndex :: IsSequence seq => seq -> Index seq -> Element seq
- Imm.Prelude: unsafeInit :: IsSequence seq => seq -> seq
- Imm.Prelude: unsafeSplitAt :: IsSequence seq => Index seq -> seq -> (seq, seq)
- Imm.Prelude: unsafeTail :: IsSequence seq => seq -> seq
- Imm.Prelude: unsafeTake :: IsSequence seq => Index seq -> seq -> seq
- Imm.Prelude: unsnoc :: IsSequence seq => seq -> Maybe (seq, Element seq)
- Imm.Prelude: until :: () => (a -> Bool) -> (a -> a) -> a -> a
- Imm.Prelude: unwords :: (Textual t, Element seq ~ t, MonoFoldable seq) => seq -> t
- Imm.Prelude: unzip :: () => [(a, b)] -> ([a], [b])
- Imm.Prelude: unzip3 :: () => [(a, b, c)] -> ([a], [b], [c])
- Imm.Prelude: updateLookupWithKey :: IsMap map => (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> (Maybe (MapValue map), map)
- Imm.Prelude: updateMap :: IsMap map => (MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- Imm.Prelude: updateWithKey :: IsMap map => (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map
- Imm.Prelude: userError :: String -> IOError
- Imm.Prelude: vectorSort :: (Vector v e, Ord e) => v e -> v e
- Imm.Prelude: vectorSortBy :: Vector v e => (e -> e -> Ordering) -> v e -> v e
- Imm.Prelude: void :: Functor f => f a -> f ()
- Imm.Prelude: when :: Applicative f => Bool -> f () -> f ()
- Imm.Prelude: withException :: (MonadMask m, Exception e) => m a -> (e -> m b) -> m a
- Imm.Prelude: words :: Textual t => t -> [t]
- Imm.Prelude: zip :: () => [a] -> [b] -> [(a, b)]
- Imm.Prelude: zip3 :: () => [a] -> [b] -> [c] -> [(a, b, c)]
- Imm.Prelude: zipWith :: () => (a -> b -> c) -> [a] -> [b] -> [c]
- Imm.Prelude: zipWith3 :: () => (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- Imm.Prelude: }
+ Imm.Hooks.WriteFile: href :: URIRef a -> Attribute
- Imm.Database.JsonFile: defaultDatabase :: Table t => IO (MVar (JsonFileDatabase t))
+ Imm.Database.JsonFile: defaultDatabase :: Table t => IO (TVar (JsonFileDatabase t))
- Imm.Database.JsonFile: mkHandle :: (Table t, FromJSON (Key t), FromJSON (Entry t), ToJSON (Key t), ToJSON (Entry t), MonadBase IO m) => MVar (JsonFileDatabase t) -> Handle m t
+ Imm.Database.JsonFile: mkHandle :: (Table t, FromJSON (Key t), FromJSON (Entry t), ToJSON (Key t), ToJSON (Entry t), MonadIO m, MonadMask m) => TVar (JsonFileDatabase t) -> Handle m t
- Imm.Logger.Simple: LoggerSettings :: LoggerSet -> LoggerSet -> LogLevel -> Bool -> LoggerSettings
+ Imm.Logger.Simple: LoggerSettings :: LoggerSet -> LoggerSet -> MVar LogLevel -> MVar Bool -> LoggerSettings
- Imm.Logger.Simple: [_colorizeLogs] :: LoggerSettings -> Bool
+ Imm.Logger.Simple: [_colorizeLogs] :: LoggerSettings -> MVar Bool
- Imm.Logger.Simple: [_logLevel] :: LoggerSettings -> LogLevel
+ Imm.Logger.Simple: [_logLevel] :: LoggerSettings -> MVar LogLevel
- Imm.Logger.Simple: defaultLogger :: IO (MVar LoggerSettings)
+ Imm.Logger.Simple: defaultLogger :: IO LoggerSettings
- Imm.Logger.Simple: mkHandle :: MonadBaseControl IO m => MVar LoggerSettings -> Handle m
+ Imm.Logger.Simple: mkHandle :: MonadIO m => LoggerSettings -> Handle m

Files

imm.cabal view
@@ -1,5 +1,5 @@ name:                imm-version:             1.4.0.0+version:             1.5.0.0 synopsis:            Execute arbitrary actions for each unread element of RSS/Atom feeds description:         Cf README file homepage:            https://github.com/k0ral/imm@@ -33,7 +33,6 @@     Imm.HTTP.Simple     Imm.Logger     Imm.Logger.Simple-    Imm.Prelude     Imm.XML     Imm.XML.Conduit   other-modules:@@ -43,10 +42,11 @@     Imm.Options     Imm.Pretty     Paths_imm+    Prelude   build-depends:     aeson,-    atom-conduit >= 0.4,-    base == 4.*,+    atom-conduit >= 0.6,+    base-noprelude == 4.*,     blaze-html,     blaze-markup,     bytestring,@@ -64,19 +64,18 @@     http-client >= 0.4.30,     http-client-tls,     http-types,-    lifted-base,     microlens,     mime-mail,-    monad-control,     monad-time,     monoid-subclasses,-    mono-traversable >= 1,     mtl,     network,-    opml-conduit >= 0.6,+    opml-conduit >= 0.7,     optparse-applicative,     prettyprinter,     prettyprinter-ansi-terminal,+    refined,+    relude,     rss-conduit >= 0.4.1,     safe-exceptions,     stm,
src/bin/Executable.hs view
@@ -1,5 +1,4 @@-{-# LANGUAGE NoImplicitPrelude #-}---module Executable where+-- module Executable where  -- {{{ Imports import           Imm@@ -7,7 +6,6 @@ import           Imm.Hooks.Dummy as Hooks import           Imm.HTTP.Simple as HTTP import           Imm.Logger.Simple as Logger-import           Imm.Prelude import           Imm.XML.Conduit as XML -- }}} 
src/lib/Imm/Aeson.hs view
@@ -1,10 +1,7 @@ {-# LANGUAGE FlexibleContexts  #-}-{-# LANGUAGE NoImplicitPrelude #-} module Imm.Aeson where  -- {{{ Imports-import           Imm.Prelude- import           Data.Aeson  import           URI.ByteString
src/lib/Imm/Boot.hs view
@@ -2,7 +2,6 @@ {-# LANGUAGE FlexibleContexts          #-} {-# LANGUAGE FlexibleInstances         #-} {-# LANGUAGE MultiParamTypeClasses     #-}-{-# LANGUAGE NoImplicitPrelude         #-} {-# LANGUAGE OverloadedStrings         #-} {-# LANGUAGE RankNTypes                #-} -- |@@ -22,21 +21,25 @@ module Imm.Boot (imm) where  -- {{{ Imports-import qualified Imm.Core                   as Core-import           Imm.Database               as Database-import           Imm.Database.FeedTable     as Database-import           Imm.Dyre                   as Dyre+import qualified Imm.Core                 as Core+import           Imm.Database             as Database+import           Imm.Database.FeedTable   as Database+import           Imm.Dyre                 as Dyre import           Imm.Feed-import           Imm.Hooks as Hooks-import           Imm.HTTP                   as HTTP-import           Imm.Logger                 as Logger-import           Imm.Options                as Options hiding (logLevel)-import           Imm.Prelude+import           Imm.Hooks                as Hooks+import           Imm.HTTP                 as HTTP+import           Imm.Logger               as Logger+import           Imm.Options              as Options hiding (logLevel) import           Imm.Pretty-import           Imm.XML as XML+import           Imm.XML                  as XML -import           Data.Conduit.Combinators   (stdin)-import           System.IO                  (hFlush)+import           Control.Exception.Safe+import           Data.Conduit.Combinators as Conduit (stdin)+import qualified Data.Map                 as Map+import           Data.Text                as Text hiding (length)+import           Data.Text.IO             as Text+import           Relude.Unsafe            (at)+import           System.IO                (hFlush) -- }}}  -- | Main function, meant to be used in your personal configuration file.@@ -91,8 +94,8 @@    handleAny (log logger Error . pretty . displayException) $ case command of     Check t        -> Core.check logger database httpClient xmlParser =<< resolveTarget database ByPassConfirmation t-    Help           -> liftBase $ putStrLn helpString-    Import         -> Core.importOPML logger database stdin+    Help           -> Text.putStrLn helpString+    Import         -> Core.importOPML logger database Conduit.stdin     Read t         -> mapM_ (Database.markAsRead logger database) =<< resolveTarget database AskConfirmation t     Run t          -> Core.run logger database httpClient hooks xmlParser =<< resolveTarget database ByPassConfirmation t     Show t         -> Core.showFeed logger database =<< resolveTarget database ByPassConfirmation t@@ -117,19 +120,19 @@  promptConfirm :: Text -> IO () promptConfirm s = do-  putStr $ s <> " Confirm [Y/n] "+  Text.putStr $ s <> " Confirm [Y/n] "   hFlush stdout-  x <- getLine-  unless (null x || x == ("Y" :: Text)) $ throwM InterruptedException+  x <- Text.getLine+  unless (Text.null x || x == "Y") $ throwM InterruptedException  -resolveTarget :: MonadBase IO m => MonadThrow m => Database.Handle m FeedTable -> SafeGuard -> Maybe Core.FeedRef -> m [FeedID]+resolveTarget :: MonadIO m => MonadThrow m => Database.Handle m FeedTable -> SafeGuard -> Maybe Core.FeedRef -> m [FeedID] resolveTarget database s Nothing = do-  result <- keys <$> Database.fetchAll database-  when (s == AskConfirmation) $ liftBase $ promptConfirm $ "This will affect " <> show (length result) <> " feeds."+  result <- Map.keys <$> Database.fetchAll database+  when (s == AskConfirmation) $ liftIO $ promptConfirm $ "This will affect " <> show (length result) <> " feeds."   return result resolveTarget database _ (Just (ByUID i)) = do-  result <- fst . (!! (i-1)) . mapToList <$> Database.fetchAll database+  result <- fst . at (i-1) . Map.toList <$> Database.fetchAll database   -- log logger Info $ "Target(s): " <> show (pretty result)-  return $ singleton result+  return [result] resolveTarget _ _ (Just (ByURI uri)) = return [FeedID uri]
src/lib/Imm/Core.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude     #-} {-# LANGUAGE OverloadedStrings     #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE TupleSections         #-}@@ -18,44 +17,41 @@ ) where  -- {{{ Imports-import qualified Imm.Database                as Database+import qualified Imm.Database            as Database import           Imm.Database.FeedTable-import qualified Imm.Database.FeedTable      as Database+import qualified Imm.Database.FeedTable  as Database import           Imm.Feed-import           Imm.Hooks                   as Hooks-import qualified Imm.HTTP                    as HTTP-import           Imm.Logger as Logger-import           Imm.Prelude+import           Imm.Hooks               as Hooks+import qualified Imm.HTTP                as HTTP+import           Imm.Logger              as Logger import           Imm.Pretty-import           Imm.XML as XML+import           Imm.XML                 as XML -import           Control.Concurrent.STM      (STM, atomically)-import           Control.Concurrent.STM.TVar+import           Control.Exception.Safe import           Control.Monad.Time import           Data.Conduit-import qualified Data.Map                    as Map-import           Data.NonNull-import           Data.Set                    (Set)-import qualified Data.Set                    as Set-import qualified Data.Text                   as Text+import qualified Data.Map                as Map+import           Data.Set                (Set)+import qualified Data.Set                as Set import           Data.Tree import           Data.Version-import qualified Paths_imm                   as Package-import           Streamly                    hiding ((<>))-import qualified Streamly.Prelude            as Stream+import qualified Paths_imm               as Package+import           Refined+import           Streamly                hiding ((<>))+import qualified Streamly.Prelude        as Stream import           System.Info import           Text.OPML.Conduit.Parse-import           Text.OPML.Types             as OPML-import           Text.XML                    as XML ()-import           Text.XML.Stream.Parse       as XML+import           Text.OPML.Types         as OPML+import           Text.XML                as XML ()+import           Text.XML.Stream.Parse   as XML import           URI.ByteString -- }}}   printVersions :: (MonadBase IO m) => m () printVersions = liftBase $ do-  putStrLn $ "imm-" <> Text.pack (showVersion Package.version)-  putStrLn $ "compiled by " <> Text.pack compilerName <> "-" <> Text.pack (showVersion compilerVersion)+  putStrLn $ "imm-" <> showVersion Package.version+  putStrLn $ "compiled by " <> compilerName <> "-" <> showVersion compilerVersion  -- | Print database status for given feed(s) showFeed :: MonadThrow m => Logger.Handle m -> Database.Handle m FeedTable -> [FeedID] -> m ()@@ -81,7 +77,7 @@     result <- lift $ tryAny $ checkOne logger database httpClient xmlParser feedID     let logResult = either (red . pretty . displayException) (\n -> green (pretty n) <+> "new element(s)") result     n <- liftBase $ atomically $ do-      modifyTVar (progress :: TVar Int) (+ 1)+      modifyTVar' (progress :: TVar Int) (+ 1)       readTVar progress     lift $ log logger Info $ brackets (fill width (bold $ cyan $ pretty n) <+> "/" <+> pretty total) <+> "Checked" <+> magenta (pretty feedID) <+> "=>" <+> logResult     return result@@ -123,7 +119,7 @@     result <- lift $ tryAny $ runOne logger database httpClient hooks xmlParser feedID     let logResult = either (red . pretty . displayException) (\n -> green (pretty n) <+> "new element(s)") result     n <- liftBase $ atomically $ do-      modifyTVar progress (+ 1)+      modifyTVar' progress (+ 1)       readTVar progress :: STM Int     lift $ log logger Info $ brackets (fill width (bold $ cyan $ pretty n) <+> "/" <+> pretty total) <+> "Processed" <+> magenta (pretty feedID) <+> "=>" <+> logResult     return $ bimap (feedID,) (feedID,) result@@ -155,7 +151,7 @@ isRead :: MonadCatch m => Database.Handle m FeedTable -> FeedID -> FeedElement -> m Bool isRead database feedID element = do   DatabaseEntry _ _ readHashes lastCheck <- Database.fetch database feedID-  let matchHash = not $ null $ (setFromList (getHashes element) :: Set Int) `intersection` readHashes+  let matchHash = not $ Set.null $ Set.fromList (getHashes element) `Set.intersection` readHashes       matchDate = case (lastCheck, getDate element) of         (Nothing, _)     -> False         (_, Nothing)     -> False@@ -169,7 +165,7 @@   forM_ (opmlOutlines opml) $ importOPML' logger database mempty  importOPML' :: MonadCatch m => Logger.Handle m -> Database.Handle m FeedTable -> Set Text -> Tree OpmlOutline -> m ()-importOPML' logger database _ (Node (OpmlOutlineGeneric b _) sub) = mapM_ (importOPML' logger database (Set.singleton . toNullable $ OPML.text b)) sub+importOPML' logger database _ (Node (OpmlOutlineGeneric b _) sub) = mapM_ (importOPML' logger database (Set.singleton . unrefine $ OPML.text b)) sub importOPML' logger database c (Node (OpmlOutlineSubscription _ s) _) = subscribe logger database (xmlUri s) c importOPML' _ _ _ _ = return () 
src/lib/Imm/Database.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE FlexibleInstances     #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude     #-} {-# LANGUAGE OverloadedStrings     #-} {-# LANGUAGE RankNTypes            #-} {-# LANGUAGE StandaloneDeriving    #-}@@ -15,12 +14,12 @@ module Imm.Database where  -- {{{ Imports-import qualified Imm.Logger as Logger-import           Imm.Logger hiding(Handle)-import           Imm.Prelude+import           Imm.Logger             hiding (Handle)+import qualified Imm.Logger             as Logger import           Imm.Pretty -import           Data.Map    (Map)+import           Control.Exception.Safe hiding (handle)+import           Data.Map               (Map) -- }}}  -- * Types@@ -34,13 +33,13 @@  data Handle m t = Handle   { _describeDatabase :: forall a . m (Doc a)-  , _fetchList :: [Key t] -> m (Map (Key t) (Entry t))-  , _fetchAll :: m (Map (Key t) (Entry t))-  , _update :: Key t -> (Entry t -> Entry t) -> m ()-  , _insertList :: [(Key t, Entry t)] -> m ()-  , _deleteList :: [Key t] -> m ()-  , _purge :: m ()-  , _commit :: m ()+  , _fetchList        :: [Key t] -> m (Map (Key t) (Entry t))+  , _fetchAll         :: m (Map (Key t) (Entry t))+  , _update           :: Key t -> (Entry t -> Entry t) -> m ()+  , _insertList       :: [(Key t, Entry t)] -> m ()+  , _deleteList       :: [Key t] -> m ()+  , _purge            :: m ()+  , _commit           :: m ()   }  
src/lib/Imm/Database/FeedTable.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE FlexibleContexts  #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies      #-} -- | Feed table definitions. This is a specialization of "Imm.Database".@@ -7,14 +6,14 @@  -- {{{ Imports import           Imm.Aeson-import           Imm.Database as Database-import           Imm.Logger as Logger-import           Imm.Prelude+import           Imm.Database           as Database+import           Imm.Logger             as Logger import           Imm.Pretty +import           Control.Exception.Safe import           Control.Monad.Time import           Data.Aeson-import           Data.Set           (Set)+import qualified Data.Set               as Set (insert) import           Data.Time import           URI.ByteString -- }}}@@ -110,7 +109,7 @@ addReadHash logger database feedID hash = do   log logger Debug $ "Adding read hash:" <+> pretty hash <> "..."   update database feedID f-  where f a = a { entryReadHashes = insertSet hash $ entryReadHashes a }+  where f a = a { entryReadHashes = Set.insert hash $ entryReadHashes a }  -- | Set the last check time to now markAsRead :: (MonadTime m, MonadThrow m)
src/lib/Imm/Database/JsonFile.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE FlexibleInstances     #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude     #-} {-# LANGUAGE OverloadedLists       #-} {-# LANGUAGE OverloadedStrings     #-} {-# LANGUAGE UndecidableInstances  #-}@@ -16,21 +15,20 @@   ) where  -- {{{ Imports-import           Imm.Database                   hiding (commit, delete, insert,-                                                 purge, update)+import           Imm.Database                hiding (commit, delete, insert,+                                              purge, update) import           Imm.Database.FeedTable import           Imm.Error-import           Imm.Prelude                    hiding (delete, keys) import           Imm.Pretty -import           Control.Concurrent.MVar.Lifted+import           Control.Concurrent.STM.TVar (swapTVar) import           Data.Aeson-import           Data.ByteString.Lazy           (hPut)-import           Data.ByteString.Streaming      (hGetContents, toLazy_)-import           Data.Map                       (Map)-import qualified Data.Map                       as Map-import qualified Data.Set                       as Set-import           Streaming.With+import           Data.ByteString.Lazy        (hPut)+import           Data.ByteString.Streaming   (hGetContents, toLazy_)+import           Data.Map                    (Map)+import qualified Data.Map                    as Map+import qualified Data.Set                    as Set+import           Streaming.With              hiding (withFile) import           System.Directory import           System.FilePath -- }}}@@ -47,10 +45,10 @@ mkJsonFileDatabase file = JsonFileDatabase file mempty Empty  -- | Default database is stored in @$XDG_CONFIG_HOME\/imm\/feeds.json@-defaultDatabase :: Table t => IO (MVar (JsonFileDatabase t))+defaultDatabase :: Table t => IO (TVar (JsonFileDatabase t)) defaultDatabase = do   databaseFile <- getXdgDirectory XdgConfig "imm/feeds.json"-  newMVar $ mkJsonFileDatabase databaseFile+  newTVarIO $ mkJsonFileDatabase databaseFile   data JsonException = UnableDecode@@ -60,73 +58,65 @@   displayException _ = "Unable to parse JSON"  -mkHandle :: (Table t, FromJSON (Key t), FromJSON (Entry t), ToJSON (Key t), ToJSON (Entry t), MonadBase IO m)-         => MVar (JsonFileDatabase t) -> Handle m t-mkHandle mvar = Handle-  { _describeDatabase = pretty <$> readMVar mvar-  , _fetchList = \keys -> Map.filterWithKey (\uri _ -> member uri $ Set.fromList keys) <$> fetchAll_-  , _fetchAll = fetchAll_-  , _update = \key f -> liftBase $ modifyMVar_ mvar (\a -> update a key f)-  , _insertList = liftBase . modifyMVar_ mvar . insert-  , _deleteList = liftBase . modifyMVar_ mvar . delete-  , _purge = liftBase $ modifyMVar_ mvar purge-  , _commit = liftBase $ modifyMVar_ mvar commit+mkHandle :: (Table t, FromJSON (Key t), FromJSON (Entry t), ToJSON (Key t), ToJSON (Entry t), MonadIO m, MonadMask m)+         => TVar (JsonFileDatabase t) -> Handle m t+mkHandle tvar = Handle+  { _describeDatabase = pretty <$> readTVarIO tvar+  , _fetchList = \keys -> loadInCache tvar >> (Map.filterWithKey (\uri _ -> Set.member uri $ Set.fromList keys) <$> getCache tvar)+  , _fetchAll = loadInCache tvar >> getCache tvar+  , _update = \key f -> loadInCache tvar >> atomically (modifyTVar' tvar $ updateInCache key f)+  , _insertList = \list -> loadInCache tvar >> atomically (modifyTVar' tvar $ insertInCache list)+  , _deleteList = \list -> loadInCache tvar >> atomically (modifyTVar' tvar $ deleteInCache list)+  , _purge = loadInCache tvar >> atomically (modifyTVar' tvar purgeInCache)+  , _commit = commit tvar   }-  where fetchAll_ = liftBase $ modifyMVar mvar $ \database -> do-          a@(JsonFileDatabase _ cache _) <- loadInCache database-          return (a, cache) - -- * Low-level implementation -loadInCache :: (Table t, FromJSON (Key t), FromJSON (Entry t))-            => JsonFileDatabase t -> IO (JsonFileDatabase t)-loadInCache t@(JsonFileDatabase file _ status) = case status of-  Empty -> do-    createDirectoryIfMissing True $ takeDirectory file-    fileContent <- withBinaryFile file ReadWriteMode (toLazy_ . hGetContents)-    cache <- (`failWith` UnableDecode) $ fmap Map.fromList $ decode $ fromEmpty "[]" fileContent-    return $ JsonFileDatabase file cache Clean-  _ -> return t+loadInCache :: (Table t, FromJSON (Key t), FromJSON (Entry t), MonadIO m, MonadMask m) => TVar (JsonFileDatabase t) -> m ()+loadInCache tvar = do+  JsonFileDatabase file _ status <- readTVarIO tvar+  when (status == Empty) $ do+    database <- loadFromDisk file+    atomically $ do+      JsonFileDatabase _ _ status' <- readTVar tvar+      when (status' == Empty) $ writeTVar tvar database++loadFromDisk :: (Table t, FromJSON (Key t), FromJSON (Entry t), MonadIO m, MonadMask m) => FilePath -> m (JsonFileDatabase t)+loadFromDisk file = do+  liftIO $ createDirectoryIfMissing True $ takeDirectory file+  fileContent <- withBinaryFile file ReadWriteMode (toLazy_ . hGetContents)+  cache <- (`failWith` UnableDecode) $ fmap Map.fromList $ decode $ fromEmpty "[]" fileContent+  return $ JsonFileDatabase file cache Clean   where fromEmpty x "" = x         fromEmpty _ y  = y +getCache :: MonadIO m => TVar (JsonFileDatabase t) -> m (Map (Key t) (Entry t))+getCache tvar = do+  JsonFileDatabase _ cache _ <- readTVarIO tvar+  return cache -insert :: (Table t, FromJSON (Key t), FromJSON (Entry t))-       => [(Key t, Entry t)] -> JsonFileDatabase t -> IO (JsonFileDatabase t)-insert rows t = insertInCache rows <$> loadInCache t  insertInCache :: Table t => [(Key t, Entry t)] -> JsonFileDatabase t -> JsonFileDatabase t insertInCache rows (JsonFileDatabase file cache _) = JsonFileDatabase file (Map.union cache $ Map.fromList rows) Dirty --update :: (Table t, FromJSON (Key t), FromJSON (Entry t))-       => JsonFileDatabase t -> Key t -> (Entry t -> Entry t) -> IO (JsonFileDatabase t)-update t key f = updateInCache key f <$> loadInCache t- updateInCache :: Table t => Key t -> (Entry t -> Entry t) -> JsonFileDatabase t -> JsonFileDatabase t updateInCache key f (JsonFileDatabase file cache _) = JsonFileDatabase file newCache Dirty where   newCache = Map.update (Just . f) key cache -delete :: (Table t, FromJSON (Key t), FromJSON (Entry t))-       => [Key t] -> JsonFileDatabase t -> IO (JsonFileDatabase t)-delete keys t = deleteInCache keys <$> loadInCache t- deleteInCache :: Table t => [Key t] -> JsonFileDatabase t -> JsonFileDatabase t deleteInCache keys (JsonFileDatabase file cache _) = JsonFileDatabase file newCache Dirty where   newCache = foldr Map.delete cache keys -purge :: (Table t, FromJSON (Key t), FromJSON (Entry t))-      => JsonFileDatabase t -> IO (JsonFileDatabase t)-purge t = purgeInCache <$> loadInCache t- purgeInCache :: Table t => JsonFileDatabase t -> JsonFileDatabase t purgeInCache (JsonFileDatabase file _ _) = JsonFileDatabase file mempty Dirty -commit :: (ToJSON (Key t), ToJSON (Entry t))-       => JsonFileDatabase t -> IO (JsonFileDatabase t)-commit t@(JsonFileDatabase file cache status) = case status of-  Dirty -> do-    withFile file WriteMode $ \h -> hPut h $ encode $ Map.toList cache-    return $ JsonFileDatabase file cache Clean-  _ -> return t+commit :: (ToJSON (Key t), ToJSON (Entry t), MonadIO m)+       => TVar (JsonFileDatabase t) -> m ()+commit tvar = do+  JsonFileDatabase file cache status <- atomically $ do+    database@(JsonFileDatabase file cache status) <- readTVar tvar+    when (status == Dirty) $ void $ swapTVar tvar $ JsonFileDatabase file cache Clean+    return database++  when (status == Dirty) $ liftIO $ withFile file WriteMode $ \h -> hPut h $ encode $ Map.toList cache
src/lib/Imm/Dyre.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE FlexibleContexts  #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes        #-} {-# LANGUAGE TypeFamilies      #-}@@ -12,7 +11,6 @@   ) where  -- {{{ Imports-import           Imm.Prelude import           Imm.Pretty  import           Config.Dyre
src/lib/Imm/Error.hs view
@@ -1,9 +1,8 @@-{-# LANGUAGE NoImplicitPrelude   #-} {-# LANGUAGE ScopedTypeVariables #-} module Imm.Error (module Imm.Error) where  -- {{{ Imports-import           Imm.Prelude+import           Control.Exception.Safe -- }}}  liftE :: (MonadThrow m, Exception e) => Either e a -> m a
src/lib/Imm/Feed.hs view
@@ -1,15 +1,14 @@ {-# LANGUAGE DataKinds         #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications  #-} -- | Helpers to manipulate feeds module Imm.Feed where  -- {{{ Imports-import           Imm.Prelude import           Imm.Pretty  import           Data.Hashable+import           Data.Text                      as Text (null) import           Data.Time import           Lens.Micro import           Text.Atom.Types@@ -56,7 +55,7 @@ getTitle (AtomElement entry) = show $ prettyAtomText $ entryTitle entry  getContent :: FeedElement -> Text-getContent (RssElement item) = if not (null content) then content else itemDescription item where+getContent (RssElement item) = if not (Text.null content) then content else itemDescription item where   ContentItem content = item ^. itemExtensionL getContent (AtomElement entry) = fromMaybe "<empty>" $ content <|> summary where   content = show . prettyAtomContent <$> entryContent entry
src/lib/Imm/HTTP.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE FlexibleContexts  #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | HTTP module abstracts over HTTP requests to the external world. --@@ -12,7 +11,6 @@ -- {{{ Imports import qualified Imm.Logger as Logger import           Imm.Logger hiding(Handle)-import           Imm.Prelude import           Imm.Pretty  import           URI.ByteString
src/lib/Imm/HTTP/Simple.hs view
@@ -1,15 +1,14 @@ {-# LANGUAGE FlexibleContexts  #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | Implementation of "Imm.HTTP" based on "Network.HTTP.Client". module Imm.HTTP.Simple (mkHandle, defaultManager, module Reexport) where  -- {{{ Imports import           Imm.HTTP-import           Imm.Prelude import           Imm.Pretty +import           Control.Exception.Safe import           Data.CaseInsensitive import           Network.Connection         as Reexport import           Network.HTTP.Client        as Reexport
src/lib/Imm/Hooks.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | Hooks module abstracts over the main behavior of the program. --@@ -11,7 +10,6 @@ import           Imm.Feed import qualified Imm.Logger as Logger import           Imm.Logger hiding(Handle)-import           Imm.Prelude import           Imm.Pretty -- }}} 
src/lib/Imm/Hooks/Dummy.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | Implementation of "Imm.Hooks" that does nothing, -- except suggesting the user to define proper hooks.@@ -8,9 +7,9 @@  -- {{{ Imports import           Imm.Hooks-import           Imm.Prelude  import           Control.Exception+import           Control.Exception.Safe -- }}}  data DummyHooks = DummyHooks
src/lib/Imm/Hooks/SendMail.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE FlexibleContexts  #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | Implementation of "Imm.Hooks" that sends a mail via a SMTP server for each new RSS/Atom element. -- You may want to check out "Network.HaskellNet.SMTP", "Network.HaskellNet.SMTP.SSL" and "Network.Mail.Mime" modules for additional information.@@ -21,20 +20,20 @@ -- >   (Just $ Authentication PLAIN "user" "password") -- >   (StartTls "smtp.server" defaultSettingsSMTPSTARTTLS) ---module Imm.Hooks.SendMail (module Imm.Hooks.SendMail, module Reexport) where+module Imm.Hooks.SendMail (module Imm.Hooks.SendMail, module Imm.Hooks, module Reexport) where  -- {{{ Imports import           Imm.Feed import           Imm.Hooks-import           Imm.Prelude import           Imm.Pretty -import           Data.NonNull+import           Data.Text                   as Text (intercalate) import           Data.Time import           Network.HaskellNet.SMTP     as Reexport import           Network.HaskellNet.SMTP.SSL as Reexport import           Network.Mail.Mime           as Reexport hiding (sendmail) import           Network.Socket+import           Refined import           Text.Atom.Types import           Text.RSS.Types -- }}}@@ -85,7 +84,7 @@ defaultFormatFrom (Rss doc) (RssElement item) = Address (Just $ channelTitle doc <> " (" <> itemAuthor item <> ")") "" defaultFormatFrom (Atom feed) (AtomElement entry) = Address (Just $ title <> " (" <> authors <> ")") ""   where title = show . prettyAtomText $ feedTitle feed-        authors = intercalate ", " $ map (toNullable . personName) $ entryAuthors entry <> feedAuthors feed+        authors = Text.intercalate ", " $ map (unrefine . personName) $ entryAuthors entry <> feedAuthors feed defaultFormatFrom _ _ = Address (Just "Unknown") ""  -- | Fill mail subject with the element title@@ -98,7 +97,7 @@ -- - the element's content or description/summary defaultFormatBody :: Feed -> FeedElement -> Text defaultFormatBody _ (RssElement item) = "<p>" <> maybe "<no link>" (withRssURI (show . prettyURI)) (itemLink item) <> "</p><p>" <> itemDescription item <> "</p>"-defaultFormatBody _ (AtomElement entry) = "<p>" <> intercalate "<br/>" links <> "</p><p>" <> fromMaybe "<empty>" (content <|> summary) <> "</p>"+defaultFormatBody _ (AtomElement entry) = "<p>" <> Text.intercalate "<br/>" links <> "</p><p>" <> fromMaybe "<empty>" (content <|> summary) <> "</p>"   where links   = map (withAtomURI (show . prettyURI) . linkHref) $ entryLinks entry         content = show . prettyAtomContent <$> entryContent entry         summary = show . prettyAtomText <$> entrySummary entry
src/lib/Imm/Hooks/WriteFile.hs view
@@ -1,19 +1,16 @@ {-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | Implementation of "Imm.Hooks" that writes a file for each new RSS/Atom item.-module Imm.Hooks.WriteFile where+module Imm.Hooks.WriteFile (module Imm.Hooks.WriteFile, module Imm.Hooks) where  -- {{{ Imports import           Imm.Feed import           Imm.Hooks-import           Imm.Prelude import           Imm.Pretty -import           Control.Arrow import           Data.ByteString.Builder import           Data.ByteString.Streaming     (toStreamingByteString)-import           Data.Monoid.Textual           hiding (elem, map)+import qualified Data.Text as Text             (null, replace) import           Data.Time import           Streaming.With import           System.Directory              (createDirectoryIfMissing)@@ -23,7 +20,7 @@ import           Text.Blaze.Html5              (Html, docTypeHtml,                                                 preEscapedToHtml, (!)) import qualified Text.Blaze.Html5              as H-import           Text.Blaze.Html5.Attributes   as H (charset, href)+import qualified Text.Blaze.Html5.Attributes   as H (charset, href) import           Text.RSS.Types import           URI.ByteString -- }}}@@ -54,14 +51,15 @@  -- | Generate a path @<root>/<feed title>/<element date>-<element title>.html@, where @<root>@ is the first argument defaultFilePath :: FilePath -> Feed -> FeedElement -> FilePath-defaultFilePath root feed element = makeValid $ root </> title </> fileName <.> "html" where+defaultFilePath root feed element = makeValid $ root </> toString title </> fileName <.> "html" where   date = maybe "" (formatTime defaultTimeLocale "%F-") $ getDate element-  fileName = date <> sanitize (convertText $ getTitle element)-  title = sanitize $ convertText $ getFeedTitle feed-  sanitize = replaceIf isPathSeparator '-' >>> replaceAny ".?!#" '_'-  replaceAny :: String -> Char -> String -> String-  replaceAny list = replaceIf (`elem` list)-  replaceIf f b = map (\c -> if f c then b else c)+  fileName = date <> toString (sanitize $ getTitle element)+  title = sanitize $ getFeedTitle feed+  sanitize = appEndo (mconcat [Endo $ Text.replace (toText [s]) "_" | s <- pathSeparators])+    >>> Text.replace "." "_"+    >>> Text.replace "?" "_"+    >>> Text.replace "!" "_"+    >>> Text.replace "#" "_"  -- | Generate an HTML page, with a title, a header and an article that contains the feed element defaultFileContent :: Feed -> FeedElement -> Builder@@ -87,7 +85,7 @@ defaultArticleTitle _ element@(AtomElement _) = H.h2 $ convertText $ getTitle element  defaultArticleAuthor :: Feed -> FeedElement -> Html-defaultArticleAuthor _ (RssElement item) = unless (null author) $ H.address $ "Published by " >> convertText author where+defaultArticleAuthor _ (RssElement item) = unless (Text.null author) $ H.address $ "Published by " >> convertText author where   author = itemAuthor item defaultArticleAuthor _ (AtomElement entry) = H.address $ do   "Published by "@@ -105,10 +103,12 @@ defaultBody _ element@(AtomElement entry) = do   unless (null links) $ H.p $ do     "Related links:"-    H.ul $ forM_ links $ \uri -> H.li (H.a ! H.href (convertAtomURI uri) $ convertAtomURI uri)+    H.ul $ forM_ links $ \uri -> H.li (H.a ! withAtomURI href uri $ convertAtomURI uri)   H.p $ preEscapedToHtml $ getContent element   where links   = map linkHref $ entryLinks entry +href :: URIRef a -> H.Attribute+href = H.href . convertURI  convertAtomURI :: (IsString t) => AtomURI -> t convertAtomURI = withAtomURI convertURI@@ -117,7 +117,7 @@ convertURI = convertText . decodeUtf8 . serializeURIRef'  convertText :: (IsString t) => Text -> t-convertText = fromString . toString (const "?")+convertText = fromString . toString  convertDoc :: (IsString t) => Doc a -> t convertDoc = show
src/lib/Imm/Logger.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE FlexibleContexts      #-} {-# LANGUAGE FlexibleInstances     #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude     #-} {-# LANGUAGE OverloadedStrings     #-} -- | Logger module abstracts over logging data. --@@ -12,7 +11,6 @@ module Imm.Logger where  -- {{{ Imports-import           Imm.Prelude import           Imm.Pretty -- }}} 
src/lib/Imm/Logger/Simple.hs view
@@ -1,52 +1,46 @@ {-# LANGUAGE FlexibleContexts  #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE NoImplicitPrelude #-} -- | Implementation of "Imm.Logger" based on @fast-logger@. -- For further information, please consult "System.Log.FastLogger". module Imm.Logger.Simple (module Imm.Logger.Simple, module Reexport) where  -- {{{ Imports import           Imm.Logger                                as Reexport-import           Imm.Prelude import           Imm.Pretty -import           Control.Concurrent.MVar.Lifted-import           Control.Monad.Trans.Control import           Data.Text.Prettyprint.Doc.Render.Terminal import           System.Log.FastLogger                     as Reexport -- }}}  data LoggerSettings = LoggerSettings-  { _loggerSet      :: LoggerSet  -- ^ 'LoggerSet' used for 'Debug', 'Info' and 'Warning' logs-  , _errorLoggerSet :: LoggerSet  -- ^ 'LoggerSet' used for 'Error' logs-  , _logLevel       :: LogLevel   -- ^ Discard logs that are strictly less serious than this level-  , _colorizeLogs   :: Bool       -- ^ Enable log colorisation+  { _loggerSet      :: LoggerSet       -- ^ 'LoggerSet' used for 'Debug', 'Info' and 'Warning' logs+  , _errorLoggerSet :: LoggerSet       -- ^ 'LoggerSet' used for 'Error' logs+  , _logLevel       :: MVar LogLevel   -- ^ Discard logs that are strictly less serious than this level+  , _colorizeLogs   :: MVar Bool       -- ^ Enable log colorisation   }   -- | Default logger forwards error messages to stderr, and other messages to stdout.-defaultLogger :: IO (MVar LoggerSettings)-defaultLogger = newMVar =<< LoggerSettings+defaultLogger :: IO LoggerSettings+defaultLogger = LoggerSettings   <$> newStdoutLoggerSet defaultBufSize   <*> newStderrLoggerSet defaultBufSize-  <*> pure Info-  <*> pure True+  <*> newMVar Info+  <*> newMVar True  -mkHandle :: MonadBaseControl IO m => MVar LoggerSettings -> Handle m+mkHandle :: MonadIO m => LoggerSettings -> Handle m mkHandle settings = Handle   { log = \l t -> do-      s <- readMVar settings-      let loggerSet = (if l == Error then _errorLoggerSet else _loggerSet) s-          handleColor = (\c -> if c then id else unAnnotate) $ _colorizeLogs s-          refLevel = _logLevel s-      when (l >= refLevel) $ liftBase $ pushLogStrLn loggerSet $ toLogStr $ renderLazy $ layoutPretty defaultLayoutOptions $ handleColor t+      refLevel <- readMVar $ _logLevel settings+      handleColor <- (\c -> if c then id else unAnnotate) <$> readMVar (_colorizeLogs settings)+      let loggerSet = (if l == Error then _errorLoggerSet else _loggerSet) settings+      when (l >= refLevel) $ liftIO $ pushLogStrLn loggerSet $ toLogStr $ renderLazy $ layoutPretty defaultLayoutOptions $ handleColor t -  , getLogLevel = _logLevel <$> readMVar settings-  , setLogLevel = \level -> modifyMVar_ settings $ \s -> return (s { _logLevel = level })-  , setColorizeLogs = \value -> modifyMVar_ settings $ \s -> return (s { _colorizeLogs = value })-  , flushLogs = do-      s <- readMVar settings-      liftBase $ flushLogStr $ _loggerSet s-      liftBase $ flushLogStr $ _errorLoggerSet s+  , getLogLevel = readMVar $ _logLevel settings+  , setLogLevel = void . swapMVar (_logLevel settings)+  , setColorizeLogs = void . swapMVar (_colorizeLogs settings)+  , flushLogs = liftIO $ do+      flushLogStr $ _loggerSet settings+      flushLogStr $ _errorLoggerSet settings   }
src/lib/Imm/Options.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE FlexibleContexts   #-}-{-# LANGUAGE NoImplicitPrelude  #-} {-# LANGUAGE OverloadedStrings  #-} {-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE TypeApplications   #-} module Imm.Options where  -- {{{ Imports@@ -9,7 +9,6 @@ import qualified Imm.Dyre                       as Dyre import           Imm.Feed import           Imm.Logger                     as Logger-import           Imm.Prelude import           Imm.Pretty  import           Data.Set                       (Set)@@ -141,7 +140,7 @@  -- {{{ Util uriReader :: ReadM URI-uriReader = eitherReader $ first show . parseURI laxURIParserOptions . encodeUtf8 . fromString+uriReader = eitherReader $ first show . parseURI laxURIParserOptions . encodeUtf8 @Text . fromString  feedRefOption :: Parser FeedRef feedRefOption = argument ((ByUID <$> auto) <|> (ByURI <$> uriReader)) $ metavar "TARGET"
− src/lib/Imm/Prelude.hs
@@ -1,63 +0,0 @@-{-# LANGUAGE FlexibleContexts #-}-module Imm.Prelude (module Imm.Prelude, module X) where---- {{{ Imports-import           Control.Applicative             as X-import           Control.Exception.Safe          as X hiding(handle)-import           Control.Monad                   as X (MonadPlus (..), unless,-                                                       void, when)-import           Control.Monad.Base              as X-import           Control.Monad.IO.Class          as X-import           Control.Monad.Trans             as X (lift)-import           Data.Bifunctor                  as X-import qualified Data.ByteString                 as B (ByteString)-import qualified Data.ByteString.Lazy            as LB (ByteString)-import           Data.Containers                 as X-import           Data.Either                     as X-import           Data.Foldable                   as X (forM_)-import           Data.Maybe                      as X hiding (catMaybes)-import           Data.Monoid.Textual             as X (TextualMonoid, fromText)-import           Data.MonoTraversable.Unprefixed as X hiding (forM_, mapM_)-import           Data.Ord                        as X-import           Data.Sequences                  as X-import           Data.String                     as X (IsString (..))-import qualified Data.Text                       as T (Text)-import           Data.Text.IO                    as X (getLine, putStr,-                                                       putStrLn)-import qualified Data.Text.Lazy                  as LT (Text)-import           Data.Traversable                as X (for, forM)-import qualified GHC.Show                        as Show-import           Prelude                         as X hiding (all, and, any,-                                                       break, concat, concatMap,-                                                       drop, dropWhile, elem,-                                                       filter, foldMap, foldr,-                                                       getLine, length, lines,-                                                       log, lookup, notElem,-                                                       null, or, product,-                                                       putStr, putStrLn,-                                                       readFile, replicate,-                                                       reverse, sequence_, show,-                                                       span, splitAt, sum, take,-                                                       takeWhile, unlines,-                                                       unwords, words,-                                                       writeFile)-import           System.IO                       as X (IOMode (..), stderr,-                                                       stdout)--- }}}---- * Shortcuts--type LByteString = LB.ByteString-type ByteString = B.ByteString-type LText = LT.Text-type Text = T.Text---- | Shortcut to 'liftIO'-io :: MonadIO m => IO a -> m a-io = liftIO---- * Generalisation---- | Generic 'Show.show'-show :: (Show a, IsString b) => a -> b-show = fromString . Show.show
src/lib/Imm/Pretty.hs view
@@ -1,13 +1,11 @@ {-# LANGUAGE FlexibleContexts  #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeApplications  #-} module Imm.Pretty (module Imm.Pretty, module X) where  -- {{{ Imports-import           Imm.Prelude--import           Data.NonNull+import           Data.Text                                 as Text import           Data.Time import           Data.Tree @@ -20,6 +18,7 @@ import           Data.Text.Prettyprint.Doc.Render.Terminal as X (AnsiStyle) import           Data.Text.Prettyprint.Doc.Render.Terminal import qualified Data.Text.Prettyprint.Doc.Render.Terminal as Pretty+import           Refined import           Text.RSS.Types                            as RSS import           URI.ByteString -- }}}@@ -61,8 +60,8 @@ --   pretty o = text "OPML" <+> pretty (opmlVersion o) <++> indent 2 (pretty (opmlHead o) <++> (vsep . map pretty $ opmlOutlines o))  prettyPerson :: AtomPerson -> Doc a-prettyPerson p = pretty (toNullable $ personName p) <> email where-  email = if null $ personEmail p+prettyPerson p = pretty (unrefine $ personName p) <> email where+  email = if Text.null $ personEmail p     then mempty     else space <> angles (pretty $ personEmail p) @@ -89,7 +88,7 @@   )  prettyURI :: URIRef a -> Doc b-prettyURI uri = pretty $ decodeUtf8 $ serializeURIRef' uri+prettyURI uri = pretty @Text $ decodeUtf8 $ serializeURIRef' uri  prettyGuid :: RssGuid -> Doc a prettyGuid (GuidText t)         = pretty t
src/lib/Imm/XML.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE NoImplicitPrelude #-} -- | XML module abstracts over the parsing of RSS/Atom feeds. -- -- This module follows the [Handle pattern](https://jaspervdj.be/posts/2018-03-08-handle-pattern.html).@@ -8,7 +7,6 @@  -- {{{ Imports import           Imm.Feed-import           Imm.Prelude  import           URI.ByteString -- }}}
src/lib/Imm/XML/Conduit.hs view
@@ -1,22 +1,19 @@ {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes        #-} -- | Implementation of "Imm.XML" based on 'Conduit'. module Imm.XML.Conduit (module Imm.XML.Conduit, module Imm.XML) where  -- {{{ Imports import           Imm.Feed-import           Imm.Prelude import           Imm.XML -import           Control.Monad-import           Control.Monad.Fix+import           Control.Exception.Safe import           Data.Conduit import           Data.XML.Types import           Text.Atom.Conduit.Parse import           Text.RSS.Conduit.Parse import           Text.RSS1.Conduit.Parse-import           Text.XML.Stream.Parse+import           Text.XML.Stream.Parse   as XML import           URI.ByteString -- }}} @@ -27,7 +24,7 @@ -- | 'Conduit' based implementation mkHandle :: MonadIO m => MonadCatch m => XmlParser -> Handle m mkHandle (XmlParser preProcess) = Handle-  { parseXml = \uri bytestring -> liftIO $ runConduit $ parseLBS def bytestring .| preProcess uri .| force "Invalid feed" ((fmap Atom <$> atomFeed) `orE` (fmap Rss <$> rssDocument) `orE` (fmap Rss <$> rss1Document))+  { parseXml = \uri bytestring -> liftIO $ runConduit $ parseLBS def bytestring .| preProcess uri .| XML.force "Invalid feed" ((fmap Atom <$> atomFeed) `orE` (fmap Rss <$> rssDocument) `orE` (fmap Rss <$> rss1Document))   }  -- | Forward all 'Event's without any pre-process
+ src/lib/Prelude.hs view
@@ -0,0 +1,8 @@+module Prelude (io, module Relude, module Relude.Extra.Map, module Control.Monad.Base) where++import Relude hiding(Handle, force)+import Relude.Extra.Map (lookup)+import           Control.Monad.Base++io :: MonadIO m => IO a -> m a+io = liftIO