Type definition doesn't match with number of arguments

Hi, Please help me understund this code: http://hackage.haskell.org/packages/archive/daemons/0.1.2/doc/html/src/Contr... 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? Emanuel

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
participants (2)
-
Andres Löh
-
Emanuel Koczwara