From 9e91eeb1a6da76bde09ea5f432d9730c5ff4b1e0 Mon Sep 17 00:00:00 2001
From: sewardj <unknown>
Date: Wed, 5 Apr 2000 11:39:07 +0000
Subject: [PATCH] [project @ 2000-04-05 11:39:07 by sewardj] * Change showsPrec
 on ErrorCall to include "error: " * Go back to old defn of length; new
 version requires O(N) stack :-(

---
 ghc/lib/hugs/PrimPrel.hs | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/ghc/lib/hugs/PrimPrel.hs b/ghc/lib/hugs/PrimPrel.hs
index 4f6846dbe53f..43948080257f 100644
--- a/ghc/lib/hugs/PrimPrel.hs
+++ b/ghc/lib/hugs/PrimPrel.hs
@@ -1136,26 +1136,21 @@ null (_:_)        = False
 (x:xs) ++ ys      = x : (xs ++ ys)
 
 map              :: (a -> b) -> [a] -> [b]
---map f xs          = [ f x | x <- xs ]
 map f []     = []
 map f (x:xs) = f x : map f xs
 
 
 filter           :: (a -> Bool) -> [a] -> [a]
---filter p xs       = [ x | x <- xs, p x ]
-filter p [] = []
+filter p []     = []
 filter p (x:xs) = if p x then x : filter p xs else filter p xs
 
 
 concat           :: [[a]] -> [a]
---concat            = foldr (++) []
 concat []       = []
 concat (xs:xss) = xs ++ concat xss
 
 length           :: [a] -> Int
---length            = foldl' (\n _ -> n + 1) 0
-length []     = 0
-length (x:xs) = let n = length xs in primSeq n (1+n)
+length            = foldl' (\n _ -> n + 1) 0
 
 (!!)             :: [b] -> Int -> b
 (x:_)  !! 0       = x
@@ -1793,7 +1788,7 @@ instance Show AsyncException where
 instance Show Exception where
   showsPrec _ (IOException err)	         = shows err
   showsPrec _ (ArithException err)       = shows err
-  showsPrec _ (ErrorCall err)	         = showString err
+  showsPrec _ (ErrorCall err)	         = showString ("error: " ++ err)
   showsPrec _ (NoMethodError err)        = showString err
   showsPrec _ (PatternMatchFail err)     = showString err
   showsPrec _ (NonExhaustiveGuards err)  = showString err
-- 
GitLab