X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FbasicTypes%2FSrcLoc.lhs;h=8bed6c19772e76f18c0f0c3f0bc5307395613765;hp=1a0198095985536eb691a2b060cacda485ba6449;hb=f278f0676579f67075033a4f9857715909c4b71e;hpb=ef6e8211dee59eb7fa80a242391b89b52bd57f80 diff --git a/compiler/basicTypes/SrcLoc.lhs b/compiler/basicTypes/SrcLoc.lhs index 1a01980..8bed6c1 100644 --- a/compiler/basicTypes/SrcLoc.lhs +++ b/compiler/basicTypes/SrcLoc.lhs @@ -69,11 +69,14 @@ module SrcLoc ( spans, isSubspanOf ) where +#include "Typeable.h" + import Util import Outputable import FastString import Data.Bits +import Data.Data \end{code} %************************************************************************ @@ -181,6 +184,14 @@ instance Outputable SrcLoc where char '\"', pprFastFilePath src_path, text " #-}"] ppr (UnhelpfulLoc s) = ftext s + +INSTANCE_TYPEABLE0(SrcSpan,srcSpanTc,"SrcSpan") + +instance Data SrcSpan where + -- don't traverse? + toConstr _ = abstractConstr "SrcSpan" + gunfold _ _ = error "gunfold" + dataTypeOf _ = mkNoRepType "SrcSpan" \end{code} %************************************************************************ @@ -443,6 +454,7 @@ pprDefnLoc loc \begin{code} -- | We attach SrcSpans to lots of things, so let's have a datatype for it. data Located e = L SrcSpan e + deriving (Typeable, Data) unLoc :: Located e -> e unLoc (L _ e) = e