Skip to content

ZHaskell/z-messagepack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Z-MessagePack

Hackage Linux Build Status MacOS Build Status Windows Build Status Gitter chat

This package is part of Z project, provides MessagePack codecs.

Requirements

  • A working haskell compiler system, GHC(>=8.6), cabal-install(>=2.4), hsc2hs.

  • Tests need hspec-discover.

Example usage

{-# LANGUAGE DeriveGeneric, DeriveAnyClass, DerivingStrategies, TypeApplication #-}

import           GHC.Generics
import qualified Z.MessagePack as MessagePack
import           Z.MessagePack (MessagePack)
import qualified Z.Data.Text as T

data Person = Person
    { name  :: T.Text
    , age   :: Int
    , magic :: Bool
    }
  deriving (Show, Generic)
  deriving anyclass MessagePack

> MessagePack.encode [Person {name = "Erik Weisz", age = 52, magic = True}]
> [145,131,164,110,97,109,101,170,69,114,105,107,32,87,101,105,115,122,163,97,103,101,52,165,109,97,103,105,99,195]

Releases

No releases published

Packages

No packages published