avh4 / elm-desktop-app / DesktopApp

This module lets you write desktop applications (for Mac, Linux, and Windows) in Elm. You must use the elm-desktop-app command line tool to build your program. (DesktopApp.program will do nothing if you try to use it in a web browser.)

See the README for an example of how to set up and build your application.

program : { init : ( model, Platform.Cmd.Cmd msg ), update : msg -> model -> ( model, Platform.Cmd.Cmd msg ), subscriptions : model -> Platform.Sub.Sub msg, view : model -> Browser.Document msg, persistence : Maybe (JsonMapping.ObjectMapping model msg) } -> Program model msg

Use this to define your main in your Main.elm file, and then use the elm-desktop-app command line tool to build your app.


type alias Program model msg =
Platform.Program () (Model model) (Msg msg)

This is the type for your Elm program when using DesktopApp.program

For example:

module Main exposing (main)

import DesktopApp

type alias Model = { ... }
type Msg = ...

main : DesktopApp.Program Model Msg
main =
    DesktopApp.program { ... }


type alias Model yourModel =
Testable.Model yourModel

This is the Model type for your Elm program when using DesktopApp.program.

Normally you won't need to refer to this directly -- use Program instead.


type alias Msg yourMsg =
Testable.Msg yourMsg

This is the Msg type for your Elm program when using DesktopApp.program.

Normally you won't need to refer to this directly -- use Program instead.