packages feed

rio 0.0.0.0 → 0.0.1.0

raw patch · 21 files changed

+774/−155 lines, 21 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

+ RIO: ($!!) :: NFData a => (a -> b) -> a -> b
+ RIO: ($!) :: () => (a -> b) -> a -> b
+ RIO: ($) :: () => (a -> b) -> a -> b
+ RIO: ($>) :: Functor f => f a -> b -> f b
+ RIO: (&&&) :: Arrow a => forall b c c'. () => a b c -> a b c' -> a b (c, c')
+ RIO: (&&) :: Bool -> Bool -> Bool
+ RIO: (&) :: () => a -> (a -> b) -> b
+ RIO: (*) :: Num a => a -> a -> a
+ RIO: (**) :: Floating a => a -> a -> a
+ RIO: (***) :: Arrow a => forall b c b' c'. () => a b c -> a b' c' -> a (b, b') (c, c')
+ RIO: (*>) :: Applicative f => f a -> f b -> f b
+ RIO: (+) :: Num a => a -> a -> a
+ RIO: (++) :: () => [a] -> [a] -> [a]
+ RIO: (-) :: Num a => a -> a -> a
+ RIO: (.) :: () => (b -> c) -> (a -> b) -> a -> c
+ RIO: (/) :: Fractional a => a -> a -> a
+ RIO: (/=) :: Eq a => a -> a -> Bool
+ RIO: (<$!>) :: Monad m => (a -> b) -> m a -> m b
+ RIO: (<$) :: Functor f => a -> f b -> f a
+ RIO: (<$>) :: Functor f => (a -> b) -> f a -> f b
+ RIO: (<) :: Ord a => a -> a -> Bool
+ RIO: (<*) :: Applicative f => f a -> f b -> f a
+ RIO: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
+ RIO: (<=) :: Ord a => a -> a -> Bool
+ RIO: (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
+ RIO: (<>) :: Monoid m => m -> m -> m
+ RIO: (<|>) :: Alternative f => forall a. () => f a -> f a -> f a
+ RIO: (=<<) :: Monad m => (a -> m b) -> m a -> m b
+ RIO: (==) :: Eq a => a -> a -> Bool
+ RIO: (>) :: Ord a => a -> a -> Bool
+ RIO: (>=) :: Ord a => a -> a -> Bool
+ RIO: (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
+ RIO: (>>) :: Monad m => m a -> m b -> m b
+ RIO: (>>=) :: Monad m => m a -> (a -> m b) -> m b
+ RIO: (^) :: (Num a, Integral b) => a -> b -> a
+ RIO: (^.) :: () => s -> Getting a s a -> a
+ RIO: (^^) :: (Fractional a, Integral b) => a -> b -> a
+ RIO: (||) :: Bool -> Bool -> Bool
+ RIO: All :: Bool -> All
+ RIO: Any :: Bool -> Any
+ RIO: DecodeError :: String -> Maybe Word8 -> UnicodeException
+ RIO: DisplayBuilder :: Builder -> DisplayBuilder
+ RIO: EQ :: Ordering
+ RIO: EncodeError :: String -> Maybe Char -> UnicodeException
+ RIO: Endo :: (a -> a) -> Endo a
+ RIO: ExitFailure :: Int -> ExitCode
+ RIO: ExitSuccess :: ExitCode
+ RIO: False :: Bool
+ RIO: First :: Maybe a -> First a
+ RIO: GT :: Ordering
+ RIO: Just :: a -> Maybe a
+ RIO: LT :: Ordering
+ RIO: Last :: Maybe a -> Last a
+ RIO: Left :: a -> Either a b
+ RIO: Nothing :: Maybe a
+ RIO: Product :: a -> Product a
+ RIO: RIO :: ReaderT env IO a -> RIO env a
+ RIO: ReadFileUtf8Exception :: !FilePath -> !UnicodeException -> ReadFileUtf8Exception
+ RIO: ReaderT :: (r -> m a) -> ReaderT k r
+ RIO: Right :: b -> Either a b
+ RIO: Sum :: a -> Sum a
+ RIO: True :: Bool
+ RIO: [appEndo] :: Endo a -> a -> a
+ RIO: [getAll] :: All -> Bool
+ RIO: [getAny] :: Any -> Bool
+ RIO: [getFirst] :: First a -> Maybe a
+ RIO: [getLast] :: Last a -> Maybe a
+ RIO: [getProduct] :: Product a -> a
+ RIO: [getSum] :: Sum a -> a
+ RIO: [getUtf8Builder] :: DisplayBuilder -> Builder
+ RIO: [runReaderT] :: ReaderT k r -> r -> m a
+ RIO: [unRIO] :: RIO env a -> ReaderT env IO a
+ RIO: abs :: Num a => a -> a
+ RIO: absurd :: () => Void -> a
+ RIO: acos :: Floating a => a -> a
+ RIO: acosh :: Floating a => a -> a
+ RIO: all :: Foldable t => (a -> Bool) -> t a -> Bool
+ RIO: and :: Foldable t => t Bool -> Bool
+ RIO: any :: Foldable t => (a -> Bool) -> t a -> Bool
+ RIO: asTypeOf :: () => a -> a -> a
+ RIO: asin :: Floating a => a -> a
+ RIO: asinh :: Floating a => a -> a
+ RIO: ask :: MonadReader r m => m r
+ RIO: asks :: MonadReader r m => (r -> a) -> m a
+ RIO: asum :: (Foldable t, Alternative f) => t f a -> f a
+ RIO: atan :: Floating a => a -> a
+ RIO: atan2 :: RealFloat a => a -> a -> a
+ RIO: atanh :: Floating a => a -> a
+ RIO: break :: () => (a -> Bool) -> [a] -> ([a], [a])
+ RIO: byteSwap16 :: Word16 -> Word16
+ RIO: byteSwap32 :: Word32 -> Word32
+ RIO: byteSwap64 :: Word64 -> Word64
+ RIO: catMaybes :: () => [Maybe a] -> [a]
+ RIO: ceiling :: (RealFrac a, Integral b) => a -> b
+ RIO: class Applicative f => Alternative (f :: * -> *)
+ RIO: class Functor f => Applicative (f :: * -> *)
+ RIO: class Bounded a
+ RIO: class Typeable * a => Data a
+ RIO: class Display a
+ RIO: class Enum a
+ RIO: class Eq a
+ RIO: class Fractional a => Floating a
+ RIO: class Foldable (t :: * -> *)
+ RIO: class Num a => Fractional a
+ RIO: class Functor (f :: * -> *)
+ RIO: class Generic a
+ RIO: class Hashable a
+ RIO: class (Real a, Enum a) => Integral a
+ RIO: class IsString a
+ RIO: class Applicative m => Monad (m :: * -> *)
+ RIO: class (Alternative m, Monad m) => MonadPlus (m :: * -> *)
+ RIO: class Monad m => MonadReader r (m :: * -> *) | m -> r
+ RIO: class Monad m => MonadThrow (m :: * -> *)
+ RIO: class MonadTrans (t :: (* -> *) -> * -> *)
+ RIO: class Monoid a
+ RIO: class NFData a
+ RIO: class Num a
+ RIO: class Eq a => Ord a
+ RIO: class Read a
+ RIO: class (Num a, Ord a) => Real a
+ RIO: class (RealFrac a, Floating a) => RealFloat a
+ RIO: class (Real a, Fractional a) => RealFrac a
+ RIO: class Semigroup a
+ RIO: class Show a
+ RIO: class Storable a
+ RIO: class (Functor t, Foldable t) => Traversable (t :: * -> *)
+ RIO: compare :: Ord a => a -> a -> Ordering
+ RIO: comparing :: Ord a => (b -> a) -> b -> b -> Ordering
+ RIO: concat :: Foldable t => t [a] -> [a]
+ RIO: concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
+ RIO: const :: () => a -> b -> a
+ RIO: cos :: Floating a => a -> a
+ RIO: cosh :: Floating a => a -> a
+ RIO: curry :: () => ((a, b) -> c) -> a -> b -> c
+ RIO: data Bool :: *
+ RIO: data Builder :: *
+ RIO: data ByteString :: *
+ RIO: data Char :: *
+ RIO: data Double :: *
+ RIO: data Either a b :: * -> * -> *
+ RIO: data ExitCode :: *
+ RIO: data Float :: *
+ RIO: data HashMap k v :: * -> * -> *
+ RIO: data HashSet a :: * -> *
+ RIO: data IO a :: * -> *
+ RIO: data Int :: *
+ RIO: data Int16 :: *
+ RIO: data Int32 :: *
+ RIO: data Int64 :: *
+ RIO: data Int8 :: *
+ RIO: data IntMap a :: * -> *
+ RIO: data IntSet :: *
+ RIO: data Integer :: *
+ RIO: data Map k a :: * -> * -> *
+ RIO: data Maybe a :: * -> *
+ RIO: data Ordering :: *
+ RIO: data ReadFileUtf8Exception
+ RIO: data Set a :: * -> *
+ RIO: data ShortByteString :: *
+ RIO: data Text :: *
+ RIO: data UnicodeException :: *
+ RIO: data Vector a :: * -> *
+ RIO: data Void :: *
+ RIO: data Word :: *
+ RIO: data Word16 :: *
+ RIO: data Word32 :: *
+ RIO: data Word64 :: *
+ RIO: data Word8 :: *
+ RIO: dataCast1 :: (Data a, Typeable (* -> *) t) => (forall d. Data d => c t d) -> Maybe c a
+ RIO: dataCast2 :: (Data a, Typeable (* -> * -> *) t) => (forall d e. (Data d, Data e) => c t d e) -> Maybe c a
+ RIO: dataTypeOf :: Data a => a -> DataType
+ RIO: decodeFloat :: RealFloat a => a -> (Integer, Int)
+ RIO: decodeUtf8' :: ByteString -> Either UnicodeException Text
+ RIO: decodeUtf8Lenient :: ByteString -> Text
+ RIO: decodeUtf8With :: OnDecodeError -> ByteString -> Text
+ RIO: display :: Display a => a -> DisplayBuilder
+ RIO: displayBuilderToText :: DisplayBuilder -> Text
+ RIO: displayBytesUtf8 :: ByteString -> DisplayBuilder
+ RIO: displayShow :: Show a => a -> DisplayBuilder
+ RIO: div :: Integral a => a -> a -> a
+ RIO: divMod :: Integral a => a -> a -> (a, a)
+ RIO: drop :: () => Int -> [a] -> [a]
+ RIO: dropWhile :: () => (a -> Bool) -> [a] -> [a]
+ RIO: either :: () => (a -> c) -> (b -> c) -> Either a b -> c
+ RIO: elem :: Foldable t => forall a. Eq a => a -> t a -> Bool
+ RIO: encodeFloat :: RealFloat a => Integer -> Int -> a
+ RIO: encodeUtf8 :: Text -> ByteString
+ RIO: encodeUtf8Builder :: Text -> Builder
+ RIO: error :: HasCallStack => [Char] -> a
+ RIO: even :: Integral a => a -> Bool
+ RIO: exp :: Floating a => a -> a
+ RIO: exponent :: RealFloat a => a -> Int
+ RIO: fail :: Monad m => String -> m a
+ RIO: filter :: () => (a -> Bool) -> [a] -> [a]
+ RIO: filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
+ RIO: first :: Arrow a => forall b c d. () => a b c -> a (b, d) (c, d)
+ RIO: fix :: () => (a -> a) -> a
+ RIO: flip :: () => (a -> b -> c) -> b -> a -> c
+ RIO: floatDigits :: RealFloat a => a -> Int
+ RIO: floatRadix :: RealFloat a => a -> Integer
+ RIO: floatRange :: RealFloat a => a -> (Int, Int)
+ RIO: floor :: (RealFrac a, Integral b) => a -> b
+ RIO: fmap :: Functor f => (a -> b) -> f a -> f b
+ RIO: fold :: Foldable t => forall m. Monoid m => t m -> m
+ RIO: foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
+ RIO: foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
+ RIO: foldMap :: Foldable t => forall m a. Monoid m => (a -> m) -> t a -> m
+ RIO: foldl' :: Foldable t => forall b a. () => (b -> a -> b) -> b -> t a -> b
+ RIO: foldr :: Foldable t => forall a b. () => (a -> b -> b) -> b -> t a -> b
+ RIO: for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f t b
+ RIO: forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m t b
+ RIO: forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
+ RIO: forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b]
+ RIO: forMaybeM :: Monad m => [a] -> (a -> m (Maybe b)) -> m [b]
+ RIO: for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
+ RIO: force :: NFData a => a -> a
+ RIO: forever :: Applicative f => f a -> f b
+ RIO: fromFirst :: a -> First a -> a
+ RIO: fromInteger :: Num a => Integer -> a
+ RIO: fromIntegral :: (Integral a, Num b) => a -> b
+ RIO: fromMaybe :: () => a -> Maybe a -> a
+ RIO: fromRational :: Fractional a => Rational -> a
+ RIO: fromShort :: ShortByteString -> ByteString
+ RIO: fromStrictBytes :: ByteString -> LByteString
+ RIO: fromString :: IsString a => String -> a
+ RIO: fst :: () => (a, b) -> a
+ RIO: gcd :: Integral a => a -> a -> a
+ RIO: gfoldl :: Data a => (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. () => g -> c g) -> a -> c a
+ RIO: gmapM :: (Data a, Monad m) => (forall d. Data d => d -> m d) -> a -> m a
+ RIO: gmapMo :: (Data a, MonadPlus m) => (forall d. Data d => d -> m d) -> a -> m a
+ RIO: gmapMp :: (Data a, MonadPlus m) => (forall d. Data d => d -> m d) -> a -> m a
+ RIO: gmapQ :: Data a => (forall d. Data d => d -> u) -> a -> [u]
+ RIO: gmapQi :: Data a => Int -> (forall d. Data d => d -> u) -> a -> u
+ RIO: gmapQl :: Data a => (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
+ RIO: gmapQr :: Data a => (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
+ RIO: gmapT :: Data a => (forall b. Data b => b -> b) -> a -> a
+ RIO: guard :: Alternative f => Bool -> f ()
+ RIO: gunfold :: Data a => (forall b r. Data b => c (b -> r) -> c r) -> (forall r. () => r -> c r) -> Constr -> c a
+ RIO: hPutBuilder :: MonadIO m => Handle -> Builder -> m ()
+ RIO: id :: () => a -> a
+ RIO: infix 4 `notElem`
+ RIO: infixl 0 `on`
+ RIO: infixl 1 &
+ RIO: infixl 3 <|>
+ RIO: infixl 4 <$>
+ RIO: infixl 8 ^.
+ RIO: infixr 0 $!
+ RIO: infixr 1 >=>
+ RIO: infixr 2 ||
+ RIO: infixr 3 &&
+ RIO: infixr 5 ++
+ RIO: infixr 6 <>
+ RIO: infixr 8 ^^
+ RIO: infixr 9 .
+ RIO: isDenormalized :: RealFloat a => a -> Bool
+ RIO: isIEEE :: RealFloat a => a -> Bool
+ RIO: isInfinite :: RealFloat a => a -> Bool
+ RIO: isJust :: () => Maybe a -> Bool
+ RIO: isLeft :: () => Either a b -> Bool
+ RIO: isNaN :: RealFloat a => a -> Bool
+ RIO: isNegativeZero :: RealFloat a => a -> Bool
+ RIO: isNothing :: () => Maybe a -> Bool
+ RIO: isRight :: () => Either a b -> Bool
+ RIO: join :: Monad m => m m a -> m a
+ RIO: lcm :: Integral a => a -> a -> a
+ RIO: lefts :: () => [Either a b] -> [a]
+ RIO: length :: Foldable t => forall a. () => t a -> Int
+ RIO: lenientDecode :: OnDecodeError
+ RIO: lens :: () => (s -> a) -> (s -> b -> t) -> Lens s t a b
+ RIO: lift :: (MonadTrans t, Monad m) => m a -> t m a
+ RIO: liftA :: Applicative f => (a -> b) -> f a -> f b
+ RIO: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
+ RIO: liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
+ RIO: liftM :: Monad m => (a1 -> r) -> m a1 -> m r
+ RIO: liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
+ RIO: liftRIO :: (MonadIO m, MonadReader env m) => RIO env a -> m a
+ RIO: lines :: String -> [String]
+ RIO: listToMaybe :: () => [a] -> Maybe a
+ RIO: local :: MonadReader r m => forall a. () => (r -> r) -> m a -> m a
+ RIO: log :: Floating a => a -> a
+ RIO: logBase :: Floating a => a -> a -> a
+ RIO: lookup :: Eq a => a -> [(a, b)] -> Maybe b
+ RIO: many :: Alternative f => forall a. () => f a -> f [a]
+ RIO: map :: () => (a -> b) -> [a] -> [b]
+ RIO: mapLeft :: (a1 -> a2) -> Either a1 b -> Either a2 b
+ RIO: mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m t b
+ RIO: mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
+ RIO: mapMaybe :: () => (a -> Maybe b) -> [a] -> [b]
+ RIO: mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b]
+ RIO: mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
+ RIO: mappend :: Monoid a => a -> a -> a
+ RIO: max :: Ord a => a -> a -> a
+ RIO: maxBound :: Bounded a => a
+ RIO: maybe :: () => b -> (a -> b) -> Maybe a -> b
+ RIO: maybeToList :: () => Maybe a -> [a]
+ RIO: mconcat :: Monoid a => [a] -> a
+ RIO: mempty :: Monoid a => a
+ RIO: min :: Ord a => a -> a -> a
+ RIO: minBound :: Bounded a => a
+ RIO: mod :: Integral a => a -> a -> a
+ RIO: mplus :: MonadPlus m => m a -> m a -> m a
+ RIO: msum :: (Foldable t, MonadPlus m) => t m a -> m a
+ RIO: mzero :: MonadPlus m => m a
+ RIO: negate :: Num a => a -> a
+ RIO: newtype ReaderT k r (m :: k -> *) (a :: k) :: forall k. () => * -> (k -> *) -> k -> *
+ RIO: newtype All :: *
+ RIO: newtype Any :: *
+ RIO: newtype DisplayBuilder
+ RIO: newtype Endo a :: * -> *
+ RIO: newtype First a :: * -> *
+ RIO: newtype Last a :: * -> *
+ RIO: newtype Product a :: * -> *
+ RIO: newtype RIO env a
+ RIO: newtype Sum a :: * -> *
+ RIO: not :: Bool -> Bool
+ RIO: notElem :: (Foldable t, Eq a) => a -> t a -> Bool
+ RIO: nubOrd :: Ord a => [a] -> [a]
+ RIO: null :: Foldable t => forall a. () => t a -> Bool
+ RIO: odd :: Integral a => a -> Bool
+ RIO: on :: () => (b -> b -> c) -> (a -> b) -> a -> a -> c
+ RIO: optional :: Alternative f => f a -> f Maybe a
+ RIO: or :: Foldable t => t Bool -> Bool
+ RIO: otherwise :: Bool
+ RIO: over :: () => ASetter s t a b -> (a -> b) -> s -> t
+ RIO: partitionEithers :: () => [Either a b] -> ([a], [b])
+ RIO: pi :: Floating a => a
+ RIO: product :: Foldable t => forall a. Num a => t a -> a
+ RIO: properFraction :: (RealFrac a, Integral b) => a -> (b, a)
+ RIO: pure :: Applicative f => a -> f a
+ RIO: quot :: Integral a => a -> a -> a
+ RIO: quotRem :: Integral a => a -> a -> (a, a)
+ RIO: readFileBinary :: MonadIO m => FilePath -> m ByteString
+ RIO: readFileUtf8 :: MonadIO m => FilePath -> m Text
+ RIO: readMaybe :: Read a => String -> Maybe a
+ RIO: realToFrac :: (Real a, Fractional b) => a -> b
+ RIO: recip :: Fractional a => a -> a
+ RIO: rem :: Integral a => a -> a -> a
+ RIO: replicate :: () => Int -> a -> [a]
+ RIO: replicateM_ :: Applicative m => Int -> m a -> m ()
+ RIO: return :: Monad m => a -> m a
+ RIO: reverse :: () => [a] -> [a]
+ RIO: rights :: () => [Either a b] -> [b]
+ RIO: rnf :: NFData a => a -> ()
+ RIO: round :: (RealFrac a, Integral b) => a -> b
+ RIO: runRIO :: MonadIO m => env -> RIO env a -> m a
+ RIO: sappend :: Semigroup s => s -> s -> s
+ RIO: scaleFloat :: RealFloat a => Int -> a -> a
+ RIO: second :: Arrow a => forall b c d. () => a b c -> a (d, b) (d, c)
+ RIO: seq :: () => a -> b -> b
+ RIO: sequence :: (Traversable t, Monad m) => t m a -> m t a
+ RIO: sequenceA :: (Traversable t, Applicative f) => t f a -> f t a
+ RIO: sequenceA_ :: (Foldable t, Applicative f) => t f a -> f ()
+ RIO: sequence_ :: (Foldable t, Monad m) => t m a -> m ()
+ RIO: set :: () => ASetter s t a b -> b -> s -> t
+ RIO: sets :: () => ((a -> b) -> s -> t) -> ASetter s t a b
+ RIO: show :: Show a => a -> String
+ RIO: significand :: RealFloat a => a -> a
+ RIO: signum :: Num a => a -> a
+ RIO: sin :: Floating a => a -> a
+ RIO: sinh :: Floating a => a -> a
+ RIO: snd :: () => (a, b) -> b
+ RIO: some :: Alternative f => forall a. () => f a -> f [a]
+ RIO: span :: () => (a -> Bool) -> [a] -> ([a], [a])
+ RIO: sqrt :: Floating a => a -> a
+ RIO: stripCR :: Text -> Text
+ RIO: subtract :: Num a => a -> a -> a
+ RIO: sum :: Foldable t => forall a. Num a => t a -> a
+ RIO: take :: () => Int -> [a] -> [a]
+ RIO: takeWhile :: () => (a -> Bool) -> [a] -> [a]
+ RIO: tan :: Floating a => a -> a
+ RIO: tanh :: Floating a => a -> a
+ RIO: throwM :: (MonadThrow m, Exception e) => e -> m a
+ RIO: to :: () => (s -> a) -> SimpleGetter s a
+ RIO: toConstr :: Data a => a -> Constr
+ RIO: toInteger :: Integral a => a -> Integer
+ RIO: toList :: Foldable t => forall a. () => t a -> [a]
+ RIO: toRational :: Real a => a -> Rational
+ RIO: toShort :: ByteString -> ShortByteString
+ RIO: toStrictBytes :: LByteString -> ByteString
+ RIO: traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f t b
+ RIO: traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
+ RIO: truncate :: (RealFrac a, Integral b) => a -> b
+ RIO: tshow :: Show a => a -> Text
+ RIO: type Lens s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t
+ RIO: type ASetter s t a b = (a -> Identity b) -> s -> Identity t
+ RIO: type ASetter' s a = ASetter s s a a
+ RIO: type FilePath = String
+ RIO: type GVector = Vector
+ RIO: type SimpleGetter s a = forall r. () => Getting r s a
+ RIO: type HasCallStack = ?callStack :: CallStack
+ RIO: type LByteString = ByteString
+ RIO: type LText = Text
+ RIO: type Lens' s a = Lens s s a a
+ RIO: type Rational = Ratio Integer
+ RIO: type SVector = Vector
+ RIO: type String = [Char]
+ RIO: type UVector = Vector
+ RIO: uncurry :: () => (a -> b -> c) -> (a, b) -> c
+ RIO: undefined :: HasCallStack => a
+ RIO: unless :: Applicative f => Bool -> f () -> f ()
+ RIO: unlines :: [String] -> String
+ RIO: unwords :: [String] -> String
+ RIO: view :: MonadReader s m => Getting a s a -> m a
+ RIO: void :: Functor f => f a -> f ()
+ RIO: when :: Applicative f => Bool -> f () -> f ()
+ RIO: withLazyFile :: MonadUnliftIO m => FilePath -> (ByteString -> m a) -> m a
+ RIO: words :: String -> [String]
+ RIO: writeFileBinary :: MonadIO m => FilePath -> ByteString -> m ()
+ RIO: writeFileDisplayBuilder :: MonadIO m => FilePath -> DisplayBuilder -> m ()
+ RIO: writeFileUtf8 :: MonadIO m => FilePath -> Text -> m ()
+ RIO: zip :: () => [a] -> [b] -> [(a, b)]
+ RIO: zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
+ RIO: zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
+ RIO.ByteString: appendFile :: MonadIO m => FilePath -> ByteString -> m ()
+ RIO.ByteString: getContents :: MonadIO m => m ByteString
+ RIO.ByteString: getLine :: MonadIO m => m ByteString
+ RIO.ByteString: hGet :: MonadIO m => Handle -> Int -> m ByteString
+ RIO.ByteString: hGetContents :: MonadIO m => Handle -> m ByteString
+ RIO.ByteString: hGetLine :: MonadIO m => Handle -> m ByteString
+ RIO.ByteString: hGetNonBlocking :: MonadIO m => Handle -> Int -> m ByteString
+ RIO.ByteString: hGetSome :: MonadIO m => Handle -> Int -> m ByteString
+ RIO.ByteString: hPut :: MonadIO m => Handle -> ByteString -> m ()
+ RIO.ByteString: hPutNonBlocking :: MonadIO m => Handle -> ByteString -> m ByteString
+ RIO.ByteString: hPutStr :: MonadIO m => Handle -> ByteString -> m ()
+ RIO.ByteString: interact :: MonadIO m => (ByteString -> ByteString) -> m ()
+ RIO.ByteString: packCString :: MonadIO m => CString -> m ByteString
+ RIO.ByteString: packCStringLen :: MonadIO m => CStringLen -> m ByteString
+ RIO.ByteString: putStr :: MonadIO m => ByteString -> m ()
+ RIO.ByteString: readFile :: MonadIO m => FilePath -> m ByteString
+ RIO.ByteString: useAsCString :: MonadUnliftIO m => ByteString -> (CString -> m a) -> m a
+ RIO.ByteString: useAsCStringLen :: MonadUnliftIO m => ByteString -> (CStringLen -> m a) -> m a
+ RIO.ByteString: writeFile :: MonadIO m => FilePath -> ByteString -> m ()
+ RIO.Logger: data CallStack :: *
+ RIO.Logger: displayCallStack :: CallStack -> DisplayBuilder
+ RIO.Logger: logDebugS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogStr -> m ()
+ RIO.Logger: logErrorS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogStr -> m ()
+ RIO.Logger: logInfoS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogStr -> m ()
+ RIO.Logger: logWarnS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogStr -> m ()
+ RIO.Text: decodeUtf8' :: ByteString -> Either UnicodeException Text
+ RIO.Text: decodeUtf8With :: OnDecodeError -> ByteString -> Text
+ RIO.Text: encodeUtf8 :: Text -> ByteString
+ RIO.Text: lenientDecode :: OnDecodeError

Files

README.md view
@@ -4,19 +4,21 @@  ![Rio](https://camo.githubusercontent.com/fc162fb0024699c85f00eae769085a5fe528153e/68747470733a2f2f7777772e61687374617469632e636f6d2f70686f746f732f636974792f76692d76363837315f30305f31343030783434322e6a7067) +[![Build Status](https://travis-ci.org/commercialhaskell/rio.svg?branch=master)](https://travis-ci.org/commercialhaskell/rio) [![Build status](https://ci.appveyor.com/api/projects/status/n6935pmtlry77dmn?svg=true)](https://ci.appveyor.com/project/snoyberg/rio-21tpl)+ __NOTE__ This code is currently in prerelease status, and has been released as a tech preview. A number of us are actively working on improving the project and getting it to a useful first release. For more information, see the [description of goals](https://github.com/snoyberg/codename-karka#readme) and the-[issue tracker for discussions](https://github.com/snoyberg/codename-karka/issues). If+[issue tracker for discussions](https://github.com/commercialhaskell/rio/issues). If you're reading this file anywhere but Github, you should probably-[read the Github version instead](https://github.com/commercialhaskell/stack/tree/rio/subs/rio#readme),+[read the Github version instead](https://github.com/commercialhaskell/rio#readme), which will be more up to date. -The goal of the `rio` library is to help you jump start your Haskell-coding. It is intended as a cross between:+The goal of the `rio` library is to make it easier to adopt Haskell+for writing production software.  It is intended as a cross between:  * Collection of well designed, trusted libraries * Useful `Prelude` replacement@@ -28,7 +30,7 @@  ## Standard library -While GHC ships with a `base` library, as well as another of other+While GHC ships with a `base` library, as well as a number of other common packages like `directory` and `transformers`, there are large gaps in functionality provided by these libraries. This choice for a more minimalistic `base` is by design, but it leads to some@@ -85,14 +87,260 @@  ## Best practices -__NOTE__ There is no need to follow any best practices listed here-when using `rio`. However, in some cases, `rio` will make design-decisions towards optimizing for these use cases. And for Haskellers-looking for a set of best practices to follow: you've come to the-right place!+Below is a set of best practices we recommend following. You're+obviously free to take any, all, or none of this. Over time, these+will probably develop into much more extensive docs. Some of these+design decisions will be catered to by choices in the `rio` library. -For now, this is just a collection of links to existing best practices-documents. We'll expand in the future.+For Haskellers looking for a set of best practices to follow: you've+come to the right place! -* https://www.fpcomplete.com/blog/2017/07/the-rio-monad-* https://www.fpcomplete.com/blog/2016/11/exceptions-best-practices-haskell+### Import practices++This library is intended to provide a fully loaded set of basic+functionality. You should:++* Enable the `NoImplicitPrelude` language extension (see below)+* Add `import RIO` as your replacement prelude in all modules+* Use the `RIO.`-prefixed modules as necessary, imported using the+  recommended qualified names in the modules themselves. For example,+  `import qualified RIO.ByteString as B`. See the module documentation+  for more information.++__TODO__ In the future, we may have editor integration or external+tooling to help with import management. Also, see project template+comments below.++### Language extensions++Very few projects these days use bare-bones Haskell 98+or 2010. Instead, almost all codebases enable some set of additional+language extensions. Below is a list of extensions we recommend as a+good default, in that these are:++* Well accepted in the community+* Cause little to no code breakage versus leaving them off+* Are generally considered safe++Our recommended defaults are:++```+AutoDeriveTypeable+BangPatterns+BinaryLiterals+ConstraintKinds+DataKinds+DefaultSignatures+DeriveDataTypeable+DeriveFoldable+DeriveFunctor+DeriveGeneric+DeriveTraversable+DoAndIfThenElse+EmptyDataDecls+ExistentialQuantification+FlexibleContexts+FlexibleInstances+FunctionalDependencies+GADTs+GeneralizedNewtypeDeriving+InstanceSigs+KindSignatures+LambdaCase+MultiParamTypeClasses+MultiWayIf+NamedFieldPuns+NoImplicitPrelude+OverloadedStrings+PartialTypeSignatures+PatternGuards+PolyKinds+RankNTypes+RecordWildCards+ScopedTypeVariables+StandaloneDeriving+TupleSections+TypeFamilies+TypeSynonymInstances+ViewPatterns+```++Notes on some surprising choices:++* `RecordWildCards` is really up for debate. It's widely used, but+  rightfully considered by many to be dangerous. Open question about+  what we do with it.+* Despite the fact that `OverloadedStrings` can break existing code,+  we recommend its usage to encourage avoidance of the `String` data+  type. Also, for new code, the risk of breakage is much lower.++__TODO__ Do we recommend setting in `package.yaml` or in the source+files themselves? Need to discuss and come to a conclusion on this+point https://github.com/commercialhaskell/rio/issues/9++There are other language extensions which are perfectly fine to use as+well, but are not recommended to be turned on by default:++```+CPP+TemplateHaskell+ForeignFunctionInterface+MagicHash+UnliftedFFITypes+TypeOperators+UnboxedTuples+PackageImports+QuasiQuotes+DeriveAnyClass+DeriveLift+StaticPointers+```++### Monads++A primary design choice you'll need to make in your code is how to+structure your monads. There are many options out there, with various+trade-offs. Instead of going through all of the debates, we're going+to point to+[an existing blog post](https://www.fpcomplete.com/blog/2017/07/the-rio-monad),+and here just give recommendations.++* If your code is going to perform I/O: it should live in the `RIO`+  monad. `RIO` is "reader IO." It's the same as `ReaderT env IO`, but+  includes some helper functions in this library and leads to nicer+  type signatures and error messages.++* If you need to provide access to specific data to a function, do it+  via a typeclass constraint on the `env`, _not_ via a concrete+  env. For example, this is bad:++  ```haskell+  myFunction :: RIO Config Foo+  ```++  This is good:++  ```haskell+  class HasConfig env where+    configL :: Lens' env Config -- more on this in a moment+  myFunction :: HasConfig env => RIO env Foo+  ```++  Reason: by using typeclass constraints on the environment, we can+  easily compose multiple functions together and collect up the+  constraints, which wouldn't be possible with concrete+  environments. We _could_ go more general with mtl-style typeclasses,+  like `MonadReader` or `MonadHasConfig`, but `RIO` is a perfect+  balance point in the composability/concreteness space (see blog post+  above for more details).++* When defining `Has`-style typeclasses for the environments, we use+  lenses (which are exposed by `RIO`) because it provides for easy+  composability. We also leverage superclasses wherever possible. As+  an example of how this works in practice:++  ```haskell+  -- Defined in RIO.Logger+  class HasLogFunc env where+    logFuncL :: Lens' env LogFunc++  class HasConfig env where+    configL :: Lens' env Config+  instance HasConfig Config where+    configL = id++  data Env = Env { envLogFunc :: !LogFunc, envConfig :: !Config }+  class (HasLogFunc env, HasConfig env) => HasEnv Env where+    envL :: Lens' env Env+  instance HasLogFunc Env where+    logFuncL = lens envLogFunc (\x y -> x { envLogFunc = y })+  instance HasConfig Env where+    configL = lens envConfig (\x y -> x { envConfig = y })+  instance HasEnv Env where+    envL = id++  -- And then, at some other part of the code+  data SuperEnv = SuperEnv { seEnv :: !Env, seOtherStuff :: !OtherStuff }+  instance HasLogFunc SuperEnv where+    logFuncL = envL.logFuncL+  instance HasConfig SuperEnv where+    configL = envL.configL+  instance HasEnv SuperEnv where+    envL = lens seEnv (\x y -> x { seEnv = y })+  ```++  __TODO__ Open question: how do we decide when we use a `Lens'`+  versus just a `SimpleGetter` in these `Has` typeclasses?++* If you're writing code that you want to be usable outside of `RIO`+  for some reason, you should stick to the good mtl-style typeclasses:+  `MonadReader`, `MonadIO`, `MonadUnliftIO`, `MonadThrow`, and+  `PrimMonad`. It's better to use `MonadReader`+`Has` than to create+  new typeclasses like `MonadLogger`, though usually just sticking+  with the simpler `RIO env` is fine (and can easily be converted to+  the more general form with `liftRIO`). You should avoid using the+  following typeclasses (intentionally not exposed from this library):+  `MonadBase`, `MonadBaseControl`, `MonadCatch`, and `MonadMask`.++### Exceptions++For in-depth discussion, see+[exceptions best practices](https://www.fpcomplete.com/blog/2016/11/exceptions-best-practices-haskell). The+basic idea is:++* If something can fail, and you want people to deal with that failure+  every time (e.g., `lookup`), then return a `Maybe` or `Either`+  value.+* If the use will sometimes not want to deal with it, then use+  exceptions. In the case of pure code, use a `MonadThrow`+  constraint. In the case of `IO` code: use runtime exceptions via+  `throwIO` (works in the `RIO` monad too).+* You'll be upset and frustrated that you don't know exactly how some+  `IO` action can fail. Accept that pain, live with it, internalize+  it, use `tryAny`, and move on. It's the price we pay for async+  exceptions.+* Do all resource allocations with functions like `bracket` and+  `finally`.++### Strict data fields++Make data fields strict by default, unless you have a good reason to+do otherwise.++### Project template++__TODO__ In the future, we'll add a new Stack template for using this+library. We'll use hpack, not cabal files, and rely on automatic+exposed-module discovery.++### Safety first++This library intentionally puts safety first, and therefore avoids+promoting partial functions and lazy I/O. If you think you need lazy+I/O: you need a streaming data library like conduit instead.++__TODO__ Decide if we include a streaming data solution out of the+box. https://github.com/commercialhaskell/rio/issues/1++### When to generalize++A common question in Haskell code is when should you generalize. Here+are some simple guidelines. For parametric polymorphism: _almost+always_ generalize, it makes your type signatures more informative and+functions more useful. In other words, `reverse :: [a] -> [a]` is far+better than `reverse :: [Int] -> [Int]`.++When it comes to typeclasses: the story is more nuanced. For+typeclasses provided by `RIO`, like `Foldable` or `Traversable`, it's+generally a good thing to generalize to them when possible. The real+question is defining your own typeclasses. As a general rule: avoid+doing so as long as possible. And _if_ you define a typeclass: make+sure its usage can't lead to accidental bugs by allowing you to swap+in types you didn't expect.++__TODO__ Expand, clarify, examples.++### Coding style++__TODO__ Point to coding style guidelines, and discuss+[hindent](https://github.com/commercialhaskell/hindent).
rio.cabal view
@@ -2,13 +2,15 @@ -- -- see: https://github.com/sol/hpack ----- hash: 6f5f94c9a9942eb49d41fe626d7dcef89c14fdbcb66c411c71b9ec99e6705971+-- hash: b145872fb20aa54d9368a8b9e4e820734cd2407c637e85881fdb54f7bab1639b  name:           rio-version:        0.0.0.0+version:        0.0.1.0 synopsis:       A standard library for Haskell-description:    Work in progress library, see README at <https://github.com/commercialhaskell/stack/tree/rio/subs/rio#readme>+description:    Work in progress library, see README at <https://github.com/commercialhaskell/rio#readme> category:       Control+homepage:       https://github.com/commercialhaskell/rio#readme+bug-reports:    https://github.com/commercialhaskell/rio/issues author:         Michael Snoyman maintainer:     michael@snoyman.com license:        MIT@@ -20,11 +22,15 @@     ChangeLog.md     README.md +source-repository head+  type: git+  location: https://github.com/commercialhaskell/rio+ library   hs-source-dirs:       src/   build-depends:-      base <10+      base >=4.9 && <10     , bytestring     , containers     , deepseq
src/RIO.hs view
@@ -1,4 +1,5 @@-module RIO (module X) where+module RIO ( module RIO.Logger+           , module RIO.Prelude) where -import RIO.Prelude as X-import RIO.Logger as X+import RIO.Prelude+import RIO.Logger
src/RIO/ByteString.hs view
@@ -1,5 +1,89 @@+-- | Strict @ByteString@. Import as:+--+-- > import qualified RIO.ByteString as B+{-# LANGUAGE NoImplicitPrelude #-} module RIO.ByteString-  ( module X+  ( module Data.ByteString+  , module RIO.ByteString   ) where -import Data.ByteString as X+import Data.ByteString hiding (head, last, tail, init, foldl1, foldl1', foldr1, foldr1', maximum, minimum, findSubstring, findSubstrings, packCString, packCStringLen, useAsCString, useAsCStringLen, getLine, getContents, putStr, putStrLn, interact, readFile, writeFile, appendFile, hGetLine, hGetContents, hGet, hGetSome, hGetNonBlocking, hPut, hPutNonBlocking, hPutStr, hPutStrLn, breakByte)+import qualified Data.ByteString as B+import RIO.Prelude+import Foreign.C.String (CString, CStringLen)++-- | Lifted 'B.packCString'+packCString :: MonadIO m => CString -> m ByteString+packCString = liftIO . B.packCString++-- | Lifted 'B.packCStringLen'+packCStringLen :: MonadIO m => CStringLen -> m ByteString+packCStringLen = liftIO . B.packCStringLen++-- | Unlifted 'B.useAsCString'+useAsCString :: MonadUnliftIO m => ByteString -> (CString -> m a) -> m a+useAsCString bs inner = withRunInIO $ \run -> B.useAsCString bs $ run . inner++-- | Unlifted 'B.useAsCStringLen'+useAsCStringLen :: MonadUnliftIO m => ByteString -> (CStringLen -> m a) -> m a+useAsCStringLen bs inner = withRunInIO $ \run -> B.useAsCStringLen bs $ run . inner++-- | Lifted 'B.getLine'+getLine :: MonadIO m => m ByteString+getLine = liftIO B.getLine++-- | Lifted 'B.getContents'+getContents :: MonadIO m => m ByteString+getContents = liftIO B.getContents++-- | Lifted 'B.putStr'+putStr :: MonadIO m => ByteString -> m ()+putStr = liftIO . B.putStr++-- | Lifted 'B.interact'+interact :: MonadIO m => (ByteString -> ByteString) -> m ()+interact = liftIO . B.interact++-- | Lifted 'B.readFile'+readFile :: MonadIO m => FilePath -> m ByteString+readFile = liftIO . B.readFile++-- | Lifted 'B.writeFile'+writeFile :: MonadIO m => FilePath -> ByteString -> m ()+writeFile fp = liftIO . B.writeFile fp++-- | Lifted 'B.appendFile'+appendFile :: MonadIO m => FilePath -> ByteString -> m ()+appendFile fp = liftIO . B.appendFile fp++-- | Lifted 'B.hGetLine'+hGetLine :: MonadIO m => Handle -> m ByteString+hGetLine = liftIO . B.hGetLine++-- | Lifted 'B.hGetContents'+hGetContents :: MonadIO m => Handle -> m ByteString+hGetContents = liftIO . B.hGetContents++-- | Lifted 'B.hGet'+hGet :: MonadIO m => Handle -> Int -> m ByteString+hGet h = liftIO . B.hGet h++-- | Lifted 'B.hGetSome'+hGetSome :: MonadIO m => Handle -> Int -> m ByteString+hGetSome h = liftIO . B.hGetSome h++-- | Lifted 'B.hGetNonBlocking'+hGetNonBlocking :: MonadIO m => Handle -> Int -> m ByteString+hGetNonBlocking h = liftIO . B.hGetNonBlocking h++-- | Lifted 'B.hPut'+hPut :: MonadIO m => Handle -> ByteString -> m ()+hPut h = liftIO . B.hPut h++-- | Lifted 'B.hPutNonBlocking'+hPutNonBlocking :: MonadIO m => Handle -> ByteString -> m ByteString+hPutNonBlocking h = liftIO . B.hPutNonBlocking h++-- | Lifted 'B.hPutStr'+hPutStr :: MonadIO m => Handle -> ByteString -> m ()+hPutStr h = liftIO . B.hPutStr h
src/RIO/ByteString/Lazy.hs view
@@ -1,5 +1,5 @@ module RIO.ByteString.Lazy-  ( module X+  ( module Data.ByteString.Lazy   ) where -import Data.ByteString.Lazy as X+import Data.ByteString.Lazy
src/RIO/Directory.hs view
@@ -1,6 +1,5 @@--- FIXME lift/unlift functions module RIO.Directory-  ( module X+  ( module System.Directory   ) where -import System.Directory as X+import System.Directory
src/RIO/FilePath.hs view
@@ -1,5 +1,5 @@ module RIO.FilePath-  ( module X+  ( module System.FilePath   ) where -import System.FilePath as X+import System.FilePath
src/RIO/HashMap.hs view
@@ -1,5 +1,5 @@ module RIO.HashMap-  ( module X+  ( module Data.HashMap.Strict   ) where -import Data.HashMap.Strict as X+import Data.HashMap.Strict
src/RIO/HashSet.hs view
@@ -1,5 +1,5 @@ module RIO.HashSet-  ( module X+  ( module Data.HashSet   ) where -import Data.HashSet as X+import Data.HashSet
src/RIO/List.hs view
@@ -1,5 +1,5 @@ module RIO.List-  ( module X+  ( module Data.List   ) where -import Data.List as X+import Data.List
src/RIO/Logger.hs view
@@ -1,17 +1,21 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE ImplicitParams #-} {-# LANGUAGE NoImplicitPrelude #-} module RIO.Logger   ( LogLevel (..)   , LogSource   , LogStr   , LogFunc+  , CallStack   , HasLogFunc (..)   , logGeneric   , logDebug   , logInfo   , logWarn   , logError+  , logDebugS+  , logInfoS+  , logWarnS+  , logErrorS   , logOther   , logSticky   , logStickyDone@@ -19,6 +23,7 @@   , NoLogging (..)   , withStickyLogger   , LogOptions (..)+  , displayCallStack   ) where  import RIO.Prelude@@ -27,7 +32,7 @@ import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Reader (MonadReader, ReaderT, runReaderT) import Lens.Micro (to)-import GHC.Stack (HasCallStack, CallStack, SrcLoc (..), getCallStack)+import GHC.Stack (HasCallStack, CallStack, SrcLoc (..), getCallStack, callStack) import Data.Time import qualified Data.Text.IO as TIO import Data.ByteString.Builder (toLazyByteString, char7)@@ -54,7 +59,7 @@   -> m () logGeneric src level str = do   logFunc <- view logFuncL-  liftIO $ logFunc ?callStack src level str+  liftIO $ logFunc callStack src level str  logDebug   :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack)@@ -80,6 +85,34 @@   -> m () logError = logGeneric "" LevelError +logDebugS+  :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack)+  => LogSource+  -> LogStr+  -> m ()+logDebugS src = logGeneric src LevelDebug++logInfoS+  :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack)+  => LogSource+  -> LogStr+  -> m ()+logInfoS src = logGeneric src LevelInfo++logWarnS+  :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack)+  => LogSource+  -> LogStr+  -> m ()+logWarnS src = logGeneric src LevelWarn++logErrorS+  :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack)+  => LogSource+  -> LogStr+  -> m ()+logErrorS src = logGeneric src LevelError+ logOther   :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack)   => Text -- ^ level@@ -218,11 +251,11 @@     getLoc :: DisplayBuilder    getLoc-     | logVerboseFormat lo = ansi setBlack <> "\n@(" <> fileLocStr <> ")"+     | logVerboseFormat lo = ansi setBlack <> "\n@(" <> displayCallStack cs <> ")"      | otherwise = mempty -   fileLocStr :: DisplayBuilder-   fileLocStr =+displayCallStack :: CallStack -> DisplayBuilder+displayCallStack cs =      case reverse $ getCallStack cs of        [] -> "<no call stack found>"        (_desc, loc):_ ->
src/RIO/Map.hs view
@@ -1,5 +1,5 @@ module RIO.Map-  ( module X+  ( module Data.Map.Strict   ) where -import Data.Map.Strict as X+import Data.Map.Strict
src/RIO/Prelude.hs view
@@ -1,10 +1,14 @@+{-# LANGUAGE BangPatterns               #-}+{-# LANGUAGE CPP                        #-} {-# LANGUAGE ConstraintKinds            #-}+{-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE NoImplicitPrelude          #-} {-# LANGUAGE OverloadedStrings          #-} {-# LANGUAGE TypeSynonymInstances       #-} module RIO.Prelude-  ( mapLeft+  ( module UnliftIO+  , mapLeft   , withLazyFile   , fromFirst   , mapMaybeA@@ -16,6 +20,7 @@   , runRIO   , liftRIO   , tshow+  , nubOrd   , readFileBinary   , writeFileBinary   , ReadFileUtf8Exception (..)@@ -30,7 +35,6 @@   , UVector   , SVector   , GVector-  , module X   , DisplayBuilder (..)   , Display (..)   , displayShow@@ -39,105 +43,336 @@   , writeFileDisplayBuilder   , hPutBuilder   , sappend+  , Control.Applicative.Alternative+  , Control.Applicative.Applicative (..)+  , Control.Applicative.liftA+#if !MIN_VERSION_base(4, 10, 0)+  , Control.Applicative.liftA2+#endif+  , Control.Applicative.liftA3+  , Control.Applicative.many+  , Control.Applicative.optional+  , Control.Applicative.some+  , (Control.Applicative.<|>)+  , Control.Arrow.first+  , Control.Arrow.second+  , (Control.Arrow.&&&)+  , (Control.Arrow.***)+  , Control.DeepSeq.NFData(..)+  , Control.DeepSeq.force+  , (Control.DeepSeq.$!!)+  , Control.Monad.Monad(..)+  , Control.Monad.MonadPlus(..)+  , Control.Monad.filterM+  , Control.Monad.foldM+  , Control.Monad.foldM_+  , Control.Monad.forever+  , Control.Monad.guard+  , Control.Monad.join+  , Control.Monad.liftM+  , Control.Monad.liftM2+  , Control.Monad.replicateM_+  , Control.Monad.unless+  , Control.Monad.when+  , Control.Monad.zipWithM+  , Control.Monad.zipWithM_+  , (Control.Monad.<$!>)+  , (Control.Monad.<=<)+  , (Control.Monad.=<<)+  , (Control.Monad.>=>)+  , Control.Monad.Catch.MonadThrow(..)+  , Control.Monad.Reader.MonadReader+  , Control.Monad.Reader.MonadTrans(..)+  , Control.Monad.Reader.ReaderT(..)+  , Control.Monad.Reader.ask+  , Control.Monad.Reader.asks+  , Control.Monad.Reader.local+  , Data.Bool.Bool(..)+  , Data.Bool.not+  , Data.Bool.otherwise+  , (Data.Bool.&&)+  , (Data.Bool.||)+  , Data.ByteString.ByteString+  , Data.ByteString.Builder.Builder+  , Data.ByteString.Short.ShortByteString+  , Data.ByteString.Short.toShort+  , Data.ByteString.Short.fromShort+  , Data.Char.Char+  , Data.Data.Data(..)+  , Data.Either.Either(..)+  , Data.Either.either+  , Data.Either.isLeft+  , Data.Either.isRight+  , Data.Either.lefts+  , Data.Either.partitionEithers+  , Data.Either.rights+  , Data.Eq.Eq(..)+  , Data.Foldable.Foldable+  , Data.Foldable.all+  , Data.Foldable.and+  , Data.Foldable.any+  , Data.Foldable.asum+  , Data.Foldable.concat+  , Data.Foldable.concatMap+  , Data.Foldable.elem+  , Data.Foldable.fold+  , Data.Foldable.foldMap+  , Data.Foldable.foldl'+  , Data.Foldable.foldr+  , Data.Foldable.forM_+  , Data.Foldable.for_+  , Data.Foldable.length+  , Data.Foldable.mapM_+  , Data.Foldable.msum+  , Data.Foldable.notElem+  , Data.Foldable.null+  , Data.Foldable.or+  , Data.Foldable.product+  , Data.Foldable.sequenceA_+  , Data.Foldable.sequence_+  , Data.Foldable.sum+  , Data.Foldable.toList+  , Data.Foldable.traverse_+  , Data.Function.const+  , Data.Function.fix+  , Data.Function.flip+  , Data.Function.id+  , Data.Function.on+  , (Data.Function.$)+  , (Data.Function.&)+  , (Data.Function..)+  , Data.Functor.Functor(..)+  , Data.Functor.void+  , (Data.Functor.$>)+  , (Data.Functor.<$>)+  , Data.Hashable.Hashable+  , Data.HashMap.Strict.HashMap+  , Data.HashSet.HashSet+  , Data.Int.Int+  , Data.Int.Int8+  , Data.Int.Int16+  , Data.Int.Int32+  , Data.Int.Int64+  , Data.IntMap.Strict.IntMap+  , Data.IntSet.IntSet+  , Data.List.break+  , Data.List.drop+  , Data.List.dropWhile+  , Data.List.filter+  , Data.List.lines+  , Data.List.lookup+  , Data.List.map+  , Data.List.replicate+  , Data.List.reverse+  , Data.List.span+  , Data.List.take+  , Data.List.takeWhile+  , Data.List.unlines+  , Data.List.unwords+  , Data.List.words+  , Data.List.zip+  , (Data.List.++)+  , Data.Map.Strict.Map+  , Data.Maybe.Maybe(..)+  , Data.Maybe.catMaybes+  , Data.Maybe.fromMaybe+  , Data.Maybe.isJust+  , Data.Maybe.isNothing+  , Data.Maybe.listToMaybe+  , Data.Maybe.mapMaybe+  , Data.Maybe.maybe+  , Data.Maybe.maybeToList+  , Data.Monoid.All (..)+  , Data.Monoid.Any (..)+  , Data.Monoid.Endo (..)+  , Data.Monoid.First (..)+  , Data.Monoid.Last (..)+  , Data.Monoid.Monoid (..)+  , Data.Monoid.Product (..)+  , Data.Monoid.Sum (..)+  , (Data.Monoid.<>)+  , Data.Ord.Ord(..)+  , Data.Ord.Ordering(..)+  , Data.Ord.comparing+  , Data.Semigroup.Semigroup+  , Data.Set.Set+  , Data.String.IsString(..)+  , Data.Text.Text+  , Data.Text.Encoding.decodeUtf8'+  , Data.Text.Encoding.decodeUtf8With+  , Data.Text.Encoding.encodeUtf8+  , Data.Text.Encoding.encodeUtf8Builder+  , Data.Text.Encoding.Error.UnicodeException(..)+  , Data.Text.Encoding.Error.lenientDecode+  , Data.Traversable.Traversable(..)+  , Data.Traversable.for+  , Data.Traversable.forM+  , Data.Vector.Vector+  , Data.Void.Void+  , Data.Void.absurd+  , Data.Word.Word+  , Data.Word.Word8+  , Data.Word.Word16+  , Data.Word.Word32+  , Data.Word.Word64+  , Data.Word.byteSwap16+  , Data.Word.byteSwap32+  , Data.Word.byteSwap64+  , Foreign.Storable.Storable+  , GHC.Generics.Generic+  , GHC.Stack.HasCallStack+  , Lens.Micro.ASetter+  , Lens.Micro.ASetter'+  , Lens.Micro.Getting+  , Lens.Micro.Lens+  , Lens.Micro.Lens'+  , Lens.Micro.SimpleGetter+  , Lens.Micro.lens+  , Lens.Micro.over+  , Lens.Micro.set+  , Lens.Micro.sets+  , Lens.Micro.to+  , (Lens.Micro.^.)+  , Prelude.Bounded (..)+  , Prelude.Double+  , Prelude.Enum+  , Prelude.FilePath+  , Prelude.Float+  , Prelude.Floating (..)+  , Prelude.Fractional (..)+  , Prelude.IO+  , Prelude.Integer+  , Prelude.Integral (..)+  , Prelude.Num (..)+  , Prelude.Rational+  , Prelude.Real (..)+  , Prelude.RealFloat (..)+  , Prelude.RealFrac (..)+  , Prelude.Show+  , Prelude.String+  , Prelude.asTypeOf+  , Prelude.curry+  , Prelude.error+  , Prelude.even+  , Prelude.fromIntegral+  , Prelude.fst+  , Prelude.gcd+  , Prelude.lcm+  , Prelude.odd+  , Prelude.realToFrac+  , Prelude.seq+  , Prelude.show+  , Prelude.snd+  , Prelude.subtract+  , Prelude.uncurry+  , Prelude.undefined+  , (Prelude.$!)+  , (Prelude.^)+  , (Prelude.^^)+  , System.Exit.ExitCode(..)+  , Text.Read.Read+  , Text.Read.readMaybe+  -- List imports from UnliftIO?   ) where -import           Control.Applicative  as X (Alternative, Applicative (..),-                                            liftA, liftA2, liftA3, many,-                                            optional, some, (<|>))-import           Control.Arrow        as X (first, second, (&&&), (***))-import           Control.DeepSeq      as X (NFData (..), force, ($!!))-import           Control.Monad        as X (Monad (..), MonadPlus (..), filterM,-                                            foldM, foldM_, forever, guard, join,-                                            liftM, liftM2, replicateM_, unless,-                                            when, zipWithM, zipWithM_, (<$!>),-                                            (<=<), (=<<), (>=>))-import           Control.Monad.Catch  as X (MonadThrow (..))-import           Control.Monad.Reader as X (MonadReader, MonadTrans (..),-                                            ReaderT (..), ask, asks, local)-import           Data.Bool            as X (Bool (..), not, otherwise, (&&),-                                            (||))-import           Data.ByteString      as X (ByteString)-import           Data.ByteString.Builder as X (Builder)-import           Data.ByteString.Short as X (ShortByteString, toShort, fromShort)-import           Data.Char            as X (Char)-import           Data.Data            as X (Data (..))-import           Data.Either          as X (Either (..), either, isLeft,-                                            isRight, lefts, partitionEithers,-                                            rights)-import           Data.Eq              as X (Eq (..))-import           Data.Foldable        as X (Foldable, all, and, any, asum,-                                            concat, concatMap, elem, fold,-                                            foldMap, foldl', foldr, forM_, for_,-                                            length, mapM_, msum, notElem, null,-                                            or, product, sequenceA_, sequence_,-                                            sum, toList, traverse_)-import           Data.Function        as X (const, fix, flip, id, on, ($), (&),-                                            (.))-import           Data.Functor         as X (Functor (..), void, ($>), (<$),-                                            (<$>))-import           Data.Hashable        as X (Hashable)-import           Data.HashMap.Strict  as X (HashMap)-import           Data.HashSet         as X (HashSet)-import           Data.Int             as X-import           Data.IntMap.Strict   as X (IntMap)-import           Data.IntSet          as X (IntSet)-import           Data.List            as X (break, drop, dropWhile, filter,-                                            lines, lookup, map, replicate,-                                            reverse, span, take, takeWhile,-                                            unlines, unwords, words, zip, (++))-import           Data.Map.Strict      as X (Map)-import           Data.Maybe           as X (Maybe (..), catMaybes, fromMaybe,-                                            isJust, isNothing, listToMaybe,-                                            mapMaybe, maybe, maybeToList)-import           Data.Monoid          as X (All (..), Any (..), Endo (..),-                                            First (..), Last (..), Monoid (..),-                                            Product (..), Sum (..), (<>))-import           Data.Ord             as X (Ord (..), Ordering (..), comparing)-import           Data.Semigroup       as X (Semigroup)-import           Data.Set             as X (Set)-import           Data.String          as X (IsString (..))-import           Data.Text            as X (Text)-import           Data.Text.Encoding   as X (encodeUtf8, decodeUtf8', decodeUtf8With, encodeUtf8Builder)-import           Data.Text.Encoding.Error as X (lenientDecode, UnicodeException (..))-import           Data.Traversable     as X (Traversable (..), for, forM)-import           Data.Vector          as X (Vector)-import           Data.Void            as X (Void, absurd)-import           Data.Word            as X-import           Foreign.Storable     as X (Storable)-import           GHC.Generics         as X (Generic)-import           GHC.Stack            as X (HasCallStack)-import           Lens.Micro           as X (ASetter, ASetter', sets, over, set, SimpleGetter, Getting, (^.), to, Lens, Lens', lens)-import           Prelude              as X (Bounded (..), Double, Enum,-                                            FilePath, Float, Floating (..),-                                            Fractional (..), IO, Integer,-                                            Integral (..), Num (..), Rational,-                                            Real (..), RealFloat (..),-                                            RealFrac (..), Show, String,-                                            asTypeOf, curry, error, even,-                                            fromIntegral, fst, gcd, lcm, odd,-                                            realToFrac, seq, show, snd,-                                            subtract, uncurry, undefined, ($!),-                                            (^), (^^))-import           System.Exit          as X (ExitCode (..))-import           Text.Read            as X (Read, readMaybe)-import           UnliftIO             as X+-- Fixed imports go here+import           Control.Applicative      (Applicative)+import           Control.Monad            (Monad (..), liftM, (<=<))+import           Control.Monad.Catch      (MonadThrow)+import           Control.Monad.Reader     (MonadReader, ReaderT (..), ask, asks)+import           Data.Bool                (otherwise)+import           Data.ByteString          (ByteString)+import           Data.ByteString.Builder  (Builder)+import           Data.Either              (Either (..))+import           Data.Foldable            (foldMap)+import           Data.Function            (flip, ($), (.))+import           Data.Functor             (Functor (..))+import           Data.Int                 (Int)+import           Data.Maybe               (Maybe, catMaybes, fromMaybe)+import           Data.Monoid              (First (..), Monoid (..))+import           Data.Ord                 (Ord)+import           Data.Semigroup           (Semigroup)+import           Data.String              (IsString (..))+import           Data.Text                (Text)+import           Data.Text.Encoding       (decodeUtf8', decodeUtf8With,+                                           encodeUtf8, encodeUtf8Builder)+import           Data.Text.Encoding.Error (UnicodeException, lenientDecode)+import           Data.Traversable         (Traversable (..))+import           Lens.Micro               (Getting)+import           Prelude                  (FilePath, IO, Show (..))+import           UnliftIO+-- import           UnliftIO                 (Exception, Handle, IOMode (..),+--                                            MonadIO (..), MonadUnliftIO,+--                                            Typeable, UnliftIO (..), throwIO,+--                                            withBinaryFile, withUnliftIO) -import qualified Data.Text            as T-import qualified Data.Text.Lazy       as TL+import qualified Data.Text                as T+import qualified Data.Text.Lazy           as TL -import qualified Data.ByteString      as B-import qualified Data.ByteString.Lazy as BL+import qualified Data.ByteString          as B+import qualified Data.ByteString.Lazy     as BL -import qualified Data.Vector.Unboxed as UVector-import qualified Data.Vector.Storable as SVector-import qualified Data.Vector.Generic as GVector+import qualified Data.Vector.Generic      as GVector+import qualified Data.Vector.Storable     as SVector+import qualified Data.Vector.Unboxed      as UVector -import qualified Data.ByteString.Builder as BB+import qualified Data.ByteString.Builder  as BB import qualified Data.Semigroup -import Control.Applicative (Const (..))-import Lens.Micro.Internal ((#.))+import           Control.Applicative      (Const (..))+import           Lens.Micro.Internal      (( #. )) +import qualified Data.Set                 as Set++-- Reexports+import qualified Control.Applicative+import qualified Control.Arrow+import qualified Control.DeepSeq+import qualified Control.Monad+import qualified Control.Monad.Catch+import qualified Control.Monad.Reader+import qualified Data.Bool+import qualified Data.ByteString+import qualified Data.ByteString.Builder+import qualified Data.ByteString.Short+import qualified Data.Char+import qualified Data.Data+import qualified Data.Either+import qualified Data.Eq+import qualified Data.Foldable+import qualified Data.Function+import qualified Data.Functor+import qualified Data.Hashable+import qualified Data.HashMap.Strict+import qualified Data.HashSet+import qualified Data.Int+import qualified Data.IntMap.Strict+import qualified Data.IntSet+import qualified Data.List+import qualified Data.Map.Strict+import qualified Data.Maybe+import qualified Data.Monoid+import qualified Data.Ord+import qualified Data.Semigroup+import qualified Data.Set+import qualified Data.String+import qualified Data.Text+import qualified Data.Text.Encoding+import qualified Data.Text.Encoding.Error+import qualified Data.Traversable+import qualified Data.Vector+import qualified Data.Void+import qualified Data.Word+import qualified Foreign.Storable+import qualified GHC.Generics+import qualified GHC.Stack+import qualified Lens.Micro+import qualified Prelude+import qualified System.Exit+import qualified Text.Read+import qualified UnliftIO++ mapLeft :: (a1 -> a2) -> Either a1 b -> Either a2 b mapLeft f (Left a1) = Left (f a1) mapLeft _ (Right b) = Right b@@ -198,6 +433,15 @@ tshow :: Show a => a -> Text tshow = T.pack . show +nubOrd :: Ord a => [a] -> [a]+nubOrd =+  loop mempty+  where+    loop _ [] = []+    loop !s (a:as)+      | a `Set.member` s = loop s as+      | otherwise = a : loop (Set.insert a s) as+ -- | Same as 'B.readFile', but generalized to 'MonadIO' readFileBinary :: MonadIO m => FilePath -> m ByteString readFileBinary = liftIO . B.readFile@@ -212,7 +456,7 @@ readFileUtf8 fp = do   bs <- readFileBinary fp   case decodeUtf8' bs of-    Left e -> throwIO $ ReadFileUtf8Exception fp e+    Left e     -> throwIO $ ReadFileUtf8Exception fp e     Right text -> return text  data ReadFileUtf8Exception = ReadFileUtf8Exception !FilePath !UnicodeException
src/RIO/Set.hs view
@@ -1,5 +1,5 @@ module RIO.Set-  ( module X+  ( module Data.Set   ) where -import Data.Set as X+import Data.Set
src/RIO/Text.hs view
@@ -1,7 +1,11 @@ module RIO.Text-  ( module X+  ( module Data.Text+  , Data.Text.Encoding.encodeUtf8+  , Data.Text.Encoding.decodeUtf8With+  , Data.Text.Encoding.decodeUtf8'+  , Data.Text.Encoding.Error.lenientDecode   ) where -import Data.Text as X -- FIXME hide partials-import Data.Text.Encoding as X (encodeUtf8, decodeUtf8With, decodeUtf8')-import Data.Text.Encoding.Error as X (lenientDecode)+import           Data.Text -- FIXME hide partials+import qualified Data.Text.Encoding+import qualified Data.Text.Encoding.Error
src/RIO/Text/Lazy.hs view
@@ -1,5 +1,5 @@ module RIO.Text.Lazy-  ( module X+  ( module Data.Text.Lazy   ) where -import Data.Text.Lazy as X+import Data.Text.Lazy
src/RIO/Time.hs view
@@ -1,5 +1,5 @@ module RIO.Time-  ( module X+  ( module Data.Time   ) where -import Data.Time as X+import Data.Time
src/RIO/Vector.hs view
@@ -1,5 +1,5 @@ module RIO.Vector-  ( module X+  ( module Data.Vector.Generic   ) where -import Data.Vector.Generic as X+import Data.Vector.Generic
src/RIO/Vector/Boxed.hs view
@@ -1,5 +1,5 @@ module RIO.Vector.Boxed-  ( module X+  ( module Data.Vector   ) where -import Data.Vector as X+import Data.Vector
src/RIO/Vector/Storable.hs view
@@ -1,5 +1,5 @@ module RIO.Vector.Storable-  ( module X+  ( module Data.Vector.Storable   ) where -import Data.Vector.Storable as X+import Data.Vector.Storable
src/RIO/Vector/Unboxed.hs view
@@ -1,5 +1,5 @@ module RIO.Vector.Unboxed-  ( module X+  ( module Data.Vector.Unboxed   ) where -import Data.Vector.Unboxed as X+import Data.Vector.Unboxed