{-# LANGUAGE CPP #-}
module Stan.Hie.Compat810
#if __GLASGOW_HASKELL__ <= 810
(
ContextInfo (..)
, HieArgs (..)
, HieAST (..)
, HieASTs (..)
, HieFile (..)
, HieType (..)
, HieTypeFlat
, IEType (..)
, Identifier
, IdentifierDetails (..)
, NodeInfo (..)
, TypeIndex
, DeclType (..)
, hFunTy2
, conDec
, eqDeclType
, NodeAnnotation
, mkNodeAnnotation
, toNodeAnnotation
, HieFileResult (hie_file_result)
, readHieFileWithNameCache
) where
import HieBin (HieFileResult (hie_file_result), readHieFile)
import HieTypes (ContextInfo (..), DeclType (..), HieAST (..), HieASTs (..), HieArgs (..),
HieFile (..), HieType (..), HieTypeFlat, IEType (..), Identifier,
IdentifierDetails (..), NodeInfo (..), TypeIndex)
import NameCache (initNameCache)
import UniqSupply (mkSplitUniqSupply)
import FastString (FastString)
type NodeAnnotation = (FastString, FastString)
mkNodeAnnotation :: FastString -> FastString -> NodeAnnotation
mkNodeAnnotation = (,)
toNodeAnnotation :: NodeAnnotation -> NodeAnnotation
toNodeAnnotation = id
hFunTy2 :: HieType b -> Maybe (b, b)
hFunTy2 t = case t of
HFunTy i1 i2 -> Just (i1, i2)
_ -> Nothing
readHieFileWithNameCache :: IO (FilePath -> IO HieFileResult)
readHieFileWithNameCache = do
uniqSupply <- mkSplitUniqSupply 'z'
let nameCache = initNameCache uniqSupply []
pure (fmap fst . readHieFile nameCache)
conDec :: DeclType
conDec = ConDec
eqDeclType :: DeclType -> DeclType -> Bool
eqDeclType d1 d2 = d1 == d2
#else
() where
#endif