Top Level TWI's again was Re: [Haskell] Re: Parameterized Show

Benjamin Franksen benjamin.franksen at
Tue Nov 23 06:46:25 EST 2004

On Tuesday 23 November 2004 10:39, Keean Schupke wrote:
> Adrian Hey wrote:
> >This is one situation, but certainly not the only possible one. You have
> >the same problem with interfacing to any unique stateful resource (or
> >even if you have a multiple but finite supply of these resources).
> No you don't... Most devices have registers, those registers contain
> values, you can inspect those values to see if the device has been
> initialised. You can then write a guard on the initialisation that really
> checks if the device has (or hasn't) been initialised rather than rely
> on some
> 'shadow' copies in RAM.

Alas, unfortunately not every device is designed in this way (I can give 
examples if you want). Adrian is right in that there is not only badly 
designed C libraries but also badly designed hardware!

Top level things with identity are evil.	-- Lennart Augustsson

More information about the Haskell mailing list