Narcissistic decimal number: Difference between revisions
m
→{{header|Haskell}}: (Some slight simplifications, and some generalisation of map to fmap)
(Added Agena) |
m (→{{header|Haskell}}: (Some slight simplifications, and some generalisation of map to fmap)) |
||
Line 1,069:
digits :: (Read a, Show a) => a -> [a]
digits
isNarcissistic :: (Show a, Read a, Num a, Eq a) => a -> Bool
Line 1,075:
let dig = digits n
len = length dig
in n ==
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
putStrLn $ unwords $
=={{header|Icon}} and {{header|Unicon}}==
|