[Haskell-beginners] Functor fmap: how to

Imants Cekusins imantc at gmail.com
Fri Jun 26 11:21:51 UTC 2015


.. and an a -> b version:

module FunctorIOab where

{-
   usage:
   *FunctorIOab> main
   {type something, <enter>}
-}

processAb:: String -> Int
processAb = length


main::IO Int
main = func getLine


func::IO String -> IO Int
func ios = processAb <$> ios


More information about the Beginners mailing list