File: PkgCereal.hs

package info (click to toggle)
haskell-serialise 0.2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 564 kB
  • sloc: haskell: 6,809; makefile: 6
file content (15 lines) | stat: -rw-r--r-- 384 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# OPTIONS_GHC -fno-warn-orphans -fsimpl-tick-factor=500 #-}
module Micro.PkgCereal (serialise, deserialise) where

import Micro.Types
import Data.Serialize as Cereal
import Data.ByteString.Lazy as BS

serialise :: Tree -> BS.ByteString
serialise = Cereal.encodeLazy

deserialise :: BS.ByteString -> Tree
deserialise = (\(Right x) -> x) . Cereal.decodeLazy

instance Serialize Tree