Merge pull request #10634 from cabalism/hlint/unused-lang-pragma
[cabal.git] / Cabal-syntax / src / Distribution / Parsec / Error.hs
blob46114c3ea98c40a7eeee68347e4fa1ac39e42fa7
1 {-# LANGUAGE DeriveGeneric #-}
3 module Distribution.Parsec.Error
4 ( PError (..)
5 , showPError
6 ) where
8 import Distribution.Compat.Prelude
9 import Distribution.Parsec.Position
10 import System.FilePath (normalise)
11 import Prelude ()
13 -- | Parser error.
14 data PError = PError Position String
15 deriving (Show, Generic)
17 instance Binary PError
18 instance NFData PError where rnf = genericRnf
20 showPError :: FilePath -> PError -> String
21 showPError fpath (PError pos msg) =
22 normalise fpath ++ ":" ++ showPos pos ++ ": " ++ msg