From 3008142e03a0fb4f2cfa82ad9d81990d54d35e01 Mon Sep 17 00:00:00 2001 From: Jan-Philip Loos Date: Mon, 8 Sep 2014 16:04:30 +0200 Subject: added binary instances for csl and pandoc, fix #174 --- src/Hakyll/Web/Pandoc/Biblio.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Hakyll/Web/Pandoc/Biblio.hs') diff --git a/src/Hakyll/Web/Pandoc/Biblio.hs b/src/Hakyll/Web/Pandoc/Biblio.hs index 6c92f28..c8f075d 100644 --- a/src/Hakyll/Web/Pandoc/Biblio.hs +++ b/src/Hakyll/Web/Pandoc/Biblio.hs @@ -21,6 +21,7 @@ module Hakyll.Web.Pandoc.Biblio -------------------------------------------------------------------------------- import Control.Applicative ((<$>)) +import Control.Monad (replicateM) import Data.Binary (Binary (..)) import Data.Typeable (Typeable) import qualified Text.CSL as CSL @@ -33,6 +34,7 @@ import Hakyll.Core.Identifier import Hakyll.Core.Item import Hakyll.Core.Writable import Hakyll.Web.Pandoc +import Hakyll.Web.Pandoc.Binary () -------------------------------------------------------------------------------- @@ -65,8 +67,10 @@ newtype Biblio = Biblio [CSL.Reference] -------------------------------------------------------------------------------- instance Binary Biblio where -- Ugly. - get = Biblio . read <$> get - put (Biblio rs) = put $ show rs + get = do + len <- get + Biblio <$> replicateM len get + put (Biblio rs) = put (length rs) >> mapM_ put rs -------------------------------------------------------------------------------- -- cgit v1.2.3