module CabalGild.Unstable.Extra.SectionArg where

import qualified Data.ByteString as ByteString
import qualified Distribution.Fields as Fields

-- | Extracts the annotation from the given 'Fields.SectionArg'.
annotation :: Fields.SectionArg a -> a
annotation :: forall a. SectionArg a -> a
annotation SectionArg a
sa = case SectionArg a
sa of
  Fields.SecArgName a
x ByteString
_ -> a
x
  Fields.SecArgStr a
x ByteString
_ -> a
x
  Fields.SecArgOther a
x ByteString
_ -> a
x

-- | Extracts the value from the given 'Fields.SectionArg'.
value :: Fields.SectionArg a -> ByteString.ByteString
value :: forall a. SectionArg a -> ByteString
value SectionArg a
sa = case SectionArg a
sa of
  Fields.SecArgName a
_ ByteString
x -> ByteString
x
  Fields.SecArgStr a
_ ByteString
x -> ByteString
x
  Fields.SecArgOther a
_ ByteString
x -> ByteString
x