Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-18 16:44:23 <dminuoso> lazy IO tends to be useful for short "Im writing a 30 lines one-off program"
2020-11-18 16:44:29 sfvm joins (~sfvm@37.228.215.148)
2020-11-18 16:44:40 <dminuoso> Especially when all you want is in base, so you dont even need cabal to get access to conduit and friends
2020-11-18 16:44:53 × mananamenos quits (~mananamen@84.122.202.215.dyn.user.ono.com) (Ping timeout: 260 seconds)
2020-11-18 16:44:59 <p0a> ah I know, it's mapM that guarantees the sequence
2020-11-18 16:45:11 <p0a> That's what makes it print 1..10 before going to the doubles
2020-11-18 16:45:29 <int-e> . o O ( And lazy IO is terrible if you want to read the first 100 bytes of all files in your home directory. )
2020-11-18 16:46:12 <int-e> (it's a good way to run out of file descriptors)
2020-11-18 16:46:36 <p0a> hehe maybe the kernel is lazy too int-e
2020-11-18 16:46:50 <Ariakenom> dminuoso: yeah, like the upcoming #adventofcode
2020-11-18 16:47:46 <dminuoso> Ariakenom: Right. If you want to beat those "solution within 30 seconds" folks, then you can't afford to spend a second on creating a cabal project or managing build-depends.
2020-11-18 16:48:38 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-11-18 16:48:43 <int-e> main = interact $ ... is the way to go for rapid one-time-tool development ;)
2020-11-18 16:49:18 <Ariakenom> int-e: indeed. the beginning of almost all of my advent coding
2020-11-18 16:49:32 justsomeguy joins (~justsomeg@216.186.218.241)
2020-11-18 16:49:32 × justsomeguy quits (~justsomeg@216.186.218.241) (Changing host)
2020-11-18 16:49:32 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
2020-11-18 16:50:01 adamwespiser joins (~adamwespi@107.181.19.30)
2020-11-18 16:50:09 <int-e> Ariakenom: right... main = interact $ unlines . return . show . solve . lines
2020-11-18 16:50:42 <Ariakenom> ex. interact (show.sum.map read.map words)
2020-11-18 16:50:43 <int-e> Ariakenom: (most common `main` from my AoC solutions last year)
2020-11-18 16:51:00 <int-e> s/map//
2020-11-18 16:51:03 <int-e> err
2020-11-18 16:51:07 <int-e> the second, not the first
2020-11-18 16:51:31 <int-e> And not having spaces around . is ugly.
2020-11-18 16:51:36 <boxscape> Do all haskell packages that are used within a project have to be compiled with the same version of ghc? More specifically, I was wondering if the cached nix haskell binaries are separate for each ghc version
2020-11-18 16:51:41 <Ariakenom> for me not because its fast but because its easy dminuoso
2020-11-18 16:51:55 <Ariakenom> int-e: both true
2020-11-18 16:51:57 lagothrix joins (~lagothrix@unaffiliated/lagothrix)
2020-11-18 16:52:27 <int-e> (I don't feel strongly about $ ... vs. (...))
2020-11-18 16:53:08 <boxscape> With multiline expressions I strongly prefer $
2020-11-18 16:53:32 <tdammers> not having spaces around . isn't just ugly, it's also a potential source of bugs
2020-11-18 16:54:01 britva joins (~britva@2a02:aa13:7240:2980:7da5:a1a0:c038:90b4)
2020-11-18 16:54:08 <hekkaidekapus> (Which will be disallowed in future GHC releases.)
2020-11-18 16:54:11 <dminuoso> boxscape: Yes
2020-11-18 16:54:14 <tdammers> because foo.bar parses as "foo compose bar", but Foo.bar parses as "identifier bar in namespace Foo"
2020-11-18 16:54:17 <maralorn> boxscape: Yes and yes
2020-11-18 16:54:21 <dminuoso> boxscape: The ABI is unstable
2020-11-18 16:54:22 <boxscape> okay, thanks
2020-11-18 16:54:27 <int-e> Ariakenom: https://paste.debian.net/1173010/ :-)
2020-11-18 16:54:28 × britva quits (~britva@2a02:aa13:7240:2980:7da5:a1a0:c038:90b4) (Client Quit)
2020-11-18 16:54:47 <texasmynsted> This might be bike-shedding but I have created haskell templates and noticed that sometimes I have the main files start with a capital and sometimes with a lower case character.
2020-11-18 16:54:57 <dminuoso> boxscape: You can find some of the reasons here https://wiki.haskell.org/Shared_libraries_and_GHC
2020-11-18 16:55:05 <maralorn> And even if the former wouldn‘t be true in some specific circumstances, the later i.e. nix builds would probably always depend on the used ghc version.
2020-11-18 16:55:06 <boxscape> thanks
2020-11-18 16:55:16 × Yumasi quits (~guillaume@2a01cb09b06b29ea21daa97718c35c9f.ipv6.abo.wanadoo.fr) (Read error: Connection reset by peer)
2020-11-18 16:55:22 <texasmynsted> The modules are always stared with an upper case. What is more common?
2020-11-18 16:55:31 jwynn6 joins (~jwynn6@050-088-122-078.res.spectrum.com)
2020-11-18 16:55:35 × alp quits (~alp@2a01:e0a:58b:4920:c9d2:961b:b0f5:7405) (Ping timeout: 272 seconds)
2020-11-18 16:55:45 <texasmynsted> and why?
2020-11-18 16:55:57 <dminuoso> texasmynsted: It's more common that the files/directories follow the casing used in the modules.
2020-11-18 16:56:06 <hekkaidekapus> tdammers: foo.bar might also mean field bar of record bar in RecordDotStuff…
2020-11-18 16:56:15 <dminuoso> I cant speak for why people do it, perhaps its just consistency
2020-11-18 16:56:31 <texasmynsted> So start with an upper case character then?
2020-11-18 16:56:36 <p0a> texasmynsted: afiak there's OSes where capital and lowercase make no difference, and it was even proposed for the linux kernel
2020-11-18 16:56:45 <p0a> talking about filenames
2020-11-18 16:56:58 <texasmynsted> I am talking specifically about file names.
2020-11-18 16:56:59 <tdammers> I like to use lowercase filenames for main, to emphasize the fact that they are not intended to be imported
2020-11-18 16:57:13 <sm[m]> I thought all files except the main one had to be capitalised, like the module name
2020-11-18 16:57:21 <dolio> That depends on the filesystem, not the OS.
2020-11-18 16:57:22 hnOsmium0001 joins (uid453710@gateway/web/irccloud.com/x-rpvaqdolaahudqno)
2020-11-18 16:57:23 <texasmynsted> tdammers: Ah perfect! Thank you.
2020-11-18 16:57:25 × LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Remote host closed the connection)
2020-11-18 16:57:30 <sm[m]> except on case-vague filesystems, of course
2020-11-18 16:57:34 <p0a> dolio: thanks, I misspoke
2020-11-18 16:58:15 <texasmynsted> I care more that I write the file name deliberately rather than care how the filesystem sees it.
2020-11-18 16:58:22 <Ariakenom> int-e: return!? let me show my reaction with a smiley (:[])
2020-11-18 16:58:51 <int-e> Ariakenom: I expected you to suggest `pure`
2020-11-18 16:58:56 <Ariakenom> but that's very consistent :D
2020-11-18 16:59:08 <Ariakenom> yeah but the smiley is funnier
2020-11-18 16:59:19 <texasmynsted> tdammers: So is your test suite main file also lower case for the same reason?
2020-11-18 16:59:26 <sm[m]> texasmynsted: capitalise all files except main ones
2020-11-18 16:59:30 <int-e> Ariakenom: it's hard to type :P
2020-11-18 16:59:48 <maerwald> I saw a job posting of a company transitioning from haskell to Go... it made me wonder what happened there. :D
2020-11-18 16:59:50 <int-e> while `return` vs. `pure` is a sign of age
2020-11-18 17:00:04 <texasmynsted> Okay then the same would go for test "main" files.
2020-11-18 17:00:12 <sm[m]> yep
2020-11-18 17:00:16 <texasmynsted> :-)
2020-11-18 17:00:17 <texasmynsted> Thank you.
2020-11-18 17:00:23 <sm[m]> if you look at projects you'll see that's the pattern
2020-11-18 17:00:45 <tdammers> int-e: I oscillate back and forth between religiously using 'pure' and consistently using 'return' for things that are monads and reserving 'pure' for non-monad functors
2020-11-18 17:01:07 Yumasi joins (~guillaume@2a01cb09b06b29ea21daa97718c35c9f.ipv6.abo.wanadoo.fr)
2020-11-18 17:01:14 <p0a> I think allowing for bugs is a feature that helps prop development, which may explain why some shy away from haskell
2020-11-18 17:01:25 <p0a> not that haskell code can't have bugs
2020-11-18 17:01:25 idhugo joins (~idhugo@80-62-116-101-mobile.dk.customer.tdc.net)
2020-11-18 17:01:43 <texasmynsted> tdammers: why not use pure everywhere it applies. It makes more sense.
2020-11-18 17:01:52 <int-e> > fix error -- is it bad that this still amuses me?
2020-11-18 17:01:53 <boxscape> p0a -fdefer-type-errors :)
2020-11-18 17:01:54 <lambdabot> "*Exception: *Exception: *Exception: *Exception: *Exception: *Exception: *Ex...
2020-11-18 17:01:58 <tdammers> texasmynsted: I do that too, but I go through phases.
2020-11-18 17:02:07 <texasmynsted> Hehh I understand
2020-11-18 17:02:37 × stree_ quits (~stree@50-108-91-191.adr01.mskg.mi.frontiernet.net) (Ping timeout: 264 seconds)
2020-11-18 17:02:46 <maerwald> p0a: was that in response to me?
2020-11-18 17:03:01 <Ariakenom> my first instinct in do-notation is to type return, but I always use pure
2020-11-18 17:03:04 LKoen joins (~LKoen@169.244.88.92.rev.sfr.net)
2020-11-18 17:03:05 <p0a> maerwald: yeah
2020-11-18 17:03:35 <int-e> tdammers: yeah I tend to use `return` for monads, but I think that if I had learned Haskell 10 years later I'd be in the pure `pure` camp.
2020-11-18 17:03:41 <maerwald> the only thing I can think of is that they have some low-latency requriements, which GHCs GC cannot deliver
2020-11-18 17:04:29 conal_ joins (~conal@64.71.133.70)
2020-11-18 17:04:51 <tdammers> maerwald: it can, just not consistently :P

All times are in UTC.