I want to print the spec function f 'defined inside the function f, so that both of their specification types belong to the same type variable. However, when I try to do it, I get a compilation error from the compiler, which suggests that the external element m and m are not the same variable type. Any advice on how to fix this?
f :: (Monad m) => (String -> Int -> String -> m ()) -> [String] -> m () f _ (x:_) = f' Nothing x where f' :: (Maybe Int) -> String -> m () -- when I comment this line, the code compiles f' _ _ = return () main = undefined
source share