{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
module Haxl.Core.CallGraph where
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
#if __GLASGOW_HASKELL__ < 804
import Data.Monoid
#endif
import Data.Text (Text)
import qualified Data.Text as Text
type ModuleName = Text
type Function = Text
data QualFunction = QualFunction ModuleName Function deriving (Eq, Ord)
instance Show QualFunction where
show (QualFunction mn nm) = Text.unpack $ mn <> Text.pack "." <> nm
type FunctionCall = (QualFunction, QualFunction)
type CallGraph = ([FunctionCall], Map QualFunction Text)
mainFunction :: QualFunction
mainFunction = QualFunction "MAIN" "main"
emptyCallGraph :: CallGraph
emptyCallGraph = ([], Map.empty)