{-# LANGUAGE OverloadedStrings #-} import Lastfm.Core import Control.Monad (forM_) main :: IO () main = do let username = "h4shirama" apiKey = "dcf893bc386af9044e505e5b78531573" putStrLn $ "Fetching artists for " ++ username ++ "..." result <- fetchArtists apiKey username case result of Left err -> putStrLn $ "Error: " ++ err Right root -> do forM_ (artist (artists root)) $ \a -> do putStrLn $ name a ++ " (" ++ show (playcount a) ++ " plays)"