I am both an Elm and a functional programming newbie, and never worked with Java seriously. I'm working my way through Elm docs, and playing with the REPL, trying to understand type annotations.
They seem pretty useful things:
type alias Point = { x:Float, y:Float }
origin : Point
origin =
{ x = 0, y = 0 }
and now all your Points are specifically formatted floats! Magic. Love it. Would love to play around with it in the REPL, but the REPL doesn't seem to understand type definitions:
> type alias Point = { x:Float, y:Float }
> origin : Point
-- SYNTAX PROBLEM -------------------------------------------- repl-temp-000.elm
I ran into something unexpected when parsing your code!
7│ origin : Point
^
I am looking for one of the following things:
end of input
whitespace
Is this a bug in the REPL, or a feature?
The elm repl does not currently support type annotations. There's a lot of people asking for this so I'm holding out hope for it soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With