I know that inside a do
block I can draw from something monadic, "extracting" its contents. For instance, if I have a function with signature:
myFunction :: MyReader (Set Int)
I can do this inside a do
block:
mySet <- myFunction
This will give me the Set Int
I want. However, if I change my function so that it takes an argument:
myFunction :: Int -> MyReader (Set Int)
I can no longer do what I want:
myFunction' <- myFunction
This fails to compile with error Couldn't match expected type
and Probable cause: ‘myFunction'’ is applied to too few arguments
. Trying something like this is not even syntactically correct:
myFunction' x <- myFunction x
I do want myFunction'
to be of type Int -> Set Int
. I can't figure out or find anywhere how to do what I want. Can anyone help, please?