Skip to content

Instantly share code, notes, and snippets.

@GNSubrahmanyam
Created October 25, 2017 12:52
Show Gist options
  • Select an option

  • Save GNSubrahmanyam/7ee044d81d4cf4c4277631dbc592f3b5 to your computer and use it in GitHub Desktop.

Select an option

Save GNSubrahmanyam/7ee044d81d4cf4c4277631dbc592f3b5 to your computer and use it in GitHub Desktop.
Purescript Array
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Data.Show
import Data.Maybe
import Data.Array
import Control.Monad.Eff.Console (log, CONSOLE, logShow)
import Data.Foldable (fold)
array = [[2,3,4],[1,5,6]]
arrayUpdated = concat array
main = do
logShow $ fromMaybe 0 (arrayUpdated !! 0) --(Just [2,3,4])
logShow $ fromMaybe [1] (array !! 0) --(Just [1,5,6])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment