Eban numbers: Difference between revisions

m
m (→‎{{header|Tailspin}}: syntax update)
Line 657:
{{trans|Julia}}
<lang haskell>{-# LANGUAGE NumericUnderscores #-}
import Data.List (find, intercalate)
import Text.Printf (printf)
import Data.List.Split (chunksOf)
Line 669:
z = b : map (\x -> if x >= 30 && x <= 66 then x `mod` 10 else x) [m, t, r3]
 
ebans ::= [Int]map -> [(String, String)]f
where
ebans = go
f x Just (c, e) ->= (thousands x, thousands $ predlength c)$ :filter goisEban xs[1..x])
where
ebanCount = zip [1..] (filter isEban [1..])
go [] = []
go (x:xs) = case find (\(_, e) -> x < e) ebanCount of
Just (c, e) -> (thousands x, thousands $ pred c) : go xs
Nothing -> go xs
 
thousands:: Int -> String
Anonymous user