[q] -> [r] -> [(q, r)]

zip :: [a] -> [b] -> [(a, b)]
base Prelude, base Data.List
zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.
(>*<) :: Monoidal f => f a -> f b -> f (a, b)
bytestring Data.ByteString.Builder.Prim
A pairing/concatenation operator for builder primitives, both bounded and fixed size. For example, > toLazyByteString (primFixed (char7 >*< char7) ('x','y')) = "xy" We can combine multiple primitives using >*< multiple times. > toLazyByteString (primFixed (char7 >*< char7 >*< char7) ('x',('y','z'))) = "xyz"
shrinkState :: ShrinkState s a => a -> s -> [(a, s)]
QuickCheck Test.QuickCheck.Modifiers, QuickCheck Test.QuickCheck
breakOnAll :: Text -> Text -> [(Text, Text)]
text Data.Text
O(n+m) Find all non-overlapping instances of needle in haystack. Each element of the returned list consists of a pair: * The entire string prior to the kth match (i.e. the prefix) * The kth match, followed by the remainder of the string Examples: > breakOnAll "::" "" > ==> [] > breakOnAll "/" "a/b/c/" > ==> [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")] In (unlikely) bad cases, this function's time complexity degrades towards O(n*m). The needle parameter may not be empty.
breakOnAll :: Text -> Text -> [(Text, Text)]
text Data.Text.Lazy
O(n+m) Find all non-overlapping instances of needle in haystack. Each element of the returned list consists of a pair: * The entire string prior to the kth match (i.e. the prefix) * The kth match, followed by the remainder of the string Examples: > breakOnAll "::" "" > ==> [] > breakOnAll "/" "a/b/c/" > ==> [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")] This function is strict in its first argument, and lazy in its second. In (unlikely) bad cases, this function's time complexity degrades towards O(n*m). The needle parameter may not be empty.
genLNodes :: Enum a => a -> Int -> [LNode a]
fgl Data.Graph.Inductive.Example
generate list of labeled nodes
gmapAccumT :: Data d => (forall e. Data e => a -> e -> (a, e)) -> a -> d -> (a, d)
syb Data.Generics.Twins
gmapT with accumulation
threadList :: (Collect r c) -> (Split t i r) -> [i] -> t -> (c, t)
fgl Data.Graph.Inductive.Internal.Thread
threadList' :: (Collect r c) -> (Split t i r) -> [i] -> t -> (c, t)
fgl Data.Graph.Inductive.Internal.Thread
mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Lazy
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString.
mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.
mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.
mapAccumL :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Lazy.Char8
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString.
mapAccumL :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Char8
The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.
mapAccumR :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)
bytestring Data.ByteString.Char8, bytestring Data.ByteString.Lazy.Char8
The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.
mapAccumL :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
text Data.Text, text Data.Text.Lazy
O(n) Like a combination of map and foldl'. Applies a function to each element of a Text, passing an accumulating parameter from left to right, and returns a final Text. Performs replacement on invalid scalar values.
mapAccumR :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
text Data.Text, text Data.Text.Lazy
The mapAccumR function behaves like a combination of map and a strict foldr; it applies a function to each element of a Text, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new Text. Performs replacement on invalid scalar values.
execRWS :: RWS r w s a -> r -> s -> (s, w)
transformers Control.Monad.Trans.RWS.Lazy, transformers Control.Monad.Trans.RWS.Strict, mtl Control.Monad.RWS.Lazy, mtl Control.Monad.RWS.Strict
Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.
breakSubstring :: ByteString -> ByteString -> (ByteString, ByteString)
bytestring Data.ByteString, bytestring Data.ByteString.Char8
otherwise -> Just (length x) </pre> For example, to tokenise a string, dropping delimiters: > tokenise x y = h (:) if null t then [] else tokenise x (drop (length x) t) > To skip to the first occurence of a string: > snd (breakSubstring x y) To take the parts of a string before a delimiter: > fst (breakSubstring x y)
breakOn :: Text -> Text -> (Text, Text)
text Data.Text
O(n+m) Find the first instance of needle (which must be non-null) in haystack. The first element of the returned tuple is the prefix of haystack before needle is matched. The second is the remainder of haystack, starting with the match. Examples: > breakOn "::" "a::b::c" ==> ("a", "::b::c") > breakOn "/" "foobar" ==> ("foobar", "") Laws: > append prefix match == haystack > If you need to break a string by a substring repeatedly (e.g. you want to break on every instance of a substring), use breakOnAll instead, as it has lower startup overhead. In (unlikely) bad cases, this function's time complexity degrades towards O(n*m).

Show more results