From 18dee20fa9bd5499ac89646bb188877ee47d0c09 Mon Sep 17 00:00:00 2001 From: Siddhartha Date: Tue, 28 Feb 2023 17:09:26 -0800 Subject: [PATCH] collapse singleton threading form --- qi-lib/flow/core/compiler.rkt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qi-lib/flow/core/compiler.rkt b/qi-lib/flow/core/compiler.rkt index 4326164a..d21eead8 100644 --- a/qi-lib/flow/core/compiler.rkt +++ b/qi-lib/flow/core/compiler.rkt @@ -41,6 +41,9 @@ ;; collapse deterministic conditionals [((~datum if) (~datum #t) f g) #'f] [((~datum if) (~datum #f) f g) #'g] + ;; trivial threading form + [((~datum thread) f) + #'f] ;; associative laws for ~> [((~datum thread) _0 ... ((~datum thread) f ...) _1 ...) #'(thread _0 ... f ... _1 ...)]