span

span :: (a -> Bool) -> [a] -> ([a], [a])
base Prelude, base Data.List
span, applied to a predicate p and a list xs, returns a tuple of xs of elements that satisfy p and second element is the remainder of the list: > span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4]) > span (< 9) [1,2,3] == ([1,2,3],[]) > span (< 0) [1,2,3] == ([],[1,2,3]) span p xs is equivalent to (takeWhile p xs, dropWhile p xs)
span :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)
bytestring Data.ByteString.Char8, bytestring Data.ByteString.Lazy.Char8
span p xs breaks the ByteString into two segments. It is equivalent to (takeWhile p xs, dropWhile p xs)
span :: (Char -> Bool) -> Text -> (Text, Text)
text Data.Text, text Data.Text.Lazy
O(n) span, applied to a predicate p and text t, returns a pair whose first element is the longest prefix (possibly empty) of t of elements that satisfy p, and whose second is the remainder of the list.
span :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
span p xs breaks the ByteString into two segments. It is equivalent to (takeWhile p xs, dropWhile p xs)
spanEnd :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)
bytestring Data.ByteString.Char8
spanEnd behaves like span but from the end of the ByteString. We have > spanEnd (not.isSpace) "x y z" == ("x y ","z") and > spanEnd (not . isSpace) ps > == > let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x)
spanEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
bytestring Data.ByteString
spanEnd behaves like span but from the end of the ByteString. We have > spanEnd (not.isSpace) "x y z" == ("x y ","z") and > spanEnd (not . isSpace) ps > == > let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x)
spanl :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
containers Data.Sequence
O(i) to a predicate p and a sequence xs, returns a pair whose first element is the longest prefix (possibly empty) of xs of elements that satisfy p and the second element is the remainder of the sequence.
spanr :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
containers Data.Sequence
O(i) to a predicate p and a sequence xs, returns a pair whose first element is the longest suffix (possibly empty) of xs of elements that satisfy p and the second element is the remainder of the sequence.
buf_span :: BufferOp a -> (Char -> Bool) -> a -> (a, a)
HTTP Network.BufferType
colspan :: Int -> HtmlAttr
html Text.Html, xhtml Text.XHtml.Strict, xhtml Text.XHtml.Frameset, xhtml Text.XHtml.Transitional
rowspan :: Int -> HtmlAttr
html Text.Html, xhtml Text.XHtml.Strict, xhtml Text.XHtml.Frameset, xhtml Text.XHtml.Transitional
thespan :: Html -> Html
html Text.Html, xhtml Text.XHtml.Strict, xhtml Text.XHtml.Frameset, xhtml Text.XHtml.Transitional