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

import Micro.Types
import Data.Aeson as Aeson
import Data.ByteString.Lazy as BS
import Data.Maybe

serialise :: Tree -> BS.ByteString
serialise = Aeson.encode

deserialise :: BS.ByteString -> Tree
deserialise = fromJust . Aeson.decode'

instance ToJSON   Tree
instance FromJSON Tree