Stream: beginners

Topic: syntax question: @ :=


view this post on Zulip roovo (Dec 15 2022 at 12:25):

Hi - I'm looking at the Parser/Core.roc source in roc examples and see the following:

Parser input a := input -> ParseResult input a

buildPrimitiveParser : (input -> ParseResult input a) -> Parser input a
buildPrimitiveParser = \fun ->
    @Parser fun

am confused as to what is the significance/meaning of the := in the definition of Parser as well as the @ in the body of the buildPrimativeParser function. I can't find either mentioned in the tutorial or any other doc, so if it is explained somewhere that would be great to know too. Thanks

view this post on Zulip Erik (Dec 15 2022 at 14:34):

Ahh I believe that is the opaque type syntax. There is some info in this doc -> https://github.com/roc-lang/roc/blob/main/roc-for-elm-programmers.md#opaque-types

view this post on Zulip roovo (Dec 15 2022 at 14:55):

Fantastic - thank you :)

view this post on Zulip Erik (Dec 15 2022 at 14:59):

no problem! :)


Last updated: Jul 06 2025 at 12:14 UTC