makeWharf :: [[Maybe Crate]] -> [Int] -> Wharf
makeWharf wharfLines colNames = M.fromList $ zip colNames wharfCols
- where wharfCols = fmap (fmap fromJust)
- $ fmap (dropWhile isNothing)
- $ transpose wharfLines
+ where wharfCols = fmap catMaybes $ transpose wharfLines
applyMoves1 :: Wharf -> [Move] -> Wharf
applyMoves1 wharf moves = foldl' applyMove1 wharf moves