Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,323
Issues
4,323
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
376
Merge Requests
376
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
4a1b418e
Commit
4a1b418e
authored
Jul 19, 2001
by
simonpj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2001-07-19 09:26:08 by simonpj]
Move eqListBy to Util, and use it
parent
2ab55bbc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
ghc/compiler/hsSyn/HsCore.lhs
ghc/compiler/hsSyn/HsCore.lhs
+2
-1
ghc/compiler/hsSyn/HsDecls.lhs
ghc/compiler/hsSyn/HsDecls.lhs
+1
-0
ghc/compiler/hsSyn/HsTypes.lhs
ghc/compiler/hsSyn/HsTypes.lhs
+1
-6
ghc/compiler/utils/Util.lhs
ghc/compiler/utils/Util.lhs
+6
-1
No files found.
ghc/compiler/hsSyn/HsCore.lhs
View file @
4a1b418e
...
...
@@ -26,7 +26,7 @@ module HsCore (
-- friends:
import HsTypes ( HsType, pprParendHsType, pprHsTyVarBndr, toHsType,
HsTupCon(..), EqHsEnv, hsTupParens,
emptyEqHsEnv, extendEqHsEnv,
eqListBy,
emptyEqHsEnv, extendEqHsEnv,
eq_hsType, eq_hsVars
)
...
...
@@ -48,6 +48,7 @@ import Type ( Kind, eqKind )
import BasicTypes ( Arity )
import FiniteMap ( lookupFM )
import CostCentre
import Util ( eqListBy )
import Outputable
\end{code}
...
...
ghc/compiler/hsSyn/HsDecls.lhs
View file @
4a1b418e
...
...
@@ -42,6 +42,7 @@ import FunDeps ( pprFundeps )
import Class ( FunDep, DefMeth(..) )
import CStrings ( CLabelString )
import Outputable
import Util ( eqListBy )
import SrcLoc ( SrcLoc )
import FastString
\end{code}
...
...
ghc/compiler/hsSyn/HsTypes.lhs
View file @
4a1b418e
...
...
@@ -46,6 +46,7 @@ import PrelNames ( mkTupConRdrName, listTyConKey, usOnceTyConKey, usManyTyConKey
usOnceTyConName, usManyTyConName
)
import FiniteMap
import Util ( eqListBy )
import Outputable
\end{code}
...
...
@@ -470,10 +471,4 @@ eq_hsPred env (HsClassP c1 tys1) (HsClassP c2 tys2)
eq_hsPred env (HsIParam n1 ty1) (HsIParam n2 ty2)
= n1 == n2 && eq_hsType env ty1 ty2
eq_hsPred env _ _ = False
-------------------
eqListBy :: (a->a->Bool) -> [a] -> [a] -> Bool
eqListBy eq [] [] = True
eqListBy eq (x:xs) (y:ys) = eq x y && eqListBy eq xs ys
eqListBy eq xs ys = False
\end{code}
ghc/compiler/utils/Util.lhs
View file @
4a1b418e
...
...
@@ -41,7 +41,7 @@ module Util (
foldl2, count,
-- comparisons
thenCmp, cmpList, prefixMatch, suffixMatch,
eqListBy,
thenCmp, cmpList, prefixMatch, suffixMatch,
-- strictness
foldl', seqList,
...
...
@@ -639,6 +639,11 @@ count p (x:xs) | p x = 1 + count p xs
%************************************************************************
\begin{code}
eqListBy :: (a->a->Bool) -> [a] -> [a] -> Bool
eqListBy eq [] [] = True
eqListBy eq (x:xs) (y:ys) = eq x y && eqListBy eq xs ys
eqListBy eq xs ys = False
thenCmp :: Ordering -> Ordering -> Ordering
{-# INLINE thenCmp #-}
thenCmp EQ any = any
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment