ZVON > References > Haskell reference
| 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

Example 1

Input: break (3==) [1,2,3,4,5]

Output: ([1,2],[3,4,5])

Example 2

Input: break (1==) [1,2,3,4,5]

Output: ([],[1,2,3,4,5])

Example 3

Input: break (0==) [1,2,3,4,5]

Output: ([1,2,3,4,5],[])

Example 4

Input: break ('w'==) "hello - world"

Output: ("hello - ","world")