The thing that is most slowing down my learning of Haskell / Yesod is my inability to do interactive debugging. Surprisingly, there doesn't seem to be any clear tutorials (or even any tutorials?) about how to go about doing this with Yesod.
It seems like I should be able to do something like:
cabal clean
cabal repl
:break Handler.myHandler 95
:main
and that should work ? unfortunately :main fails with a "not in scope `main`"
I've found this: https://github.com/chrisdone/ghci-reload-demo which seems ideal in terms of developer friendliness but having similar difficulty getting it to work.
I've installed the foreign-store-0.1 module, updated my scafford with app/DevelMain.hs and updated my .cabal file with warp and foreign-store as suggested.
I'm failing at the last hurdle which is being able to run DevelMain. This is almost certainly my total lack of knowledge but I'm sure I can't be the only one who is / will struggle with this?
:l DevelMain.hs (and various combinations like app.DevelMain.hs etc) all fail with "Failed, modules loaded: none"
I've added a **TODO into this wiki page (hope you don't mind). If someone were to help me get ghci debugging working, I'd be happy to turn the experience into some decent (ie beginner level) documentation for the wiki :)
Many thanks
--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
DevelMain.hs:32:11: Not in scope: type constructor or class `IO'DevelMain.hs:37:7: Not in scope: data constructor `Nothing'DevelMain.hs:41:11: Not in scope: `return'DevelMain.hs:43:7: Not in scope: data constructor `Just'DevelMain.hs:45:38: Not in scope: `$'DevelMain.hs:47:44: Not in scope: `>>'DevelMain.hs:47:67: Not in scope: `>>='DevelMain.hs:52:51: Not in scope: type constructor or class `IO'DevelMain.hs:52:60: Not in scope: type constructor or class `IO'DevelMain.hs:53:49: Not in scope: `$'DevelMain.hs:55:13: Not in scope: `>>='DevelMain.hs:59:10: Not in scope: type constructor or class `IO'Failed, modules loaded: Application, Import, Settings, Handler.Home, Handler.Users, Handler.Property, Handler.Media, Foundation, Settings.Development, Settings.StaticFiles, Model.
--
You received this message because you are subscribed to a topic in the Google Groups "Yesod Web Framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yesodweb/UaCxPcNwi2o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yesodweb+u...@googlegroups.com.
b) If the code isn't being interpreted you get an error when you add a breakpoint suggesting that you run "add *whatever" to load the module in interpreted mode.[ 8 of 12] Compiling Handler.Users ( Handler/Users.hs, interpreted )
--
--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+u...@googlegroups.com.
could it be something to do with "cabal repl" ?
On Jun 28, 2014 7:34 AM, "Simon Gardner" <slg...@gmail.com> wrote:
>
> >You could try proving that by using cabal repl with your toy program.
>
> Yeah, I've tried, using the qsort example from https://www.haskell.org/ghc/docs/7.6.3/html/users_guide/ghci-debugger.html
>
> I get an error message: No modules are loaded with debugging support.
>
> (The module is definitely loaded as "interpreted".
>
> >But you should definitely learn how to just use print and trace statements.
>
> I agree that I should learn but even this has proved to be frustratingly difficult !
>
> Whilst it's (obviously) possible to work without one, I would have thought an interactive debugging environment would be a fundamental requirement?
>
A debugger is mostly isomorphic to print statements, just more efficient.
It looks like you are not getting the answers you need, but at this point the questions are not yesod specific so you can try asking elsewhere.
>
>
>
> On Saturday, 28 June 2014 14:47:25 UTC+1, Greg Weber wrote:
>>
>> On Fri, Jun 27, 2014 at 11:44 AM, Simon Gardner <slg...@gmail.com> wrote:
>>>
>>> could it be something to do with "cabal repl" ?
>>
>>
>> You could try proving that by using cabal repl with your toy program.
>>
>> But you should definitely learn how to just use print and trace statements.
>
>It looks like you are not getting the answers you need, but at this point the questions are not yesod specific so you can try asking elsewhere.
I have debugging working fine in ghci with plain Haskell, but for some reason not with Yesod (or maybe it's cabal repl). Either way, surely this group is the best place to ask that question?
Presumably somebody must have ghci debugging working with Yesod? If so, what are they doing / not doing differently from me? If no-one is using ghci debugging with Yesod, that's interesting (and strange?) by itself.
Thanks for taking the time to reply Greg :)
--
You received this message because you are subscribed to a topic in the Google Groups "Yesod Web Framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yesodweb/UaCxPcNwi2o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yesodweb+u...@googlegroups.com.
On Jun 29, 2014 11:54 PM, "Simon" <slg...@gmail.com> wrote:
>
> >A debugger is mostly isomorphic to print statements, just more efficient.
>
> yes, and that's a big deal.
>
> >It looks like you are not getting the answers you need, but at this point the questions are not yesod specific so you can try asking elsewhere.
>
> I have debugging working fine in ghci with plain Haskell, but for some reason not with Yesod (or maybe it's cabal repl). Either way, surely this group is the best place to ask that question?
>
> Presumably somebody must have ghci debugging working with Yesod? If so, what are they doing / not doing differently from me? If no-one is using ghci debugging with Yesod, that's interesting (and strange?) by itself.
I have never heard anyone speak of using the ghci debugger. Debuggers are great for dealing with code you don't understand. If I can't understand my code by adding one or two print statements that's because it is poorly written so I clean it up by adding types, refactoring, and adding tests. A debugger would be a lot more useful for investigating libraries, but it is better to be in the mindset that you own those and they are part of your app.
Can someone help to adopt this script to OS X Mavericks? I have no `inotifywait` command.
--
Can someone help to adopt this script to OS X Mavericks? I have no `inotifywait` command.