Intersecting number wheels: Difference between revisions

m
→‎{{header|Haskell}}: Tidied, pruned out one import, preferring a guard to bool.
m (→‎{{header|Haskell}}: Tidied, applied Ormolu.)
m (→‎{{header|Haskell}}: Tidied, pruned out one import, preferring a guard to bool.)
Line 893:
terminating at the first digit found, and printing a map-accumulation of that recursion over a list of given length but arbitrary content.
 
<lang haskell>import Data.BoolChar (boolisDigit)
import Data.Char (isDigit)
import Data.List (mapAccumL)
import qualified Data.Map.Strict as M
Line 907 ⟶ 906:
where
click wheels name =
let wheelgo =m fromMaybe ['?'] (M.lookup name wheels)c
v | isDigit c = head(m, wheelc)
in bool | otherwise = click m c
in ( go . flip click(M.insert name . leftRotate) wheels
(,) <*> head
(isDigit v || '?' == v)
(fromMaybe ['?'] (M.insertlookup name (leftRotate wheel) wheels))
v
 
leftRotate :: [a] -> [a]
9,655

edits