haskell-distributed / distributed-process-client-server

Cloud Haskell - gen_server implementation
http://haskell-distributed.github.io
BSD 3-Clause "New" or "Revised" License
13 stars 11 forks source link

Compiler should enforce rules for prioritised processes #13

Closed hyperthunk closed 7 years ago

hyperthunk commented 7 years ago

Currently it's possible to pass a process definition containing handleExternal or handleControlChannel to pserve, but this will fail at runtime with something like ExitOther "IllegalControlChannel". It would be better if the compiler enforced this distinction, so instead of embedding ProcessDefinition inside of PrioritisedProcessDefinition, I think we should copy the fields across (and rename them) so we can avoid this. I might be necessary to move external handlers out of the apiHandlers group to achieve this, but I think that's a price worth paying for the additional type safety.