Hey,
Brining more types to IoT seems like a cool idea :)
Here are just some quick thoughts by me googling about MQTT:
but the similarities seem to stop there.. For example, there doesn't seem to be any notion of content types of requests and responses, whilst content negotiation is one of the core features of Servant (in my opinion).
Because MQTT doesn't have this notion, I'm not sure how one would implement type-directed routing ala Servant. You would have to implement some notion of content types on top of MQTT, but that would perhaps make
it hard to interact with existing MQTT implementations. Do you know if there are standard extensions that add this kind of functionality?
Secondly, from a glance, MQTT
seems to be a very bi-directional protocol that supports many to many
communication, whilst HTTP (and servant) is very client-server oriented.
I'm sure there is merit in doing a typed (servant-like) approach to MQTT topics, but I'm not sure if putting it in servant is the right approach. Given the very different natures of these protocols.
However, I do think the type-level DSL could be re-used to write
give a good idea how to implement a MQTT-based router for such a DSL.
If you have any questions for implementing such a router yourself, feel free to ask them here, or poke me on IRC (#servant, arianvp).