[Haskell-cafe] Configuration Problem and Plugins
M. George Hansen
technopolitica at gmail.com
Sun Sep 4 07:44:59 CEST 2011
On Sat, Sep 3, 2011 at 12:33 AM, Max Rabkin <max.rabkin at gmail.com> wrote:
> On Sat, Sep 3, 2011 at 03:15, M. George Hansen <technopolitica at gmail.com> wrote:
>> Greetings,
>>
>> I'm a Python programmer who is relatively new to Haskell, so go easy on me :)
>>
>> I have a program that uses (or will use) plugins to render output to
>> the user in a generic way. I'm basing the design of the plugin
>> infrastructure on the Plugins library, and have the following
>> interface:
>>
>> data Renderer = Renderer {
>> initialize :: IO (),
>> destroy :: IO (),
>> render :: SystemOutput -> IO ()
>> }
>
> How about having initialize return the render (and destroy, if
> necessary) functions:
>
> initialize :: IO (SystemOutput -> IO ())
>
> or
>
> initialize :: IO (SystemOutput -> IO (), IO())
>
Thanks for your reply. That does seem like the best solution, I'll
give it a try.
--
M. George Hansen
More information about the Haskell-Cafe
mailing list