I can't think of an easy way to do it. It will come down to: * Looking up which package the module came from (likely in the GHC package database) * Figuring out if it's in the snapshot or local (the `stack query` command may help here) * Finding the relevant source code, checking hs-source-dirs in the cabal file, and looking for the file in question
On Mon, Dec 18, 2017 at 11:43 PM, Csaba Hruska <csaba.hru...@gmail.com> wrote: > Hi, > > I am experimenting with a tool and I need some help or advice. > Assuming a stack based project what is the simplest way to retrieve the > source code for a module from the module name? > The module source code should be the same that GHC used when compiled the > project. > I'd like to retrieve the source code for both local and stackage modules. > > Thanks, > Csaba Hruska > > -- > You received this message because you are subscribed to the Google Groups > "haskell-stack" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to haskell-stack+unsubscr...@googlegroups.com. > To post to this group, send email to haskell-stack@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/haskell-stack/6c05584e-a4c1-463d-bb64-5cbc83ef93e0% > 40googlegroups.com > <https://groups.google.com/d/msgid/haskell-stack/6c05584e-a4c1-463d-bb64-5cbc83ef93e0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "haskell-stack" group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stack+unsubscr...@googlegroups.com. To post to this group, send email to haskell-stack@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/CAKA2JgJUBO8oDaFK0uwc4RSkEuT9UMPF8QpdKP1ToLBOfV-BFA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.