From fd3152f29c8d8e9cc134423da18fb828ba20ebcc Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 2 Nov 2020 20:54:09 -0400 Subject: Added CoMonad for CoFree. --- luxc/src/lux/optimizer.clj | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'luxc') diff --git a/luxc/src/lux/optimizer.clj b/luxc/src/lux/optimizer.clj index 0c1b304e0..6e235e084 100644 --- a/luxc/src/lux/optimizer.clj +++ b/luxc/src/lux/optimizer.clj @@ -1054,11 +1054,26 @@ (&/$Cons [(&a-case/$StoreTestAC _register) _body] (&/$Nil)) (&/T [meta ($let (pass-0 top-level-func? value) _register (pass-0 top-level-func? _body))]) + (&/$Cons [(&a-case/$BitTestAC true) _then] + (&/$Cons [(&a-case/$BitTestAC false) _else] + (&/$Nil))) + (&/T [meta ($if (pass-0 top-level-func? value) (pass-0 top-level-func? _then) (pass-0 top-level-func? _else))]) + + (&/$Cons [(&a-case/$BitTestAC true) _then] + (&/$Cons [(&a-case/$NoTestAC false) _else] + (&/$Nil))) + (&/T [meta ($if (pass-0 top-level-func? value) (pass-0 top-level-func? _then) (pass-0 top-level-func? _else))]) + (&/$Cons [(&a-case/$BitTestAC false) _else] (&/$Cons [(&a-case/$BitTestAC true) _then] (&/$Nil))) (&/T [meta ($if (pass-0 top-level-func? value) (pass-0 top-level-func? _then) (pass-0 top-level-func? _else))]) - + + (&/$Cons [(&a-case/$BitTestAC false) _else] + (&/$Cons [(&a-case/$NoTestAC) _then] + (&/$Nil))) + (&/T [meta ($if (pass-0 top-level-func? value) (pass-0 top-level-func? _then) (pass-0 top-level-func? _else))]) + ;; The pattern for a record-get is a single branch, with a ;; tuple pattern and a body corresponding to a ;; local-variable extracted from the tuple. -- cgit v1.2.3