-- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
-- SPDX-License-Identifier: BSD-3-Clause.

{-# LANGUAGE CPP #-}
#include "ghclib_api.h"
module Language.Haskell.GhclibParserEx.GHC.Hs.Decls(
    isNewType, isForD, isDerivD, isClsDefSig
  ) where

#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
import GHC.Hs
#else
import HsSyn
#endif
#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_900)
import GHC.Types.SrcLoc
#else
import SrcLoc
#endif

isNewType :: NewOrData -> Bool
isNewType :: NewOrData -> Bool
isNewType NewOrData
NewType = Bool
True
isNewType NewOrData
DataType = Bool
False

isForD, isDerivD :: LHsDecl GhcPs -> Bool
isForD :: LHsDecl GhcPs -> Bool
isForD (L SrcSpan
_ ForD{}) = Bool
True; isForD LHsDecl GhcPs
_ = Bool
False
isDerivD :: LHsDecl GhcPs -> Bool
isDerivD (L SrcSpan
_ DerivD{}) = Bool
True; isDerivD LHsDecl GhcPs
_ = Bool
False

isClsDefSig :: Sig GhcPs -> Bool
isClsDefSig :: Sig GhcPs -> Bool
isClsDefSig (ClassOpSig XClassOpSig GhcPs
_ Bool
True [Located (IdP GhcPs)]
_ LHsSigType GhcPs
_) = Bool
True; isClsDefSig Sig GhcPs
_ = Bool
False