X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FUniqSupply.lhs;h=25a5289d12e113d76cf7d8d3a9d2cd51ccfb3b20;hb=814d2f506d63f785dbfe33189dde606a06e60285;hp=e7a2d1e649a4f4eaa19ee0604378fd87c4990aec;hpb=97ca9e73c862b8d7db581d2f63230c04524c797c;p=ghc-hetmet.git diff --git a/compiler/basicTypes/UniqSupply.lhs b/compiler/basicTypes/UniqSupply.lhs index e7a2d1e..25a5289 100644 --- a/compiler/basicTypes/UniqSupply.lhs +++ b/compiler/basicTypes/UniqSupply.lhs @@ -4,13 +4,6 @@ % \begin{code} -{-# OPTIONS -w #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - module UniqSupply ( UniqSupply, -- Abstractly @@ -30,8 +23,6 @@ module UniqSupply ( getUniqueUs, getUs, returnUs, thenUs, mapUs ) where -#include "HsVersions.h" - import Unique import FastTypes @@ -133,7 +124,7 @@ initUs :: UniqSupply -> UniqSM a -> (a,UniqSupply) initUs init_us m = case unUSM m init_us of { (r,us) -> (r,us) } initUs_ :: UniqSupply -> UniqSM a -> a -initUs_ init_us m = case unUSM m init_us of { (r,us) -> r } +initUs_ init_us m = case unUSM m init_us of { (r, _) -> r } {-# INLINE thenUs #-} {-# INLINE lazyThenUs #-} @@ -162,9 +153,6 @@ thenUs_ (USM expr) (USM cont) returnUs :: a -> UniqSM a returnUs result = USM (\us -> (result, us)) -withUs :: (UniqSupply -> (a, UniqSupply)) -> UniqSM a -withUs f = USM (\us -> f us) -- Ha ha! - getUs :: UniqSM UniqSupply getUs = USM (\us -> splitUniqSupply us) @@ -194,7 +182,7 @@ getUniquesUs = USM (\us -> case splitUniqSupply us of (us1,us2) -> (uniqsFromSupply us1, us2)) mapUs :: (a -> UniqSM b) -> [a] -> UniqSM [b] -mapUs f [] = returnUs [] +mapUs _ [] = returnUs [] mapUs f (x:xs) = f x `thenUs` \ r -> mapUs f xs `thenUs` \ rs -> @@ -207,7 +195,7 @@ mapUs f (x:xs) {-# -- SPECIALIZE mapAndUnzip3M :: (a -> UniqSM (b,c,d)) -> [a] -> UniqSM ([b],[c],[d]) #-} lazyMapUs :: (a -> UniqSM b) -> [a] -> UniqSM [b] -lazyMapUs f [] = returnUs [] +lazyMapUs _ [] = returnUs [] lazyMapUs f (x:xs) = f x `lazyThenUs` \ r -> lazyMapUs f xs `lazyThenUs` \ rs ->