Remix.run Logo
cptroot 3 hours ago

Good news, there's a line in the "Coming from Rust"[1] page that says

> You never annotate a function signature unless you want to for documentation purposes.

so it sounds like function annotation is still an option for the purposes of communication, just no longer required in all cases.

[1] https://loonlang.com/concepts/from-rust

cptroot 2 hours ago | parent [-]

Aha, here's the syntax in case you're curious (using an example lifted from the playground)

  [type Shape
    [Circle f64]
    [Rect f64 f64]
    Point
  ]

  [sig test_sig : Shape -> Float]
  [fn test_sig [shape]
    [match shape
      [Circle r] [* 3.14159 [* r r]]
      [Rect w h] [* w h]
      Point 0.0
    ]
  ]
Unfortunately it seems like this doesn't currently work as expected when I use it in the playground, so I'm going to go file an issue
ecto 2 hours ago | parent [-]

thank you <3 I will fix asap