Hlint: Warning: Use list comprehension
This commit is contained in:
		
							parent
							
								
									fd0969ad67
								
							
						
					
					
						commit
						d6393f5f63
					
				| @ -113,16 +113,16 @@ data Opt = | |||||||
| 
 | 
 | ||||||
| -- these make me nervous | -- these make me nervous | ||||||
| optsWithConstructor f opts = concatMap get opts | optsWithConstructor f opts = concatMap get opts | ||||||
|     where get o = if f v == o then [o] else [] where v = value o |     where get o = [o | f v == o] where v = value o | ||||||
| 
 | 
 | ||||||
| optsWithConstructors fs opts = concatMap get opts | optsWithConstructors fs opts = concatMap get opts | ||||||
|     where get o = if any (== o) fs then [o] else [] |     where get o = [o | any (== o) fs] | ||||||
| 
 | 
 | ||||||
| optValuesForConstructor f opts = concatMap get opts | optValuesForConstructor f opts = concatMap get opts | ||||||
|     where get o = if f v == o then [v] else [] where v = value o |     where get o = [v | f v == o] where v = value o | ||||||
| 
 | 
 | ||||||
| optValuesForConstructors fs opts = concatMap get opts | optValuesForConstructors fs opts = concatMap get opts | ||||||
|     where get o = if any (\f -> f v == o) fs then [v] else [] where v = value o |     where get o = [v | any (\f -> f v == o) fs] where v = value o | ||||||
| 
 | 
 | ||||||
| -- | Parse the command-line arguments into options, command name, and | -- | Parse the command-line arguments into options, command name, and | ||||||
| -- command arguments. Any dates in the options are converted to explicit | -- command arguments. Any dates in the options are converted to explicit | ||||||
|  | |||||||
| @ -116,7 +116,7 @@ optValueWithDefault optcons def opts = | |||||||
| 
 | 
 | ||||||
| optValuesForConstructor :: (String -> Opt) -> [Opt] -> [String] | optValuesForConstructor :: (String -> Opt) -> [Opt] -> [String] | ||||||
| optValuesForConstructor optcons opts = concatMap get opts | optValuesForConstructor optcons opts = concatMap get opts | ||||||
|     where get o = if optcons v == o then [v] else [] where v = value o |     where get o = [v | optcons v == o] where v = value o | ||||||
| 
 | 
 | ||||||
| main = do | main = do | ||||||
|   args <- getArgs |   args <- getArgs | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user