Skip to content

Instantly share code, notes, and snippets.

@jaketrent

jaketrent/Main.elm

Created Mar 20, 2017
Embed
What would you like to do?
A headless Elm program
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)
module MyProgram exposing (..)
print : Int -> Int
print num =
Debug.log "num of destiny" num
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