I am trying to understand Monads in Haskell and during my countless experiments with code I have encountered this thing:
f2 = do return \"da\"
This is known Monomorphism_restriction
Use signatures
f2 :: Monad m => m String f2 = do return "da"
or use language extension:
{-# LANGUAGE NoMonomorphismRestriction #-} f2 = do return "da"
to get valid code