Yes, it’s concat
from the Standard Prelude, given by
concat :: [[a]] -> [a]
concat xss = foldr (++) [] xss
If you want to turn [[[a]]]
into [a]
, you must use it twice:
Prelude> (concat . concat) [[[1,2],[3]],[[4]]]
[1,2,3,4]
More Related Contents:
- Haskell finding mean of cubes of odd members Any ideas? [closed]
- Histogram in Haskell [closed]
- What is Haskell’s Stream Fusion
- Using return vs. not using return in the list monad
- Cartesian product of infinite lists in Haskell
- Decrementing ranges in Haskell
- Zip with default value instead of dropping values?
- Replace individual list elements in Haskell?
- Using Haskell’s map function to calculate the sum of a list
- Need to partition a list into lists based on breaks in ascending order of elements (Haskell)
- Merging two lists in Haskell
- Haskell Monad – How does Monad on list work?
- Understanding a recursively defined list (fibs in terms of zipWith)
- Removing duplicates from a list in Haskell without elem
- Removing syntactic sugar: List comprehension in Haskell
- Counting unique elements in a list
- Unsequence Monad function within Haskell
- Grouping a list into lists of n elements in Haskell
- Concatenating two lists – difference between ‘+=’ and extend()
- How to check if all of the following items are in a list?
- Subsets in Prolog
- Java 8: sort list of objects by attribute without custom comparator
- Lazy lists in Prolog?
- How do I split or chunk a list into equal parts, with Dart?
- Python: create a pandas data frame from a list
- How to extend a Scala list to enable slicing not by explicit position but by given predicate/condition
- R: Print list to a text file
- Add or remove an entry from a List type attribute in a DynamoDB table item
- How to count items’ occurence in a List
- Prolog, find minimum in a list