Created
March 20, 2017 13:47
-
-
Save jaketrent/df13653b7471bc63bdb5f1f32ad04c81 to your computer and use it in GitHub Desktop.
A headless Elm program
This file contains 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 exposing (..) | |
import MyProgram exposing (print) | |
import Platform exposing (program) | |
nodeProgram : a -> Program Never () () | |
nodeProgram _ = | |
program | |
{ init = ( (), Cmd.none ) | |
, update = \() -> \() -> ( (), Cmd.none ) | |
, subscriptions = \() -> Sub.none | |
} | |
main : Program Never () () | |
main = | |
nodeProgram (print 9) |
This file contains 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 MyProgram exposing (..) | |
print : Int -> Int | |
print num = | |
Debug.log "num of destiny" num |
This file contains 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
elm make --output main.js *.elm | |
node main.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment