================================================================================
lambdas/pipeOperator
================================================================================

import "pkl:test"

local add1 = (x) -> x + 1
local mul2 = (x) -> x * 2
local higher1 = (x) -> (y) -> (y |> x) + 1

res1 = 42 |> add1
res2 = 42 |> add1 |> add1
res3 = 42 |> add1 |> mul2

res4 = -1.abs |> add1
res5 = 1 + 2 + 3 |> add1
res6 = 42 ?? 21 |> add1
res7 = 21 |> add1 ?? 42

res8 = 42.abs |> higher1.apply(add1)
res9 = 42.abs |> (add1 |> higher1)

class Person {}

res10 = test.catch(() -> 42 |> 21)
res11 = test.catch(() -> 42 |> new Person {})

--------------------------------------------------------------------------------

(module
  (importClause
    (stringConstant))
  (classProperty
    (modifier)
    (identifier)
    (functionLiteral
      (parameterList
        (typedIdentifier
          (identifier)))
      (binaryExpr
        (variableExpr
          (identifier))
        (intLiteral))))
  (classProperty
    (modifier)
    (identifier)
    (functionLiteral
      (parameterList
        (typedIdentifier
          (identifier)))
      (binaryExpr
        (variableExpr
          (identifier))
        (intLiteral))))
  (classProperty
    (modifier)
    (identifier)
    (functionLiteral
      (parameterList
        (typedIdentifier
          (identifier)))
      (functionLiteral
        (parameterList
          (typedIdentifier
            (identifier)))
        (binaryExpr
          (parenthesizedExpr
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier))))
          (intLiteral)))))
  (classProperty
    (identifier)
    (binaryExpr
      (intLiteral)
      (variableExpr
        (identifier))))
  (classProperty
    (identifier)
    (binaryExpr
      (binaryExpr
        (intLiteral)
        (variableExpr
          (identifier)))
      (variableExpr
        (identifier))))
  (classProperty
    (identifier)
    (binaryExpr
      (binaryExpr
        (intLiteral)
        (variableExpr
          (identifier)))
      (variableExpr
        (identifier))))
  (classProperty
    (identifier)
    (binaryExpr
      (propertyCallExpr
        (unaryExpr
          (intLiteral))
        (identifier))
      (variableExpr
        (identifier))))
  (classProperty
    (identifier)
    (binaryExpr
      (binaryExpr
        (binaryExpr
          (intLiteral)
          (intLiteral))
        (intLiteral))
      (variableExpr
        (identifier))))
  (classProperty
    (identifier)
    (binaryExprRightAssoc
      (intLiteral)
      (binaryExpr
        (intLiteral)
        (variableExpr
          (identifier)))))
  (classProperty
    (identifier)
    (binaryExprRightAssoc
      (binaryExpr
        (intLiteral)
        (variableExpr
          (identifier)))
      (intLiteral)))
  (classProperty
    (identifier)
    (methodCallExpr
      (binaryExpr
        (propertyCallExpr
          (intLiteral)
          (identifier))
        (variableExpr
          (identifier)))
      (identifier)
      (argumentList
        (variableExpr
          (identifier)))))
  (classProperty
    (identifier)
    (binaryExpr
      (propertyCallExpr
        (intLiteral)
        (identifier))
      (parenthesizedExpr
        (binaryExpr
          (variableExpr
            (identifier))
          (variableExpr
            (identifier))))))
  (clazz
    (identifier)
    (classBody))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (binaryExpr
            (intLiteral)
            (intLiteral))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (binaryExpr
            (intLiteral)
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))))))))
