I have a type
Handler [Maybe AvailableDay]
I would like to inspect the contents of [Maybe AvailableDay] in ghci. How do I do that?
I have a type Handler [Maybe AvailableDay] I would like to inspect the contents
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot simply extract the “contents” of a
Handler, as aHandleris really a computation which can depend on the current request, session state and so on. So in order to run it, you’d have to feed it all of that. This would involve usingrunHandler, followed byunYesodApp, andrunon the resultingIteratee. Technically possible, but incredibly messy to do on your own.If you don’t think the value is depending on any of that, then you should be able to rewrite it as a pure computation or one in the
IOmonad, which should be a lot simpler to run.