Elm I need whitespace, but got stuck on what looks like a new declaration -
i start try elm , i'm stuck on basic issue.
here code:
add : int -> int -> int add x y = x + y add 3 4 i try run in browser elm reactor got issue.
detected errors in 1 module. -- syntax problem ---------------------------------------------------- hello.elm need whitespace, got stuck on looks new declaration. either missing stuff in declaration above or need add spaces here: looking 1 of following things: whitespace i search documentation don't find error in code
edit: don't have error if remove add 3 4
to run in browser you'll need main method has type graphics.element, html.html, signal graphics.element, or signal html.html. easiest use graphics.element.show "show" string.
import graphics.element exposing (show) add : int -> int -> int add x y = x + y main = show (add 3 4) if want try code out without making runnable elm module, can use repl
:~ % elm repl ---- elm repl 0.16.0 ----------------------------------------------------------- :help help, :exit exit, more @ <https://github.com/elm-lang/elm-repl> -------------------------------------------------------------------------------- > add x y = x + y <function> : number -> number -> number > add 3 4 7 : number >
Comments
Post a Comment