on master help sign in
Fixed flaw with FC dependency by making FC equality always return true.

If any fc equality is needed just use FC' fc to convert. Fixes idris-lang/Idris-dev#550

commit8b17db3ecc20564c749fdc16208d797f870ed2d3 authorAhmad Salim Al-Sibahi <asal@itu.dk> dateMon 21 Oct 2013, 23:05 (13 years ago) parent57c8657
2 files changed+18−5
src/Core/TT.hs+12−1 src/Idris/AbsSyntaxTree.hs+6−4
src/Core/TT.hs+12−1
@@ -42,7 +42,18 @@ data Option = TTypeInTType
4242data FC = FC { fc_fname :: String, -- ^ Filename
4343 fc_line :: Int, -- ^ Line number
4444 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'
4657
4758-- | Empty source location
4859emptyFC :: FC
src/Idris/AbsSyntaxTree.hs+6−4
@@ -561,7 +561,9 @@ data PTerm = PQuote Raw
561561 | PCoerced PTerm -- ^ To mark a coerced argument, so as not to coerce twice
562562 | PUnifyLog PTerm -- ^ dump a trace of unifications when building term
563563 | PNoImplicits PTerm -- ^ never run implicit converions on the term
564− deriving (Eq, Show)
564+ deriving Eq
565+
566+
565567{-!
566568deriving instance Binary PTerm
567569!-}
@@ -642,7 +644,7 @@ data PDo' t = DoExp FC t
642644 | DoBindP FC t t
643645 | DoLet FC Name t t
644646 | DoLetP FC t t
645− deriving (Eq, Functor, Show)
647+ deriving (Eq, Functor)
646648{-!
647649deriving instance Binary PDo'
648650!-}
@@ -807,8 +809,8 @@ expandNS syn n = case syn_namespace syn of
807809
808810--- Pretty printing declarations and terms
809811
810−{-instance Show PTerm where-}
811− {-show tm = showImp Nothing False False tm-}
812+instance Show PTerm where
813+ show tm = showImp Nothing False False tm
812814
813815instance Pretty PTerm where
814816 pretty = prettyImp False