
8 May
2013
8 May
'13
5:59 p.m.
Hi.
The type of commandSender is:
(Serialize a, Serialize b) => a -> Handler (Maybe b)
But definition looks like this:
commandSender command reader writer = do ...
As I understund, command has type a and this function returns Handler (Maybe b). reader and writer doesn't fit here. What's going on?
Well, given this definition of commandSender taking three arguments, Handler must be a type synonym for a function type. Let's verify that: http://hackage.haskell.org/packages/archive/daemons/0.1.2/doc/html/Control-P... says:
type Handler r = Producer ByteString IO () -> Consumer ByteString IO () -> IO r
There you have your two extra arguments :) Cheers, Andres -- Andres Löh, Haskell Consultant Well-Typed LLP, http://www.well-typed.com