On Sat, Jun 16, 2012 at 3:31 PM, Corentin Dupont <corentin.dup...@gmail.com>wrote:
> Hi Alexander, > sorry my initial example was maybe misleading. What I really what to do is > to associate each event with an arbitrary data type. For example, consider > the following events: > NewPlayer > NewRule > Message > User > > I want to associate the following data types with each, to pass to there > respective handlers: > NewPlayer ---> Player > NewRule ---> Rule > Message ---> String > User ---> String > > Message and User have the same data type associated, that's why we can't > use this type as a key to index the event... > > In that case, you definitely want FunctionalDependencies or TypeFamilies, and will probably want to drop the constraint (Handler e d) on Event e (if it doesn't work), and maybe enforce it with explicit exports.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe