Explicit imports #2

Closed
drozzy opened this Issue Jul 31, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@drozzy
Contributor

drozzy commented Jul 31, 2012

Any chance of showing explicit imports in examples?
I've noticed none of the snap docs do this, but for a newbie like me it is rather hard to figure out what comes from where... :-(

@mightybyte

This comment has been minimized.

Show comment Hide comment
@mightybyte

mightybyte Jul 31, 2012

Owner

I usually just load the code in GHCi and use :i to find out where a symbol comes from. In this particular case it's quite easy to do that since the example is already a self-contained file that builds properly. If you want to add them, I'll certainly accept a pull request. :)

Owner

mightybyte commented Jul 31, 2012

I usually just load the code in GHCi and use :i to find out where a symbol comes from. In this particular case it's quite easy to do that since the example is already a self-contained file that builds properly. If you want to add them, I'll certainly accept a pull request. :)

@drozzy

This comment has been minimized.

Show comment Hide comment
@drozzy

drozzy Aug 3, 2012

Contributor

Hm... how would I compile just the examples? The project build file (.cabal) does not build examples/Site.hs

And when I try runhaskell on Site.hs it says "Could not find module Snap.Snapplet.AcidState.

Contributor

drozzy commented Aug 3, 2012

Hm... how would I compile just the examples? The project build file (.cabal) does not build examples/Site.hs

And when I try runhaskell on Site.hs it says "Could not find module Snap.Snapplet.AcidState.

@mightybyte

This comment has been minimized.

Show comment Hide comment
@mightybyte

mightybyte Aug 3, 2012

Owner

First do cabal install, then ghci examples/Site.hs.

Alternatively you could create a .ghci file like this one and put it in the root snaplet-acid-state directory. The first line in that file means that if you run ghci from the same directory as the .ghci file, it will also load source files from the src directory instead of the cabal installed packages.

Owner

mightybyte commented Aug 3, 2012

First do cabal install, then ghci examples/Site.hs.

Alternatively you could create a .ghci file like this one and put it in the root snaplet-acid-state directory. The first line in that file means that if you run ghci from the same directory as the .ghci file, it will also load source files from the src directory instead of the cabal installed packages.

@drozzy

This comment has been minimized.

Show comment Hide comment
@drozzy

drozzy Aug 3, 2012

Contributor

Cool, that works. I did cabal build before.

Contributor

drozzy commented Aug 3, 2012

Cool, that works. I did cabal build before.

@mightybyte

This comment has been minimized.

Show comment Hide comment
@mightybyte

mightybyte Aug 3, 2012

Owner

Fixed with commit fa7cf8c

Owner

mightybyte commented Aug 3, 2012

Fixed with commit fa7cf8c

@mightybyte mightybyte closed this Aug 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment