Commit 0f3fa783 authored by bbr's avatar bbr
Browse files

qualified reading in all external instances

parent b2349764
......@@ -113,6 +113,7 @@ instance (Show t0) => Show (C_Array t0) where
instance (Read t0) => Read (C_Array t0) where
readsPrec d r = readParen (d>10) (\ r -> [ (C_Array x1,r1) | ("Array",r0) <- lex r,
(x1,r1) <- readsPrec 11 r0]) r
readsPrec d r = readParen (d>10)
(\ r -> [ (C_Array x1,r1) | (_,r0) <- readQualified "IArray" "Array" r,
(x1,r1) <- readsPrec 11 r0]) r
......@@ -189,7 +189,7 @@ instance Read C_Four where
instance (Read t0) => Read (IOVal t0) where
readsPrec d r = readParen (d>10)
(\ r -> [ (IOVal x1,r1) | ("IOVal",r0) <- lex r,
(\ r -> [ (IOVal x1,r1) | (_,r0) <- readQualified "Prelude" "IOVal" r,
(x1,r1) <- readsPrec 11 r0]) r
instance Read (IO (IOVal a)) where
......@@ -199,7 +199,9 @@ instance Read (C_IO a) where
readsPrec = error "no reading IO"
instance Read C_Success where
readsPrec d r = Prelude.readParen(Prelude.False)(\ r -> [(,)(C_Success)(r0) | ((,) ((:) 'S' ((:) 'u' ((:) 'c' ((:) 'c' ((:) 'e' ((:) 's' ((:) 's' []))))))) r0) <- Prelude.lex(r)])(r)
readsPrec d r = Prelude.readParen(Prelude.False)
(\ r -> [(,)(C_Success)(r0) |
(_,r0) <- readQualified "Prelude" "Success" r])(r)
instance Read a => Read (Prim a) where
readsPrec p s = map (\(x,y) -> (PrimValue x,y)) (readsPrec p s)
......@@ -219,20 +221,20 @@ instance Read (a->b) where
instance Read DataPrelude.C_Nat where
readsPrec d r =
readParen False (\ r -> [(C_IHi,r0) | ("IHi",r0) <- lex r]) r
++ readParen (d>10) (\ r -> [(C_O x1,r1) | ("O" ,r0) <- lex r,
(x1 ,r1) <- readsPrec 11 r0]) r
++ readParen (d>10) (\ r -> [(C_I x1,r1) | ("I" ,r0) <- lex r,
(x1 ,r1) <- readsPrec 11 r0]) r
readParen False (\ r -> [(C_IHi,r0) | (_ ,r0) <- readQualified "Prelude" "IHi" r]) r
++ readParen (d>10) (\ r -> [(C_O x1,r1) | (_ ,r0) <- readQualified "Prelude" "O" r,
(x1,r1) <- readsPrec 11 r0]) r
++ readParen (d>10) (\ r -> [(C_I x1,r1) | (_ ,r0) <- readQualified "Prelude" "I" r,
(x1,r1) <- readsPrec 11 r0]) r
++ [(toCurry i,r0) | (i::Integer,r0) <- reads r]
instance Read DataPrelude.C_Int where
readsPrec d r =
readParen (d>10) (\ r -> [(C_Neg x1,r1) | ("Neg",r0) <- lex r,
(x1,r1) <- readsPrec 11 r0]) r
++ readParen False (\ r -> [(C_Zero,r0) | ("Zero",r0) <- lex r]) r
++ readParen (d>10) (\ r -> [(C_Pos x1,r1) | ("Pos",r0) <- lex r,
(x1,r1) <- readsPrec 11 r0]) r
readParen (d>10) (\ r -> [(C_Neg x1,r1) | (_ ,r0) <- readQualified "Prelude" "Neg" r,
(x1,r1) <- readsPrec 11 r0]) r
++ readParen False (\ r -> [(C_Zero,r0) | (_ ,r0) <- readQualified "Prelude" "Zero" r]) r
++ readParen (d>10) (\ r -> [(C_Pos x1,r1) | (_ ,r0) <- readQualified "Prelude" "Pos" r,
(x1,r1) <- readsPrec 11 r0]) r
++ [(toCurry i,r0) | (i::Integer,r0) <- reads r]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment