
I am trying to load darc.hs (from darcs 2.3.1, ghci 6.10.4 on Ubuntu) and I get the following :~/darcs-src/darcs-2.3.1/src$ ghci GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> :load darcs Darcs/RepoPath.hs:59:0: error: impossible.h: No such file or directory phase `C pre-processor' failed (exitcode = 1)
What am I doing wrong? Thanks, Daryoush

What am I doing wrong? I don't know exactly. What's your use case? You should be able to load the darcs library into ghci without problems. Maybe this is good enough for you?
impossible.h is located in src. So looking up ghc flags about how to to pass -I flags to CPP should be enough (?). Another way to find those flags fast is running ./Setup -v3 which will output the ghc commands cabal is running. HTH Marc Weber

I am trying to understand darcs implementation. I can install the app using
cabal, so now I want to load it in ghci to be able to play around with it.
Any help on how to load the .h is greatly appreciated. I tried -i with
path to the src directory but it didn't work (should it?).
I am also very curious how others approach a new code base. What do the you
do to figure out an implementation?
Thanks,
Daryoush
On Mon, Feb 15, 2010 at 10:49 PM, Marc Weber
What am I doing wrong? I don't know exactly. What's your use case? You should be able to load the darcs library into ghci without problems. Maybe this is good enough for you?
impossible.h is located in src. So looking up ghc flags about how to to pass -I flags to CPP should be enough (?).
Another way to find those flags fast is running ./Setup -v3 which will output the ghc commands cabal is running.
HTH Marc Weber _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Any help on how to load the .h is greatly appreciated. I tried -i with path to the src directory but it didn't work (should it?). Try -I -i is used for .hs files only (?).
I am also very curious how others approach a new code base. What do the you do to figure out an implementation? ghci offers a debugger. I haven't used that much yet. If things are a little bit more complex I don't use ghci. I use ghc to call the code I'm interested in. This way my memory :-) doesn't vanish. If you stop ghci things are gone. Yeah, you can copy paste code into an editor.. Sometimes the only way for me to understand code is spending hours reading it.
However I'm not sure whether you can get to know code that much faster. Afterall it depends on your goals. What do you want to do with darcs? There are some papers as well. You should also know that there is a darcs (devel/users) mailinglist if you're stuck that's the appropriate place to ask questions (or try irc) Marc Weber

On Tue, Feb 16, 2010 at 12:17 AM, Marc Weber
Any help on how to load the .h is greatly appreciated. I tried -i with path to the src directory but it didn't work (should it?). Try -I -i is used for .hs files only (?).
This seems like a missing feature in cabal or ghci. In the past darcs used a makefile and it was possible to type, 'make ghci' and you'd be dumped at the ghci prompt with everything ready. Perhaps the right way to get this feature is to write a plugin for ghci to add this. I'm thinking the plugin would use the cabal library to understand a .cabal file and then instruct ghci in how to load each module that is requested (making sure CPP and flags are dealt with correctly and dependency order is respected). When a .cabal file provides all the modules as a library (as is the case with darcs), you can install the library and then instruct ghci to load the right package. From inside ghci you can then :m + the modules you want to use. The downside to this is that only things exported from the modules are visible and every time you change the source you have to reinstall and restart ghci. So, something like this: cabal install foo-1.2 ghci -package foo-1.2 :m + Data.Foo I hope that helps, Jason
participants (3)
-
Daryoush Mehrtash
-
Jason Dagit
-
Marc Weber