File: ReadShow.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 (16 lines) | stat: -rw-r--r-- 352 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE StandaloneDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Micro.ReadShow where

import Micro.Types
import Data.ByteString.Lazy.Char8 as BS

serialise :: Tree -> BS.ByteString
serialise = BS.pack . show

deserialise :: BS.ByteString -> Tree
deserialise = read . BS.unpack

deriving instance Show Tree
deriving instance Read Tree