fork download
  1. import Data.Foldable
  2. import Control.Monad
  3. import Control.Monad.Instances
  4.  
  5. monkeyNum :: Integer -> Integer
  6. monkeyNum = foldMap ((^ 5) . read . (:[])) . show
  7.  
  8. isMonkey :: Integer -> Bool
  9. isMonkey = monkeyNum >>= (==)
  10.  
  11. main :: IO ()
  12. main = print $ sum $ filter isMonkey [10..99999]
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:12:15:
    Ambiguous occurrence `sum'
    It could refer to either `Prelude.sum', imported from Prelude
                          or `Data.Foldable.sum', imported from Data.Foldable at prog.hs:1:0-19
stdout
Standard output is empty