From ebececef6d963bcd093889c56ca395ffde35e1a0 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Tue, 22 Oct 2024 08:28:51 +0200 Subject: [PATCH] added MonadFix --- src/compiler/api/GF/Data/Operations.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler/api/GF/Data/Operations.hs b/src/compiler/api/GF/Data/Operations.hs index e9b95f8ab..539b77c8f 100644 --- a/src/compiler/api/GF/Data/Operations.hs +++ b/src/compiler/api/GF/Data/Operations.hs @@ -50,6 +50,7 @@ import qualified Data.Map as Map import Data.Map (Map) --import Control.Applicative(Applicative(..)) import Control.Monad (liftM,liftM2) --,ap +import Control.Monad.Fix import GF.Data.ErrM import GF.Data.Relation @@ -237,6 +238,10 @@ instance ErrorMonad Err where handle a@(Ok _) _ = a handle (Bad i) f = f i +instance MonadFix Err where + mfix f = let res@(~(Ok x)) = f x in res + + liftErr e = err raise return e {- instance ErrorMonad (STM s) where