split

splitAt :: Int -> [a] -> ([a], [a])
base Prelude, base Data.List
splitAt n xs returns a tuple xs prefix of length n and second element is the remainder of the list: > splitAt 6 "Hello World!" == ("Hello ","World!") > splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5]) > splitAt 1 [1,2,3] == ([1],[2,3]) > splitAt 3 [1,2,3] == ([1,2,3],[]) > splitAt 4 [1,2,3] == ([1,2,3],[]) > splitAt 0 [1,2,3] == ([],[1,2,3]) > splitAt (-1) [1,2,3] == ([],[1,2,3]) It is equivalent to (take n xs, drop n xs). splitAt is an instance of the more general Data.List.genericSplitAt, in which n may be of any integral type.
splitTyConApp :: TypeRep -> (TyCon, [TypeRep])
base Data.Typeable
Splits a type constructor application
type Split t i r = i -> t -> (r, t)
fgl Data.Graph.Inductive.Internal.Thread
split :: (Char -> Bool) -> Text -> [Text]
text Data.Text
O(n) Splits a Text into components delimited by separators, The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg. > split (=='a') "aabbaca" == ["","","bb","c",""] > split (=='a') "" == [""]
split :: (Char -> Bool) -> Text -> [Text]
text Data.Text.Lazy
O(n) Splits a Text into components delimited by separators, The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg. > split (=='a') "aabbaca" == ["","","bb","c",""] > split (=='a') [] == [""]
split :: Char -> ByteString -> [ByteString]
bytestring Data.ByteString.Char8
O(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e. > split '\n' "a\nb\nd\ne" == ["a","b","d","e"] > split 'a' "aXaXaXa" == ["","X","X","X",""] > split 'x' "x" == ["",""] and > intercalate [c] . split c == id > split == splitWith . (==) As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original.
split :: Char -> ByteString -> [ByteString]
bytestring Data.ByteString.Lazy.Char8
O(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e. > split '\n' "a\nb\nd\ne" == ["a","b","d","e"] > split 'a' "aXaXaXa" == ["","X","X","X"] > split 'x' "x" == ["",""] and > intercalate [c] . split c == id > split == splitWith . (==) As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original.
split :: Int -> IntSet -> (IntSet, IntSet)
containers Data.IntSet
O(min(n,W)). The expression (split x set) is a pair (set1,set2) of set less than x and set2 comprises the elements of set greater than x. > split 3 (fromList [1..5]) == (fromList [1,2], fromList [4,5])
split :: Key -> IntMap a -> (IntMap a, IntMap a)
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(min(n,W)). The expression (split k map) is a pair (map1,map2) than k and all keys in map2 larger than k. Any key equal to k is found in neither map1 nor map2. > split 2 (fromList [(5,"a"), (3,"b")]) == (empty, fromList [(3,"b"), (5,"a")]) > split 3 (fromList [(5,"a"), (3,"b")]) == (empty, singleton 5 "a") > split 4 (fromList [(5,"a"), (3,"b")]) == (singleton 3 "b", singleton 5 "a") > split 5 (fromList [(5,"a"), (3,"b")]) == (singleton 3 "b", empty) > split 6 (fromList [(5,"a"), (3,"b")]) == (fromList [(3,"b"), (5,"a")], empty)
split :: Type -> (Type, [Type])
template-haskell Language.Haskell.TH.Ppr
split :: Word8 -> ByteString -> [ByteString]
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
O(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e. > split '\n' "a\nb\nd\ne" == ["a","b","d","e"] > split 'a' "aXaXaXa" == ["","X","X","X",""] > split 'x' "x" == ["",""] and > intercalate [c] . split c == id > split == splitWith . (==) As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original.
split :: Ord a => a -> Set a -> (Set a, Set a)
containers Data.Set
O(log n). The expression (split x set) is a pair (set1,set2) of set less than x and set2 comprises the elements of set greater than x.
split :: Ord k => k -> Map k a -> (Map k a, Map k a)
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). The expression (split k map) is a pair (map1,map2) than k and the keys in map2 larger than k. Any key equal to k is found in neither map1 nor map2. > split 2 (fromList [(5,"a"), (3,"b")]) == (empty, fromList [(3,"b"), (5,"a")]) > split 3 (fromList [(5,"a"), (3,"b")]) == (empty, singleton 5 "a") > split 4 (fromList [(5,"a"), (3,"b")]) == (singleton 3 "b", singleton 5 "a") > split 5 (fromList [(5,"a"), (3,"b")]) == (singleton 3 "b", empty) > split 6 (fromList [(5,"a"), (3,"b")]) == (fromList [(3,"b"), (5,"a")], empty)
split :: RandomGen g => g -> (g, g)
random System.Random
package split
package
Combinator library and utility functions for splitting lists. Version 0.1.4.2
package split-record
package
Split a big audio file into pieces at positions of silence Version 0.1.1
splitAt :: Int -> ByteString -> (ByteString, ByteString)
bytestring Data.ByteString, bytestring Data.ByteString.Char8
O(1) splitAt n xs is equivalent to (take n xs, drop n xs).
splitAt :: Int -> Seq a -> (Seq a, Seq a)
containers Data.Sequence
O(log(min(i,n-i))). Split a sequence at a given position. splitAt i s = (take i s, drop i s).
splitAt :: Int -> Text -> (Text, Text)
text Data.Text
O(n) splitAt n t returns a pair whose first element is a prefix of t of length n, and whose second is the remainder of the string. It is equivalent to (take n t, drop n t).
splitAt :: Int64 -> ByteString -> (ByteString, ByteString)
bytestring Data.ByteString.Lazy, bytestring Data.ByteString.Lazy.Char8
O(n\c)/ splitAt n xs is equivalent to (take n xs, drop n xs).

Show more results