From: Neil Smith Date: Mon, 29 Jan 2018 19:42:13 +0000 (+0000) Subject: Taking advantage of a neat trick for using $ rather than a lambda X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=afbd4deb28735d001f95b9ff1922033945cdecbe;p=advent-of-code-17.git Taking advantage of a neat trick for using $ rather than a lambda --- diff --git a/src/advent21/advent21.hs b/src/advent21/advent21.hs index fcc28d3..bd9ca0d 100644 --- a/src/advent21/advent21.hs +++ b/src/advent21/advent21.hs @@ -68,15 +68,16 @@ transposeG g = M.fromList [((c, r) , M.findWithDefault False (r, c) g) | r <- [0 -- Find all the arrangments of a grid, including reflection and rotation. allArrangements :: Grid -> [Grid] -allArrangements grid = map (\f -> f grid) [ id - , reflectH - , reflectV - , transposeG - , reflectH . transposeG - , reflectV . transposeG - , reflectH . reflectV . transposeG - , reflectV . reflectH - ] +-- allArrangements grid = map (\f -> f grid) [ id +allArrangements grid = map ($ grid) [ id + , reflectH + , reflectV + , transposeG + , reflectH . transposeG + , reflectV . transposeG + , reflectH . reflectV . transposeG + , reflectV . reflectH + ]