packages feed

HaskellAnalysisProgram-0.1.0: src/MetaHS/DataModel/Utils/Language/Haskell/Exts/Syntax/ConDecl.hs

{-|
Module      : MetaHS.DataModel.Utils.Language.Haskell.Exts.Syntax.QName
Description : Utility functions for ConDecl objects.
Copyright   : Copyright (C) 2017-2019 H.H.R.F. Vos, S. Kamps
License     : -- This file is distributed under the  terms of the Apache License 2.0.
              For more information, see the file "LICENSE", which is included in the distribution.
Stability   : experimental
Utility functions for ConDecl objects.
-}
module MetaHS.DataModel.Utils.Language.Haskell.Exts.Syntax.ConDecl
    where

import Language.Haskell.Exts.Syntax
import qualified MetaHS.DataModel.Utils.Language.Haskell.Exts.Syntax.Name as Name

-- | Returns the name for a ConDecl object.
name :: ConDecl l -- ^ The ConDecl object to analyze.
     -> String    -- ^ The name of the ConDecl object.
name (ConDecl _ x _)        = Name.name x
name (InfixConDecl _ _ x _) = Name.name x
name (RecDecl _ x _)        = Name.name x