Move single-use functions into "where" clause
This commit is contained in:
		
							parent
							
								
									0bf364ec12
								
							
						
					
					
						commit
						6c1627c481
					
				
					 1 changed files with 11 additions and 12 deletions
				
			
		|  | @ -98,10 +98,9 @@ rotate' b@(Block s o@(xo,yo) cs) | |||
|   | s == O = b -- O doesn't need rotation | ||||
|   | s == I && (xo,yo+1) `elem` cs = rotateWith clockwise b -- I only has two orientations | ||||
|   | otherwise = rotateWith counterclockwise b | ||||
| 
 | ||||
|   where | ||||
|     rotateWith :: (Coord -> Coord -> Coord) -> Block -> Block | ||||
| rotateWith dir b = let o = b ^. origin | ||||
|                     in b & extra %~ fmap (dir o) | ||||
|     rotateWith dir b = b & extra %~ fmap (dir (b ^. origin)) | ||||
| 
 | ||||
|     clockwise :: Coord -- ^ origin | ||||
|               -> Coord -- ^ point to rotate around origin | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sam Tay
						Sam Tay