Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gershomb
GHC
Commits
ff2b99e1
Commit
ff2b99e1
authored
5 years ago
by
Ömer Sinan Ağacan
Committed by
Marge Bot
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused UniqSupply functions
parent
b90437d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/basicTypes/UniqSupply.hs
+1
-42
1 addition, 42 deletions
compiler/basicTypes/UniqSupply.hs
with
1 addition
and
42 deletions
compiler/basicTypes/UniqSupply.hs
+
1
−
42
View file @
ff2b99e1
...
...
@@ -22,15 +22,12 @@ module UniqSupply (
mkSplitUniqSupply
,
splitUniqSupply
,
listSplitUniqSupply
,
splitUniqSupply3
,
splitUniqSupply4
,
-- * Unique supply monad and its abstraction
UniqSM
,
MonadUnique
(
..
),
liftUs
,
UniqSM
,
MonadUnique
(
..
),
-- ** Operations on the monad
initUs
,
initUs_
,
lazyThenUs
,
lazyMapUs
,
getUniqueSupplyM3
,
-- * Set supply strategy
initUniqSupply
...
...
@@ -114,22 +111,6 @@ uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily n
uniqsFromSupply
(
MkSplitUniqSupply
n
_
s2
)
=
mkUniqueGrimily
n
:
uniqsFromSupply
s2
takeUniqFromSupply
(
MkSplitUniqSupply
n
s1
_
)
=
(
mkUniqueGrimily
n
,
s1
)
-- | Build three 'UniqSupply' from a single one,
-- each of which can supply its own unique
splitUniqSupply3
::
UniqSupply
->
(
UniqSupply
,
UniqSupply
,
UniqSupply
)
splitUniqSupply3
us
=
(
us1
,
us2
,
us3
)
where
(
us1
,
us'
)
=
splitUniqSupply
us
(
us2
,
us3
)
=
splitUniqSupply
us'
-- | Build four 'UniqSupply' from a single one,
-- each of which can supply its own unique
splitUniqSupply4
::
UniqSupply
->
(
UniqSupply
,
UniqSupply
,
UniqSupply
,
UniqSupply
)
splitUniqSupply4
us
=
(
us1
,
us2
,
us3
,
us4
)
where
(
us1
,
us2
,
us'
)
=
splitUniqSupply3
us
(
us3
,
us4
)
=
splitUniqSupply
us'
{-
************************************************************************
* *
...
...
@@ -182,7 +163,6 @@ initUs_ :: UniqSupply -> UniqSM a -> a
initUs_
init_us
m
=
case
unUSM
m
init_us
of
{
UniqResult
r
_
->
r
}
{-# INLINE thenUs #-}
{-# INLINE lazyThenUs #-}
{-# INLINE returnUs #-}
{-# INLINE splitUniqSupply #-}
...
...
@@ -199,10 +179,6 @@ thenUs (USM expr) cont
=
USM
(
\
us0
->
case
(
expr
us0
)
of
UniqResult
result
us1
->
unUSM
(
cont
result
)
us1
)
lazyThenUs
::
UniqSM
a
->
(
a
->
UniqSM
b
)
->
UniqSM
b
lazyThenUs
expr
cont
=
USM
(
\
us0
->
let
(
result
,
us1
)
=
liftUSM
expr
us0
in
unUSM
(
cont
result
)
us1
)
thenUs_
::
UniqSM
a
->
UniqSM
b
->
UniqSM
b
thenUs_
(
USM
expr
)
(
USM
cont
)
=
USM
(
\
us0
->
case
(
expr
us0
)
of
{
UniqResult
_
us1
->
cont
us1
})
...
...
@@ -234,12 +210,6 @@ instance MonadUnique UniqSM where
getUniqueM
=
getUniqueUs
getUniquesM
=
getUniquesUs
getUniqueSupplyM3
::
MonadUnique
m
=>
m
(
UniqSupply
,
UniqSupply
,
UniqSupply
)
getUniqueSupplyM3
=
liftM3
(,,)
getUniqueSupplyM
getUniqueSupplyM
getUniqueSupplyM
liftUs
::
MonadUnique
m
=>
UniqSM
a
->
m
a
liftUs
m
=
getUniqueSupplyM
>>=
return
.
flip
initUs_
m
getUniqueUs
::
UniqSM
Unique
getUniqueUs
=
USM
(
\
us0
->
case
takeUniqFromSupply
us0
of
(
u
,
us1
)
->
UniqResult
u
us1
)
...
...
@@ -247,14 +217,3 @@ getUniqueUs = USM (\us0 -> case takeUniqFromSupply us0 of
getUniquesUs
::
UniqSM
[
Unique
]
getUniquesUs
=
USM
(
\
us0
->
case
splitUniqSupply
us0
of
(
us1
,
us2
)
->
UniqResult
(
uniqsFromSupply
us1
)
us2
)
-- {-# SPECIALIZE mapM :: (a -> UniqSM b) -> [a] -> UniqSM [b] #-}
-- {-# SPECIALIZE mapAndUnzipM :: (a -> UniqSM (b,c)) -> [a] -> UniqSM ([b],[c]) #-}
-- {-# SPECIALIZE mapAndUnzip3M :: (a -> UniqSM (b,c,d)) -> [a] -> UniqSM ([b],[c],[d]) #-}
lazyMapUs
::
(
a
->
UniqSM
b
)
->
[
a
]
->
UniqSM
[
b
]
lazyMapUs
_
[]
=
returnUs
[]
lazyMapUs
f
(
x
:
xs
)
=
f
x
`
lazyThenUs
`
\
r
->
lazyMapUs
f
xs
`
lazyThenUs
`
\
rs
->
returnUs
(
r
:
rs
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment