From e335258339033509337c7582fb2b27d890a7599d Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 1 Oct 2001 09:40:26 +0000 Subject: [PATCH] [project @ 2001-10-01 09:40:26 by simonpj] Add a rule for equality on strings --- ghc/lib/std/PrelBase.lhs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghc/lib/std/PrelBase.lhs b/ghc/lib/std/PrelBase.lhs index 3407e1e..ae82fb6 100644 --- a/ghc/lib/std/PrelBase.lhs +++ b/ghc/lib/std/PrelBase.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelBase.lhs,v 1.52 2001/09/26 15:12:37 simonpj Exp $ +% $Id: PrelBase.lhs,v 1.53 2001/10/01 09:40:26 simonpj Exp $ % % (c) The University of Glasgow, 1992-2000 % @@ -452,11 +452,13 @@ String equality is used when desugaring pattern-matches against strings. \begin{code} eqString :: String -> String -> Bool -eqString = (==) +eqString [] [] = True +eqString (c1:cs1) (c2:cs2) = c1 == c2 && cs1 `eqString` cs2 {-# RULES "eqString" (==) = eqString #-} \end{code} + %********************************************************* %* * \subsection{Type @Int@} -- 1.7.10.4