packages feed

phino-0.0.152: test-resources/rewriter-packs/custom/with-complex-condition.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
input: '[[x -> [[a -> Q.z]], y -> [[b -> $.w]], L> Func ]].x'
output: |-
  ⟦
    a ↦ Φ.z,
    y ↦ ⟦
      b ↦ ξ.w
    ⟧,
    λ ⤍ Func
  ⟧
rules:
  custom:
    - name: with-complex-condition
      pattern: '[[ !t1 -> [[!B1]], !B2 ]].!t1'
      result: '[[ !B1, !B2 ]]'
      when:
        and:
          - in:
              - 'a'
              - '!B1'
          - or:
              - in:
                  - 'Δ'
                  - '!B2'
              - in:
                  - 'λ'
                  - '!B2'