Jan Laitenberger <[EMAIL PROTECTED]> writes:
>
>
> Hi,
>
> Excuse me for resubmitting my Problem with Hugs1.4June / Hugs981111.
> I just discovered that the code in my last mail was incomplete.
>
> Here it is (somehow simplified:)
>
>
> data SpecialOptions = SpecialOptions { x :: Int }
> deriving (Show, Read)
>
> data Options = Options { s :: SpecialOptions }
> deriving (Show, Read)
>
> initOptions = Options { s = SpecialOptions{x=42} }
>
> main :: Options
> main = (read . show) initOptions
>
>
>
> This program gives
>
> Program error: PreludeText.read: no parse
>
>
>
> main :: Int
> main = (read . show) 42
>
> works fine. The problem is that the show/read functions for
> nested data structures are incompatible...
>
> Does anyone know how to fix it?
>
Not an Officially Fix in any way, but try changing
your defn of Prelude.showField to
showField :: (Show a) => String -> a -> ShowS
showField m v = showString m .
showChar '=' .
showParen True (shows v)
--Sigbjorn