mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
make () to OBJECT instance (Nil)
This commit is contained in:
parent
674c26d9c7
commit
dbe760d6e2
1 changed files with 5 additions and 0 deletions
|
|
@ -46,6 +46,11 @@ instance OBJECT Object where
|
|||
fromObjectError :: String
|
||||
fromObjectError = "fromObject: cannot cast"
|
||||
|
||||
instance OBJECT () where
|
||||
toObject = const ObjectNil
|
||||
fromObject ObjectNil = Right ()
|
||||
fromObject _ = Left fromObjectError
|
||||
|
||||
instance OBJECT Int where
|
||||
toObject = ObjectInteger
|
||||
fromObject (ObjectInteger n) = Right n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue