From 3ee347c89cb7f25304b11b7c886c963f5e01c76c Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 23 Jul 2018 09:22:10 -0400 Subject: [PATCH] Define a PureEffect instance for Function. --- src/Control/Abstract/Value.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Control/Abstract/Value.hs b/src/Control/Abstract/Value.hs index e357cdc08..fc00775a8 100644 --- a/src/Control/Abstract/Value.hs +++ b/src/Control/Abstract/Value.hs @@ -52,6 +52,10 @@ data Function address value m result where Function :: [Name] -> Set Name -> m address -> Function address value m value Call :: value -> [address] -> Function address value m address +instance PureEffect (Function address value) where + handle handler (Request (Function name fvs body) k) = Request (Function name fvs (handler body)) (handler . k) + handle handler (Request (Call fn addrs) k) = Request (Call fn addrs) (handler . k) + class Show value => AbstractIntro value where -- | Construct an abstract unit value.