Elm REPL 中的类型注解

Type annotations in Elm REPL

我既是 Elm 又是函数式编程新手,从未认真地与 Java 合作过。我正在研究 Elm 文档,并使用 REPL,试图理解类型注释。

它们看起来很有用:

type alias Point = { x:Float, y:Float }

origin : Point
origin =
  { x = 0, y = 0 }

现在您所有的积分都是经过专门格式化的浮点数!魔法。爱它。很想在 REPL 中使用它,但 REPL 似乎不理解类型定义:

> 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

这是 REPL 中的错误还是功能?

榆树回复does not currently support type annotations。有很多人要求这个,所以我很快就会抱有希望。