zlyz1w
Last Updated: February 25, 2016
·
1.279K
· kennu

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

2 Responses
Add your response

18250

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

over 1 year ago ·
18251

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 ·