From: simonpj Date: Mon, 1 Oct 2001 09:40:26 +0000 (+0000) Subject: [project @ 2001-10-01 09:40:26 by simonpj] X-Git-Tag: Approximately_9120_patches~895 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e335258339033509337c7582fb2b27d890a7599d;p=ghc-hetmet.git [project @ 2001-10-01 09:40:26 by simonpj] Add a rule for equality on strings --- 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@}