Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-05-06 23:20:59 <cdsmith> tempate_: The typical convention is to put library code in src/, application code in app/, and test code in test/ -- but it's not universal, so, do what you like.  That's the most common convention if you want something to copy.
2021-05-06 23:21:54 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-05-06 23:22:30 <cdsmith> tempate_: I don't know much about stack, but if you still write a cabal file, there are different sections for the three.  For example, https://github.com/google/codeworld/blob/master/codeworld-compiler/codeworld-compiler.cabal is from a project of mine, and has Executable, Library, and Test-suite sections.
2021-05-06 23:24:05 nbloomf joins (~nbloomf@2600:1700:ad14:3020:3c82:1c53:1e38:e2d9)
2021-05-06 23:26:07 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 252 seconds)
2021-05-06 23:27:22 <tempate_> cdsmith: but does it make sense to have an executable for the src if it's just a library?
2021-05-06 23:28:17 <tempate_> cdsmith: and, regarding the tests, as you can see, mine are pretty primitive, they don't have an `exitcode-stdio-1.0` type or anything of the sort, so what should I put in there?
2021-05-06 23:29:34 kristijonas_ joins (~kristijon@78-56-32-39.static.zebra.lt)
2021-05-06 23:29:52 × kristijonas quits (~kristijon@78-56-32-39.static.zebra.lt) (Read error: Connection reset by peer)
2021-05-06 23:29:55 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-05-06 23:32:52 <cdsmith> tempate_: I don't know much about stack, but if you still write a cabal file, there are different sections for the three.  For example, https://github.com/google/codeworld/blob/master/codeworld-compiler/codeworld-compiler.cabal is from a project of mine, and has Executable, Library, and Test-suite sections.
2021-05-06 23:32:58 <cdsmith> Oops
2021-05-06 23:33:02 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:3c82:1c53:1e38:e2d9) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-05-06 23:33:18 <cdsmith> Ugh, I wrote a long response, and then hit a wrong key and it was replaced with my previous one. :(
2021-05-06 23:33:59 <cdsmith> tempate_: Yeah, it would make sense for you to leave out the executable section entirely, then.  Put your library code in src/, and your test code (e.g., your current Main.hs) in test/
2021-05-06 23:34:17 × Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa)
2021-05-06 23:34:43 × proofofkeags quits (~proofofke@205.209.28.54) (Ping timeout: 265 seconds)
2021-05-06 23:35:38 <cdsmith> tempate_: exitcode-stdio-1.0 is the right test type.  It means "just run this, and check that it exits successfully".  If you want to improve your tests a bit, consider using error when they fail, as this will cause the process to report a failing error code.
2021-05-06 23:37:30 <cdsmith> tempate_: So, instead of `putStrLn "checking foo: " ++ show foo`, consider `putStrLn "checking foo: " ++ if foo then "pass" else error "foo failed"`
2021-05-06 23:39:13 <tempate_> cdsmith: alright, noted. thanks a lot
2021-05-06 23:40:12 <tempate_> cdsmith: right now the tests return a boolean with whether they worked or not. That would do the trick, wouldn't it?
2021-05-06 23:40:38 geowiesnot joins (~user@87-89-181-157.abo.bbox.fr)
2021-05-06 23:42:11 <cdsmith> tempate_: Sure, they can still return boolean, but then in main, you really ought to make the process fail when a test fails.  Your test code now will exit "successfully" (with exit code 0), regardless of whether your tests pass or not.  It's a minor point, but cabal assumes your tests always pass that way
2021-05-06 23:42:32 <tempate_> oh, right
2021-05-06 23:42:51 <tempate_> ok, great, I can do that
2021-05-06 23:43:22 <tempate_> what's the correct way of importing my src modules in test now?
2021-05-06 23:44:08 geekosaur joins (930099da@rrcs-147-0-153-218.central.biz.rr.com)
2021-05-06 23:44:22 <cdsmith> You don't need to change the code at all.  Just add your library to build-depends of your test-suite.  (So the test-suite's build-depends should include 8puzzle)
2021-05-06 23:45:51 jgt_ joins (~jgt@87.227.221.129)
2021-05-06 23:46:48 <tempate_> Hmmm. I'm getting a rather exotic error.
2021-05-06 23:47:37 <cdsmith> tempate_: Please do share. :)
2021-05-06 23:48:08 × Synthetica quits (uid199651@gateway/web/irccloud.com/x-zjwhyipdmwoktmxx) (Quit: Connection closed for inactivity)
2021-05-06 23:48:36 <tempate_> Actually it's not that exotic: "Encountered missing or private dependencies: 8puzzle -any"
2021-05-06 23:48:55 <tempate_> https://bpa.st/LNOA
2021-05-06 23:49:00 <tempate_> My current .cabal file
2021-05-06 23:49:45 <jackdk> tempate_: you need a `library` section
2021-05-06 23:50:21 × jb55 quits (~jb55@gateway/tor-sasl/jb55) (Ping timeout: 240 seconds)
2021-05-06 23:50:28 <tempate_> oh, right
2021-05-06 23:51:15 jb55 joins (~jb55@gateway/tor-sasl/jb55)
2021-05-06 23:51:16 royal_screwup213 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-05-06 23:51:31 <jackdk> I generally find that I want a `library` section for almost all non-test code, one or more `test-suite`sections that depend on the library to do the tests, and one or more `executable` sections that have a very small `Main.hs`, maybe command-line argument parsing, but not much more than that
2021-05-06 23:51:53 × jgt_ quits (~jgt@87.227.221.129) (Ping timeout: 246 seconds)
2021-05-06 23:52:09 <tempate_> Yeah, that's precisely what I was thinking
2021-05-06 23:52:33 ddellacosta joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-05-06 23:52:35 × cdsmith quits (49cf15a2@c-73-207-21-162.hsd1.ga.comcast.net) (Quit: Connection closed)
2021-05-06 23:53:06 Alleria joins (~textual@2603-7000-3040-0000-51c8-115a-6a5b-a292.res6.spectrum.com)
2021-05-06 23:53:18 cdsmith joins (49cf15a2@c-73-207-21-162.hsd1.ga.comcast.net)
2021-05-06 23:53:30 Alleria is now known as Guest276
2021-05-06 23:53:31 × toppler quits (~user@mtop.default.momentoftop.uk0.bigv.io) (Read error: Connection reset by peer)
2021-05-06 23:53:45 <tempate_> ok, it appears to be working now
2021-05-06 23:53:52 toppler joins (~user@mtop.default.momentoftop.uk0.bigv.io)
2021-05-06 23:55:59 × royal_screwup213 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 252 seconds)
2021-05-06 23:56:11 _Alleria joins (~AllahuAkb@69.202.254.168)
2021-05-06 23:56:14 × Guest68595 quits (~textual@2603-7000-3040-0000-e0ee-d4bf-3f09-6e32.res6.spectrum.com) (Ping timeout: 245 seconds)
2021-05-06 23:56:22 gnumonic joins (~gnumonic@c-73-170-91-210.hsd1.ca.comcast.net)
2021-05-06 23:57:16 danso joins (~dan@23-233-111-52.cpe.pppoe.ca)
2021-05-06 23:57:51 × Alleria_ quits (~AllahuAkb@2603-7000-3040-0000-0553-c3ee-855b-649d.res6.spectrum.com) (Ping timeout: 250 seconds)
2021-05-06 23:58:12 × ddellacosta quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 240 seconds)
2021-05-06 23:59:02 <tempate_> I don't like how it's getting on top of that: https://imgur.com/a/G6p8DCv, but I guess I'll have to live with it
2021-05-07 00:00:57 <tempate_> I have updated the git (https://github.com/Tempate/8puzzle), in case any of you are interested
2021-05-07 00:01:11 <tempate_> Thank you both, cdsmith and jackdk, for your help
2021-05-07 00:01:34 <cdsmith> tempate_: Awesome.
2021-05-07 00:01:58 tromp_ joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-05-07 00:02:02 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 246 seconds)
2021-05-07 00:02:59 cdsmith parts (49cf15a2@c-73-207-21-162.hsd1.ga.comcast.net) ()
2021-05-07 00:03:36 cdsmith joins (~cdsmithus@c-73-207-21-162.hsd1.ga.comcast.net)
2021-05-07 00:04:45 × geekosaur quits (930099da@rrcs-147-0-153-218.central.biz.rr.com) (Quit: Connection closed)
2021-05-07 00:06:00 geekosaur joins (930099da@rrcs-147-0-153-218.central.biz.rr.com)
2021-05-07 00:06:15 × tromp_ quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 252 seconds)
2021-05-07 00:07:42 <cdsmith> Slightly ranting here, but Haskell really needs a feature to derive not only this instance, but any other instances needed to derive this one. I hate this 200 lines of stand-alone deriving that I'll have to update every time I update to a new template-haskell version.
2021-05-07 00:10:06 mouseghost joins (~draco@87-206-9-185.dynamic.chello.pl)
2021-05-07 00:10:06 × mouseghost quits (~draco@87-206-9-185.dynamic.chello.pl) (Changing host)
2021-05-07 00:10:06 mouseghost joins (~draco@wikipedia/desperek)
2021-05-07 00:11:19 ddellacosta joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-05-07 00:12:04 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-05-07 00:14:19 × acidjnk_new2 quits (~acidjnk@p200300d0c72b954650e5c2c931fd0d8a.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
2021-05-07 00:14:37 zmijunkie joins (~Adium@87.122.209.149)
2021-05-07 00:16:05 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-05-07 00:16:06 × ddellacosta quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 260 seconds)
2021-05-07 00:16:10 × zmijunkie1 quits (~Adium@87.123.53.7) (Ping timeout: 252 seconds)
2021-05-07 00:17:25 × vgtw quits (~vgtw@gateway/tor-sasl/vgtw) (Remote host closed the connection)
2021-05-07 00:18:50 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 246 seconds)
2021-05-07 00:20:35 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 246 seconds)
2021-05-07 00:23:45 bennofs_ joins (~quassel@dynamic-089-012-144-143.89.12.pool.telefonica.de)
2021-05-07 00:24:19 vgtw joins (~vgtw@gateway/tor-sasl/vgtw)
2021-05-07 00:25:27 royal_screwup213 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-05-07 00:26:07 × nineonine quits (~nineonine@2604:3d08:7783:f200:a9b8:e92a:88db:4a1) (Remote host closed the connection)
2021-05-07 00:27:09 kderme joins (2e675c7c@46-92-124.adsl.cyta.gr)
2021-05-07 00:27:12 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-05-07 00:27:17 jgt_ joins (~jgt@87.227.221.129)
2021-05-07 00:27:42 nineonine joins (~nineonine@2604:3d08:7783:f200:a9b8:e92a:88db:4a1)
2021-05-07 00:27:53 × bennofs__ quits (~quassel@dynamic-089-012-167-128.89.12.pool.telefonica.de) (Ping timeout: 265 seconds)
2021-05-07 00:28:01 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-05-07 00:29:00 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 246 seconds)
2021-05-07 00:29:42 × royal_screwup213 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 240 seconds)
2021-05-07 00:32:05 × nineonine quits (~nineonine@2604:3d08:7783:f200:a9b8:e92a:88db:4a1) (Ping timeout: 250 seconds)
2021-05-07 00:33:38 <gnumonic> So I'm doing some kind of complicated stuff with singletons and GADTs and I noticed that, inside a do-block, "let GadtThing x = mkGadt" often throws type errors whereas "GadtThing x <- pure mkGadt" doesn't. I thought they were equivalent? Why might the latter one work while the former doesn't?
2021-05-07 00:34:06 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-05-07 00:34:21 <geekosaur> MonoLocalBinds?
2021-05-07 00:36:42 × stree quits (~stree@68.36.8.116) (Ping timeout: 246 seconds)

All times are in UTC.