zlyz1w
Last Updated: February 25, 2016
·
1.192K
· kennu
F8828772ff141a7cb8fe109af7948da1

How to run Yesod interactively in GHCi (Haskell)

After scaffolding your Yesod app:

ghci -XTemplateHaskell -XTypeFamilies -XDeriveDataTypeable -XOverloadedStrings -XGADTs -XMultiParamTypeClasses -XQuasiQuotes -XCPP Import.hs

That will load all the exports from Import.hs, allowing you to examine your data types and try out stuff interactively in the REPL. You may then want to load some additional modules:

:l Model
:l Application
Say Thanks
Respond

2 Responses
Add your response

18250
Default profile 5 normal

What if we are using a cabal sandbox? I get a bunch of "Could not find module" errors.

over 1 year ago ·
18251
Default profile 5 normal

Answering my own question. -- Use "cabal repl" -- However, it is possible to continue using ghci following the information in: http://stackoverflow.com/questions/12546757/how-do-i-use-cabals-min-version-and-other-macros-with-ghci/12546758#12546758

over 1 year ago ·