From c6e39268be197a4eaccc0187271764a646017715 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 27 Oct 2024 01:00:38 +0200 Subject: Refactored comparisons and sets --- std/List/Church.bruijn | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'std/List/Church.bruijn') diff --git a/std/List/Church.bruijn b/std/List/Church.bruijn index c8d5d29..b48e7c8 100644 --- a/std/List/Church.bruijn +++ b/std/List/Church.bruijn @@ -421,13 +421,15 @@ eq? ⋀?‣ ∘∘∘ zip-with ⧗ (a → a → Boolean) → (List a) → Boolea :test (eq? …=?… empty empty) (true) # returns eq, lt, gt depending on comparison of two lists and comparison function -compare-case z [[[[[[[rec]]]]]]] ⧗ (a → a → Boolean) → c → d → e → (List a) → (List a) → Boolean - rec ∅?1 (∅?0 4 3) (∅?0 2 go) - go [=?0 (7 6 5 4 3 ~2 ~1) 0] (5 ^1 ^0) +compare-case' z [[[[[[[rec]]]]]]] ⧗ Compare → a → b → c → (List a) → (List a) → d + rec ∅?1 (∅?0 4 2) (∅?0 3 (5 eq gt lt ^1 ^0)) + eq 6 5 4 3 2 ~1 ~0 + gt 3 + lt 2 # returns 1 if a>b, -1 if a