From 3377879dd0380751c4ec14431552afc9e74f2672 Mon Sep 17 00:00:00 2001 From: Rakarake Date: Mon, 1 May 2023 11:57:06 +0200 Subject: [PATCH] Small fix in morphBind --- src/Monomorphizer/Monomorphizer.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Monomorphizer/Monomorphizer.hs b/src/Monomorphizer/Monomorphizer.hs index 4a40e15..5b746e9 100644 --- a/src/Monomorphizer/Monomorphizer.hs +++ b/src/Monomorphizer/Monomorphizer.hs @@ -150,7 +150,10 @@ getMonoFromPoly t = do Returns the annotated bind name. -} morphBind :: M.Type -> T.Bind -> EnvM Ident -morphBind expectedType b@(T.Bind (ident, btype) args (exp, expt)) = +morphBind expectedType b@(T.Bind (ident, btype) args (exp, expt)) = do + -- The "new name" is used to find out if it is already marked or not. + let name' = newFuncName expectedType b + bindMarked <- isBindMarked (coerce name') local ( \env -> env @@ -159,9 +162,6 @@ morphBind expectedType b@(T.Bind (ident, btype) args (exp, expt)) = } ) $ do - -- The "new name" is used to find out if it is already marked or not. - let name' = newFuncName expectedType b - bindMarked <- isBindMarked (coerce name') -- Return with right name if already marked if bindMarked then return name'