1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00

Define a PureEffect instance for Function.

This commit is contained in:
Rob Rix 2018-07-23 09:22:10 -04:00
parent aa1e7eb9ce
commit 3ee347c89c

View File

@ -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.