take -filepath -bytestring

take :: Int -> [a] -> [a]
base Prelude, base Data.List
take n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs: > take 5 "Hello World!" == "Hello" > take 3 [1,2,3,4,5] == [1,2,3] > take 3 [1,2] == [1,2] > take 3 [] == [] > take (-1) [1,2] == [] > take 0 [1,2] == [] It is an instance of the more general Data.List.genericTake, in which n may be of any integral type.
take :: Int -> Seq a -> Seq a
containers Data.Sequence
O(log(min(i,n-i))). The first i elements of a sequence. If i is negative, take i s yields the empty sequence. If the sequence contains fewer than i elements, the whole sequence is returned.
take :: Int -> Text -> Text
text Data.Text
O(n) take n, applied to a Text, returns the prefix of the Text of length n, or the Text itself if n is greater than the length of the Text. Subject to fusion.
take :: Int64 -> Text -> Text
text Data.Text.Lazy
O(n) take n, applied to a Text, returns the prefix of the Text of length n, or the Text itself if n is greater than the length of the Text. Subject to fusion.
takeWhile :: (a -> Bool) -> [a] -> [a]
base Prelude, base Data.List
takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p: > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] > takeWhile (< 9) [1,2,3] == [1,2,3] > takeWhile (< 0) [1,2,3] == []
takeMVar :: MVar a -> IO a
base Control.Concurrent.MVar
Return the contents of the MVar. If the MVar is currently empty, takeMVar will wait until it is full. After a takeMVar, the MVar is left empty. There are two further important properties of takeMVar: * takeMVar is single-wakeup. That is, if there are multiple threads blocked in takeMVar, and the MVar becomes full, only one thread will be woken up. The runtime guarantees that the woken thread completes its takeMVar operation. * When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.
takeInput :: [(String, String)] -> ByteString -> ByteString
cgi Network.CGI.Protocol
Takes the right number of bytes from the input.
takeTMVar :: TMVar a -> STM a
stm Control.Concurrent.STM.TMVar
Return the contents of the TMVar. If the TMVar is currently empty, the transaction will retry. After a takeTMVar, the TMVar is left empty.
takeWhile :: (Char -> Bool) -> Text -> Text
text Data.Text, text Data.Text.Lazy
O(n) takeWhile, applied to a predicate p and a Text, returns the longest prefix (possibly empty) of elements that satisfy p. Subject to fusion.
takeWhileL :: (a -> Bool) -> Seq a -> Seq a
containers Data.Sequence
O(i) applied to a predicate p and a sequence xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.
takeWhileR :: (a -> Bool) -> Seq a -> Seq a
containers Data.Sequence
O(i) applied to a predicate p and a sequence xs, returns the longest suffix (possibly empty) of xs of elements that satisfy p. takeWhileR p xs is equivalent to reverse (takeWhileL p (reverse xs)).
takeWord16 :: I16 -> Text -> Text
text Data.Text.Foreign
O(1) Return the prefix of the Text of n Word16 units in length. If n would cause the Text to end inside a surrogate pair, the end of the prefix will be advanced by one additional Word16 unit to maintain its validity.
takeWord16 :: Int -> Text -> Text
text Data.Text.Unsafe
O(1) Unchecked take of k Word16s from the front of a Text.
genericTake :: Integral i => i -> [a] -> [a]
base Data.List
The genericTake function is an overloaded version of take, which accepts any Integral value as the number of elements to take.
tryTakeMVar :: MVar a -> IO (Maybe a)
base Control.Concurrent.MVar
A non-blocking version of takeMVar. The tryTakeMVar function returns immediately, with Nothing if the MVar was empty, or Just a if the MVar was full with contents a. After tryTakeMVar, the MVar is left empty.
tryTakeTMVar :: TMVar a -> STM (Maybe a)
stm Control.Concurrent.STM.TMVar
A version of takeTMVar that does not retry. The tryTakeTMVar function returns Nothing if the TMVar was empty, or Just a if the TMVar was full with contents a. After tryTakeTMVar, the TMVar is left empty.