I am relatively new to Haskell and have struggled to find some clarification on this confusion.
Given a function that takes an Integer as an input, what would be the difference between the function returning State Integer ()
and State Int Integer
.
I think I am right in understanding that State Int Integer
requires me to return the result using the pure
function.
When I try to write a function of func :: Integer -> State Integer ()
I get the error No instance for (Num ()) arising from the literal ‘0’
, as I try to use pure
to return the value 0.