I'm using Scotty to write a small web apps.
I need to run IO inside the ScottyM type.
There are several difficulties:
First I can't automatically derive type synonyms from MonadIO in order to run liftIO:
type ScottyM = ScottyT Text IO
Second, I don't know how to derive ScottyT from MonadIO:
newtype ScottyT e m a
Constructors
ScottyT
runS :: State (ScottyState e m) a
What are my options?
Thanks
Is it necessary for you to run your IO inside
ScottyMinstead of before you startscotty?Another option is to abuse
notFoundandnextto run IO inActionM, which is more straightforward: