msgpack / msgpack-haskell

Haskell implementation of MessagePack / msgpack.org[Haskell]
http://hackage.haskell.org/package/msgpack
138 stars 80 forks source link

Maybe fix maybe maybe? #60

Closed Thhethssmuz closed 5 years ago

Thhethssmuz commented 8 years ago

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