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,324
Issues
4,324
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
385
Merge Requests
385
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
17cbca82
Commit
17cbca82
authored
Aug 25, 1997
by
sof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 1997-08-25 22:24:30 by sof]
Removed use of COMPILING_GHC; removed intersectLists from export list
parent
38a2dde0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
31 deletions
+10
-31
ghc/compiler/utils/ListSetOps.lhs
ghc/compiler/utils/ListSetOps.lhs
+10
-31
No files found.
ghc/compiler/utils/ListSetOps.lhs
View file @
17cbca82
...
...
@@ -4,28 +4,29 @@
\section[ListSetOps]{Set-like operations on lists}
\begin{code}
#ifdef COMPILING_GHC
#include "HsVersions.h"
#endif
module ListSetOps (
unionLists,
intersectLists,
--UNUSED:
intersectLists,
minusList
#ifndef COMPILING_GHC
, disjointLists, intersectingLists
#endif
) where
#if defined(COMPILING_GHC)
IMP_Ubiq(){-uitous-}
import Util ( isIn, isn'tIn )
#if __GLASGOW_HASKELL__ >= 202
import List
#endif
\end{code}
\begin{code}
unionLists :: (Eq a) => [a] -> [a] -> [a]
#ifdef REALLY_HASKELL_1_3
unionLists = union
#else
unionLists [] [] = []
unionLists [] b = b
unionLists a [] = a
...
...
@@ -33,12 +34,10 @@ unionLists (a:as) b
| a `is_elem` b = unionLists as b
| otherwise = a : unionLists as b
where
#if defined(COMPILING_GHC)
is_elem = isIn "unionLists"
#else
is_elem = elem
#endif
{- UNUSED
intersectLists :: (Eq a) => [a] -> [a] -> [a]
intersectLists [] [] = []
intersectLists [] b = []
...
...
@@ -47,11 +46,8 @@ intersectLists (a:as) b
| a `is_elem` b = a : intersectLists as b
| otherwise = intersectLists as b
where
#if defined(COMPILING_GHC)
is_elem = isIn "intersectLists"
#else
is_elem = elem
#endif
-}
\end{code}
Everything in the first list that is not in the second list:
...
...
@@ -59,23 +55,6 @@ Everything in the first list that is not in the second list:
minusList :: (Eq a) => [a] -> [a] -> [a]
minusList xs ys = [ x | x <- xs, x `not_elem` ys]
where
#if defined(COMPILING_GHC)
not_elem = isn'tIn "minusList"
#else
not_elem = notElem
#endif
\end{code}
\begin{code}
#if ! defined(COMPILING_GHC)
disjointLists, intersectingLists :: Eq a => [a] -> [a] -> Bool
disjointLists [] bs = True
disjointLists (a:as) bs
| a `elem` bs = False
| otherwise = disjointLists as bs
intersectingLists xs ys = not (disjointLists xs ys)
#endif
\end{code}
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