on master help sign in
Fixed flaw with FC dependency by making FC equality always return true.
8b17db3Ahmad Salim Al-Sibahi
src/Core/TT.hs+12−1
@@ -42,7 +42,18 @@ data Option = TTypeInTType
42data FC = FC { fc_fname :: String, -- ^ Filename
42data FC = FC { fc_fname :: String, -- ^ Filename
43 fc_line :: Int, -- ^ Line number
43 fc_line :: Int, -- ^ Line number
44 fc_column :: Int -- ^ Column number
44 fc_column :: Int -- ^ Column number
45− } deriving Eq
45+ }
46+
47+-- | Ignore source location equality (so deriving classes do not compare FCs)
48+instance Eq FC where
49+ _ == _ = True
50+
51+-- | FC with equality
52+newtype FC' = FC' { unwrapFC :: FC }
53+
54+instance Eq FC' where
55+ FC' fc == FC' fc' = fcEq fc fc'
56+ where fcEq (FC n l c) (FC n' l' c') = n == n' && l == l' && c == c'
46
57
47-- | Empty source location
58-- | Empty source location
48emptyFC :: FC
59emptyFC :: FC
src/Idris/AbsSyntaxTree.hs+6−4
@@ -561,7 +561,9 @@ data PTerm = PQuote Raw
561 | PCoerced PTerm -- ^ To mark a coerced argument, so as not to coerce twice
561 | PCoerced PTerm -- ^ To mark a coerced argument, so as not to coerce twice
562 | PUnifyLog PTerm -- ^ dump a trace of unifications when building term
562 | PUnifyLog PTerm -- ^ dump a trace of unifications when building term
563 | PNoImplicits PTerm -- ^ never run implicit converions on the term
563 | PNoImplicits PTerm -- ^ never run implicit converions on the term
564− deriving (Eq, Show)
564+ deriving Eq
565+
566+
565{-!
567{-!
566deriving instance Binary PTerm
568deriving instance Binary PTerm
567!-}
569!-}
@@ -642,7 +644,7 @@ data PDo' t = DoExp FC t
642 | DoBindP FC t t
644 | DoBindP FC t t
643 | DoLet FC Name t t
645 | DoLet FC Name t t
644 | DoLetP FC t t
646 | DoLetP FC t t
645− deriving (Eq, Functor, Show)
647+ deriving (Eq, Functor)
646{-!
648{-!
647deriving instance Binary PDo'
649deriving instance Binary PDo'
648!-}
650!-}
@@ -807,8 +809,8 @@ expandNS syn n = case syn_namespace syn of
807
809
808--- Pretty printing declarations and terms
810--- Pretty printing declarations and terms
809
811
810−{-instance Show PTerm where-}
812+instance Show PTerm where
811− {-show tm = showImp Nothing False False tm-}
813+ show tm = showImp Nothing False False tm
812
814
813instance Pretty PTerm where
815instance Pretty PTerm where
814 pretty = prettyImp False
816 pretty = prettyImp False