is there haskell do-notation but for fmap? I assume this is not the right way to write a function that prints something and returns a value square :: Int -> IO Int square n = fmap (\_ -> n * n) $ print ("squaring " ++ show n)
-
Prikaži ovu nit
(this function is nonsense, but there is a general pattern of, you do some I/O, probably a read, and then fmap the result to transform it, e.g. `fmap read getStrLn`)
15:11 - 2. velj 2020.
0 replies
0 proslijeđenih tweetova
1 korisnik označava da mu se sviđa
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.