[project @ 2000-04-10 12:12:27 by simonpj]
[ghc-hetmet.git] / ghc / lib / std / PrelRead.lhs
index c096e80..3f64865 100644 (file)
@@ -21,7 +21,6 @@ import PrelTup
 import PrelMaybe
 import PrelShow                -- isAlpha etc
 import PrelBase
-import Monad
 
 -- needed for readIO and instance Read Buffermode
 import PrelIOBase ( IO, userError, BufferMode(..) )
@@ -59,6 +58,22 @@ class  Read a  where
     readList   = readList__ reads
 \end{code}
 
+In this module we treat [(a,String)] as a monad in MonadPlus
+But MonadPlus isn't defined yet, so we simply give local
+declarations for mzero and guard suitable for this particular
+type.  It would also be reasonably to move MonadPlus to PrelBase
+along with Monad and Functor, but that seems overkill for one 
+example
+
+\begin{code}
+mzero :: [a]
+mzero = []
+
+guard :: Bool -> [()]
+guard True  = [()]
+guard False = []
+\end{code}
+
 %*********************************************************
 %*                                                     *
 \subsection{Utility functions}