Skip to content

gsuuon/MessagePack.FSharpExtensions

 
 

Repository files navigation

MessagePack.FSharpExtensions

NuGet Status Build status Build Status

MessagePack.FSharpExtensions is a MessagePack-CSharp extension library for F#.

Usage

open MessagePack
open MessagePack.Resolvers
open MessagePack.FSharp

CompositeResolver.RegisterAndSetAsDefault(
  FSharpResolver.Instance,
  StandardResolver.Instance
)

[<MessagePackObject>]
type UnionSample =
  | Foo of XYZ : int
  | Bar of OPQ : string list

let data = Foo 999

let bin = MessagePackSerializer.Serialize(data)

match MessagePackSerializer.Deserialize<UnionSample>(bin) with
| Foo x ->
  printfn "%d" x
| Bar xs ->
  printfn "%A" xs

About

MessagePack Extensions for F#. / msgpack.org[F#]

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 85.1%
  • F# 14.9%