[Haskell-beginners] interface/abstract class: what is the haskell way?
Daniel Trstenjak
daniel.trstenjak at gmail.com
Fri Feb 8 14:24:02 CET 2013
Hi Emmanuel,
On Fri, Feb 08, 2013 at 01:51:26PM +0100, Emmanuel Touzery wrote:
> But that way I must still have public getEventProvider() function which
> returns the record, that I call by convention without some compiler
> enforcement, which doesn't sound right.
In some way you have to tell your program the available providers. How
should a compiler enforce this?
> I think what I am trying to achieve is a very common problem and I maybe
> suggested a bit too strongly how I would code it in OO languages, maybe it
> should be arranged completely differently in idiomatic haskell?
I think that the 'record of functions' is quite idiomatic Haskell for
this use case.
> Otherwise which Oleg as you talking about, maybe I would read that original
> post too.
I had pretty much the same issue and Oleg gave pretty much the same answer.
And there's really only one Oleg ;): http://okmij.org/ftp/
There's no way you could miss him hanging around in Haskell land for some time.
Greetings,
Daniel
More information about the Beginners
mailing list