[Haskell-cafe] Non-advanced usage of Type classes
Yves Parès
limestrael at gmail.com
Wed Jun 8 00:34:08 CEST 2011
...and the other one being operational (which I find simpler).
2011/6/8 Brandon Allbery <allbery.b at gmail.com>
> On Tue, Jun 7, 2011 at 16:16, Arnaud Bailly <arnaud.oqube at gmail.com>
> wrote:
> > For example, while designing some program (a game...) I defined a type
> class
> > thus:
> >
> >> class (Monad io) => CommandIO io where
> >> readCommand :: io Command
> >> writeResult :: CommandResult -> io ()
>
> This is in fact one of the reasons to use type classes. In fact,
> you'll find a somewhat more general variety of it on Hackage in a
> couple of forms, the one I'm most familiar with being MonadPrompt.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110608/79486b09/attachment.htm>
More information about the Haskell-Cafe
mailing list