I have a simple web app written with scotty. I would like to use fay to generate the front-end JS code and use shared types between the frontend and the backend.
At the moment, I run my app using cabal run
: in my .cabal file I defined an "executable" and "build-depends" depends on base
.
When I include "fay" and "fay-base" in "build-depends", compilation fails because Prelude
is ambigous.
I understand that "fay-base" is supposed to replace the standard prelude, but I still do want to use the standard prelude in the backend code.
So, how should I write my .cabal file and what language extensions should I use in my .hs files so that std Prelude and fay Prelude can coexist? Is this the right approach?
I am using fay-0.20.1.1.