
On Mon, Jul 09, 2007 at 09:41:32PM +0100, Claus Reinke wrote:
hiding concrete types in existentials sometimes only defers problems instead of solving them, but exposing class interfaces instead of types is a useful way to mitigate that effect. it just so happens that this particular problem, reading an existential type, slightly exceeds that pattern, as 'read' needs to know the hidden type to do its job ('read' does not determine the type from the input form, but uses the type to determine what form.the input should have). a workaround is to try to read all possible types, then hide the type again once a match is found. the main disadvantage of this method is that we need a list of all the types that could possibly be hidden
As a follow up, mainly meant to thank you, I wanted to let you know that I adopted this approach in a piece of software I'm writing. It's a status bar for the XMonad Window Manager, the tiling WM written in Haskell.[1] Actually it is a text based status bar that can be used with any WM, but we love XMonad particularly...;-) More information about this status bar can be found here: http://www.haskell.org/pipermail/xmonad/2007-July/001442.html with link to the source code, a screen shot and eve a link to a binary. I obviously credited you for the help and the code![2] One again, thank you. All the best, Andrea [1] http://xmonad.org/ [2] http://gorgias.mine.nu/repos/xmobar/Runnable.hs