Skip to content

Instantly share code, notes, and snippets.

@dwhitney
Last active February 13, 2019 19:20
Show Gist options
  • Save dwhitney/f7e8488025f517be7e6f05de85ade3b4 to your computer and use it in GitHub Desktop.
Save dwhitney/f7e8488025f517be7e6f05de85ade3b4 to your computer and use it in GitHub Desktop.
module Main where
import Prelude
import Data.Array (range) as Array
import Data.Traversable (traverse)
import Effect.Aff (Aff)
combineABunchOfArrays :: Aff (Array Int)
combineABunchOfArrays =
traverse makeArray (Array.range 0 10) # map join
combineABunchOfArrays2 :: Aff (Array Int)
combineABunchOfArrays2 =
join <$> traverse makeArray (Array.range 0 10)
makeArray :: Int -> Aff (Array Int)
makeArray num = pure $ Array.range 0 num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment