Skip to content

Instantly share code, notes, and snippets.

@Denommus
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save Denommus/75e0902cf7d97e4ccb8b to your computer and use it in GitHub Desktop.

Select an option

Save Denommus/75e0902cf7d97e4ccb8b to your computer and use it in GitHub Desktop.
Solves this problem: http://i.imgur.com/iEmwu7Y.png
import Control.Applicative
process :: [[[a]]] -> [[a]]
process [] = []
process [x] = x
process (x : xs) = (++) <$> x <*> process xs
main :: IO ()
main = putStrLn . show . process $ [[[3], [5]], [[1]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment