Giter Club home page Giter Club logo

msgpack-haskell's Introduction

msgpack-haskell's People

Contributors

2mol avatar beam2d avatar delta2323 avatar fommil avatar hinsley avatar hiroshinoji avatar hvr avatar hvriedel avatar iphydf avatar kuenishi avatar mwotton avatar oiwah avatar pepshiso avatar qoelet avatar reiddraper avatar symbiont-rahul-muttineni avatar symbiont-sam-halliday avatar tanakh avatar unnonouno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msgpack-haskell's Issues

Does not build with network-conduit-0.6.0

I deleted .ghc and:


Downloading network-conduit-0.6.1.1...
Configuring network-conduit-0.6.1.1...
Building network-conduit-0.6.1.1...
Preprocessing library network-conduit-0.6.1.1...
[1 of 4] Compiling Data.Conduit.Network.Utils ( Data/Conduit/Network/Utils.hs, dist/build/Data/Conduit/Network/Utils.o )
[2 of 4] Compiling Data.Conduit.Network.UDP ( Data/Conduit/Network/UDP.hs, dist/build/Data/Conduit/Network/UDP.o )
[3 of 4] Compiling Data.Conduit.Network.Internal ( Data/Conduit/Network/Internal.hs, dist/build/Data/Conduit/Network/Internal.o )
[4 of 4] Compiling Data.Conduit.Network ( Data/Conduit/Network.hs, dist/build/Data/Conduit/Network.o )
[1 of 4] Compiling Data.Conduit.Network.Utils ( Data/Conduit/Network/Utils.hs, dist/build/Data/Conduit/Network/Utils.p_o )
[2 of 4] Compiling Data.Conduit.Network.UDP ( Data/Conduit/Network/UDP.hs, dist/build/Data/Conduit/Network/UDP.p_o )
[3 of 4] Compiling Data.Conduit.Network.Internal ( Data/Conduit/Network/Internal.hs, dist/build/Data/Conduit/Network/Internal.p_o )
[4 of 4] Compiling Data.Conduit.Network ( Data/Conduit/Network.hs, dist/build/Data/Conduit/Network.p_o )
Registering network-conduit-0.6.1.1...
Running Haddock for network-conduit-0.6.1.1...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: rts-1.0
Preprocessing library network-conduit-0.6.1.1...
Haddock coverage:
  80% (  4 /  5) in 'Data.Conduit.Network.Utils'
  92% ( 12 / 13) in 'Data.Conduit.Network.UDP'
  75% (  3 /  4) in 'Data.Conduit.Network.Internal'
  63% ( 19 / 30) in 'Data.Conduit.Network'
Documentation created: dist/doc/html/network-conduit/index.html
Installing library in /home/ollie/.cabal/lib/network-conduit-0.6.1.1/ghc-7.4.2
Registering network-conduit-0.6.1.1...
Configuring msgpack-rpc-0.8.0...
Building msgpack-rpc-0.8.0...
Preprocessing library msgpack-rpc-0.8.0...
[1 of 2] Compiling Network.MessagePackRpc.Client ( Network/MessagePackRpc/Client.hs, dist/build/Network/MessagePackRpc/Client.o )

Network/MessagePackRpc/Client.hs:76:17:
    Not in scope: data constructor `ClientSettings'
Updating documentation index /home/ollie/.cabal/share/doc/index.html
cabal: Error: some packages failed to install:
msgpack-rpc-0.8.0 failed during the building phase. The exception was:
ExitFailure 1

If I cabal-install --constraint='network-conduit < 0.6' msgpack-rpc it all builds OK.

The type of Client.call cannot be named

I want to write a function that forwards to Client.call, but the type of Client.call contains an unnamable constraint (RpcType). I can still do it by using -fno-warn-missing-signatures, but I'd like to be able to specify the type of that function.

msgpack-idl README is outdated

The executable is now called mpidl, it has different command-line syntax, and it cannot compile the provided example.

msgpack-idl generate java codes which msgpack-java cannot serialize.

  • about Tuple:
    msgpack-java doesn't have serializer( org.msgpack.template.*Template class) for Tuple.java, so instances of generated Tuple class cannot be serialized. It would be better that TupleN.java is in msgpack-java.
  • about HashMap, ArrayList:
    Although msgpack-idl generates java codes using HashMap, ArrayList class for Map,List type, msgpack-java does have only have templates for interfaces of Map,List. It would be better that msgpack-idl generate java code using Map,List interfaces.

Sorry for not reporting concrete error messages. I would report concrete errors next week.

Infinite loop in client receiving "Just a" from a "Maybe a" method

Here is a simple example with Maybe String. The same happens with Maybe Int and probably with any other Maybe a. Returning Nothing works fine, but returning Just a causes an infinite loop in a symbol called msgpackzm1zi0zi0_DataziMessagePackziObject_zdwzdcfromObject_info.

As mentioned in the title, the infinite loop occurs on the client side. The server side is fine.

Makefile:

run: server.pid
        rm server.pid

server.pid: test-client test-server
        ./test-server & echo $$! > server.pid
        sleep 1
        -./test-client
        kill `cat server.pid`

%: %.hs
        ghc -package msgpack-rpc $<

clean:
        rm test-client test-server *.hi *.o

test-client.hs:

{-# LANGUAGE OverloadedStrings #-}
import           Control.Monad.IO.Class     (liftIO)
import           Network.MessagePack.Client

foo :: String -> Client (Maybe String)
foo = call "foo"

main :: IO ()
main = execClient "localhost" 1234 $ do
  ret <- foo "hello"
  liftIO $ print ret

test-server.hs:

import           Network.MessagePack.Server

foo :: String -> Server (Maybe String)
foo s = return $ Just s

main :: IO ()
main = serve 1234 [method "foo" foo]

My GHC version is 7.8.4, the msgpack and msgpack-rpc were both installed from a git clone up-to-date at the time of this bug submission.

New spec not supported ?

I am having trouble trying to deserialize json objects serialized by msgpack-python 0.4.0.

I keep getting error messages such as invalid raw tag 0x82 even with a small testing bytestring such as (python side):

msgpack.packb({"user":"vagrant","id":"localdev"})
Out[52]: '\x82\xc4\x04user\xc4\x07vagrant\xc4\x02id\xc4\x08localdev'

Am I using the library incorrectly (just using tryUnpack for now and never got a Right value?

Is the lib too old not supporting the latest msgapack protocol ? Is msgpack-haskell still active (it looks pretty inactive ...)

Any help appreciated. Thanks

execClient does not permit returning results

execClient returns IO (), so it always returns unit, preventing me from turning a Client a into an IO a. I'd like to be able to call an rpc method and then process the result further after tearing down the TCP connection without staying inside the Client monad.

Add support for Integer of MessagePack class

Currently, Integer is not supported by msgpack-haskell. Integer is a arbitrary precision integer type for Haskell.

int in python is also arbitrary.

It would be nice to add support for Integer in class MessagePack.

The behavior can be same as Python, if the value is under the permitted range, the encode the value, otherwise raise an error.

fromObject always returning Nothing

Maybe I'm just doing something wrong, but even doing something as simple as

fromObject $ toObject 8

returns Nothing. Am I missing something obvious?

Hackage release does not compile

A recent (-ish.. from 2015) commit fixed a compilation problem caused by missing Functor and DeriveDataTypable. Please create a new hackage release so I don't need to install from github.

Incorrect bounds

I have to make a revision on Hackage: https://hackage.haskell.org/package/msgpack-1.0.0/revisions/

As msgpack-1.0.0 uses OverloadedLists the base have to be restricted to >=4.7.

Also I added an upper bound on binary as there was name resolution clash for i.e. getInt8 on GHC8.0 build. Haven't investigated it further. I recommend adding upper bounds to all dependencies, it's much easier to relax them for most recent version, then try to restrict bounds afterwards.

Problem unpacking ADTs

I am new to Haskell, so perhaps I am mistaken in expecting the following to work, but it seems to me that MessagePack should be able to serialize any ADT.

{-# LANGUAGE TemplateHaskell #-}
import Data.MessagePack

data Test = X | Y | Z Int deriving Show
deriveObject True ''Test

main = do
  print ((unpack . pack) X :: Test)  -- "X" as expected
  print ((unpack . pack) Y :: Test)  -- "X", but expected "Y"
  print ((unpack . pack) $ Z 3 :: Test) -- "Z 3" as expected
  print $ pack X
  print $ pack Y
  print $ pack $ Z 3

mpidl returns error (mpidl: Prelude.undefined) on example input.

I installed msgpack-idl 0.2.0 using cabal, and tested it using the example in README, however the command quit with code 1 and message: "mpidl: Prelude.undefined".

I tested by outputting both cpp and python, but got same error.

Here's the log:

~/tmp> mpidl cpp -o cpp -n test foo.idl -p
[MPMessage {msgName = "UserInfo", msgParam = [], msgFields = [Field {fldId = 1, fldType = TInt True 32, fldName = "uid", fldDefault = Nothing},Field {fldId = 2, fldType = TString, fldName = "name", fldDefault = Nothing},Field {fldId = 3, fldType = TNullable (TInt True 32), fldName = "flags", fldDefault = Just (LInt 1)}]},MPEnum {enumName = "Sites", enumMem = [(0,"SiteA"),(1,"SiteB"),(2,"SiteC")]},MPMessage {msgName = "LogInLog", msgParam = [], msgFields = [Field {fldId = 1, fldType = TUserDef "UserInfo" [], fldName = "user", fldDefault = Nothing},Field {fldId = 2, fldType = TUserDef "Sites" [], fldName = "site", fldDefault = Nothing}]},MPService {serviceName = "foo", serviceVersion = Nothing, serviceMethods = [Function {methodInherit = False, methodName = "login", methodRetType = TBool, methodArgs = [Field {fldId = 1, fldType = TUserDef "Sites" [], fldName = "site", fldDefault = Nothing},Field {fldId = 2, fldType = TUserDef "UserInfo" [], fldName = "user", fldDefault = Nothing}]}]}]
mpidl: Prelude.undefined

Here's the foo.idl (there was an error on line 19 in the README example):

message UserInfo {
1: int uid
2: string name
3: int? flags = 1
}

enum Sites {
0: SiteA
1: SiteB
2: SiteC
}

message LogInLog {
1: UserInfo user
2: Sites site
}

service foo {
bool login(1: Sites site, 2: UserInfo user)
}

Best,
Jianshi

Maybe fix maybe maybe?

Using Maybe types leads to an infinite loop on the client:

import Control.Concurrent (forkIO)
import Data.MessagePack
import Network.MessagePack.Client
import Network.MessagePack.Server

getMaybeValue :: Server (Maybe Int)
getMaybeValue = return $ Just 42

getMaybeValue' :: Client (Maybe Int)
getMaybeValue' = call "getMaybeValue"

main = do
  forkIO $ serve 5000 [ method "getMaybeValue" getMaybeValue ]

  maybeValue <- execClient "127.0.0.1" 5000 getMaybeValue'
  print maybeValue -- Newer reaches this point

Allow binary-0.8

With binary-0.8, compilation fails because of ambiguity for functions like getWord16be. This should be fixable by changing the import of Data.Binary.

jubatus-msgpack-rpc header file location (C++ backend)

I'm using C++ backend, there seems a minor glitch in generated hpp files,

jubatus-msgpack-rpc will install header files into

 /usr/local/include/jubatus/msgpack/rpc/

but generated hpp file (i.e. classifier_client.hpp) uses

 #include <msgpack/rpc/client.h>

Shouldn't it be

 #include <jubatus/msgpack/rpc/client.h>

?

Jianshi

msgpack-1.0.0 fails to build

I get this error:

Resolving dependencies...
Configuring msgpack-1.0.0...
Building msgpack-1.0.0...
Preprocessing library msgpack-1.0.0...
[1 of 5] Compiling Data.MessagePack.Put ( src/Data/MessagePack/Put.hs, dist/dist-sandbox-39e50ff7/build/Data/MessagePack/Put.o )
[2 of 5] Compiling Data.MessagePack.Get ( src/Data/MessagePack/Get.hs, dist/dist-sandbox-39e50ff7/build/Data/MessagePack/Get.o )
[3 of 5] Compiling Data.MessagePack.Assoc ( src/Data/MessagePack/Assoc.hs, dist/dist-sandbox-39e50ff7/build/Data/MessagePack/Assoc.o )
[4 of 5] Compiling Data.MessagePack.Object ( src/Data/MessagePack/Object.hs, dist/dist-sandbox-39e50ff7/build/Data/MessagePack/Object.o )

src/Data/MessagePack/Object.hs:237:35:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1, MessagePack a2)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:236:10-65
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2]’
    In the expression: ObjectArray [toObject a1, toObject a2]
    In an equation for ‘toObject’:
        toObject (a1, a2) = ObjectArray [toObject a1, toObject a2]

src/Data/MessagePack/Object.hs:238:27:
    Couldn't match type ‘GHC.Exts.Item (V.Vector Object)’ with ‘Object’
    Expected type: V.Vector Object -> [Object]
      Actual type: V.Vector Object -> [GHC.Exts.Item (V.Vector Object)]
    In the pattern: [a1, a2]
    In the pattern: ObjectArray [a1, a2]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2])
          = (,) <$> fromObject a1 <*> fromObject a2

src/Data/MessagePack/Object.hs:238:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1, MessagePack a2)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:236:10-65
    In the pattern: [a1, a2]
    In the pattern: ObjectArray [a1, a2]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2])
          = (,) <$> fromObject a1 <*> fromObject a2

src/Data/MessagePack/Object.hs:242:39:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1, MessagePack a2, MessagePack a3)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:241:10-85
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2, toObject a3]’
    In the expression:
      ObjectArray [toObject a1, toObject a2, toObject a3]
    In an equation for ‘toObject’:
        toObject (a1, a2, a3)
          = ObjectArray [toObject a1, toObject a2, toObject a3]

src/Data/MessagePack/Object.hs:243:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1, MessagePack a2, MessagePack a3)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:241:10-85
    In the pattern: [a1, a2, a3]
    In the pattern: ObjectArray [a1, a2, a3]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2, a3])
          = (,,) <$> fromObject a1 <*> fromObject a2 <*> fromObject a3

src/Data/MessagePack/Object.hs:247:43:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:246:10-105
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2, toObject a3, toObject a4]’
    In the expression:
      ObjectArray [toObject a1, toObject a2, toObject a3, toObject a4]
    In an equation for ‘toObject’:
        toObject (a1, a2, a3, a4)
          = ObjectArray [toObject a1, toObject a2, toObject a3, ....]

src/Data/MessagePack/Object.hs:248:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:246:10-105
    In the pattern: [a1, a2, a3, a4]
    In the pattern: ObjectArray [a1, a2, a3, a4]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2, a3, a4])
          = (,,,) <$> fromObject a1 <*> fromObject a2 <*> fromObject a3
            <*> fromObject a4

src/Data/MessagePack/Object.hs:252:47:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:251:10-125
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2, toObject a3, toObject a4, ....]’
    In the expression:
      ObjectArray
        [toObject a1, toObject a2, toObject a3, toObject a4, ....]
    In an equation for ‘toObject’:
        toObject (a1, a2, a3, a4, a5)
          = ObjectArray [toObject a1, toObject a2, toObject a3, ....]

src/Data/MessagePack/Object.hs:253:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:251:10-125
    In the pattern: [a1, a2, a3, a4, a5]
    In the pattern: ObjectArray [a1, a2, a3, a4, a5]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2, a3, a4, a5])
          = (,,,,) <$> fromObject a1 <*> fromObject a2 <*> fromObject a3
            <*> fromObject a4
            <*> fromObject a5

src/Data/MessagePack/Object.hs:257:51:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:256:10-145
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2, toObject a3, toObject a4, ....]’
    In the expression:
      ObjectArray
        [toObject a1, toObject a2, toObject a3, toObject a4, ....]
    In an equation for ‘toObject’:
        toObject (a1, a2, a3, a4, a5, a6)
          = ObjectArray [toObject a1, toObject a2, toObject a3, ....]

src/Data/MessagePack/Object.hs:258:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:256:10-145
    In the pattern: [a1, a2, a3, a4, a5, a6]
    In the pattern: ObjectArray [a1, a2, a3, a4, a5, a6]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2, a3, a4, a5, a6])
          = (,,,,,) <$> fromObject a1 <*> fromObject a2 <*> fromObject a3
            <*> fromObject a4
            <*> fromObject a5
            <*> fromObject a6

src/Data/MessagePack/Object.hs:262:55:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6,
                      MessagePack a7)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:261:10-165
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2, toObject a3, toObject a4, ....]’
    In the expression:
      ObjectArray
        [toObject a1, toObject a2, toObject a3, toObject a4, ....]
    In an equation for ‘toObject’:
        toObject (a1, a2, a3, a4, a5, a6, a7)
          = ObjectArray [toObject a1, toObject a2, toObject a3, ....]

src/Data/MessagePack/Object.hs:263:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6,
                      MessagePack a7)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:261:10-165
    In the pattern: [a1, a2, a3, a4, a5, a6, a7]
    In the pattern: ObjectArray [a1, a2, a3, a4, a5, a6, a7]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2, a3, a4, a5, a6, a7])
          = (,,,,,,) <$> fromObject a1 <*> fromObject a2 <*> fromObject a3
            <*> fromObject a4
            <*> fromObject a5
            <*> fromObject a6
            <*> fromObject a7

src/Data/MessagePack/Object.hs:267:59:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6,
                      MessagePack a7,
                      MessagePack a8)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:266:10-185
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2, toObject a3, toObject a4, ....]’
    In the expression:
      ObjectArray
        [toObject a1, toObject a2, toObject a3, toObject a4, ....]
    In an equation for ‘toObject’:
        toObject (a1, a2, a3, a4, a5, a6, a7, a8)
          = ObjectArray [toObject a1, toObject a2, toObject a3, ....]

src/Data/MessagePack/Object.hs:268:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6,
                      MessagePack a7,
                      MessagePack a8)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:266:10-185
    In the pattern: [a1, a2, a3, a4, a5, a6, a7, a8]
    In the pattern: ObjectArray [a1, a2, a3, a4, a5, a6, a7, a8]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2, a3, a4, a5, a6, a7, a8])
          = (,,,,,,,) <$> fromObject a1 <*> fromObject a2 <*> fromObject a3
            <*> fromObject a4
            <*> fromObject a5
            <*> fromObject a6
            <*> fromObject a7
            <*> fromObject a8

src/Data/MessagePack/Object.hs:272:63:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6,
                      MessagePack a7,
                      MessagePack a8,
                      MessagePack a9)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:271:10-205
    In the first argument of ‘ObjectArray’, namely
      ‘[toObject a1, toObject a2, toObject a3, toObject a4, ....]’
    In the expression:
      ObjectArray
        [toObject a1, toObject a2, toObject a3, toObject a4, ....]
    In an equation for ‘toObject’:
        toObject (a1, a2, a3, a4, a5, a6, a7, a8, a9)
          = ObjectArray [toObject a1, toObject a2, toObject a3, ....]

src/Data/MessagePack/Object.hs:273:27:
    Could not deduce (GHC.Exts.IsList (V.Vector Object))
      arising from an overloaded list
    from the context (MessagePack a1,
                      MessagePack a2,
                      MessagePack a3,
                      MessagePack a4,
                      MessagePack a5,
                      MessagePack a6,
                      MessagePack a7,
                      MessagePack a8,
                      MessagePack a9)
      bound by the instance declaration
      at src/Data/MessagePack/Object.hs:271:10-205
    In the pattern: [a1, a2, a3, a4, a5, a6, a7, a8, a9]
    In the pattern: ObjectArray [a1, a2, a3, a4, a5, a6, a7, a8, a9]
    In an equation for ‘fromObject’:
        fromObject (ObjectArray [a1, a2, a3, a4, a5, a6, a7, a8, a9])
          = (,,,,,,,,) <$> fromObject a1 <*> fromObject a2 <*> fromObject a3
            <*> fromObject a4
            <*> fromObject a5
            <*> fromObject a6
            <*> fromObject a7
            <*> fromObject a8
            <*> fromObject a9
Failed to install msgpack-1.0.0
cabal: Error: some packages failed to install:
msgpack-1.0.0 failed during the building phase. The exception was:
ExitFailure 1

Output of cabal list --simple-output --installed:

Cabal 1.18.1.3
GLURaw 1.4.0.1
GLUT 2.5.1.1
HTTP 4000.2.10
HUnit 1.2.5.2
OpenGL 2.9.2.0
OpenGLRaw 1.5.0.0
QuickCheck 2.6
array 0.5.0.0
async 2.0.1.5
attoparsec 0.10.4.0
base 4.7.0.1
bin-package-db 0.0.0.0
binary 0.7.1.0
blaze-builder 0.4.0.1
bytestring 0.10.4.0
case-insensitive 1.1.0.3
containers 0.5.5.1
data-binary-ieee754 0.4.4
deepseq 1.3.0.2
directory 1.2.1.0
fgl 5.5.0.1
filepath 1.3.0.2
ghc 7.8.3
ghc-prim 0.3.1.0
hashable 1.2.2.0
hashable 1.2.3.2
haskeline 0.7.1.2
haskell-src 1.0.1.6
haskell2010 1.1.2.0
haskell98 2.0.0.3
hoopl 3.10.0.1
hpc 0.6.0.1
hscolour 1.20.3
html 1.0.1.2
integer-gmp 0.5.1.0
mtl 2.1.3.1
mtl 2.2.1
network 2.4.2.3
old-locale 1.0.0.6
old-time 1.1.0.2
parallel 3.2.0.4
parsec 3.1.5
pretty 1.1.1.1
primitive 0.5.2.1
process 1.2.0.0
random 1.0.1.1
regex-base 0.93.2
regex-compat 0.95.1
regex-posix 0.95.2
rts 1.0
split 0.2.2
stm 2.4.2
syb 0.4.1
template-haskell 2.9.0.0
terminfo 0.4.0.0
text 1.1.0.0
text 1.2.0.4
time 1.4.2
transformers 0.3.0.0
transformers 0.4.3.0
unix 2.7.0.1
unordered-containers 0.2.4.0
unordered-containers 0.2.5.1
vector 0.10.9.1
xhtml 3000.2.1
zlib 0.5.4.1

Add to stackage

Hey, would you mind adding this library to Stackage?

I'd like to add my library that depends on it to Stackage.

msgpack fails to decode fixstr

Even if msgpack does not make use of fixstr during encoding, msgpack should be able to parse fixstr, but it fails:

Python:

>>> import msgpack
>>> msgpack.packb('abc')
'\xa3abc'
>>> msgpack.unpackb('\xa3abc')
'abc'

ghci:

Prelude> import Data.Binary
Prelude Data.Binary> import Data.MessagePack
Prelude Data.Binary Data.MessagePack> :set -XOverloadedStrings
Prelude Data.Binary Data.MessagePack> Data.Binary.decode "\xa3abc" :: Data.MessagePack.Object
*** Exception: Data.Binary.Get.runGet at position 1: Data.Binary.Get(Alternative).empty
CallStack (from HasCallStack):
  error, called at libraries/binary/src/Data/Binary/Get.hs:342:5 in binary-0.8.3.0:Data.Binary.Get

Intermediate form for typeclass?

Perhaps I've just missed it, but I'd really like to have a typeclass for going from Object to an arbitrary type 'a'. We have Unpackable for going from ByteString to a, but sometimes I'd like to do some editing on the structure first. (In this case, I want to merge two ObjectMaps with a left bias before passing them on to the target type.)

for example, Aeson does this with fromJSON:

http://hackage.haskell.org/packages/archive/aeson/0.1.0.0/doc/html/Data-Aeson.html

ParseError when client closes connection

I'm testing out msgpack-haskell, and my test application works fine - I can call a test method and see that the server receives the call correctly, and the client receives a return value successfully. However, there's a problem: every time a client disconnects from the server I get this printed to the console:

ParseError {errorContexts = ["demandInput"], errorMessage = "not enough bytes", errorPosition = 1:1}

This error seems to be coming from attoparsec. Maybe the parser isn't correctly handling the situation where the connection terminates and it gets EOF?

I'm using attoparsec 0.10.4.0, network-conduit 1.0.0, msgpack 0.7.1.5, and msgpack-rpc 0.9.0. I do see that msgpack 0.7.2.5 exists, but I can't install it as cabal warns it will break haskell platform due to updated dependencies. If this is fixed in msgpack 0.7.2.5, it'd be really great if a fix was back ported to something that will build on the current haskell platform.

Unable to build msgpack

`D:\ALL_FILES\installers\HASKELL\msgpack-haskell-master\msgpack>runhaskell setup.
lhs build
Warning: If linking fails, consider installing KB2533623.
Building msgpack-1.0.0...
Preprocessing library msgpack-1.0.0...
[2 of 5] Compiling Data.MessagePack.Get ( src\Data\MessagePack\Get.hs, dist\buil
d\Data\MessagePack\Get.o )

src\Data\MessagePack\Get.hs:53:30: error:
Ambiguous occurrence getInt8' It could refer to either Data.Binary.Get.getInt8',
imported from Data.Binary.Get' at src\Data\Message Pack\Get.hs:25:1-32 or Data.MessagePack.Get.getInt8',
defined at src\Data\MessagePack\Get.hs:123:1

src\Data\MessagePack\Get.hs:54:30: error:
Ambiguous occurrence getInt16be' It could refer to either Data.Binary.Get.getInt16be',
imported from Data.Binary.Get' at src\Data\Message Pack\Get.hs:25:1-32 or Data.MessagePack.Get.getInt16be',
defined at src\Data\MessagePack\Get.hs:126:1

src\Data\MessagePack\Get.hs:55:30: error:
Ambiguous occurrence getInt32be' It could refer to either Data.Binary.Get.getInt32be',
imported from Data.Binary.Get' at src\Data\Message Pack\Get.hs:25:1-32 or Data.MessagePack.Get.getInt32be',
defined at src\Data\MessagePack\Get.hs:129:1

src\Data\MessagePack\Get.hs:56:30: error:
Ambiguous occurrence getInt64be' It could refer to either Data.Binary.Get.getInt64be',
imported from Data.Binary.Get' at src\Data\Message Pack\Get.hs:25:1-32 or Data.MessagePack.Get.getInt64be',
defined at src\Data\MessagePack\Get.hs:132:1

D:\ALL_FILES\installers\HASKELL\msgpack-haskell-master\msgpack>`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.