@@ -13,7 +13,6 @@ module Development.IDE.GHC.CoreFile
1313 ) where
1414
1515import Control.Monad
16- import Data.Foldable
1716import Data.IORef
1817import Data.Maybe
1918import Development.IDE.GHC.Compat
@@ -44,33 +43,6 @@ data CoreFile
4443 , cf_iface_hash :: ! Fingerprint
4544 }
4645
47- -- | Like IfaceBinding, but lets us serialize internal names as well
48- data TopIfaceBinding v
49- = TopIfaceNonRec v IfaceExpr
50- | TopIfaceRec [(v , IfaceExpr )]
51- deriving (Functor , Foldable , Traversable )
52-
53- -- | GHC doesn't export 'tcIdDetails', 'tcIfaceInfo', or 'tcIfaceType',
54- -- but it does export 'tcIfaceDecl'
55- -- so we use `IfaceDecl` as a container for all of these
56- -- invariant: 'IfaceId' is always a 'IfaceId' constructor
57- type IfaceId = IfaceDecl
58-
59- instance Binary (TopIfaceBinding IfaceId ) where
60- put_ bh (TopIfaceNonRec d e) = do
61- putByte bh 0
62- put_ bh d
63- put_ bh e
64- put_ bh (TopIfaceRec vs) = do
65- putByte bh 1
66- put_ bh vs
67- get bh = do
68- t <- getByte bh
69- case t of
70- 0 -> TopIfaceNonRec <$> get bh <*> get bh
71- 1 -> TopIfaceRec <$> get bh
72- _ -> error " Binary TopIfaceBinding"
73-
7446instance Binary CoreFile where
7547 put_ bh (CoreFile core fp) = lazyPut bh core >> put_ bh fp
7648 get bh = CoreFile <$> lazyGet bh <*> get bh
0 commit comments