mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
🔥 Data.Functor.Classes.Pretty.Orphans.
This commit is contained in:
parent
9a5f78a6c0
commit
e44f43e689
@ -21,7 +21,6 @@ library
|
||||
, Data.Error
|
||||
, Data.Functor.Both
|
||||
, Data.Functor.Classes.Eq.Generic
|
||||
, Data.Functor.Classes.Pretty.Orphans
|
||||
, Data.Functor.Classes.Show.Generic
|
||||
, Data.Functor.Listable
|
||||
, Data.Mergeable
|
||||
|
@ -1,22 +0,0 @@
|
||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||
module Data.Functor.Classes.Pretty.Orphans
|
||||
( module Pretty
|
||||
) where
|
||||
|
||||
import Data.ByteString
|
||||
import Data.Functor.Classes.Pretty as Pretty
|
||||
import Data.Text.Encoding
|
||||
import GHC.Stack
|
||||
|
||||
instance Pretty ByteString where
|
||||
pretty = pretty . decodeUtf8With (\ _ -> ('\xfffd' <$))
|
||||
|
||||
instance Pretty SrcLoc where
|
||||
pretty SrcLoc{..}
|
||||
| srcLocStartLine == srcLocEndLine
|
||||
, srcLocStartCol == srcLocEndCol
|
||||
= pretty srcLocFile <> colon <> pretty srcLocStartLine <> colon <> pretty srcLocStartCol
|
||||
| srcLocStartLine == srcLocEndLine
|
||||
= pretty srcLocFile <> colon <> pretty srcLocStartLine <> colon <> pretty srcLocStartCol <> pretty '-' <> pretty srcLocEndCol
|
||||
| otherwise
|
||||
= pretty srcLocFile <> colon <> pretty srcLocStartLine <> colon <> pretty srcLocStartCol <> pretty '-' <> pretty srcLocEndLine <> colon <> pretty srcLocEndCol
|
@ -4,7 +4,7 @@ module Data.Syntax.Declaration where
|
||||
import Algorithm
|
||||
import Data.Align.Generic
|
||||
import Data.Functor.Classes.Eq.Generic
|
||||
import Data.Functor.Classes.Pretty.Orphans
|
||||
import Data.Functor.Classes.Pretty
|
||||
import Data.Functor.Classes.Show.Generic
|
||||
import GHC.Generics
|
||||
|
||||
|
@ -4,7 +4,7 @@ module Data.Syntax.Expression where
|
||||
import Algorithm
|
||||
import Data.Align.Generic
|
||||
import Data.Functor.Classes.Eq.Generic
|
||||
import Data.Functor.Classes.Pretty.Orphans
|
||||
import Data.Functor.Classes.Pretty
|
||||
import Data.Functor.Classes.Show.Generic
|
||||
import GHC.Generics
|
||||
|
||||
|
@ -4,7 +4,7 @@ module Data.Syntax.Statement where
|
||||
import Algorithm
|
||||
import Data.Align.Generic
|
||||
import Data.Functor.Classes.Eq.Generic
|
||||
import Data.Functor.Classes.Pretty.Orphans
|
||||
import Data.Functor.Classes.Pretty
|
||||
import Data.Functor.Classes.Show.Generic
|
||||
import GHC.Generics
|
||||
|
||||
|
@ -4,7 +4,7 @@ module Data.Syntax.Type where
|
||||
import Algorithm
|
||||
import Data.Align.Generic
|
||||
import Data.Functor.Classes.Eq.Generic
|
||||
import Data.Functor.Classes.Pretty.Orphans
|
||||
import Data.Functor.Classes.Pretty
|
||||
import Data.Functor.Classes.Show.Generic
|
||||
import GHC.Generics
|
||||
|
||||
|
@ -10,7 +10,7 @@ import Algorithm
|
||||
import Data.Align.Generic
|
||||
import Data.Functor (void)
|
||||
import Data.Functor.Classes.Eq.Generic
|
||||
import Data.Functor.Classes.Pretty.Orphans
|
||||
import Data.Functor.Classes.Pretty
|
||||
import Data.Functor.Classes.Show.Generic
|
||||
import Data.List.NonEmpty (NonEmpty(..))
|
||||
import Data.Maybe (fromMaybe)
|
||||
|
Loading…
Reference in New Issue
Block a user