Skip to content

Instantly share code, notes, and snippets.

@maticzav
Created July 10, 2016 09:30
Show Gist options
  • Save maticzav/f0b9177bf59d3efa44815167fd55cdf0 to your computer and use it in GitHub Desktop.
Save maticzav/f0b9177bf59d3efa44815167fd55cdf0 to your computer and use it in GitHub Desktop.
Flatten 2D list in Elm
import List exposing (..)
flatten2D : List (List a) -> List a
flatten2D list =
foldr (++) [] list
-- SAMPLE
flatten2D [[1,2],[3,4],[1,1]] == [1,2,3,4,1,1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment