ZVON > References > Haskell reference |
Intro / Search / ZVON |
| Indexes | Syntax | >> Prelude << | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random |
Module: | Prelude |
---|---|
Function: | break |
Type: | (a -> Bool) -> [a] -> ([a],[a]) |
Description: | creates a tuple of two lists from the original one separated at condition boundary |
Related: | splitAt |
Keywords: | list construction, split, tuple |
Input: break (3==) [1,2,3,4,5]
Output: ([1,2],[3,4,5])
Input: break (1==) [1,2,3,4,5]
Output: ([],[1,2,3,4,5])
Input: break (0==) [1,2,3,4,5]
Output: ([1,2,3,4,5],[])
Input: break ('w'==) "hello - world"
Output: ("hello - ","world")