Created
March 28, 2016 22:19
-
-
Save prozacchiwawa/22b9605c732db2bb7e68 to your computer and use it in GitHub Desktop.
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 | |
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