Skip to content

Instantly share code, notes, and snippets.

@prozacchiwawa
Created March 28, 2016 22:19
Show Gist options
  • Save prozacchiwawa/22b9605c732db2bb7e68 to your computer and use it in GitHub Desktop.
Save prozacchiwawa/22b9605c732db2bb7e68 to your computer and use it in GitHub Desktop.
module Main where
import Prelude
import Control.Monad.Eff
import Control.Monad.Eff.Console
import qualified Data.String as String
import qualified Node.Process as Process
doWithArgv :: forall e. (Array String -> Eff (process :: Process.PROCESS | e) Unit) -> Eff (process :: Process.PROCESS | e) Unit
doWithArgv f = do
args <- Process.argv
(f args)
return unit
printSplitArgs :: forall e. Array String -> Eff (console :: CONSOLE | e) Unit
printSplitArgs argv = do
print (String.joinWith "," argv)
main :: forall e. Eff (console :: CONSOLE, process :: Process.PROCESS | e) Unit
main = do
doWithArgv printSplitArgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment