DocsPlaygroundBlogCommunityPackages
  • Playground
  • Blog
  • Community
  • Packages
  • X
  • Bluesky
  • GitHub
  • Forum
Language ManualAPISyntax LookupReact

Syntax Lookup

Enter some language construct you want to know more about.
This is the triangle pipe operator.

The |> operator passes a value to a function as its last argument.

Note that this operator has been deprecated. See Triangle Pipe for more details.

Example

ReScriptJS Output
let dieRoll = size => {
  Math.Int.random(1, size)
}

let dieRollMessage = (name, value) => {
  "Hi " ++ name ++ ", you rolled a " ++ Int.toString(value)
}

let message = dieRoll(6) |> dieRollMessage("Jeremy")

Which produces a message such as Hello Jeremy, you rolled a 3.

References

  • Triangle Pipe

© 2025 The ReScript Project

About
  • Community
  • ReScript Association
Find us on