I have a type
Handler [Maybe AvailableDay]
I would like to inspect the contents of [Maybe AvailableDay] in ghci. How do I do that?
相关问题
- Extracting from a Union Type when some have identi
- Understanding do notation for simple Reader monad:
- Making Custom Instances of PersistBackend
- Haskell: What is the differrence between `Num [a]
- applying a list to an entered function to check fo
相关文章
- Is it possible to write pattern-matched functions
- Haskell underscore vs. explicit variable
- Top-level expression evaluation at compile time
- How do I get from a type to the TryParse method?
- Stuck in the State Monad
- foldr vs foldr1 usage in Haskell
- Java Generics: How to specify a Class type for a g
- List of checkboxes with digestive-functors
You cannot simply extract the "contents" of a
Handler
, as aHandler
is 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
, andrun
on 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
IO
monad, which should be a lot simpler to run.