From 4c6386fd250e8447e76ec9dfb6e8f5a266a050e2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 29 Feb 2024 11:35:25 +0100 Subject: Added higher order reducer --- src/Reducer/ION.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Reducer/ION.hs') diff --git a/src/Reducer/ION.hs b/src/Reducer/ION.hs index 9154bd8..5eb959b 100644 --- a/src/Reducer/ION.hs +++ b/src/Reducer/ION.hs @@ -147,7 +147,8 @@ rules ch vm = case chr' ch of let parentVal = load (load (sp vm1 + 1) vm1 + 1) vm1 let (a, vm2) = app (ord 'f') (load (sp vm1) vm1) vm1 lazy 0 (wor a) (wor parentVal) (store (sp vm2) parentVal vm2) - _ -> error $ "invalid combinator " ++ show ch + '\0' -> store (sp vm) (arg' 1 vm) vm + _ -> error $ "invalid combinator " ++ show ch where lvm n f g = lazy n f g vm eval :: VM -> VM -- cgit v1.2.3