mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +03:00
🔥 Data.Functor.Classes.Pretty.Orphans.
This commit is contained in:
parent
9a5f78a6c0
commit
e44f43e689
@ -21,7 +21,6 @@ library
|
|||||||
, Data.Error
|
, Data.Error
|
||||||
, Data.Functor.Both
|
, Data.Functor.Both
|
||||||
, Data.Functor.Classes.Eq.Generic
|
, Data.Functor.Classes.Eq.Generic
|
||||||
, Data.Functor.Classes.Pretty.Orphans
|
|
||||||
, Data.Functor.Classes.Show.Generic
|
, Data.Functor.Classes.Show.Generic
|
||||||
, Data.Functor.Listable
|
, Data.Functor.Listable
|
||||||
, Data.Mergeable
|
, 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 Algorithm
|
||||||
import Data.Align.Generic
|
import Data.Align.Generic
|
||||||
import Data.Functor.Classes.Eq.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 Data.Functor.Classes.Show.Generic
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ module Data.Syntax.Expression where
|
|||||||
import Algorithm
|
import Algorithm
|
||||||
import Data.Align.Generic
|
import Data.Align.Generic
|
||||||
import Data.Functor.Classes.Eq.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 Data.Functor.Classes.Show.Generic
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ module Data.Syntax.Statement where
|
|||||||
import Algorithm
|
import Algorithm
|
||||||
import Data.Align.Generic
|
import Data.Align.Generic
|
||||||
import Data.Functor.Classes.Eq.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 Data.Functor.Classes.Show.Generic
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ module Data.Syntax.Type where
|
|||||||
import Algorithm
|
import Algorithm
|
||||||
import Data.Align.Generic
|
import Data.Align.Generic
|
||||||
import Data.Functor.Classes.Eq.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 Data.Functor.Classes.Show.Generic
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import Algorithm
|
|||||||
import Data.Align.Generic
|
import Data.Align.Generic
|
||||||
import Data.Functor (void)
|
import Data.Functor (void)
|
||||||
import Data.Functor.Classes.Eq.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 Data.Functor.Classes.Show.Generic
|
||||||
import Data.List.NonEmpty (NonEmpty(..))
|
import Data.List.NonEmpty (NonEmpty(..))
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe)
|
||||||
|
Loading…
Reference in New Issue
Block a user