Created
October 25, 2017 12:52
-
-
Save GNSubrahmanyam/7ee044d81d4cf4c4277631dbc592f3b5 to your computer and use it in GitHub Desktop.
Purescript Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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