From bba02fe178f8c027e7b94f8bead1fdbe6aa56088 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 30 Sep 2019 14:27:31 -0400 Subject: [PATCH] Define an Effect instance for Parse. --- src/Semantic/Parse.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Semantic/Parse.hs b/src/Semantic/Parse.hs index 768112e4f..d78e58450 100644 --- a/src/Semantic/Parse.hs +++ b/src/Semantic/Parse.hs @@ -14,3 +14,6 @@ deriving instance Functor m => Functor (Parse m) instance HFunctor Parse where hmap f (Parse parser blob k) = Parse parser blob (f . k) + +instance Effect Parse where + handle state handler (Parse parser blob k) = Parse parser blob (handler . (<$ state) . k)