-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | ... -- -- ... @package bricks-internal @version 0.0.0.4 module Bricks.Internal.List -- |
--   >>> minimum [1,2,3]
--   Just 1
--   
-- --
--   >>> minimum []
--   Nothing
--   
minimum :: Ord a => [a] -> Maybe a -- |
--   >>> maximum [1,2,3]
--   Just 3
--   
-- --
--   >>> maximum []
--   Nothing
--   
maximum :: Ord a => [a] -> Maybe a module Bricks.Internal.Map -- | If s is a subset of the keys in m then -- --
--   m exactKeys s = Right (m `restrictKeys` s)
--   
-- -- Otherwise, m exactKeys s = Left s' where s' is the -- keys that are missing from m. -- --

Examples

-- --
--   >>> :{
--   
--   >>> fromList [('a', 1), ('b', 2), ('c', 3)]
--   
--   >>> `exactKeys` Set.fromList ['a', 'b']
--   
--   >>> :}
--   Right (fromList [('a',1),('b',2)])
--   
-- --
--   >>> :{
--   
--   >>> fromList [('a', 1), ('b', 2), ('c', 3)]
--   
--   >>> `exactKeys` Set.fromList ['a', 'x', 'y']
--   
--   >>> :}
--   Left (fromList "xy")
--   
exactKeys :: Ord k => Map k a -> Set k -> Either (Set k) (Map k a) -- | This function was added in containers version 0.5.8 which we're not -- using yet. restrictKeys :: Ord k => Map k a -> Set k -> Map k a module Bricks.Internal.Prelude (<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 <&> module Bricks.Internal.Seq -- | General-purpose finite sequences. data Seq a :: * -> * -- | O(1). Add an element to the left end of a sequence. Mnemonic: a -- triangle with the single element at the pointy end. (<|) :: () => a -> Seq a -> Seq a infixr 5 <| -- | O(1). Add an element to the right end of a sequence. Mnemonic: -- a triangle with the single element at the pointy end. (|>) :: () => Seq a -> a -> Seq a infixl 5 |> -- | O(log(min(i,n-i))). Update the element at the specified -- position. If the position is out of range, the original sequence is -- returned. adjust can lead to poor performance and even memory -- leaks, because it does not force the new value before installing it in -- the sequence. adjust' should usually be preferred. adjust :: () => (a -> a) -> Int -> Seq a -> Seq a -- |
--   >>> adjustLast (+ 1) (fromList [1, 2, 3])
--   fromList [1,2,4]
--   
-- --
--   >>> adjustLast (+ 1) empty
--   fromList []
--   
adjustLast :: (a -> a) -> Seq a -> Seq a -- | Alias for ><. append :: Seq a -> Seq a -> Seq a -- | fold specialized for Seq. concat :: Foldable f => f (Seq a) -> Seq a -- | Like concatMap, but for Seq. concatMap :: Foldable f => (a -> Seq b) -> f a -> Seq b -- | O(i) where i is the prefix length. dropWhileL -- p xs returns the suffix remaining after takeWhileL p -- xs. dropWhileL :: () => (a -> Bool) -> Seq a -> Seq a -- | O(i) where i is the suffix length. dropWhileR -- p xs returns the prefix remaining after takeWhileR p -- xs. -- -- dropWhileR p xs is equivalent to reverse -- (dropWhileL p (reverse xs)). dropWhileR :: () => (a -> Bool) -> Seq a -> Seq a -- | O(1). The empty sequence. empty :: () => Seq a -- | O(n). The filter function takes a predicate p -- and a sequence xs and returns a sequence of those elements -- which satisfy the predicate. filter :: () => (a -> Bool) -> Seq a -> Seq a -- | O(n). Create a sequence from a finite list of elements. There -- is a function toList in the opposite direction for all -- instances of the Foldable class, including Seq. fromList :: () => [a] -> Seq a -- | Like intersperse, but for Seq. intersperse :: a -> Seq a -> Seq a -- | O(1). The number of elements in the sequence. length :: () => Seq a -> Int -- | Specialization of fmap. map :: (a -> b) -> Seq a -> Seq b -- |
--   >>> minimum (fromList [1,2,3])
--   Just 1
--   
-- --
--   >>> minimum empty
--   Nothing
--   
minimum :: Ord a => Seq a -> Maybe a -- |
--   >>> maximum (fromList [1,2,3])
--   Just 3
--   
-- --
--   >>> maximum empty
--   Nothing
--   
maximum :: Ord a => Seq a -> Maybe a -- | O(1). Is this the empty sequence? null :: () => Seq a -> Bool -- | Specialization of toList for Seq. toList :: Seq a -> [a] trimWhile :: (a -> Bool) -> Seq a -> Seq a -- | O(1). A singleton sequence. singleton :: () => a -> Seq a module Bricks.Internal.Text -- | A space efficient, packed, unboxed Unicode text type. data Text :: * -- | O(n) all p t determines whether all -- characters in the Text t satisfy the predicate -- p. Subject to fusion. all :: (Char -> Bool) -> Text -> Bool -- | O(n) Appends one Text to the other by copying both of -- them into a new Text. Subject to fusion. append :: Text -> Text -> Text concat :: Foldable f => f Text -> Text concatMap :: Foldable f => (a -> Text) -> f a -> Text intercalate :: Foldable f => Text -> f Text -> Text intercalateMap :: (Foldable f, Functor f) => Text -> (a -> Text) -> f a -> Text -- | O(n) The isPrefixOf function takes two Texts and -- returns True iff the first is a prefix of the second. Subject -- to fusion. isPrefixOf :: Text -> Text -> Bool -- | O(n) The isSuffixOf function takes two Texts and -- returns True iff the first is a suffix of the second. isSuffixOf :: Text -> Text -> Bool -- | O(1) Tests whether a Text is empty or not. Subject to -- fusion. null :: Text -> Bool -- | O(n) Convert a String into a Text. Subject to -- fusion. Performs replacement on invalid scalar values. pack :: String -> Text -- | O(m+n) Replace every non-overlapping occurrence of -- needle in haystack with replacement. -- -- This function behaves as though it was defined as follows: -- --
--   replace needle replacement haystack =
--     intercalate replacement (splitOn needle haystack)
--   
-- -- As this suggests, each occurrence is replaced exactly once. So if -- needle occurs in replacement, that occurrence will -- not itself be replaced recursively: -- --
--   replace "oo" "foo" "oo" == "foo"
--   
-- -- In cases where several instances of needle overlap, only the -- first one will be replaced: -- --
--   replace "ofo" "bar" "ofofo" == "barfo"
--   
-- -- In (unlikely) bad cases, this function's time complexity degrades -- towards O(n*m). replace :: Text -> Text -> Text -> Text -- | O(n*m) replicate n t is a Text -- consisting of the input t repeated n times. replicate :: Int -> Text -> Text show :: Show a => a -> Text -- | O(1) Convert a character into a Text. Subject to fusion. -- Performs replacement on invalid scalar values. singleton :: Char -> Text -- | O(n) Convert a Text into a String. Subject to -- fusion. unpack :: Text -> String -- | O(n) Joins words using single space characters. unwords :: [Text] -> Text