packages feed

cabal-gild-0.3.0.1: source/library/CabalGild/Type/Comment.hs

-- | This module defines the 'Comment' data type.
module CabalGild.Type.Comment where

import qualified CabalGild.Extra.String as String
import qualified Data.ByteString as ByteString

-- | A comment with corresponding annotation. Leading blank space is preserved,
-- but trailing blank space is not.
data Comment a = Comment
  { annotation :: a,
    -- | Does /not/ include the 'delimiter'.
    value :: ByteString.ByteString
  }
  deriving (Eq, Show)

-- | The start of a comment, which is @--@.
delimiter :: ByteString.ByteString
delimiter = String.toUtf8 "--"