blob: d7b22321eed732ee14a74ad0e53defe7fcb33e2b [file] [log] [blame]
iproctorff8eb922007-07-25 19:06:13 +00001Haskell Thrift Bindings
2
3Running: you need -fglasgow-exts.
4
5Enums: become haskell data types. Use fromEnum to get out the int value.
6
7Structs: become records. Field labels are ugly, of the form f_STRUCTNAME_FIELDNAME. All fields are Maybe types.
8
9Exceptions: identical to structs. Throw them with throwDyn. Catch them with catchDyn.
10
11Client: just a bunch of functions. You may have to import a bunch of client files to deal with inheritance.
12
13Interface: You should only have to import the last one in the chain of inheritors. To make an interface, declare a label:
14data MyIface = MyIface
15and then declare it an instance of each iface class, starting with the superest class and proceding down (all the while defining the methods).
16Then pass your label to process as the handler.
17
18Processor: Just a function that takes a handler label, protocols. It calls the superclasses process if there is a superclass.
19
20
21Note: Protocols implement flush as well as transports and do not have a getTransport method. This is because I couldn't get getTransport to typecheck. Shrug.
22