From: simonpj Date: Wed, 25 Sep 2002 15:16:30 +0000 (+0000) Subject: [project @ 2002-09-25 15:16:30 by simonpj] X-Git-Tag: nhc98-1-18-release~843 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ce9fdae6b57a3704f7cc98a100a266eef870df39;hp=06922eb27ec5f90178c287491283a21a97b9d8f3;p=ghc-base.git [project @ 2002-09-25 15:16:30 by simonpj] Remove readList__ --- diff --git a/GHC/Read.lhs b/GHC/Read.lhs index ad875c0..60805ff 100644 --- a/GHC/Read.lhs +++ b/GHC/Read.lhs @@ -41,7 +41,6 @@ module GHC.Read , readListDefault, readListPrecDefault -- Temporary - , readList__ , readParen ) where @@ -75,11 +74,10 @@ import GHC.Base import GHC.Arr \end{code} -------------------------------------------------------- - TEMPORARY UNTIL I DO DERIVED READ \begin{code} readParen :: Bool -> ReadS a -> ReadS a +-- A Haskell 98 function readParen b g = if b then mandatory else optional where optional r = g r ++ mandatory r mandatory r = do @@ -87,21 +85,6 @@ readParen b g = if b then mandatory else optional (x,t) <- optional s (")",u) <- lex t return (x,u) - - -readList__ :: ReadS a -> ReadS [a] - -readList__ readx - = readParen False (\r -> do - ("[",s) <- lex r - readl s) - where readl s = - (do { ("]",t) <- lex s ; return ([],t) }) ++ - (do { (x,t) <- readx s ; (xs,u) <- readl2 t ; return (x:xs,u) }) - - readl2 s = - (do { ("]",t) <- lex s ; return ([],t) }) ++ - (do { (",",t) <- lex s ; (x,u) <- readx t ; (xs,v) <- readl2 u ; return (x:xs,v) }) \end{code}