From 86bb3fc4d33202369cf87a96db9b99674aaa4535 Mon Sep 17 00:00:00 2001 From: David Waern Date: Fri, 27 Mar 2009 21:33:04 +0000 Subject: Remove H.DocName and put DocName in H.Types --- src/Haddock/InterfaceFile.hs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/Haddock/InterfaceFile.hs') diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 7ed200ca..8a1a909c 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -14,7 +14,6 @@ module Haddock.InterfaceFile ( ) where -import Haddock.DocName () import Haddock.Types import Haddock.Utils @@ -515,3 +514,26 @@ instance Binary name => Binary (HaddockModInfo name) where stabi <- get bh maint <- get bh return (HaddockModInfo descr porta stabi maint) + + +instance Binary DocName where + put_ bh (Documented name modu) = do + putByte bh 0 + put_ bh name + put_ bh modu + put_ bh (Undocumented name) = do + putByte bh 1 + put_ bh name + + get bh = do + h <- getByte bh + case h of + 0 -> do + name <- get bh + modu <- get bh + return (Documented name modu) + 1 -> do + name <- get bh + return (Undocumented name) + _ -> error "get DocName: Bad h" + -- cgit v1.2.3