{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
module Development.IDE.GHC.Compat.Util (
MonadCatch,
GhcException,
handleGhcException,
catch,
try,
Bag,
bagToList,
listToBag,
unionBags,
isEmptyBag,
LBooleanFormula,
BooleanFormula(..),
OverridingBool(..),
MaybeErr(..),
orElse,
#if MIN_VERSION_ghc(8,10,0)
Pair(..),
#endif
EnumSet,
toList,
FastString,
#if MIN_VERSION_ghc(9,2,0)
LexicalFastString(..),
#endif
uniq,
unpackFS,
mkFastString,
fsLit,
pprHsString,
Fingerprint(..),
getFileHash,
fingerprintData,
fingerprintString,
fingerprintFingerprints,
Uniquable,
nonDetCmpUnique,
getUnique,
Unique,
mkUnique,
newTagUnique,
emptyUDFM,
plusUDFM,
plusUDFM_C,
StringBuffer(..),
hGetStringBuffer,
stringToStringBuffer,
nextChar,
atEnd,
is_ident
) where
#if MIN_VERSION_ghc(9,0,0)
import Control.Exception.Safe (MonadCatch, catch, try)
import GHC.Data.Bag
import GHC.Data.BooleanFormula
import GHC.Data.EnumSet
import GHC.Data.FastString
import GHC.Data.Maybe
import GHC.Data.Pair
import GHC.Data.StringBuffer
import GHC.Parser.CharClass (is_ident)
import GHC.Types.Unique
import GHC.Types.Unique.DFM
import GHC.Utils.Fingerprint
import GHC.Utils.Misc
import GHC.Utils.Outputable (pprHsString)
import GHC.Utils.Panic hiding (try)
#else
import Bag
import BooleanFormula
import Ctype (is_ident)
import EnumSet
import qualified Exception
import FastString
import Fingerprint
import Maybes
#if MIN_VERSION_ghc(8,10,0)
import Pair
#endif
import Outputable (pprHsString)
import Panic hiding (try)
import StringBuffer
import UniqDFM
import Unique
import Util
#endif
#if !MIN_VERSION_ghc(9,0,0)
type MonadCatch = Exception.ExceptionMonad
catch :: (Exception.ExceptionMonad m, Exception e) => m a -> (e -> m a) -> m a
catch :: m a -> (e -> m a) -> m a
catch = m a -> (e -> m a) -> m a
forall (m :: * -> *) e a.
(ExceptionMonad m, Exception e) =>
m a -> (e -> m a) -> m a
Exception.gcatch
try :: (Exception.ExceptionMonad m, Exception e) => m a -> m (Either e a)
try :: m a -> m (Either e a)
try = m a -> m (Either e a)
forall (m :: * -> *) e a.
(ExceptionMonad m, Exception e) =>
m a -> m (Either e a)
Exception.gtry
#endif