What about:
[ (x,y) | (x:rest) <- tails xs , y <- rest ]
More Related Contents:
- Haskell, tuple (double, string) [closed]
- Haskell: moving image on horizontal line
- Applicatives compose, monads don’t
- Is there a Haskell idiom for updating a nested data structure?
- How do you represent a graph in Haskell?
- How do functors work in haskell?
- Large-scale design in Haskell? [closed]
- How to compare two functions for equivalence, as in (λx.2*x) == (λx.x+x)?
- What are “n+k patterns” and why are they banned from Haskell 2010?
- Should do-notation be avoided in Haskell?
- Applicative functor evaluation is not clear to me
- What constitutes a fold for types other than list?
- Ordering of parameters to make use of currying
- Why is lazy evaluation useful?
- Pattern matching identical values
- What is a monad?
- How to use (->) instances of Monad and confusion about (->)
- Why are side-effects modeled as monads in Haskell?
- Abusing the algebra of algebraic data types – why does this work?
- How to interpret bind/>>= of the function instance?
- What’s the status of multicore programming in Haskell?
- What does “pure” mean in “pure functional language”?
- Implement zip using foldr
- How to enumerate a recursive datatype in Haskell?
- Functional lenses
- Why does OCaml sometimes require eta expansion?
- How to compare two functions for extensional equivalence, as in (λx.2*x) == (λx.x+x)?
- Explanation of “tying the knot”
- ‘some’ and ‘many’ functions from the ‘Alternative’ type class [duplicate]
- Sampling sequences of random numbers in Haskell