From 214ca86120b26ebc5c478b56107e52b894e46b34 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 11 Feb 2009 18:32:41 +0100 Subject: [PATCH] Make the flatfunc in FuncMap optional. --- Translator.hs | 2 +- TranslatorTypes.hs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Translator.hs b/Translator.hs index 5b58232..ec9334b 100644 --- a/Translator.hs +++ b/Translator.hs @@ -96,7 +96,7 @@ flattenBind bind@(NonRec var expr) = do -- Add it to the session --addFunc hsfunc hwfunc let flatfunc = flattenFunction hsfunc bind - addFunc hsfunc flatfunc + addFunc hsfunc let used_hsfuncs = map appFunc (apps flatfunc) State.mapM resolvFunc used_hsfuncs return () diff --git a/TranslatorTypes.hs b/TranslatorTypes.hs index 70ae9b7..60d12eb 100644 --- a/TranslatorTypes.hs +++ b/TranslatorTypes.hs @@ -14,7 +14,7 @@ import Flatten -- function along the way. type FuncMap = Map.Map HsFunction FuncData -- | Some stuff we collect about a function along the way. -type FuncData = (FlatFunction) +type FuncData = (Maybe FlatFunction) data VHDLSession = VHDLSession { coreMod :: HscTypes.CoreModule, -- The current module @@ -23,10 +23,10 @@ data VHDLSession = VHDLSession { } -- | Add the function to the session -addFunc :: HsFunction -> FlatFunction -> VHDLState () -addFunc hsfunc flatfunc = do +addFunc :: HsFunction -> VHDLState () +addFunc hsfunc = do fs <- State.gets funcs -- Get the funcs element from the session - let fs' = Map.insert hsfunc (flatfunc) fs -- Insert function + let fs' = Map.insert hsfunc (Nothing) fs -- Insert function State.modify (\x -> x {funcs = fs' }) -- | Find the given function in the current session -- 2.30.2