Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[enhance] stdlib,opaserialize: add a custom serialisation for type bo…

…ol (solves issue 47)

many thanks to Alok Menghrajani for pointing the issue #47
  • Loading branch information...
commit d3a6565d8c91c63b4a27529d36bff8135e0943c2 1 parent cf934ac
@OpaOnWindowsNow OpaOnWindowsNow authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 stdlib/core/rpc/core/opaserialize.opa
View
13 stdlib/core/rpc/core/opaserialize.opa
@@ -885,6 +885,19 @@ OpaSerializeClosure = {{
}} /* disabled : OpaValue.interface */
+
+@private serialize_bool(b:bool,_):RPC.Json.json =
+ {Bool=b}
+
+@private unserialize_bool(b:RPC.Json.json):option(bool) =
+ match b
+ ~{Bool} -> some(Bool)
+ _ -> none
+ end
+
+@serializer(bool) serialization_bool = (serialize_bool,unserialize_bool)
+
+
/**
* Deprecated, [un]serialize
*/
Please sign in to comment.
Something went wrong with that request. Please try again.