Home liberachat/#haskell: Logs Calendar

Logs on 2022-03-09 (liberachat/#haskell)

00:00:13 vaibhavsagar[m] joins (~vaibhavsa@2001:470:69fc:105::ffe)
00:00:22 <monochrom> You can reused eventId'
00:00:32 <monochrom> err s/reused/reuse/
00:00:35 andreabedini[m] joins (~andreabed@2001:470:69fc:105::c821)
00:00:35 kadoban joins (~kadoban@user/kadoban)
00:01:24 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 240 seconds)
00:01:39 <haskellnoob> I think right now my problem is this line "t <- parseJSON $ v V.! 0", because it doesn't know what type that is
00:01:56 <haskellnoob> Compiler says: Probable fix: use a type annotation to specify what ‘a0’ should be.
00:02:05 <Axman6> there's this weird linguistic fad I keep seeing, especially from people in California, where they'll say things like that, like "this car needs cleaned", "this'll need renovated", completely dropping the "to be". it breaks my brain everytime I hear it on youtube
00:02:14 <haskellnoob> Ambiguous type variable ‘a0’ arising from the literal ‘"e"’
00:03:03 <haskellnoob> Axman6 I'm not a native english speaker, please forgive me
00:03:07 <Axman6> haskellnoob: do EventId and XOnlyPubKey ever exist in json objects if the form { "id": "67912989239847893" }? seems like a weird FromJSON instance
00:03:13 <Axman6> haskellnoob: no, this was about monochrom's typo
00:03:45 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
00:03:48 <geekosaur> Axman6, it'salso a Pittsburgh thing
00:03:58 <haskellnoob> ok, so the json array looks like this: ["e", "063df25d22738a838cbbdc3dee470e0c58284954", "https://google.com"] - or with a p instead of e
00:04:00 <geekosaur> I keep thinking "-ing, not-ed!"
00:04:05 <Axman6> *seems like a weird instance given the example you gave of it being used in an array
00:04:06 <monochrom> Consider "real good" >:)
00:04:40 <Axman6> geekosaur: interesting - though for me, y'all are just "American"
00:05:12 <Axman6> (with California and Texas being basically their own countried)
00:05:49 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
00:05:53 <haskellnoob> I see what you mean, should be "parseJSON = withText "EventId" $ \i -> do" right?
00:06:10 <Axman6> yeah, that would be more useful
00:06:18 <Axman6> and would help with this code actually
00:06:31 <haskellnoob> thanks, at least one step further
00:06:44 Dykam joins (Dykam@dykam.nl)
00:07:21 <haskellnoob> he still complains about this line "t <- parseJSON $ v V.! 0" in the instance FromJSON Tag.
00:07:32 <haskellnoob> doesn't know what type it is
00:08:28 <Axman6> then you can do: withArray "Tag" $ \v -> do guard (V.length v == 3); case v ! 0 of (Text "p") -> ETag <$> ((,) <$> parseJSON (v ! 1) <*> parseJSON (v ! 2); (Text "e") -> ...;
00:08:30 × mmhat quits (~mmh@55d49be1.access.ecotel.net) (Quit: WeeChat 3.4)
00:09:02 <Axman6> just match on the Text constructor of the Value
00:10:14 ski . o O ( s/(Text "p") ->/Text "p" ->/ )
00:10:25 <Axman6> yeah, that too
00:11:24 <Axman6> haskellnoob: I thginkwhat you have in your last paste will work as long as you just do case v V.! 0 of Text "p" -> ...; Text "e" -> ...; _ -> fail "bad tag bro"
00:11:56 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
00:13:30 machinedgod joins (~machinedg@24.105.81.50)
00:14:17 <haskellnoob> having this now: https://pastebin.com/zN1hQhx8
00:14:36 <haskellnoob> which gives me this error:
00:14:37 <haskellnoob> parse error (possibly incorrect indentation or mismatched brackets) | 106 | Text "e" -> PTag <$> ((,) <$> parseJSON (v ! 1) <*> parseJSON (v ! 2)
00:15:05 <Axman6> need to close those brackets bro (which I forgot in my code, sorry) avter the (v ! 2)'s
00:15:07 <Axman6> after*
00:15:22 <geekosaur> paren counting is a useful skill
00:15:56 <haskellnoob> right
00:15:59 <haskellnoob> now: Not in scope: data constructor ‘Text’
00:16:11 <Axman6> ETag <$> liftA2 (,) ... might also be a little cleaner
00:16:22 <Axman6> you need to import Value(Text) from Aeson
00:16:30 <Axman6> uh, it might be String actually
00:16:56 <haskellnoob> got it
00:16:57 <haskellnoob> one sec
00:17:11 <Axman6> yeah the type is String
00:17:17 <Axman6> uh, constructor*
00:17:26 <Axman6> ... | String !Text | ...
00:17:55 <haskellnoob> no way
00:18:00 <haskellnoob> this actually works
00:18:01 <haskellnoob> hahahaha
00:18:03 <haskellnoob> thanks guys
00:18:24 <Axman6> have you tested it with actual data? :)
00:19:05 <haskellnoob> actual data? are you crazy? the compiler says it's okay, I won't break the illusion now!
00:19:21 <haskellnoob> :)
00:20:21 <Axman6> JSON is stringly typed, it can always go wrong ;)
00:20:22 <haskellnoob> thanks Axman6, exa and monochrom
00:22:01 × haskellnoob quits (~haskellno@181.122.131.227) (Remote host closed the connection)
00:22:21 haskellnoob joins (~haskellno@181.122.131.227)
00:23:04 × haskellnoob quits (~haskellno@181.122.131.227) (Remote host closed the connection)
00:25:08 × ubert quits (~Thunderbi@p200300ecdf3be9b34516931a7c3fe14b.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
00:27:07 ubert joins (~Thunderbi@p200300ecdf3be9b31a3c049f5a83f6ca.dip0.t-ipconnect.de)
00:28:21 × ubert quits (~Thunderbi@p200300ecdf3be9b31a3c049f5a83f6ca.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
00:28:30 ubert1 joins (~Thunderbi@p200300ecdf3be9b34946219f5177446d.dip0.t-ipconnect.de)
00:30:37 × kilolympus quits (~kilolympu@31.205.200.235) (Ping timeout: 240 seconds)
00:30:48 ubert1 is now known as ubert
00:34:31 kilolympus joins (~kilolympu@31.205.200.235)
00:34:36 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 240 seconds)
00:36:11 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
00:37:31 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 272 seconds)
00:38:45 hyiltiz joins (~quassel@31.220.5.250)
00:46:47 × jgeerds quits (~jgeerds@55d4548e.access.ecotel.net) (Ping timeout: 252 seconds)
00:47:17 × emf quits (~emf@2620:10d:c090:400::5:33d6) (Ping timeout: 240 seconds)
00:48:37 × foul_owl quits (~kerry@23.82.193.87) (Ping timeout: 240 seconds)
00:51:04 foul_owl joins (~kerry@174-21-76-71.tukw.qwest.net)
00:53:42 emf joins (~emf@2620:10d:c090:400::5:9fc8)
00:54:17 mvk joins (~mvk@2607:fea8:5cc3:7e00::45ee)
01:00:02 × DNH quits (~DNH@2a02:8108:1100:16d8:1c1a:3fa2:4926:7c5a) (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:00:41 × foul_owl quits (~kerry@174-21-76-71.tukw.qwest.net) (Ping timeout: 256 seconds)
01:03:16 × dsrt^ quits (~dsrt@50.232.121.75) (Ping timeout: 256 seconds)
01:03:42 nattiestnate joins (~nate@202.138.250.37)
01:04:04 × nattiestnate quits (~nate@202.138.250.37) (Client Quit)
01:06:00 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds)
01:06:22 kongsheng joins (~kongsheng@71.28.228.142)
01:12:38 × Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 252 seconds)
01:13:05 × ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec)
01:14:24 Maxdamantus joins (~Maxdamant@user/maxdamantus)
01:16:05 × x88x88x quits (~x88x88x@2001:19f0:5:39a8:5400:3ff:feb6:73cb) (Read error: Connection reset by peer)
01:16:05 foul_owl joins (~kerry@23.82.193.89)
01:17:48 <DigitalKiwi> is there some library for arbitrary(?) units. i want to quickly do maths on like miles per gallon per dollar etc.
01:18:22 <dons> https://hackage.haskell.org/package/units is the classic one i think
01:18:43 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
01:18:44 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
01:18:44 wroathe joins (~wroathe@user/wroathe)
01:19:12 <dons> you'll need something else if you want to do currency conversions though, obvs.
01:23:18 <janus> how do i run the doctests for the random library?
01:24:38 <geekosaur> do you know about cabal-doctest?
01:25:42 justsomeguy joins (~justsomeg@user/justsomeguy)
01:32:39 <janus> geekosaur: yes, but i was told it is deprecated
01:35:34 <janus> in fact, i tried adding cabal-doctest, and that's when i was told it was deprecated: https://github.com/haskell/random/pull/128/files
01:35:54 <janus> so i am trying to figure out what i have misunderstood, what is the proper way to have doctests now?
01:36:32 <geekosaur> that seems odd since as far as I know there is no alternative currently
01:37:39 <janus> there is docspec by phadej, and you can invoke doctest as a interpreter since doctest-0.20: "cabal repl --with-ghc=doctest", see https://hackage.haskell.org/package/doctest-0.20.0/changelog
01:37:39 <geekosaur> certainly its hackage page doesn't mention one (but it does say it's deprecated, sadly)
01:38:24 <janus> but i don't think the random library would expect me to use either of these approaches, since it is older than doctest-0.20 and also doesn't mention docspec at all
01:39:38 <janus> i just think 'cabal test doctests --enable-tests' seems like a pretty intuitive way of executing the tests, what am i doing wrong?
01:39:51 <janus> because it fails with the message that i posted in a comment on that pr
01:39:54 <hololeap> I feel like I've asked this before, but is there any way to get `cabal repl` to open a specific module in a project?
01:41:28 <dons> $ cabal v2-repl My.Cool.Module ?
01:43:23 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 272 seconds)
01:44:14 alt-romes joins (~romes@44.190.189.46.rev.vodafone.pt)
01:45:53 <hololeap> I'm not actually sure what that does. it doesn't seem to matter which module I put there
01:46:25 off^ joins (~off@50.232.121.75)
01:46:45 <dons> oh it seems to load the package that contains My.Cool.Module
01:47:04 <dons> you still then have to load it with : :m My.Cool.Module
01:47:09 × romesrf quits (~romes@44.190.189.46.rev.vodafone.pt) (Ping timeout: 256 seconds)
01:47:32 <dons> puts you in the right package tho
01:47:37 <geekosaur> I don'tthink ghci provides enough knobs for either cabal replor stack ghci to do that
01:49:06 <hololeap> hm, too bad. it would be really nice to "open" a module so I can play around with functions to see how they behave
01:49:29 <geekosaur> you can manually use :m asdons said
01:49:35 <dons> just use :m in the ghci prompt you get to
01:49:39 <geekosaur> it just can't "focus" it automatically for you
01:50:33 × ishutin quits (~ishutin@84-236-40-230.pool.digikabel.hu) (Ping timeout: 256 seconds)
01:50:46 <hololeap> I guess :m + ... could work, although I like how regular ghci also pulls in the imports of a module when you open the file as an argument and also exposes "hidden" functions
01:51:13 <dons> $ cabal v2-repl Glean
01:51:13 <dons> [7 of 7] Compiling Glean ( glean/client/hs/Glean.hs, interpreted )
01:51:13 <dons> Ok, 7 modules loaded.
01:51:13 <dons> *Glean> :m Glean.Angle
01:51:19 <dons> Prelude Glean.Angle> :t query
01:51:19 <dons> query
01:51:19 <dons> :: Glean.Typed.Binary.Type t =>
01:51:19 <dons> Angle t -> Glean.Query.Thrift.Internal.Query t
01:51:31 <dons> tab completion works too. so you can explore the exported module a bit
01:51:49 <hololeap> can you reference any functions that aren't exported by Glean.Angle?
01:51:53 <geekosaur> and it's interpreted so it'll still have those "hidden" functions
01:52:00 ishutin joins (~ishutin@78-131-74-100.pool.digikabel.hu)
01:52:03 <dons> I think ghci can see all of it right? iirc
01:52:34 <geekosaur> I do this with xmonad somewhat regularly while testing and/or typing things
01:53:00 <DigitalKiwi> thanks dons
01:54:01 <hololeap> ultimately I would like to automate this to some degree so I can have a terminal open in my IDE with ghci loaded and the module imported
01:55:15 <hololeap> and also support different components
01:55:47 <dons> might need access to cabal internals if you want to do it programmatically
01:55:54 <dons> or the ghci library
01:56:04 <dons> people have done interactive shells like this via the ghci lib a few times in the past iirc
01:56:56 <hololeap> cool
01:57:02 <dons> i don't think cabal out of the box is quite the right thing, its close. but not exactly what you'd want for an IDE that's e.g. swtiching contexts following the editor
01:57:11 <dons> but its not far off what you need
01:57:58 <hololeap> I was thinking about trying to write a kate plugin for this
01:58:43 <jackdk> janus: whenever I wrote doctests, I did so by calling the doctest main from a test-suite. dunno if that helps
01:59:03 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Remote host closed the connection)
02:03:08 × kaph_ quits (~kaph@93-39-148-20.ip76.fastwebnet.it) (Ping timeout: 250 seconds)
02:04:20 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Remote host closed the connection)
02:12:59 yauhsien_ joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
02:15:46 <janus> jackdk: but then there is no communication of the dependencies (and other cabal information) to the test suite, right? i thought that was the rationale for using cabal-doctest or 'cabal repl --with-ghc=doctest'
02:16:55 <jackdk> *shrug*, but this worked (at least once): https://github.com/qfpl/semialign-extras
02:17:08 <janus> ok cool, thank you, i'll try
02:17:42 × erisco quits (~erisco@d24-57-249-233.home.cgocable.net) (Quit: ZNC 1.8.2+cygwin2 - https://znc.in)
02:18:31 erisco joins (~erisco@d24-57-249-233.home.cgocable.net)
02:22:37 vysn joins (~vysn@user/vysn)
02:24:25 AlexNoo_ joins (~AlexNoo@178.34.161.220)
02:25:46 × kayvank quits (~user@52-119-115-185.PUBLIC.monkeybrains.net) (Remote host closed the connection)
02:25:48 <janus> jackdk: i just tried executing the test suite on that project with ghc 8.10.7 and doctest 0.20, and it failed to find its dependencies. so it's a similar situation to what's happening with random
02:26:01 × AlexZenon quits (~alzenon@178.34.160.24) (Ping timeout: 256 seconds)
02:26:27 × Alex_test quits (~al_test@178.34.160.24) (Ping timeout: 272 seconds)
02:26:36 × theproffesor quits (~theproffe@2601:282:8202:4a10::8622) (Quit: ¯\_(ツ)_/¯)
02:26:46 <janus> it seems to me like this is an approach that used to work, and now it doesn't. but cabal-doctest still works. i'd prefer if people had build-type:Custom and a working test suite over a test suite that doesn't execute...
02:27:54 <janus> but the bounds on semialign-extras are telling, since it has base<4.14, which means it worked until at least until ghc 8.8.4. (assuming the bounds are correct)
02:27:57 × AlexNoo quits (~AlexNoo@178.34.160.24) (Ping timeout: 256 seconds)
02:28:30 <janus> but OTOH, i tried running the tests on random with ghc 8.6.5. so maybe it has to be an old doctest _and_ an old ghc
02:29:02 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
02:29:44 <janus> davean: now i understand why you prefer the older random releases ;)
02:30:06 × emf quits (~emf@2620:10d:c090:400::5:9fc8) (Quit: emf)
02:30:53 AlexZenon joins (~alzenon@178.34.161.220)
02:31:00 Alex_test joins (~al_test@178.34.161.220)
02:32:03 <jackdk> janus: worked for me inside the nix shell. I suspect it's picking up the packages it needs from the shell
02:32:41 <janus> oh, maybe it is using ghc.environment files somehow?
02:39:10 da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:d2a9:6da2:b132:dfcb:fb0e)
02:39:22 × da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:d2a9:6da2:b132:dfcb:fb0e) (Client Quit)
02:41:20 <jackdk> nix-shells use an old cabal v1-command-style "global" package db. I put "global" in quotes because it's contained within the nix shell.
02:42:36 da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:d2a9:20af:a1b:4b5f:e73)
02:43:49 jz99 joins (~jz99@150.203.68.4)
02:45:03 yauhsienhuangtw joins (~Yau-Hsien@61-231-43-120.dynamic-ip.hinet.net)
02:45:19 × alt-romes quits (~romes@44.190.189.46.rev.vodafone.pt) (Quit: WeeChat 3.4)
02:47:57 × neurocyte0917090 quits (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
02:48:14 × yauhsien quits (~Yau-Hsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 260 seconds)
02:51:30 da39a3ee5e6b4b0_ joins (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914)
02:54:12 × da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:d2a9:20af:a1b:4b5f:e73) (Ping timeout: 240 seconds)
02:55:49 ubert1 joins (~Thunderbi@p200300ecdf3be98ff66ac9efa0af0607.dip0.t-ipconnect.de)
02:56:26 × ubert quits (~Thunderbi@p200300ecdf3be9b34946219f5177446d.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
02:56:26 ubert1 is now known as ubert
03:02:07 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
03:04:10 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
03:04:48 <davean> janus: ;)
03:05:08 <davean> jackdk: it gets deeper
03:05:11 <davean> er, janus
03:07:42 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
03:09:41 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection)
03:11:10 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
03:12:23 [_] joins (~itchyjunk@user/itchyjunk/x-7353470)
03:14:39 [itchyjunk] is now known as Guest4684
03:14:39 [_] is now known as [itchyjunk]
03:15:37 × Guest4684 quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 240 seconds)
03:16:39 × da39a3ee5e6b4b0_ quits (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914) (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:17:43 × Unicorn_Princess quits (~Unicorn_P@46-54-248-191.static.kate-wing.si) (Remote host closed the connection)
03:18:58 × alp quits (~alp@user/alp) (Ping timeout: 250 seconds)
03:19:55 × notzmv quits (~zmv@user/notzmv) (Remote host closed the connection)
03:22:12 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 240 seconds)
03:26:45 notzmv joins (~zmv@user/notzmv)
03:27:00 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
03:29:48 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Ping timeout: 240 seconds)
03:32:03 ec joins (~ec@gateway/tor-sasl/ec)
03:36:44 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds)
03:38:12 × beka quits (~beka@104.193.170.240) (Ping timeout: 240 seconds)
03:39:19 × yauhsien_ quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Remote host closed the connection)
03:40:14 × kongsheng quits (~kongsheng@71.28.228.142) (Quit: Client closed)
03:41:00 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
03:44:27 yauhsien_ joins (~Yau-Hsien@112.121.69.46)
03:46:16 da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914)
03:48:09 × yauhsienhuangtw quits (~Yau-Hsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 272 seconds)
03:49:20 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
03:52:25 yauhsienhuangtw joins (~Yau-Hsien@61-231-43-120.dynamic-ip.hinet.net)
03:53:06 beka joins (~beka@104-244-24-117.PUBLIC.monkeybrains.net)
03:55:24 Erutuon joins (~Erutuon@user/erutuon)
03:56:23 × yauhsien_ quits (~Yau-Hsien@112.121.69.46) (Ping timeout: 272 seconds)
04:01:10 yauhsien_ joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
04:01:11 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Read error: Connection reset by peer)
04:01:26 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 272 seconds)
04:04:54 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds)
04:05:41 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
04:05:41 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
04:05:41 wroathe joins (~wroathe@user/wroathe)
04:11:54 × analognoise quits (~analognoi@185.229.59.233) (Read error: Connection reset by peer)
04:15:05 Guest48 joins (~Guest48@103.177.44.10)
04:15:17 × yauhsien_ quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Read error: Connection reset by peer)
04:17:37 Guest487 joins (~Guest48@103.177.44.10)
04:18:12 × tomku quits (~tomku@user/tomku) (Ping timeout: 256 seconds)
04:22:00 × jjhoo quits (~jahakala@user/jjhoo) (Ping timeout: 268 seconds)
04:22:30 × gdown quits (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection)
04:23:20 tomku joins (~tomku@user/tomku)
04:25:30 adam_ joins (~m-2jewo5@129.153.21.50)
04:27:04 jjhoo joins (~jahakala@user/jjhoo)
04:27:31 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
04:31:55 × adam_ quits (~m-2jewo5@129.153.21.50) (Remote host closed the connection)
04:32:12 adamcstephens_ joins (~m-2jewo5@129.153.21.50)
04:34:39 × yauhsienhuangtw quits (~Yau-Hsien@61-231-43-120.dynamic-ip.hinet.net) (Read error: Connection reset by peer)
04:37:55 mbuf joins (~Shakthi@122.174.187.22)
04:41:04 jz9915 joins (~jz99@150.203.68.4)
04:44:32 × jz99 quits (~jz99@150.203.68.4) (Ping timeout: 256 seconds)
04:49:51 strawburr joins (~user@172.56.40.24)
04:51:02 × adamcstephens quits (161730d29b@2604:bf00:561:2000::2d5) (Remote host closed the connection)
04:52:05 adamcstephens_ is now known as adamcstephens
04:54:40 AdamS[m] joins (~adamvalko@2001:470:69fc:105::1:d5f0)
04:59:40 k8yun joins (~k8yun@user/k8yun)
04:59:49 × da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914) (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:12:44 × jz9915 quits (~jz99@150.203.68.4) (Quit: Client closed)
05:12:55 jz99 joins (~jz99@150.203.68.4)
05:14:53 × jz99 quits (~jz99@150.203.68.4) (Client Quit)
05:18:46 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Read error: Connection reset by peer)
05:24:09 × off^ quits (~off@50.232.121.75) (Remote host closed the connection)
05:25:37 da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914)
05:28:00 × ubert quits (~Thunderbi@p200300ecdf3be98ff66ac9efa0af0607.dip0.t-ipconnect.de) (Quit: ubert)
05:28:35 ubert joins (~Thunderbi@p200300ecdf3be98f2891ed35b60ac0a6.dip0.t-ipconnect.de)
05:30:52 deadmarshal_ joins (~deadmarsh@95.38.117.150)
05:32:18 × Guest48 quits (~Guest48@103.177.44.10) (Quit: Client closed)
05:32:18 × Guest487 quits (~Guest48@103.177.44.10) (Quit: Client closed)
05:35:02 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
05:35:16 × deadmarshal_ quits (~deadmarsh@95.38.117.150) (Ping timeout: 256 seconds)
05:35:28 × strawburr quits (~user@172.56.40.24) (Remote host closed the connection)
05:37:43 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
05:38:18 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
05:44:44 bahamas joins (~lucian@84.232.140.52)
05:46:57 deadmarshal_ joins (~deadmarsh@95.38.117.150)
05:53:48 xkuru joins (~xkuru@user/xkuru)
05:59:25 × chenqisu1 quits (~chenqisu1@183.217.201.47) (Remote host closed the connection)
05:59:38 × soxen quits (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net) (Ping timeout: 256 seconds)
05:59:53 × boborygmy quits (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net) (Ping timeout: 272 seconds)
06:01:03 × k8yun quits (~k8yun@user/k8yun) (Quit: Leaving)
06:01:11 coot joins (~coot@213.134.190.95)
06:04:30 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
06:06:18 <Axman6> um, dumb question, but how do use cabal repl with a package I've installed? I'm used to stack repl -package foo, what's the equivalent when using cabal?
06:06:31 boborygmy joins (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net)
06:06:34 soxen joins (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net)
06:07:11 <Axman6> ah, looks like --build-depends
06:07:16 <jneira[m]> <geekosaur> "stack controls its version of..." <- yeah that is the reason, it lets you override it but I guess nobody does it, so you end with two msys, as you can't touch stack one without high probs of break it
06:07:28 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds)
06:07:36 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 240 seconds)
06:08:48 ec joins (~ec@gateway/tor-sasl/ec)
06:09:20 × bliminse quits (~bliminse@host109-152-150-162.range109-152.btcentralplus.com) (Quit: leaving)
06:09:52 × ubert quits (~Thunderbi@p200300ecdf3be98f2891ed35b60ac0a6.dip0.t-ipconnect.de) (Quit: ubert)
06:10:10 ubert joins (~Thunderbi@p200300ecdf3be98f192a131a3268d950.dip0.t-ipconnect.de)
06:16:37 × mvk quits (~mvk@2607:fea8:5cc3:7e00::45ee) (Ping timeout: 240 seconds)
06:17:12 × CATS quits (apic@brezn3.muc.ccc.de) (Ping timeout: 256 seconds)
06:18:08 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
06:18:30 azimut joins (~azimut@gateway/tor-sasl/azimut)
06:21:01 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:21:18 bliminse joins (~bliminse@host109-152-150-162.range109-152.btcentralplus.com)
06:23:20 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Remote host closed the connection)
06:24:33 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
06:27:06 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
06:29:06 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
06:29:23 × da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914) (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:31:03 × bahamas quits (~lucian@84.232.140.52) (Ping timeout: 256 seconds)
06:32:51 Guest48 joins (~Guest48@103.177.44.10)
06:35:28 × Guest48 quits (~Guest48@103.177.44.10) (Client Quit)
06:39:20 da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914)
06:45:54 xkuru joins (~xkuru@user/xkuru)
06:46:42 × xkuru quits (~xkuru@user/xkuru) (Remote host closed the connection)
06:47:07 xkuru joins (~xkuru@user/xkuru)
06:48:22 × deadmarshal_ quits (~deadmarsh@95.38.117.150) (Ping timeout: 256 seconds)
06:52:09 Guest48 joins (~Guest48@103.177.44.10)
06:57:13 × Guest48 quits (~Guest48@103.177.44.10) (Quit: Client closed)
07:00:46 arjun joins (~arjun@user/arjun)
07:01:11 <arjun> how do i point cabal to install a package form a different url globally ?
07:01:31 <arjun> sidenote: anyone know what's up here -> https://github.com/vincenthz/hs-memory/pull/87 ?
07:05:28 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
07:06:37 c209e6dc-4d76-47 joins (~aditya@2601:249:4300:1296:195:dac6:592c:a55a)
07:07:40 vglfr joins (~vglfr@88.155.45.155)
07:10:45 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
07:12:18 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
07:16:05 × kimjetwav quits (~user@2607:fea8:2363:8f00:9e8a:8fa1:6b4e:dd92) (Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.50))
07:17:09 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 272 seconds)
07:21:25 × whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
07:24:52 Philos86 joins (~Philos86@38.80.235.160)
07:26:08 <Philos86> Hello, I'm new to Haskell and was wondering if I could get some help. I'm trying to implement the sRGB gamma transfer function and getting some errors about the Fractional datatype.
07:27:27 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Remote host closed the connection)
07:27:55 × ishutin quits (~ishutin@78-131-74-100.pool.digikabel.hu) (Ping timeout: 272 seconds)
07:29:00 ishutin joins (~ishutin@87-97-2-239.pool.digikabel.hu)
07:32:16 <Cale> Philos86: sure, maybe put the code/error up on dpaste.com or something?
07:33:33 <Cale> Fractional by the way, is a type class -- it's an interface shared by numerical data types that can represent fractional values (and do things like division)
07:34:38 × ubert quits (~Thunderbi@p200300ecdf3be98f192a131a3268d950.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
07:34:51 <Cale> You might be getting errors if you try to use (/) to divide integer values, for instance, because you'll need to explicitly convert them to a fractional type of number, such as Double before doing that.
07:36:17 × bliminse quits (~bliminse@host109-152-150-162.range109-152.btcentralplus.com) (Ping timeout: 240 seconds)
07:36:51 <Philos86> Cale Here you go: https://pastebin.com/EwuerMTc
07:37:40 <Cale> Oh, Fractional isn't a type, you can't use it like that in a type signature
07:37:45 <Philos86> Ah, that makes sense.
07:38:08 <Philos86> Is there a generic Real datatype I can use that represents real numbers?
07:38:09 <Cale> Also, you don't have to repeat the x on the left of each guard (and I think that's not valid)
07:38:29 bliminse joins (~bliminse@host86-156-84-211.range86-156.btcentralplus.com)
07:39:10 <Cale> You could write something like gammaCorrect :: (Fractional a) => a -> a
07:39:27 <Cale> However, I see that you're also running into an issue with exponentiation
07:39:30 <Philos86> Now it's telling me "No instance for (Fractional b0) arising from a use of `/'".
07:39:41 <Cale> ^ can only handle non-negative integer exponents
07:39:52 <Philos86> Oh.
07:39:57 <Cale> (but can work with any type of numbers in the base)
07:40:07 <Philos86> So is there a way to raise a real number to the power of another real number?
07:40:15 <Cale> (**)
07:40:27 <Cale> :t (**)
07:40:28 <lambdabot> Floating a => a -> a -> a
07:40:44 <Philos86> Ah. Is that valid for negative bases/exponents too?
07:41:57 <Cale> > pi ** (-4)
07:41:58 <ski> > 2 ^^ (-3)
07:41:58 <lambdabot> 1.0265982254684336e-2
07:42:00 <lambdabot> 0.125
07:42:17 <Philos86> Ah, ok.
07:42:20 <Cale> > 2 ** sqrt 2
07:42:22 <lambdabot> 2.665144142690225
07:42:42 <Cale> But it forces the base and result to be floating point
07:42:43 <Philos86> Some previous implementations of pow (looking at you, HLSL) don't support negative bases or exponents for some reason.
07:42:52 da39a3ee5e6b4b0_ joins (~textual@171.5.29.46)
07:42:57 × da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914) (Ping timeout: 240 seconds)
07:43:00 × boborygmy quits (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net) (Ping timeout: 240 seconds)
07:43:02 <Cale> There's also ^^
07:43:05 <Cale> :t (^^)
07:43:06 <lambdabot> (Fractional a, Integral b) => a -> b -> a
07:43:21 <Cale> It allows negative integer exponents, but requires a fractional base / result type
07:43:24 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 240 seconds)
07:43:34 <Cale> Just for comparison,
07:43:36 <Cale> :t (^)
07:43:37 <lambdabot> (Integral b, Num a) => a -> b -> a
07:43:44 × soxen quits (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net) (Ping timeout: 272 seconds)
07:44:28 <Philos86> Huh
07:44:58 <Philos86> Ok silly question, but how do I write a number (of any kind) to the console/stdout/stderr?
07:45:15 <Cale> print x will usually do it
07:45:23 <Cale> which is the same as putStrLn (show x)
07:45:37 <Axman6> :t ((^),(^^),(**))
07:45:38 <lambdabot> (Integral b1, Integral b2, Floating a1, Fractional a2, Num a3) => (a3 -> b1 -> a3, a2 -> b2 -> a2, a1 -> a1 -> a1)
07:45:50 <ski> luvly jubly
07:45:51 <Cale> show will convert things into strings (usually in a way that results in valid Haskell source code representations of them, but sadly not always)
07:46:02 <Axman6> urgh, for some reason I expected to get back a tuple of types... that is not at all useful, ignore me
07:46:25 <Philos86> Also is the an exact arithmetic datatype that works like Float/Double?
07:46:42 <Philos86> Like the iRRAM library for C++
07:47:05 <Cale> There are some on Hackage
07:47:46 <Cale> https://hackage.haskell.org/package/aern2-real
07:47:56 <Cale> https://hackage.haskell.org/package/exact-real
07:48:06 <Philos86> Like does it work as-is do I need to use it with special functions?
07:48:26 <Philos86> Like in C I would need to use a bunch of MPFR proxy functions
07:48:40 <Cale> It implements the standard numerical classes
07:48:47 <Cale> like Fractional etc.
07:49:04 <Philos86> So I could literally just do "pi / 2" and it would be more or less exact?
07:49:09 <Cale> yep
07:50:05 <Cale> Though, not sure what the printed result will look like. You might have to extract a specific approximation to actually see something sensible.
07:53:05 <Philos86> Kinda surprised something like that isn't built-in from the start
07:53:17 <Cale> Well, it's usually quite impractical for real use
07:53:27 <Philos86> Ah, yeah speed-wise.
07:53:34 <Cale> yeah
07:53:49 <Cale> Like, adding the numbers from 1 to 1000 might be painfully slow kind of slow.
07:53:51 <Philos86> Is there a 128bit datatype?
07:54:32 <Cale> https://hackage.haskell.org/package/long-double
07:55:59 <Cale> There's also Data.Fixed for fixed-precision arithmetic
07:58:50 <Philos86> Alright, thanks.
07:59:17 <Philos86> I've heard performance isn't as great at times; is it because of the backend compiler it uses?
08:00:38 gehmehgeh joins (~user@user/gehmehgeh)
08:00:56 <Cale> Performance of which thing?
08:02:29 <Philos86> Haskell in general; I've heard reports that a program in Haskell does not have the raw goodput of an equivalent program written in C/C++, but was curious if there's any truth to it.
08:03:01 <Cale> Just GHC-compiled Haskell code in general? The art of optimising Haskell code is definitely a bit less well-known and can be a little less intuitive than languages that are closer to the bare-metal representation. Though most of the time, it just comes down to using the right data structures and algorithms at a high level.
08:03:32 <sm> well, very few things are as fast as C in general
08:03:45 <Cale> If you're really trying to race a C program at some tight loop, that might require mangling your code a bunch, but you could also just write the small loop in C and call it.
08:03:56 fendor joins (~fendor@178.165.181.170.wireless.dyn.drei.com)
08:03:58 <Cale> (or assembly/llvm for that matter)
08:04:28 <Philos86> Well GHC actually compiles to C (or was it C--?) as an intermediary right? I figured at that point the next compiler in the toolchain could/would handle platform-specific optimization.
08:04:31 <Cale> no
08:04:43 <Philos86> Huh.
08:04:49 <Cale> Well, it compiles to its own thing called C-- as one of the intermediates
08:05:12 <Cale> (but that's not very much like C)
08:05:23 <Cale> At one point in the past, it did compile via C
08:05:51 <Cale> (which it had to mangle the compiler output of gcc with horrible perl scripts before the programs would run, it was terrible)
08:06:05 <Philos86> I was reading up on it and it made it sound like they switched to using regular C or LLVM SSA as the intermediary.
08:06:18 <Cale> But it has its own native code generator now, as well as an LLVM backend as an option
08:06:40 <Philos86> Oh, ok so you can use LLVM if you'd like, but it's not the default or only option.
08:06:44 <Cale> yeah
08:06:49 lortabac joins (~lortabac@2a01:e0a:541:b8f0:94a8:4010:5291:ba96)
08:08:22 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
08:09:26 <Cale> Oh, davean let me know that -via-C still exists actually :D
08:09:36 <Cale> -fvia-C
08:09:48 <davean> https://downloads.haskell.org/~ghc/9.2.2/docs/html/users_guide/codegens.html#c-code-generator-fvia-c
08:09:52 <davean> basicly it doesn't exist though
08:10:10 <davean> Its a technicallity it does which is why I mentioned it not here
08:10:20 michalz joins (~michalz@185.246.204.77)
08:10:20 <davean> (Unless you're working on porting GHC)
08:10:32 × beka quits (~beka@104-244-24-117.PUBLIC.monkeybrains.net) (Ping timeout: 256 seconds)
08:10:42 <Cale> ah, the option is physically removed from standard-built compilers, probably good :)
08:11:00 <Philos86> Ah yeah I'm not porting GHC to anywhere.
08:11:02 <merijn> Cale: I was about to say, it merely exists in a hypothetical sense :p
08:11:34 <merijn> "If you are facing a porting problem HARDER than making via-C work again for your platform, the code is still around"
08:11:41 <davean> I just figured Cale would like to know the truth instead of the convinient reality
08:11:47 <Philos86> Ok so are literal values defined as a certain type by default?
08:11:47 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
08:12:02 <Cale> Numerical literals are polymorphic
08:12:04 <Cale> :t 5
08:12:05 <lambdabot> Num p => p
08:12:08 <Cale> :t 4.5
08:12:09 <lambdabot> Fractional p => p
08:12:19 <davean> theres also a thing called "defaulting"
08:12:35 <merijn> imo, defaulting was a mistake
08:12:39 <Philos86> Ok so a literal 0.5 would be implemented on a context-by-context basis?
08:12:44 <davean> merijn: yes, but it does relate to the question
08:12:58 <davean> merijn: and the 'base' code is littered with it
08:13:00 <merijn> Philos86: Well, specifically, 0.5 gets translated to "fromRational 0.5"
08:13:06 <Philos86> So x = 0.5 + 1 might be different from x = 0.5 / y
08:13:16 <merijn> Philos86: And, for example, 5 gets translated to "fromInteger"
08:13:39 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
08:13:56 <Philos86> In C you can define the precision/datatypes of literal values, and wasn't sure if I can or should be doing that in Haskell.
08:13:59 <merijn> Philos86: Type inference is bidirectional, so the type of 'x' (and thus it's value) derives from *both* the parts of it's expression *and* how it's used
08:14:04 <davean> Philos86: specify its type
08:14:24 <merijn> Philos86: In your 'x = 0.5 + 1' GHC infers a couple of things
08:14:25 <Cale> Philos86: Especially if you're not giving explicit type signatures. If you want to get good performance out of numerical stuff, you should definitely try to specify the types as much as you can.
08:14:54 <Philos86> Ok, that's what I was thinking but wasn't sure.
08:15:02 <merijn> Philos86: First of all "0.5 :: Fractional p => p", "1 :: Num p => p", and "(+) :: Num a => a -> a -> a"
08:15:18 <merijn> Philos86: So GHC infers: "x :: (Fractional a, Num a) => a"
08:15:20 <Philos86> In the case of my transfer function, how would I force all literals to be either single or double precision?
08:15:32 <merijn> Philos86: ":: Double" :)
08:15:35 <Philos86> Like x * 12.92. Is the literal single or double?
08:15:48 <merijn> Philos86: Rationals are arbitrary precision
08:15:53 <Cale> When you see that something has a type like Fractional p => p then at runtime, this is implemented as a function which takes a record of all the Fractional operations (which in turn includes a record of all the Num operations), and computes your value using them.
08:16:03 <merijn> Philos86: So it depends on the conversion from rational to actualy type/value (like Double)
08:16:12 <Philos86> Ok so would I define the type like this?
08:16:13 <Philos86> x * (12.92 :: Double)
08:16:15 <sm> when GHC RTS (?) fails to decode due to unset/wrong locale... is there any more specific exception to catch than IOException ?
08:16:35 <merijn> Philos86: Yeah. Or, if 'x :: Double' GHC will automatically infer 12.92 as being Double too
08:16:36 <Cale> It's usually enough just to specify the types at the top level when you define things
08:16:51 <Philos86> @merij
08:16:51 <lambdabot> Unknown command, try @list
08:17:11 <merijn> Philos86: Or, if you write "y = x * 12.92" then "y :: Double" is enough to infer 'x' and '12.92' are Double
08:17:13 <Philos86> merijn Because I'm only taking a single Double parameter, is GHC assuming all literals are floats then?
08:17:26 × TheCoffeMaker quits (~TheCoffeM@user/thecoffemaker) (Ping timeout: 245 seconds)
08:17:42 <merijn> Philos86: You cannot mix different types in arithmetic (unlike C) and there is no automatic conversion
08:18:09 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
08:18:18 <merijn> Philos86: So fixing one part of an expression to a specific type is sufficient to fix *everything* unless you explicitly add conversions
08:18:36 × LiaoTao_ quits (~LiaoTao@gateway/tor-sasl/liaotao) (Ping timeout: 240 seconds)
08:18:46 <Cale> Philos86: the information generally flows through the operations
08:18:48 <Cale> :t (*)
08:18:48 <lambdabot> Num a => a -> a -> a
08:18:54 <merijn> Which can be annoying sometimes when mixing lots of integer and float math, but overall I prefer it to C's implicit conversion, because it's harder to mess up explicit conversions
08:19:02 <Cale> both arguments and the result of (*) must have the same type, for example
08:19:04 lumberja1k123 joins (~alMalsamo@gateway/tor-sasl/almalsamo)
08:19:05 <Philos86> Ok so is it safe to assume that GHC promotes a literal or variable to the most precise/accurate datatype between two operands?
08:19:11 <merijn> > (5 :: Int) * (12.00 :: Double)
08:19:12 <lambdabot> error:
08:19:12 <lambdabot> • Couldn't match expected type ‘Int’ with actual type ‘Double’
08:19:12 <lambdabot> • In the second argument of ‘(*)’, namely ‘(12.00 :: Double)’
08:19:20 <Cale> GHC will never implicitly convert numerical types
08:19:23 <merijn> Philos86: GHC never promots variables
08:19:36 TheCoffeMaker joins (~TheCoffeM@user/thecoffemaker)
08:19:47 <merijn> Philos86: Only literals are polymorphic and they're converted *once*, based on the type of the expression their used in
08:19:48 <Philos86> So (x :: Float) * (y :: Double) would be invalid?
08:19:53 <merijn> Philos86: Yes
08:19:54 <Cale> correct
08:20:20 <Philos86> You said explicit is allowed though so I can manually promote x to Double then right?
08:20:32 <Cale> yeah, you could use realToFrac to convert it
08:20:33 <merijn> Philos86: So literals are arbitrary precision (and will be converted to the nearest possible representation based on use)
08:20:36 × lumberjack123 quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
08:20:44 <merijn> > (0.5 :: Float) * (2.0 :: Double)
08:20:46 <lambdabot> error:
08:20:46 <lambdabot> • Couldn't match expected type ‘Float’ with actual type ‘Double’
08:20:46 <lambdabot> • In the second argument of ‘(*)’, namely ‘(2.0 :: Double)’
08:20:51 <merijn> > realToFrac (0.5 :: Float) * (2.0 :: Double)
08:20:52 <lambdabot> 1.0
08:21:01 <ski> > realToFrac (pi :: Float) :: Double
08:21:03 <lambdabot> 3.1415927410125732
08:21:25 <Philos86> So wait how do you typecast/coerce/promote a variable?
08:21:29 <ski> > fromIntegral (5 :: Int) * (12.00 :: Double)
08:21:31 <lambdabot> 60.0
08:21:37 <Philos86> Is it just (x :: Type) :: OtherType?
08:21:41 <ski> no
08:21:43 <merijn> There are no casts, there's coercions (but you don't want those)
08:21:53 <merijn> Philos86: The two main functions you want for arithmetic are:
08:21:58 <merijn> :t realToFrac
08:21:59 <lambdabot> (Real a, Fractional b) => a -> b
08:22:02 <merijn> :t fromIntegral
08:22:03 <lambdabot> (Integral a, Num b) => a -> b
08:22:35 <ski> `(x :: Type) :: OtherType' only works when `Type' and `OtherType' are the same type. a type ascription is not a cast or a coercion. it specifies what type something already has
08:22:36 <merijn> The former converting between fractional/real types and the latter for converting any integral type to an arbitrary Num
08:22:41 <Cale> Philos86: Well, that basically ensures that Type and OtherType will unify with each other, i.e. that if they're polymorphic, that you can specialise them both to get some more concrete type
08:22:59 × lumberja1k123 quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Remote host closed the connection)
08:23:01 <Cale> Philos86: Or if they're not polymorphic, it just ensures that Type and OtherType are the same type
08:23:13 <Philos86> Ok wait so it sounds like ultimately in Haskell all arithmetic boils down to either an integral type or fractional type, yes?
08:23:15 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Ping timeout: 256 seconds)
08:23:34 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
08:23:39 <Cale> Well, you can introduce your own new data types and make them instances of these classes by implementing the operations
08:23:42 <Philos86> Like for example any integer (eg. 5) can ultimately be represented as a fractional (5 / 1) so it seems like Haskell is internally using those for everything, no?
08:24:02 <merijn> Philos86: Consider the case of "2 :: Double". The literal '2' has type 'Num a => a' (i.e. any instance of Num) and the type annotation says it has type Double. So the question (to GHC) is "is Double an instance of Num?". Yes, so it uses 2 as type Double
08:24:06 lumberjack123 joins (~alMalsamo@gateway/tor-sasl/almalsamo)
08:24:18 <Philos86> Just trying to wrap by head around integrals and fractionals.
08:24:41 <Cale> (5 :: Integer) will internally be a data structure that stores 5 as a machine int, because it's small enough, but for a large enough value, would use a GMP large integer
08:24:57 <Cale> (5 :: Double) will use a machine double internally
08:25:06 <Cale> (5 :: Int) will definitely use a machine integer
08:25:09 geekosaur joins (~geekosaur@xmonad/geekosaur)
08:25:13 <Philos86> Ok so in that case it's looking at 2 (as a Num) and seeing if it can downcast it (but not really) to a Double before implementation
08:25:33 <merijn> Philos86: The think is that the *literal* 5 in source is treated as "fromInteger 5" and the representation depends on "what integer type is 5 converted to"
08:25:35 <Cale> When you have a real program, at some point, you will have to choose a specific type
08:25:45 <ski> > fromInteger 2 :: Double
08:25:47 <lambdabot> 2.0
08:26:06 <merijn> Philos86: So if you have "5 :: Double" it will convert the integer value 5 to the closest IEEE-754 Double (which happens to be 2.0)
08:26:08 <ski> a literal `2' gets converted to `fromInteger 2', where that `2' has type `Integer'
08:26:23 <Cale> On the ghci prompt, or if you're really lazy about specifying things, there's a mechanism which will try to "default" the type chosen to Integer, and if that doesn't work, then Double (and this list can be modified with a default declaration)
08:26:35 LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao)
08:26:37 <Philos86> Ah, ok.
08:26:40 Erutuon joins (~Erutuon@user/erutuon)
08:26:58 <Cale> It only applies in cases where a type is only constrained by Prelude classes that include some numerical ones.
08:26:59 <merijn> (because the literal "5 :: Double" is treated as "fromInteger 5 :: Double" and "fromInteger :: Num a => Integer -> a" and Double is an instance of Num)
08:27:02 <Philos86> Also thanks for answering all my questions; Haskell is very much a world of difference from the C family of languages.
08:27:07 <ski> (a floating-point literal like `2.0' gets converted to `fromRational 2.0', interpreting that `2.0' as a `Rational')
08:27:40 <merijn> Philos86: Note that literals (by definition) are finite in size and thus can be represented losslessly as Rational (which is basically a fractional representation)
08:27:43 <Philos86> Does haskell have a native way of doing integrations or summations?
08:27:46 <merijn> > 5 :: Rational
08:27:48 <lambdabot> 5 % 1
08:27:51 <ski> (note that `fromInteger' is distinct from `fromIntegral', btw)
08:28:01 <merijn> > 1 / 3 :: Rational
08:28:03 <lambdabot> 1 % 3
08:28:19 <Cale> Philos86: There's sum, which will take the sum of a list
08:28:29 <Cale> > sum [x^2 | x <- [1..10]]
08:28:30 <lambdabot> 385
08:28:51 <merijn> Philos86: So the literal as seen by the compiler is lossless and you only incur loss of precision when the compiler uses "fromRational :: Fractional a => Rational -> a" to convert it to, e.g. a Double
08:29:31 <Cale> No built-in mechanism for integrals, but relevant libraries exist
08:29:35 <Philos86> Ah ok so the precision loss is ultimately context-specific then
08:30:03 × Natch quits (~natch@c-67bae255.014-297-73746f25.bbcust.telenor.se) (Ping timeout: 256 seconds)
08:30:12 <merijn> Philos86: Yeah. And since there's no automatic promotion there's only a single context-specific loss (e.g. to Double or whatever)
08:30:29 <Philos86> Ok that makes sense now.
08:31:19 alp joins (~alp@user/alp)
08:31:44 <Philos86> I'm looking for some libraries for integration but not finding anything on google
08:31:55 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:32:13 × [exa] quits (exa@user/exa/x-3587197) (Remote host closed the connection)
08:32:35 <merijn> Philos86: Which is why in your 'y = x * 0.5' example fixing either 'x' or 'y' is sufficient to make things work out
08:32:49 <merijn> The rest is inferred transitively via *
08:34:25 Natch joins (~natch@c-67bae255.014-297-73746f25.bbcust.telenor.se)
08:35:09 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
08:35:48 <Philos86> Does Haskell have any kind of loops?
08:36:02 <ski> > let x = x in x
08:36:05 <lambdabot> *Exception: <<loop>>
08:36:26 <merijn> Philos86: Define loops :)
08:36:50 <merijn> Because "no" but also "yes, of course"
08:37:45 <Philos86> Like for example if I need to integrate over hemisphere and calculate some value based on a vector for that specific iteration I could do that easily in C using a for loop
08:37:52 Erutuon joins (~Erutuon@user/erutuon)
08:38:30 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
08:39:15 chele joins (~chele@user/chele)
08:39:16 <merijn> Philos86: Most while loops can be trivially turned into maps/folds and various higher order traversals. Where as more generic while loops are more likely to be easier to just write recursively
08:39:33 <Philos86> Ah, ok that makes sense.
08:39:58 <Philos86> So let's say I need to integrate over a hemisphere, how would that look in Haskell?
08:40:09 <merijn> Most "iterative solutions with state" tend to map rather naturally to folds
08:40:28 <merijn> Philos86: I can't say, because I don't know what "integration over a hemisphere" looks like in "not Haskell" :)
08:41:01 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
08:41:35 dschrempf joins (~dominik@178.251.70.207)
08:42:11 <Philos86> Oh, well like in C integration usually gets turned into a summation via some kind of for loop with a specific number of samples
08:44:10 <merijn> Philos86: Basically, if you can formulate your loop body as a function with type: "IterationInput -> State -> State" it's a fold :)
08:44:15 <merijn> :t foldl
08:44:16 <lambdabot> Foldable t => (b -> a -> b) -> b -> t a -> b
08:44:18 <merijn> :t foldr
08:44:19 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
08:44:45 <merijn> (You can make IterationInput an integer or () if you only need the state)
08:44:57 <merijn> Although, if you only need the state you can probably just use:
08:44:57 <Philos86> Ok so going back to my gamma transfer function as an example
08:45:01 <merijn> :t iterate
08:45:03 <lambdabot> (a -> a) -> a -> [a]
08:45:15 <merijn> > iterate (+1) 0
08:45:16 <lambdabot> [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,2...
08:46:07 <ski> > takeWhile (< 1000) (iterate (2 *) 1)
08:46:09 <lambdabot> [1,2,4,8,16,32,64,128,256,512]
08:46:25 <Philos86> How would I iterate or fold a number of real values through a function and print them all out?
08:47:08 jgeerds joins (~jgeerds@55d4548e.access.ecotel.net)
08:47:13 <Philos86> Like if function f takes a single value x, and I want to iterate or fold over a range of 0 to 1 how do you do that?
08:47:56 <ski> % for_ [0,0.25 .. 1] (\x -> print x)
08:47:56 <yahb> ski: 0.0; 0.25; 0.5; 0.75; 1.0
08:48:05 <merijn> Philos86: ok, so the input of 'f' is the values within your range? What does 'f' return?
08:48:52 <Philos86> In this case it maps a value within the range of [0, 1] and returns another value within the range of [0, 1]
08:49:04 machinedgod joins (~machinedg@24.105.81.50)
08:49:04 <merijn> And what do you do with the result of 'f'?
08:49:33 <Philos86> Ultimately it would be stored somewhere, like in a file or printed to the console.
08:49:58 <ski> each individual `f x' would be stored in a file, for each `x' in the range ?
08:50:00 <merijn> oh, so you just want to use a function before printing? The something like ski's example
08:50:18 <merijn> :t mapM_
08:50:18 <lambdabot> (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
08:50:44 <merijn> % mapM_ (print . (+1)) [0,0.25..1]
08:50:44 <yahb> merijn: 1.0; 1.25; 1.5; 1.75; 2.0
08:50:58 <merijn> (just imagine (+1) is whatever function you want)
08:51:03 jespada joins (~jespada@148.252.132.235)
08:51:52 <merijn> ah, looks like I have a reasonably simple iterative problem in last years AOC
08:52:19 <Philos86> It's giving me syntax errors about the % sign
08:52:22 <merijn> Philos86: Problem: https://adventofcode.com/2021/day/6 iterative solution using foldl https://github.com/merijn/AdventOfCode/blob/master/Day6.hs#L42-L51
08:52:32 <merijn> Philos86: % is just the signal to the bot to run it :)
08:52:49 <Philos86> Oh, derp.
08:53:07 <Philos86> Ok what does the double .. mean in the array list?
08:53:53 <merijn> Philos86: pedantic side note: there's no array lists. There's list (which are single linked lists) and there are arrays/vectors (but those aren't in base)
08:54:15 mcgroin joins (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
08:54:29 <merijn> Philos86: [x,y..z] gets translated to "enumFromThenTo" (and there's various other Enum based functions)
08:54:39 <merijn> > [1..] -- enumFrom 1
08:54:41 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
08:54:50 <merijn> > [1,3..] -- enumFromThen 1 3
08:54:50 <Philos86> So does y control the precision of each iteration?
08:54:51 <lambdabot> [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53...
08:54:59 [exa] joins (~exa@user/exa/x-3587197)
08:55:01 <merijn> > [1,3..10] -- enumFromThenTo 1 3 10
08:55:04 <lambdabot> [1,3,5,7,9]
08:55:14 <Philos86> Eg. [0,0.0625..1] would increment by 0.0625 each time?
08:55:20 <Cale> yeah
08:55:24 <merijn> Philos86: Yeah. Although admittedly the Double instance is a god awful abomination best avoid like the plague :p
08:55:34 <Philos86> How so?
08:55:41 <merijn> Philos86: But it was the simplest way to do your [0, 1] constraint :)
08:55:52 <Philos86> Ah, I see.
08:55:55 <merijn> > [0.1..]
08:55:56 <lambdabot> [0.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,11.1,12.1,13.1,14.1,15.1,16.1,...
08:56:21 <Cale> Yeah, in the Double/Float case, the precision it uses to test if you're at the end is half the distance between the first two given elements, so there are some wacky things that can happen
08:56:26 <merijn> Philos86: Well, if "enumFrom" is supposed to pick the next value, what is the "next" value of a double? As you can see, the default choice is horrible
08:56:37 notzmv joins (~zmv@user/notzmv)
08:56:40 <merijn> For integeral values "next" has a more sensible definition
08:56:48 <ski> > [0,2/11 .. 1] :: [Float]
08:56:49 <lambdabot> [0.0,0.18181819,0.36363637,0.54545456,0.72727275,0.90909094,1.0909091]
08:57:17 <Philos86> No wonder integration libraries exist haha.
08:57:21 <merijn> Philos86: But the .. notation works for any enumerable type
08:57:24 <tomsmeding> > [0,0.4..1.2]
08:57:25 <lambdabot> [0.0,0.4,0.8,1.2000000000000002]
08:57:28 <merijn> > [False..]
08:57:29 <lambdabot> <hint>:1:9: error: parse error on input ‘]’
08:57:34 <merijn> > [False ..]
08:57:35 <lambdabot> [False,True]
08:57:38 <ski> @botsmack
08:57:38 <lambdabot> :)
08:57:58 <Philos86> Ok so what's the difference between a fold and a map?
08:58:17 worldhelloworld joins (~c1utt4r@vmi275462.contaboserver.net)
08:58:17 <merijn> Philos86: If you wanna use "proper" arrays (i.e. like C's arrays) you'll want
08:58:20 <merijn> @hackage vector
08:58:20 <lambdabot> https://hackage.haskell.org/package/vector
08:58:22 <Cale> map will apply a function to all the elements of a list to get another list
08:58:26 <ski> a `map' translates each element in a list into a new element (independently). the new list has the same number of elements
08:58:34 <merijn> > map (+1) [0..10]
08:58:36 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11]
08:58:38 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
08:58:39 <Cale> a fold need not produce a list as its result -- it does some arbitrary thing to combine the elements of the list
08:58:44 <merijn> > foldl (+) 0 [0..10]
08:58:45 <lambdabot> 55
08:59:11 [exa] hangs a nice ' atop that foldl
08:59:19 <merijn> > map f [a,b,c]
08:59:20 <lambdabot> error:
08:59:20 <lambdabot> • Ambiguous type variable ‘b0’ arising from a use of ‘show_M258285656192...
08:59:20 <lambdabot> prevents the constraint ‘(Show b0)’ from being solved.
08:59:28 <merijn> > map f [a,b,c] :: [Expr]
08:59:29 <lambdabot> [f a,f b,f c]
08:59:44 <merijn> > foldl f z [a,b,c] :: Expr
08:59:45 <lambdabot> f (f (f z a) b) c
08:59:58 <ski> > foldr f z [a,b,c] :: Expr
08:59:59 <lambdabot> f a (f b (f c z))
09:00:10 __monty__ joins (~toonn@user/toonn)
09:00:31 acidjnk joins (~acidjnk@p200300d0c7049f95a8560519e34e318b.dip0.t-ipconnect.de)
09:00:52 <ski> > foldl (**) z [a,b,c] :: Expr
09:00:53 <lambdabot> ((z**a)**b)**c
09:00:54 <ski> > foldr (-) z [a,b,c] :: Expr
09:00:55 <lambdabot> a - (b - (c - z))
09:02:21 worldhelloworld2 joins (~quassel@vmi275462.contaboserver.net)
09:03:19 × [exa] quits (~exa@user/exa/x-3587197) (Quit: repty)
09:03:25 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Remote host closed the connection)
09:03:28 bahamas joins (~lucian@84.232.140.52)
09:03:56 [exa] joins (exa@user/exa/x-3587197)
09:04:32 <Philos86> Ok so folds ultimately just add it all up
09:04:49 <Cale> It's possible to implement map using foldr
09:04:57 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Ping timeout: 240 seconds)
09:04:59 <Philos86> I'm assuming foldl and foldr mean fold-left and fold-right, respectively?
09:05:06 <ski> yes
09:05:15 <Philos86> Ok so what's the difference?
09:05:17 <Cale> Yeah, and those refer to the way that the resulting expression is nested
09:05:28 <Cale> > foldr f z [1,2,3]
09:05:29 <lambdabot> f 1 (f 2 (f 3 z))
09:05:33 <Cale> > foldl f z [1,2,3]
09:05:35 <lambdabot> f (f (f z 1) 2) 3
09:06:03 <Cale> (this is using a cute library that's loaded into lambdabot to display expressions)
09:06:53 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
09:06:54 <Cale> ( https://hackage.haskell.org/package/simple-reflect )
09:08:15 <ski> @where folds
09:08:16 <lambdabot> <http://en.wikipedia.org/wiki/File:Fold-diagrams.svg>,<https://cale.l5.ca/share/Folds.svg>
09:08:16 × lumberjack123 quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
09:08:16 <Philos86> Ok what does the . in mapM_ (print . someFunc) do here?
09:08:24 <ski> function composition
09:08:38 <Cale> https://cale.l5.ca/share/Folds.svg -- you can see a bunch of folds and folding-related functions visualised here
09:08:49 <Cale> (f . g) x = f (g x)
09:09:00 <ski> Cale : ahead of you :p
09:09:07 <Cale> oh, haha
09:09:30 <Cale> The wikipedia link is dead :(
09:09:46 <Philos86> Oh so the . passes the result of g into f
09:10:33 <ski> Philos86 : it's the same as `mapM_ (\x -> print (someFunc x))', or `mapM_ myFun' where `myFun x = print (someFunc x)'
09:11:01 <Cale> Yeah, of course, due to lazy evaluation being outermost-first, what will operationally happen (typically) is that the code for f will be entered immediately with its parameter bound to (g x)
09:11:46 <Cale> (and then, when f decides to inspect that argument, g will actually be used)
09:12:48 <Philos86> So can Haskell do OOP or is that a bad idea here?
09:12:50 lumberjack123 joins (~alMalsamo@gateway/tor-sasl/almalsamo)
09:13:09 <Cale> It has no built-in features for it, but it can do a pretty good job of it
09:13:24 <merijn> Although the use of OOP style design is kinda niche
09:13:29 <Cale> Yeah
09:14:25 <Cale> Though there are times where I see someone go overboard defining a type that has 180 cases or something, and then that gets pattern matched on only 2 or 3 times :P
09:14:27 <Philos86> I'm just curious how you'd handle certain things that typically require state
09:15:11 <hololeap> do you know about the state monad?
09:15:16 <Philos86> Like for example I've heard reports of Haskell being increasingly used for game development, which typically require AI and some kinda physics library
09:15:24 <Cale> A good rule of thumb is that any time you have a type with more constructors than there are times you'll ever pattern match on it, you might just want to replace the type with a record of the results of those pattern matches.
09:15:45 <Cale> Let's start even more basic than the state monad
09:16:07 <Cale> Functions can produce different results when applied to different arguments
09:16:11 <Philos86> hololeap No, I'm only vaguely aware of it and monads in general.
09:16:28 <hololeap> ok, I probably got to far ahead
09:16:47 <Philos86> Cale Do constructors mean the same thing here as they do in C/C++?
09:16:49 <Cale> So you can represent a situation where you have variables that change just by having those variables be the parameters of a function
09:16:54 <ski> Philos86 : no
09:17:03 <Cale> Philos86: Yeah, not really, no
09:17:28 <ski> @where C/C++
09:17:28 <lambdabot> "C/C++ : A new language for the new Millennium" by Richard Heathfield in 2005-02 at <http://web.archive.org/web/20090421080714/http://www.cpax.org.uk/prg/portable/c/c++/rfe00000.html>
09:17:51 <Cale> You'll want to read about algebraic data types before the thing I said about data constructors begins to make sense probably :)
09:18:09 <ski> and pattern-matching
09:19:06 <Philos86> I'm somewhat aware of pattern matching
09:19:24 × mcgroin quits (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds)
09:19:26 <merijn> Philos86: I mean, contrary to the "popular internet perception" Haskell is a whole lot less principled and safe then the average inexperienced person talking about Haskell makes it out to be :p
09:19:54 <merijn> Philos86: There's like 5 or 6 different types of mutable state, including straight up "malloc & pointers" :)
09:20:00 krappix joins (~krappix@nat-eduroam-76-gw-01-lne.lille.inria.fr)
09:20:15 <hololeap> most languages only know about product types, which are like structs. there are also sum types which are more like "choose a constructor from a list of choices". you can also mix and match
09:20:21 <Cale> When you define a new data type, you specify a bunch of new values that get names starting with uppercase letters, and these values can be functions (i.e. they can have arguments), with the special property that you're allowed to pattern match on them and get the arguments back out
09:20:33 <Philos86> So you're saying alot of YT is getting it wrong then?
09:20:47 <merijn> Philos86: Depends on the channel, probably ;)
09:21:04 <merijn> But overall I'd say "most things said about Haskell outside of Haskell communities are wrong", yes :)
09:21:22 <hololeap> it's mostly that haskell makes it less easy to break the rules and/or go crazy, but you still can
09:21:22 <Cale> Philos86: As a counterpoint to what merijn is pointing out: Haskell also makes it less necessary to use all of those things
09:21:43 <merijn> Yeah, in practice you usually don't need all that stuff
09:22:04 <merijn> I'm just saying it's there and using it isn't that hard if you come from, like, C
09:22:10 <Philos86> Ah ok
09:22:26 <merijn> Sure, blowing your foot of using malloc and pointers in Haskell is about as easy as in C, which is motivation not too :p
09:22:31 <Cale> and after a while of not using them as much, you will begin to understand why that's a good idea, because programs that don't manipulate state and twiddle things in memory everywhere are so much easier to reason about, debug, and test
09:22:36 <Philos86> So if I actually needed to create a singleton or some-such I could, but not necessarily should.
09:23:07 <merijn> Philos86: Singletons are less necessary since most things are immutable and pure by default
09:23:31 <merijn> Philos86: singletons are important because they arise when "shared mutable state needs to be ensured to be globally unique"
09:23:35 <Philos86> Ok so how does Haskell handle things like interfacing with C?
09:23:45 <merijn> But if you eliminate most shared mutable state, that's a non-issue
09:24:01 <merijn> Philos86: There's a C FFI which is, frankly, trivial to use if you know C
09:24:07 <Philos86> Like if I want to draw a triangle in OpenGL, do I need to create wrappers that explicitly state the side-effects of the OGL calls like you do with the IO() datatype?
09:24:30 <hololeap> it's actually not that uncommon when you start looking at real programs. it seems like quite a few use MVars (IO mutable variables) to implement essentially the singleton pattern from OOP
09:25:15 <merijn> Philos86: Normally C FFI happens using IO
09:25:34 <merijn> Philos86: For example, here's a bunch of FFI I do with SQLite and some of my own code in the same repo: https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/src/SQLiteExts.hs#L80-L168
09:26:04 <merijn> And the relevant C header https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/cbits/sqlite-functions.h
09:26:05 DNH joins (~DNH@2a02:8108:1100:16d8:1c1a:3fa2:4926:7c5a)
09:26:14 <merijn> Should be fairly straightforward :)
09:26:33 <hololeap> but you can get away with a lot less singletons if you learn how to do write haskell idiomatically
09:27:10 <hololeap> it's just sometimes they are actually useful at the top level of a program
09:27:57 <Philos86> Ah ok that makes sense.
09:29:18 <Philos86> Not sure if this is sensible question, but how conducive is Haskell to mathematics in general over other languages like C?
09:29:23 <merijn> Philos86: If you have a C/C++ backgroun, Ryan Newton gave an interesting keynote about Haskell at C++Now a few years back: https://www.youtube.com/watch?v=lC5UWG5N8oY
09:29:40 × coot quits (~coot@213.134.190.95) (Quit: coot)
09:29:52 <Cale> Philos86: Haskell is definitely good for those people who have a mathematical mindset
09:30:00 ccntrq joins (~Thunderbi@2a01:c22:8509:dc00:953c:9b71:e9ca:822e)
09:30:14 <hololeap> it was written by math nerds
09:30:19 <Philos86> Like let's say I need to write some kind of math library that can or will be called from C
09:30:46 <Philos86> Cale Ah, that might explain why I'm struggling with it then, as I come from the other side of the camp.
09:30:53 <maerwald> I think for actual maths stuff, people use python
09:31:18 <Philos86> Could I write my library in Haskell and call it from C?
09:31:39 <Cale> Technically, yes, though it's a little awkward to go in that direction
09:32:04 <Philos86> maerwald Does Python offer a FFI or call to/from C? Last I checked it doesn't.
09:32:24 <hololeap> maybe llvm would make that easier?
09:32:28 <Cale> You can FFI export things from Haskell, and then on the C side, you need to call a thing to start the Haskell runtime and then you can call the exported functions.
09:32:57 × Natch quits (~natch@c-67bae255.014-297-73746f25.bbcust.telenor.se) (Ping timeout: 240 seconds)
09:33:00 <Philos86> Oh, so Haskell can't generate standalone code that can run then.
09:33:18 <hololeap> it has a runtime
09:33:22 × thevishy quits (~Nishant@49.37.242.151) (Read error: Connection reset by peer)
09:33:22 <Cale> Like, there's a garbage collector and stuff.
09:33:31 <Cale> thread scheduler
09:33:57 thevishy joins (~Nishant@49.37.242.151)
09:34:10 <hololeap> it's not a good fit for e.g. arduino
09:34:25 <hololeap> although I think someone did make a subset that worked for that...
09:34:27 <Cale> It might be more appropriate to write Haskell code that writes C code.
09:34:45 <Philos86> So if I have a function that is say literally 'f x y = (x ** 5) / pi - y' it would still require the runtime, despite being pure math that could probably be implemented using just doubles and the x87 or SSE/AVX registers?
09:35:11 <Cale> There are some libraries like that. FFTW is a fast Fourier transform library written as an O'Caml program that writes C programs
09:35:23 <__monty__> Yes, because haskell has certain semantics and guaranteeing those requires the runtime.
09:35:26 <Philos86> Cale Funny how we got back to the discussion of whether or not Haskell compiles to C as an intermediary.
09:35:36 <merijn> __monty__: disagree
09:35:47 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
09:35:57 <__monty__> merijn: Even if I add "at this time?"
09:36:12 <Cale> Philos86: Yeah, except that in this case, you'd be writing a one-shot compiler in Haskell, that would itself generate C code. The compiler you could even run interpreted :P
09:36:16 <merijn> Philos86: I mean, "does code like that require a runtime?" probably not. Was it worth anyone's engineering time to minimise reliance on the runtime? No
09:36:38 <Philos86> That makes sense.
09:37:03 <merijn> __monty__: I disagree that Haskell's semantics require a runtime. GHC's implementation kinda hard relies on it, but there's no theoretical reason to consider "Haskell" needing it
09:37:20 kuribas joins (~user@ptr-25vy0ia81ze2oltltpx.18120a2.ip6.access.telenet.be)
09:37:49 <Cale> There's a library called Atom that was written and used a while back to make the control software for a bunch of hybrid hydraulic vehicles. It's a Haskell library that generates C code to avoid the need for a realtime operating system.
09:37:55 <hololeap> that's actually a good point. a lot of this isn't haskell specific, but ghc specific
09:37:59 <__monty__> Yeah, but this discussion isn't really about pie in the sky stuff. The question is rather concrete. "Can I FFI into Haskell without the runtime."
09:38:08 <Cale> https://hackage.haskell.org/package/atom
09:38:36 <merijn> Philos86: The runtime itself is "just" a library linked into the program, if you're one of those people trying to shave off every byte, that's a problem, but in practice that's a non-issue since you usually wanna embed a non-trivial amount of Haskell so you'd need most of the runtime anyway
09:38:54 <Cale> Yeah
09:39:00 × ishutin quits (~ishutin@87-97-2-239.pool.digikabel.hu) (Ping timeout: 250 seconds)
09:39:08 <Cale> Though, it's usually more comfortable regardless just to go the other way
09:39:09 maerwald looks at his 50MB big binaries that have 200LOC of code
09:39:30 <Philos86> Well the idea was to use Haskell for situations where Haskell lends itself very well (eg. math and physics libraries), or for very math-heavy programs (eg. computer graphics) thinking that Haskell, being a pure functional language, could optimize or be optimized for said usage better than C/C++ would.
09:39:33 <Cale> Usually the stuff that needs to be written in C is a lot smaller
09:39:46 <dminuoso> maerwald: To be fair, the default of cabal not splitting sections and not stripping your binary is a big part of that.
09:40:04 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
09:40:04 <hololeap> also it being statically linked by default
09:40:05 <Cale> Or, more to the point, the performance-critical stuff is usually tight loops in the innermost parts of your program
09:40:05 <dminuoso> (Amusingly cabal has a defunct stripping function. You can enable it all you want, it actually doesnt do anything)
09:40:23 <maerwald> Philos86: I'm not sure Haskell is very strong on math-heavy programs. The fact that it's suitable for math-like minds doesn't imply we can compete with other language ecosystems wrt such libraries
09:40:23 <Cale> and so it's fine to surround that with high-level code
09:40:39 <Philos86> dminuoso I'm using stack, not cabal so not sure if I have that problem.
09:40:53 ishutin joins (~ishutin@85-238-93-20.pool.digikabel.hu)
09:41:07 EvanR_ joins (~EvanR@user/evanr)
09:41:10 <Philos86> maerwald Ah, ok that makes sense.
09:41:17 <dminuoso> Philos86: Doesnt stack use cabal-the-lib though?
09:41:22 <hololeap> isn't massive pretty competitive as far as performance?
09:41:28 <maerwald> having done computer graphics in Haskell a bit, I'm pretty confident to say it cannot compete with OpenCV for example
09:41:28 <merijn> maerwald: That sound's like your not stripping and not using split sections
09:41:28 <Philos86> I have no idea; I'm new to all of this haha.
09:41:34 <Cale> Yeah, there is a bunch of numerical stuff written for Haskell, but it's a bit haphazard, and there hasn't been a coordinated effort of any kind to build a one-size-fits-all numerical computing solution.
09:41:35 × EvanR quits (~EvanR@user/evanr) (Read error: Connection reset by peer)
09:41:35 <maerwald> merijn: I am =)
09:41:46 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Ping timeout: 256 seconds)
09:41:46 <dminuoso> sounds unlikely
09:42:03 <dminuoso> Even our 20kLOC with plenty of libraries is smaller than that
09:42:11 <hololeap> *Massiv
09:42:16 <dminuoso> maerwald: How do you strip? Do you rely on `enable-stripping` in cabal?
09:42:32 <dminuoso> Err *executable-stripping
09:42:40 <dminuoso> Because that thing is properly broken and doesnt do anything
09:42:45 <maerwald> I'm aware
09:42:47 <Cale> But if you have to do like, one numerical computing thing... there are bindings to BLAS and Lapack and a bunch of other stuff, as well as some higher level libraries for more specific tasks.
09:43:11 <maerwald> cabal build --ghc-options='-split-sections -optl-static'
09:43:12 <merijn> maerwald: My 30k LOC using a bazillion libraries is 20MB unstripped
09:43:29 <dminuoso> Yup, our 20kLOC with a bazillion libraries is around 16MiB as well
09:43:30 <Cale> https://hackage.haskell.org/package/statistics -- this library is pretty decent in my experience
09:43:45 <merijn> maerwald: Are you sure most that size isn't the C libraries you're linking?
09:43:49 <maerwald> obviously, I was exaggarating
09:44:04 <Philos86> So like if I want to write a ray-tracer (where you need a BVH, or an Octree, and many other things like BSDFs and such) would that actually be harder to do that in Haskell?
09:44:21 <merijn> Philos86: I don't think so
09:45:07 <dminuoso> merijn: though, 20MiB unstripped?
09:45:09 <dminuoso> How did you do that?
09:45:24 <dminuoso> Anything of that size with a bazillion libraries would probably be closer to 100MiB
09:45:26 <Cale> I've written a raytracer that was about 1 page of Haskell code at some point. Of course, it had no fancy features of any kind, and it just rendered some spheres with fractal reflections :)
09:45:53 <merijn> dminuoso: The power of transitive split-sections?
09:45:56 <maerwald> Philos86: and even if you manage to build your computational graphics stuff in Haskell, you're very unlikely reaching similar-to-C performance unless you invest a LOT of time into performance optimization in Haskell
09:46:03 <Cale> I wonder if I still have it somewhere... I think it might be past the point where I lost a bunch of stuff in a hard drive death
09:46:20 <merijn> maerwald: I'm not even convinced of that for "offline" raytracing
09:46:49 <Cale> On the up-side, it can be pretty easy to experiment with parallelism in Haskell
09:47:06 <kuribas> I am thinking to write a library that has lenses to change or read from a bytestring directly, using some record as template.
09:47:35 <kuribas> So basically: getField . deserialize, but without the deserialize.
09:47:50 <Cale> (Getting truly great performance still takes work, but for a raytracer, it would be easy at least to get all your cores hot)
09:47:52 <Philos86> Cale Does that it'd be relatively simple for one to implement a rasterizer in Haskell?
09:48:07 <Philos86> *that mean
09:48:14 <kuribas> Hopefully ghc can inline the lenses, and reduce them to offsets.
09:48:25 <merijn> dminuoso: On linux it's 11 MB stripped (13 on macos)
09:48:30 <Cale> Yeah, relatively simple to get something that goes faster than single-threaded anyway
09:48:38 Natch joins (~natch@c-67bae255.014-297-73746f25.bbcust.telenor.se)
09:48:46 <Cale> You might have to fiddle around a bit with how you chunk the work
09:49:08 <Cale> but for a raytracer, it's embarrassingly parallel, so you'll get a decent solution without too much trouble
09:49:24 <kuribas> so "view @"field" @MyRecord bs", becomes "peekAt fieldOffset bs"
09:50:10 <kuribas> With the hope that this gives C like performance, but safe manipulation of the binary.
09:51:25 <kuribas> Using generics.
09:51:27 <maerwald> kuribas: in order to do fast bytestring access you need to rely on e.g. elemIndex, which uses memchr
09:51:44 <kuribas> maerwald: yes?
09:52:16 <maerwald> How would you do that when you need to deserialize? Usually you have a binary format that tells you where the next offset is if you need to process large binary data
09:52:18 × worldhelloworld2 quits (~quassel@vmi275462.contaboserver.net) (Ping timeout: 272 seconds)
09:52:22 <kuribas> Or I use "peek"?
09:52:54 <kuribas> maerwald: the idea is not to deserialize, but to calculate the offsets from a record definition.
09:52:57 × worldhelloworld quits (~c1utt4r@vmi275462.contaboserver.net) (Ping timeout: 272 seconds)
09:53:04 <kuribas> the record definition also defines the binary format of the blob.
09:53:34 <kuribas> Maybe generics are too fragile, and I will need to generate lenses using TH...
09:53:41 <Philos86> Cale So how would Haskell's parallelism align with GPGPU parallelism?
09:53:58 <maerwald> kuribas: maybe https://hackage.haskell.org/package/winery is enough, it's very performant
09:54:03 <Philos86> Also can Haskell natively compile code to run on GPUs?
09:54:55 <Philos86> Theoretically, if GHC generates and compiles its own CPU code couldn't it also do the same for GPUs and keep them in sync?
09:55:21 × thevishy quits (~Nishant@49.37.242.151) (Quit: Leaving)
09:55:30 <Philos86> Like say I'm running a fold over some complex function with a number of values and parameters. Can GHC break that down into chunks that would run on a GPU?
09:57:13 <kuribas> maerwald: yeah, that looks interesting.
09:58:04 <hololeap> more likely there would be some kind of language subset or interface that limits the allowed operations and then compile that to the cuda code or whatever
09:58:15 <hololeap> I don't know if that exists currently, though
09:58:55 <Philos86> Huh.
09:58:55 ubert joins (~Thunderbi@p200300ecdf3be98fb257cc52479c2a5c.dip0.t-ipconnect.de)
09:58:56 <Cale> There is a library, I haven't heard much about it in years, but it's apparently still maintained https://hackage.haskell.org/package/accelerate
09:59:34 <Cale> It's pretty cool -- you can write array operations, and there are backends that can use CUDA or various other mechanisms to implement them
10:01:32 <Cale> https://github.com/AccelerateHS/accelerate/ good readme here with a bunch of links to resources
10:03:50 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
10:05:37 × jespada quits (~jespada@148.252.132.235) (Ping timeout: 272 seconds)
10:06:04 jespada joins (~jespada@148.252.132.235)
10:06:08 × bahamas quits (~lucian@84.232.140.52) (Ping timeout: 256 seconds)
10:06:38 MajorBiscuit joins (~MajorBisc@c-001-015-055.client.tudelft.eduvpn.nl)
10:07:57 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Ping timeout: 240 seconds)
10:11:29 mcgroin joins (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
10:20:22 romesrf joins (~romes@44.190.189.46.rev.vodafone.pt)
10:21:59 worldhelloworld joins (~c1utt4r@vmi275462.contaboserver.net)
10:24:37 worldhelloworld2 joins (~quassel@vmi275462.contaboserver.net)
10:24:52 <romesrf> \o
10:25:21 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 245 seconds)
10:25:39 × jespada quits (~jespada@148.252.132.235) (Ping timeout: 256 seconds)
10:26:36 × c209e6dc-4d76-47 quits (~aditya@2601:249:4300:1296:195:dac6:592c:a55a) (Quit: Konversation terminated!)
10:27:49 akegalj joins (~akegalj@78-3-81-31.adsl.net.t-com.hr)
10:36:53 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
10:37:09 lavaman joins (~lavaman@98.38.249.169)
10:37:16 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
10:42:10 jespada joins (~jespada@148.252.132.235)
10:45:05 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
10:46:11 zaquest joins (~notzaques@5.130.79.72)
10:54:09 zincy_ joins (~zincy@2a00:23c8:970c:4801:d43:5e37:69e3:551c)
10:56:01 × da39a3ee5e6b4b0_ quits (~textual@171.5.29.46) (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:58:23 × acidjnk quits (~acidjnk@p200300d0c7049f95a8560519e34e318b.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
11:02:22 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d43:5e37:69e3:551c) (Remote host closed the connection)
11:07:36 × krappix quits (~krappix@nat-eduroam-76-gw-01-lne.lille.inria.fr) (Ping timeout: 256 seconds)
11:12:46 zincy_ joins (~zincy@2a00:23c8:970c:4801:39f9:90f7:922:e73b)
11:13:34 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
11:15:46 coot joins (~coot@213.134.190.95)
11:15:50 × mcgroin quits (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 256 seconds)
11:15:55 × vglfr quits (~vglfr@88.155.45.155) (Ping timeout: 272 seconds)
11:17:35 × zincy_ quits (~zincy@2a00:23c8:970c:4801:39f9:90f7:922:e73b) (Remote host closed the connection)
11:18:07 fendor_ joins (~fendor@91.141.34.180.wireless.dyn.drei.com)
11:18:19 zincy_ joins (~zincy@2a00:23c8:970c:4801:d43:5e37:69e3:551c)
11:20:56 × fendor quits (~fendor@178.165.181.170.wireless.dyn.drei.com) (Ping timeout: 256 seconds)
11:21:19 × zeenk quits (~zeenk@2a02:2f04:a30d:1300:51a3:bcfc:6cda:9fc5) (Quit: Konversation terminated!)
11:22:01 × jespada quits (~jespada@148.252.132.235) (Read error: Connection reset by peer)
11:24:29 × awpr quits (uid446117@id-446117.lymington.irccloud.com) (Quit: Connection closed for inactivity)
11:24:36 × Inst quits (~Liam@2601:6c4:4080:3f80:8c26:e871:cea5:bbc0) (Ping timeout: 240 seconds)
11:26:16 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d43:5e37:69e3:551c) (Remote host closed the connection)
11:26:21 deadmarshal_ joins (~deadmarsh@95.38.230.176)
11:27:16 kaph joins (~kaph@an-19-184-70.service.infuturo.it)
11:30:09 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
11:33:48 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
11:34:25 × ishutin quits (~ishutin@85-238-93-20.pool.digikabel.hu) (Read error: Connection reset by peer)
11:36:18 euprogramista joins (~euprogram@185.218.127.6)
11:36:19 ishutin joins (~ishutin@87-97-12-221.pool.digikabel.hu)
11:37:40 <euprogramista> hi there, can use this channel to ask general questions about haskell (even some beginner's questions)?
11:38:25 <yushyin> euprogramista: yes!
11:38:36 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
11:38:56 <euprogramista> yushyin: tks
11:39:19 zincy_ joins (~zincy@2a00:23c8:970c:4801:d43:5e37:69e3:551c)
11:40:03 <euprogramista> I'm studying the chapter about functors-applicative-functors-and-monoids from LYAH and things are getting a bit complicated on the topic about using fmap over functions.
11:40:36 <euprogramista> one particular thing caught my attention: "When we use fmap (+3) over Just 3, it's easy to..."
11:41:05 <euprogramista> so I tried to just check the type of `:t fmap (*3) Just`
11:41:18 <euprogramista> which is `fmap (*3) Just :: Num (Maybe a) => a -> Maybe a`
11:41:34 <euprogramista> I got confused about what is this `Num (Maybe a)`
11:41:56 <kuribas> :t Just --euprogramista
11:41:56 <lambdabot> a -> Maybe a
11:41:58 <euprogramista> I understand what could be `Num a` or `Maybe a`
11:42:02 lavaman joins (~lavaman@98.38.249.169)
11:42:30 × jgeerds quits (~jgeerds@55d4548e.access.ecotel.net) (Ping timeout: 272 seconds)
11:42:34 <kuribas> euprogramista: it's trying to do (*3) over a (Maybe a).
11:43:01 <kuribas> euprogramista: you are "fmapping" over the function Just, not over the Maybe type.
11:43:04 <euprogramista> kuribas: so how can I apply (*3) to (Maybe a)?
11:43:15 geekosaur joins (~geekosaur@xmonad/geekosaur)
11:43:48 <euprogramista> if I try to make this work in my head I think that it woud be the same as trying to do ((Just 1) * 3) which wouldn't work
11:43:53 <kuribas> :t fmap (*3) (Just 2)
11:43:54 <lambdabot> Num b => Maybe b
11:43:58 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d43:5e37:69e3:551c) (Remote host closed the connection)
11:44:10 <romesrf> :t fmap
11:44:11 <lambdabot> Functor f => (a -> b) -> f a -> f b
11:44:19 <romesrf> (a -> b) -> (f a -> f b)
11:44:25 <euprogramista> right... but how can I, as an example, use (fmap (*3) Just) ?
11:44:34 <romesrf> a function from a to b becomes a function from Maybe a to Maybe b
11:44:40 <romesrf> :t (*3)
11:44:41 <lambdabot> Num a => a -> a
11:44:44 × arjun quits (~arjun@user/arjun) (Ping timeout: 256 seconds)
11:44:45 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
11:44:49 <romesrf> :t fmap @Maybe (*3)
11:44:50 <lambdabot> error:
11:44:50 <lambdabot> Pattern syntax in expression context: fmap@Maybe
11:44:50 <lambdabot> Did you mean to enable TypeApplications?
11:45:06 <romesrf> :t fmap (*3) :: (Maybe a -> Maybe b)
11:45:07 <lambdabot> error:
11:45:07 <lambdabot> • Couldn't match type ‘a1’ with ‘b1’
11:45:07 <lambdabot> ‘a1’ is a rigid type variable bound by
11:45:10 <kuribas> euprogramista: because "Just" is a function, so you are fmapping over the function.
11:45:55 <romesrf> when you fmap (*3), the function Int -> Int becomes Maybe Int -> Maybe Int
11:46:06 <romesrf> which you can then apply to any (Maybe Int) to get another Maybe Int
11:46:22 <euprogramista> hmm... I think that this makes sense to me now
11:46:37 <romesrf> euprogramista: but I would also recommend seeing the fmap instance of Maybe
11:46:43 <kuribas> :t fmap (+1) (*3)
11:46:43 <lambdabot> Num b => b -> b
11:46:55 <romesrf> https://hackage.haskell.org/package/base-4.16.0.0/docs/src/GHC.Base.html#line-1030
11:46:57 <kuribas> > (fmap (+1) (*3)) 6
11:46:58 <lambdabot> 19
11:47:04 <euprogramista> so the Num (Maybe a) is to tell that I'm gonna get a Maybe where a is a Num?
11:47:48 <euprogramista> Id like to test this function
11:48:03 <euprogramista> (fmap (*3) Just) 10
11:48:04 <romesrf> euprogramista: No, you only got Num (Maybe a) because you applied fmap to a function rather than to a maybe value
11:48:17 <euprogramista> > (fmap (*3) Just) 10
11:48:18 <lambdabot> error:
11:48:18 <lambdabot> • No instance for (Num (Maybe Integer))
11:48:18 <lambdabot> arising from a use of ‘e_1310’
11:49:04 <romesrf> `fmap (*3) Just` :: (Num (Maybe a) => a -> Maybe a) -- the constraint here indicates that the function is a -> Maybe a as long as there is an instance Num (Maybe a)
11:49:42 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
11:49:56 <romesrf> euprogramista: the thing about fmap is that it works for any functor, not just Maybes, that's why you didn't get a type error when you did (fmap (*3) Just) instead of (fmap (*3) (Just 2))
11:50:01 <romesrf> :t Just
11:50:03 <lambdabot> a -> Maybe a
11:50:20 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
11:50:31 <romesrf> (a -> Maybe a) is a function, and functions are functors (instance Functor ((->) a))
11:50:50 <romesrf> so if you think about fmap of the function functor instead of mayb
11:50:58 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
11:51:20 <romesrf> fmap of maybe is :: (a -> b) -> Maybe a -> Maybe b
11:51:55 <euprogramista> so not necessarily just because I can use fmap with any functor it doesn't mean that what I get will work in practical means?
11:52:14 <kuribas> euprogramista: Note that technically any type could be a Num instance, for example functions. Luckily functions don't have a Num instance. That's why this doesn't give a type error.
11:52:19 <kuribas> (but should give one).
11:52:22 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
11:52:52 <kuribas> > (fmap (*(3::Int)) Just) 10 -- restricting the literal to Int solves this.
11:52:54 <lambdabot> error:
11:52:54 <lambdabot> • Couldn't match type ‘Maybe t0’ with ‘Int’
11:52:54 <lambdabot> Expected type: t0 -> Int
11:54:12 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Ping timeout: 250 seconds)
11:54:28 <romesrf> euprogramista: e.g. using "+" to sum two strings in javascript won't sum de ascii value of the strings but rather join the two strings together
11:54:29 <kuribas> Well, in your case, the literal would be a "Maybe a" value.
11:54:43 <romesrf> euprogramista: so when using fmap you need to think about the semantics of what you're using it on
11:55:15 × ccntrq quits (~Thunderbi@2a01:c22:8509:dc00:953c:9b71:e9ca:822e) (Ping timeout: 268 seconds)
11:55:17 <romesrf> fmap (any_function) has type Functor f => f a -> f b
11:55:28 CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
11:55:40 <romesrf> what that function now does depends on the implementation of fmap for the specific functor you're using
11:56:45 ccntrq joins (~Thunderbi@2a01:c23:941d:5a00:c6ed:e12e:1f74:6b4a)
11:57:43 acidjnk joins (~acidjnk@p200300d0c7049f95a8560519e34e318b.dip0.t-ipconnect.de)
11:59:36 ccntrq1 joins (~Thunderbi@2a01:c23:9136:4a00:eba3:c941:ef08:4dc0)
12:00:42 × kaph quits (~kaph@an-19-184-70.service.infuturo.it) (Read error: Connection reset by peer)
12:01:08 × ccntrq quits (~Thunderbi@2a01:c23:941d:5a00:c6ed:e12e:1f74:6b4a) (Ping timeout: 250 seconds)
12:01:09 ccntrq1 is now known as ccntrq
12:02:10 <euprogramista> okay... maybe this can also help me to better understand it: When I see something like this -> f :: (Eq a) => a -> a -> Bool. I can read it as the function takes two arguments and they have to be a member of Eq. How can I properly read Num (Maybe a) => a -> Maybe a?
12:02:27 <euprogramista> sorry that it's taking long for me to properly understand
12:03:45 <kuribas> euprogramista: Don't worry. It means the function can take a value of type `a` into a value of type `Maybe a`, but only as long as an instance `Maybe a` for Num exists.
12:04:07 <kuribas> euprogramista: in practice it doesn't exist, but type classes are open, so someone "could" define it.
12:04:43 <romesrf> f :: Eq a => a -> a -> Bool is read "f is a function that forall types a that satisfy the constraint `Eq a`, a -> a -> Bool"
12:05:03 × coot quits (~coot@213.134.190.95) (Remote host closed the connection)
12:05:21 <romesrf> which means you can call this function with any type that instances Eq
12:05:26 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
12:06:02 <romesrf> Num (Maybe a) => a -> Maybe a is a function that forall 'a's such that (Maybe a) is an instance of Num, takes an a and returns Maybe a
12:06:02 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
12:06:39 <romesrf> however, by default, there isn't any `a` that can make that be true
12:07:06 <romesrf> you could define in your code something like `instance Num (Maybe Int)`
12:07:21 <romesrf> so if you called that function with an Int, it would work because (Maybe Int) would be an instance of Num
12:07:51 <kuribas> euprogramista: constraints don't have to be on type variables, they can be on any type.
12:08:01 <romesrf> however, by default no instance like that is defined, so even though that function exists, it can't really be called because there is no satisfying `a`
12:08:42 <romesrf> but if you create such instance of (Num (Maybe Int)), you'd be able to call that function with a == Int
12:08:49 <euprogramista> omg I think I get it now
12:08:55 <romesrf> euprogramista: :P
12:09:02 <euprogramista> when I run this:
12:09:07 <euprogramista> > :info Num
12:09:09 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
12:09:12 <albet70> is there a library in haskell like pandas in python? for excel data
12:09:15 <romesrf> :info Num
12:09:22 × Philos86 quits (~Philos86@38.80.235.160) (Ping timeout: 256 seconds)
12:09:22 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 250 seconds)
12:09:23 <romesrf> % :info Num
12:09:24 <yahb> romesrf: type Num :: * -> Constraint; class Num a where; (+) :: a -> a -> a; (-) :: a -> a -> a; (*) :: a -> a -> a; negate :: a -> a; abs :: a -> a; signum :: a -> a; fromInteger :: Integer -> a; {-# MINIMAL (+), (*), abs, signum, fromInteger, (negate | (-)) #-}; -- Defined in `GHC.Num'; instance Num DiffTime -- Defined in `time-1.9.3:Data.Time.Clock.Internal.DiffTime'; instance Num NominalDiffTime
12:09:29 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
12:09:40 <euprogramista> I can see that there is no instance for Maybe
12:09:54 <romesrf> euprogramista: yeah!
12:09:56 <euprogramista> the :info Num proves exactly what you folks are saying
12:10:04 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
12:10:12 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Ping timeout: 240 seconds)
12:10:13 <euprogramista> great! thanks a lot for walking me through this folks
12:10:22 <romesrf> euprogramista: good luck keep up
12:10:34 <romesrf> it only gets more fun :D
12:10:39 <euprogramista> this channel is a bless :D studying haskell alone is hard
12:11:04 <romesrf> posting questions on discourse also works
12:11:15 <romesrf> discourse.haskell.org
12:11:22 <euprogramista> :interesting
12:11:46 <romesrf> it's good that the questions are more "searchable" there, you might find things other people have asked interesting too
12:12:24 <kuribas> euprogramista: hint: many functions in haskell are actually very general, and this can be confusing for beginners. Put type annotations on such functions or values to make the types easier.
12:12:37 <kuribas> :t foldr
12:12:38 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
12:12:55 <kuribas> :t foldr :: (a -> b -> b) -> b -> [a] -> b
12:12:56 <lambdabot> (a -> b -> b) -> b -> [a] -> b
12:13:11 <euprogramista> nice I didn't know about discourse. I've been usually searching on stackoverflow but answers are usually full of theory that I can't follow at the moment.
12:13:35 <kuribas> Which is in fact good practice for anyone have problem with difficult types errors.
12:14:12 Topsi joins (~Tobias@dyndsl-095-033-023-104.ewe-ip-backbone.de)
12:14:23 <euprogramista> kuribas: what do you mean by type annotation?
12:14:56 <euprogramista> sorry I should have googled this one (was just convenient since I'm already here)
12:15:01 <kuribas> euprogramista: (value :: type)
12:15:16 <kuribas> it constrains the value to the type.
12:15:24 <euprogramista> ah got it
12:15:30 <kuribas> > 3 :: Int
12:15:31 <lambdabot> 3
12:15:36 <kuribas> :t 3
12:15:37 <lambdabot> Num p => p
12:15:40 <kuribas> :t 3 :: Int
12:15:41 <lambdabot> Int
12:15:50 <euprogramista> in the LYAH it calls it class constraint instead of type annotation
12:16:26 <euprogramista> but I guess class constraint is just one way to call it
12:16:27 <kuribas> no, the class constraint is the part before "=>"
12:16:50 <kuribas> type annotation is ":: <some type>"
12:17:05 <kuribas> they are different things.
12:17:11 mcgroin joins (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
12:18:16 × DNH quits (~DNH@2a02:8108:1100:16d8:1c1a:3fa2:4926:7c5a) (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:19:30 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
12:19:35 <euprogramista> kuribas: thanks for helping
12:21:20 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
12:21:49 <kuribas> np
12:21:56 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
12:22:27 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
12:23:24 DNH joins (~DNH@2a02:8108:1100:16d8:1c1a:3fa2:4926:7c5a)
12:23:32 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
12:23:33 <albet70> is there library to read and write excel file?
12:28:48 <geekosaur> hackage shows several in various states of support and completeness
12:31:17 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
12:31:37 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
12:32:00 euprogra1ista joins (~euprogram@ip-103-85-36-164.syd.xi.com.au)
12:33:48 × euprogramista quits (~euprogram@185.218.127.6) (Ping timeout: 272 seconds)
12:34:31 <lortabac> albet70: I have used xlsx, it's not ideal but it did the job for me
12:34:39 <lortabac> @hackage xlsx
12:34:39 <lambdabot> https://hackage.haskell.org/package/xlsx
12:35:17 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
12:35:35 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
12:37:37 × Logio quits (em@kapsi.fi) (Ping timeout: 272 seconds)
12:37:44 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
12:39:10 kongsheng joins (~kongsheng@71.28.228.142)
12:39:44 euprogra1ista parts (~euprogram@ip-103-85-36-164.syd.xi.com.au) ()
12:41:18 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
12:41:29 adamcstephens parts (~m-2jewo5@129.153.21.50) ()
12:41:30 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds)
12:41:43 Lycurgus joins (~juan@98.4.112.204)
12:41:44 <albet70> ok
12:42:08 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
12:42:45 Logio joins (em@kapsi.fi)
12:46:25 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
12:46:43 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
12:47:14 × fendor_ quits (~fendor@91.141.34.180.wireless.dyn.drei.com) (Remote host closed the connection)
12:48:56 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
12:49:14 × vysn quits (~vysn@user/vysn) (Ping timeout: 250 seconds)
12:50:04 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
12:50:19 re101-fousek-71 joins (~re101-fou@196.43.170.89)
12:51:15 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
12:54:52 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Remote host closed the connection)
12:55:52 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
12:58:02 AlexNoo_ is now known as AlexNoo
13:00:45 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
13:00:49 jgeerds joins (~jgeerds@55d4548e.access.ecotel.net)
13:01:16 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
13:02:47 mikoto-chan joins (~mikoto-ch@213.177.151.239)
13:05:46 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
13:06:26 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
13:09:44 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
13:09:44 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
13:10:17 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
13:12:03 <Topsi> I get the following error with a nightly GHC and a project created with stack new: https://paste.tomsmeding.com/2LsGbbDm
13:12:09 <Topsi> There is a similar issue, which was apparently worked around by adding cabal to the setup-depends field. https://github.com/commercialhaskell/stack/issues/5110
13:12:14 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
13:12:15 <Topsi> More specific to my problem I have found an issue where they talk about adding a setup-depends field with Cabal-syntax >= 3.7 https://github.com/haskell/cabal/issues/7974
13:12:21 <Topsi> Unfortunately this does not work. https://paste.tomsmeding.com/8pOtxs3L
13:12:23 <Topsi> What is StackSetupShim/how can I supply it the Cabal-syntax package?
13:13:23 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
13:14:28 ph88 joins (~ph88@2a02:8109:9e00:71d0:f90c:4552:5c2e:aa7d)
13:16:11 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
13:16:36 cosimone joins (~user@93-47-229-38.ip115.fastwebnet.it)
13:17:33 × worldhelloworld quits (~c1utt4r@vmi275462.contaboserver.net) (Remote host closed the connection)
13:17:37 × re101-fousek-71 quits (~re101-fou@196.43.170.89) (Quit: Client closed)
13:18:29 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
13:18:57 <merijn> Topsi: Cabal-syntax 3.7 doesn't exist yet
13:19:10 <merijn> or rather, it's the current HEAD branch of Cabal/cabal-install
13:19:34 × acidjnk quits (~acidjnk@p200300d0c7049f95a8560519e34e318b.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
13:20:16 <merijn> Topsi: So that example cabal file has a bunch of dependencies restricting to unreleased versions of packages
13:20:37 × Cale quits (~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com) (Ping timeout: 250 seconds)
13:20:40 × worldhelloworld2 quits (~quassel@vmi275462.contaboserver.net) (Read error: Connection reset by peer)
13:20:51 c1utt4r joins (~c1utt4r@vmi275462.contaboserver.net)
13:20:54 <Topsi> yes. but I supply the current HEAD branch of Cabal if you look at my extra-deps https://paste.tomsmeding.com/8pOtxs3L
13:21:38 worldhelloworld2 joins (~quassel@vmi275462.contaboserver.net)
13:23:44 <merijn> Topsi: It declares cabal-version 1.12, but also uses custom-setup which didn't exist until 1.24
13:24:43 <Topsi> what declares cabal-version 1.12?
13:25:08 <Topsi> ahh, at the very top
13:25:49 × jgeerds quits (~jgeerds@55d4548e.access.ecotel.net) (Ping timeout: 240 seconds)
13:26:02 <merijn> In general mixing stack with GHC head seems like a recipe for pain, though
13:26:47 <Topsi> it's the same error with cabal-version 1.24
13:27:08 <merijn> Since stack is under maintained and lagging Cabal by quite a bit
13:27:37 <merijn> The most recent stack release demands Cabal 3.2, so it doesn't support 3.4 or 3.6 and I certainly wouldn't hold my breath for support for 3.7/3.8
13:27:50 soxen joins (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net)
13:27:50 boborygmy joins (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net)
13:33:11 Unicorn_Princess joins (~Unicorn_P@46-54-248-191.static.kate-wing.si)
13:38:08 krappix joins (~krappix@nat-eduroam-76-gw-01-lne.lille.inria.fr)
13:39:01 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
13:41:34 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
13:43:11 da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914)
13:45:29 <maerwald> you'll likely run out of air
13:46:17 benin joins (~benin@183.82.26.94)
13:47:35 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
13:51:43 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
13:53:56 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
13:56:39 jespada joins (~jespada@148.252.132.116)
13:56:41 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
13:58:10 × Unicorn_Princess quits (~Unicorn_P@46-54-248-191.static.kate-wing.si) (Remote host closed the connection)
14:01:15 arjun joins (~arjun@user/arjun)
14:01:53 × da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914) (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:02:36 × ph88 quits (~ph88@2a02:8109:9e00:71d0:f90c:4552:5c2e:aa7d) (Read error: Connection reset by peer)
14:04:16 × ishutin quits (~ishutin@87-97-12-221.pool.digikabel.hu) (Read error: Connection reset by peer)
14:04:21 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
14:04:58 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
14:06:38 <exarkun> is it possible to implement unsafePerformIO in Haskell? Or must it be implemented by the runtime at a lower level?
14:06:56 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
14:07:15 ishutin joins (~ishutin@92-249-150-241.static.digikabel.hu)
14:07:25 <merijn> exarkun: Define "implement in" and "haskell"
14:07:26 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
14:07:36 <geekosaur> it *is* implemented in Haskell, although it requires MagicHash extension
14:07:51 <Lycurgus> like writing a compiler in the lang compiled
14:07:52 <exarkun> I tried to follow links from hoogle to the implementation and got a dead end. Where is the implementation?
14:08:55 <Lycurgus> ur meaning ghc when you say Haskell
14:09:11 <exarkun> merijn: That sounds hard :/ I'm probably less interested in exactly the question I asked and more interested in learning more about how IO works, I guess.
14:09:14 <geekosaur> https://downloads.haskell.org/ghc/8.10.7/docs/html/libraries/base-4.14.3.0/src/GHC-IO-Unsafe.html#unsafePerformIO
14:09:33 <merijn> exarkun: That's mostly an implementation detail of GHC. There's several papers on it
14:09:36 <geekosaur> and it does indeed provide a clue as to how IO works in ghc
14:09:41 <merijn> exarkun: Relevant are the ghc-prim package
14:09:44 <merijn> @hackage ghc-prim
14:09:44 <lambdabot> https://hackage.haskell.org/package/ghc-prim
14:09:55 <merijn> exarkun: And the "Lazy Functional State Threads" paper
14:09:59 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
14:10:06 <merijn> exarkun: Which explains both the ST monad and IO
14:10:10 <merijn> exarkun: Or rather
14:10:21 <merijn> exarkun: It explains the implementation used by GHC
14:11:04 <exarkun> Cool. This looks like a bunch of good reading material.
14:11:24 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
14:11:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Ping timeout: 240 seconds)
14:13:09 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
14:13:29 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
14:15:01 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
14:17:59 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
14:19:46 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
14:21:08 × elkcl quits (~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru) (Ping timeout: 256 seconds)
14:22:25 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Remote host closed the connection)
14:23:48 <merijn> exarkun: Specifically, the paper I mentioned is about "how do we enforce an ordering of operations in a lazy setting?" and that is, of course, precisely what IO does (enforce ordering/sequencing of side-effects)
14:24:28 <dminuoso> 15:07:36 geekosaur | it *is* implemented in Haskell, although it requires MagicHash extension
14:24:37 <dminuoso> Mmm, it is *not* implemented in Haskell
14:24:38 zer0bitz joins (~zer0bitz@dsl-hkibng32-54fbf8-224.dhcp.inet.fi)
14:24:40 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
14:25:03 <dminuoso> It is implemented by GHC Haskell - the relevant point is, you couldn't conjure this yourself.
14:25:14 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
14:25:15 <merijn> exarkun: Turns out IO and ST are both built on top of the same underlying abstractions
14:26:09 o-90 joins (~o-90@gateway/tor-sasl/o-90)
14:26:14 × soxen quits (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net) (Ping timeout: 256 seconds)
14:26:17 × boborygmy quits (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net) (Ping timeout: 240 seconds)
14:26:50 <exarkun> That's kinda neat. I'm not sure if I would have guessed it, probably not, but I can convince myself that I can sort of see why it would be.
14:26:50 <dminuoso> Unless you argue that you can implement it in terms of the GHC API, but Im not entirely sure whether that is saying much
14:28:23 × arjun quits (~arjun@user/arjun) (Remote host closed the connection)
14:28:56 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
14:29:32 × akegalj quits (~akegalj@78-3-81-31.adsl.net.t-com.hr) (Quit: leaving)
14:33:02 elkcl joins (~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru)
14:35:37 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
14:36:48 ProfSimm joins (~ProfSimm@87.227.196.109)
14:37:25 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
14:37:26 Inst joins (~Liam@2601:6c4:4080:3f80:7996:fa87:bd3d:81c8)
14:39:34 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Remote host closed the connection)
14:40:09 × o-90 quits (~o-90@gateway/tor-sasl/o-90) (Remote host closed the connection)
14:40:14 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
14:41:06 infandum joins (~user@205.189.58.89)
14:44:29 ProfSimm is now known as anomal
14:45:33 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 272 seconds)
14:45:48 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
14:46:09 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
14:46:38 <infandum> I am running into the following error: stats.csv: openBinaryFile: resource exhausted (Too many open files). I thought it would be pretty straightforward, as the file it tried to open was just being checked if it existed with Turtle's du (to check if existing and if not 0 bytes). evaluating with Control.Exception that did not work, so I replaced it with Turtle's testfile, that did not work either. Here is the only time it is used: skip
14:46:38 <infandum> <- (&&) <$> (pure $ skipFlag) <*> (TU.testfile "stats.csv"); when (not skip) $ process otherFile
14:46:38 <infandum>
14:47:02 <infandum> Sorry, broke a line apparently: skip <- (&&) <$> (pure $ skipFlag) <*> (TU.testfile "stats.csv"); when (not skip) $ process otherFile
14:47:02 <infandum>
14:49:29 <infandum> Many of these files are being checked, so I figured that they weren't being closed, but now it's just checking for existence, what would the problem be?
14:52:15 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
14:52:47 boborygmy joins (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net)
14:52:47 soxen joins (~bob@pool-173-54-217-168.nwrknj.fios.verizon.net)
14:52:48 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
14:53:16 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
14:54:17 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 240 seconds)
14:55:17 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
14:56:22 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
14:56:56 bahamas joins (~lucian@84.232.140.52)
14:57:47 Sgeo joins (~Sgeo@user/sgeo)
15:01:45 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
15:03:34 × bahamas quits (~lucian@84.232.140.52) (Ping timeout: 250 seconds)
15:03:37 jakalx joins (~jakalx@base.jakalx.net)
15:04:02 vglfr joins (~vglfr@88.155.117.136)
15:04:10 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
15:04:10 × jespada quits (~jespada@148.252.132.116) (Read error: Connection reset by peer)
15:05:01 ph88 joins (~ph88@2a02:8109:9e00:71d0:f90c:4552:5c2e:aa7d)
15:05:22 × krappix quits (~krappix@nat-eduroam-76-gw-01-lne.lille.inria.fr) (Quit: Client closed)
15:05:32 × ccntrq quits (~Thunderbi@2a01:c23:9136:4a00:eba3:c941:ef08:4dc0) (Remote host closed the connection)
15:05:50 ccntrq joins (~Thunderbi@2a01:c23:9136:4a00:eba3:c941:ef08:4dc0)
15:06:35 × benin quits (~benin@183.82.26.94) (Quit: The Lounge - https://thelounge.chat)
15:06:38 <infandum> I wonder if it is coincidence: using inline-r, other files are being written. I wonder if the problem is actually there and it just happens to bug out during the haskell opening step.
15:06:42 jgeerds joins (~jgeerds@55d4548e.access.ecotel.net)
15:07:20 <dpratt> what's a good way to set up a new Haskell project? is "cabal init" still the best option? probably relevant that I'm not too interested in using stack, and I am doing this in a Nix environment
15:07:36 × son0p quits (~ff@181.136.122.143) (Ping timeout: 256 seconds)
15:08:36 × yaroot quits (~yaroot@2409:12:ac0:2300:680e:dbff:fe1e:4953) (Ping timeout: 240 seconds)
15:09:14 yaroot joins (~yaroot@2409:12:ac0:2300:680e:dbff:fe1e:4953)
15:10:17 × mcgroin quits (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds)
15:10:28 <merijn> dpratt: cabal init should be fine, although I usually copy and edit a cabal file from a similar project
15:12:37 <dpratt> ok, thanks merijn
15:15:47 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 256 seconds)
15:27:11 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
15:28:14 shapr` joins (~user@pool-173-73-44-186.washdc.fios.verizon.net)
15:28:35 × kritzefitz quits (~kritzefit@debian/kritzefitz) (Ping timeout: 256 seconds)
15:28:50 kritzefitz joins (~kritzefit@debian/kritzefitz)
15:29:37 × shapr quits (~user@pool-173-73-44-186.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
15:30:52 × dschrempf quits (~dominik@178.251.70.207) (Ping timeout: 250 seconds)
15:31:22 jespada joins (~jespada@148.252.132.116)
15:31:24 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
15:31:25 vysn joins (~vysn@user/vysn)
15:32:29 × anomal quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
15:32:48 ProfSimm joins (~ProfSimm@87.227.196.109)
15:33:30 × kongsheng quits (~kongsheng@71.28.228.142) (Quit: Client closed)
15:47:24 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
15:47:42 ProfSimm joins (~ProfSimm@87.227.196.109)
15:49:43 <Benzi-Junior> hey, doing a coding challenge, and I'm wondering if there is something I missed, I'm given "data Agent msg a" and asked to provide a "instance Functor (Agent msg)" and I'm struggling a bit with the lack of a constructor, or in fact any implementation of "Agent"
15:52:03 × jgeerds quits (~jgeerds@55d4548e.access.ecotel.net) (Ping timeout: 268 seconds)
15:52:07 <Benzi-Junior> should I just assume that they forgot to ask for an implementation or is there a reasonable way of working with the data without an associated constructor ?
15:52:29 <merijn> Benzi-Junior: As you describe it, it sounds impossible
15:52:53 <geekosaur> do they not even tell you shat this data should be doing?
15:53:01 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:94a8:4010:5291:ba96) (Quit: WeeChat 2.8)
15:53:11 × zer0bitz quits (~zer0bitz@dsl-hkibng32-54fbf8-224.dhcp.inet.fi) (Ping timeout: 256 seconds)
15:53:11 <[exa]> types without constructors are possible but the task doesn't seem to be possible to do in a sane way
15:53:24 <[exa]> except ofcourse for BS like `fmap _ = undefined`
15:53:41 <merijn> I mean, I suppose if there is no constructor for Agent, then the implementation is trivial ;)
15:54:34 <Benzi-Junior> geekosaur, "Agent msg a" is an abstract process that can send and receive broadcast messages of type msg and will eventually return a result of type a
15:54:59 <geekosaur> oh brother
15:55:07 <Benzi-Junior> oh wait, the next line tells me to "Define the type such that Agent msg is a free monad"
15:55:16 <geekosaur> ah, there you gothen
15:55:21 zer0bitz joins (~zer0bitz@dsl-hkibng32-54fbf8-224.dhcp.inet.fi)
15:55:46 <geekosaur> once you do that, the Functor instance should be pretty obvious
15:55:58 <geekosaur> free monad is, at least
15:56:01 <Benzi-Junior> I just missed it because it's labeled "TODO" which it seemed was verie astutely done throughout the document
15:56:10 <geekosaur> *assuming you know what a free monad is, at least
15:56:23 <Benzi-Junior> ye I tried starting this a while back and it seemed... to simple
15:56:27 <Benzi-Junior> until it was impossible
15:57:38 <Benzi-Junior> ok very important question, which is a better constructor name for "data Agent msg a", Bond or Smith ?
15:57:39 × jespada quits (~jespada@148.252.132.116) (Read error: Connection reset by peer)
15:59:38 <kuribas> Archer?
16:00:07 <Franciman> ^^
16:01:18 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
16:02:48 jespada joins (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net)
16:02:52 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
16:03:53 jespada_ joins (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net)
16:04:14 × alp quits (~alp@user/alp) (Ping timeout: 250 seconds)
16:04:54 × canta quits (~canta@user/canta) (Quit: WeeChat 2.8)
16:05:06 canta joins (~canta@user/canta)
16:07:00 × jespada quits (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net) (Ping timeout: 240 seconds)
16:08:54 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
16:11:00 shapr` is now known as shapr
16:12:19 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
16:13:00 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Ping timeout: 240 seconds)
16:14:42 <SrPx> what is currently the fastest int map implementation for insertion, deletion and lookup?
16:14:49 <SrPx> specially lookup
16:15:14 <geekosaur> IntMap is usually fastest
16:15:33 <Benzi-Junior> ok, so for a "instance Applicative (Agent msg)" I'm struggling, how do I implement pure, I understand how I could do it if there was an "Default msg" assertion
16:15:49 × ishutin quits (~ishutin@92-249-150-241.static.digikabel.hu) (Ping timeout: 240 seconds)
16:16:11 <geekosaur> Benzi-Junior, did you understand "free monad"?
16:16:20 <SrPx> geekosaur: you sure? i think i've read a paper a few years ago about an alternative that is faster for lookups, but slower for merging
16:16:25 <SrPx> can't remember what it was though
16:16:56 <geekosaur> SrPx, I was considering based on what we actually have, not on papers that might lack usable implementations
16:17:07 <SrPx> I see
16:17:14 neverfindme joins (~hayden@158.123.160.43)
16:17:23 × jespada_ quits (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net) (Ping timeout: 272 seconds)
16:17:52 ishutin joins (~ishutin@178-164-208-216.pool.digikabel.hu)
16:18:01 <geekosaur> Benzi-Junior, a "free x" means you have a constructor corresponding to each operation on "x". so for a free monad you have a constructor corresponding to pure/return and another corresponding to bind/>>=
16:18:03 bahamas joins (~lucian@84.232.140.52)
16:18:19 <geekosaur> (this is an oversimplification but close enough for this, I think)
16:19:01 <geekosaur> this whole thing is a bit problematic because one would assume if someone knew about free monads, they'd already know about functors…
16:20:49 nuh^ joins (~nuh@50.232.121.75)
16:21:11 <Benzi-Junior> geekosaur, I know what free constructions are in category theory, but less so in practice
16:21:32 × ccntrq quits (~Thunderbi@2a01:c23:9136:4a00:eba3:c941:ef08:4dc0) (Remote host closed the connection)
16:21:38 × vysn quits (~vysn@user/vysn) (Ping timeout: 260 seconds)
16:21:50 ccntrq joins (~Thunderbi@2a01:c23:9136:4a00:eba3:c941:ef08:4dc0)
16:22:53 <Benzi-Junior> geekosaur, if I understand you correctly, "data Agent msg a" should have at least 2 constructors, one that takes a "msg" and another to take an "a"
16:23:35 <geekosaur> not quite, as I understand it from the problem statement. (Agent msg) is the free monad, not Agent itself
16:24:09 jespada joins (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net)
16:24:12 × In0perable quits (~PLAYER_1@fancydata.science) (Quit: All your buffer are belong to us!)
16:24:17 <geekosaur> sadly this means it's not really defined enough to dothis right. or put otherwise, the TODO you mentioned was a warning that the problem set isn't fully written yet
16:24:42 <geekosaur> which makes it really hard to do anything useful
16:25:53 <Benzi-Junior> huh
16:26:20 <geekosaur> they *really* needed to show you the full definition of Agent
16:27:45 × HotblackDesiato quits (~HotblackD@gateway/tor-sasl/hotblackdesiato) (Read error: Connection reset by peer)
16:27:45 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
16:27:45 × hololeap quits (~hololeap@user/hololeap) (Read error: Connection reset by peer)
16:28:08 HotblackDesiato joins (~HotblackD@gateway/tor-sasl/hotblackdesiato)
16:28:53 <geekosaur> but as I said, the TODO indicates that whoever wrote the problem set hadn't gotten as far as writing that yet; someone learning how to write Functor instances should not be expected to know what a free monad is yet
16:29:05 hololeap joins (~hololeap@user/hololeap)
16:29:11 chexum joins (~quassel@gateway/tor-sasl/chexum)
16:29:18 <geekosaur> much less how to write one when the monad instance is on (Agent msg) instead of just Agent
16:29:44 <geekosaur> (which you can tell because they tell you the Functor instance is on (Agent msg))
16:30:17 <geekosaur> really tempted to say go find a different problem set to work on
16:32:01 <Benzi-Junior> see that really is what stumped me, it seemed to be trivial until it feels like an assumption of "Default msg" is needed
16:33:24 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
16:33:57 <geekosaur> it's not an assumption, it falls out from "free monad"
16:34:04 × ccntrq quits (~Thunderbi@2a01:c23:9136:4a00:eba3:c941:ef08:4dc0) (Remote host closed the connection)
16:34:19 <geekosaur> like I said though, the problem set is incomplete and therefore doen't give you that
16:37:08 × Codaraxis quits (~Codaraxis@user/codaraxis) (Ping timeout: 256 seconds)
16:38:50 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 252 seconds)
16:43:16 vicfred joins (~vicfred@user/vicfred)
16:45:27 Inoperable joins (~PLAYER_1@fancydata.science)
16:45:52 × hgolden quits (~hgolden2@cpe-172-114-81-123.socal.res.rr.com) (Remote host closed the connection)
16:46:09 <Benzi-Junior> I don't think the problem set is incomplete, it is labeled with the TODO's to indicate what the steps of the challenge are
16:46:26 × mbuf quits (~Shakthi@122.174.187.22) (Quit: Leaving)
16:47:42 hgolden joins (~hgolden2@cpe-172-114-81-123.socal.res.rr.com)
16:47:49 Midjak joins (~Midjak@82.66.147.146)
16:48:20 <monochrom> No one has actually seen the original problem statement verbatim unabridged, right?
16:51:33 × c1utt4r quits (~c1utt4r@vmi275462.contaboserver.net) (Remote host closed the connection)
16:51:44 <Franciman> i miss do notation in my sml journey :(
16:51:56 <Franciman> i'm writing my parser
16:52:04 <Franciman> and have to pass some state on
16:52:23 <monochrom> Use a ref >:)
16:52:31 × vicfred quits (~vicfred@user/vicfred) (Quit: Leaving)
16:52:51 c1utt4r joins (~c1utt4r@vmi275462.contaboserver.net)
16:53:32 × neverfindme quits (~hayden@158.123.160.43) (Ping timeout: 240 seconds)
16:53:39 <Franciman> yup
16:55:18 <monochrom> Before do-notation, people wrote each line as "foo a b >>= \x ->", and aligned the >>='s.
16:55:35 <Franciman> oh, there was an haskell without do notation?
16:55:50 <monochrom> I think yes.
16:56:00 <Franciman> well i mean, without do notation but monads were being used*
16:56:16 ub joins (~Thunderbi@p200300ecdf3be98f4574cf7817efb211.dip0.t-ipconnect.de)
16:56:18 <monochrom> I think yes.
16:56:48 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds)
16:56:53 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
16:58:06 <Franciman> :O
16:58:29 lbseale joins (~ep1ctetus@user/ep1ctetus)
16:58:47 × cosimone quits (~user@93-47-229-38.ip115.fastwebnet.it) (Remote host closed the connection)
17:00:17 × DNH quits (~DNH@2a02:8108:1100:16d8:1c1a:3fa2:4926:7c5a) (Ping timeout: 252 seconds)
17:02:42 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
17:02:58 gdown joins (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net)
17:04:03 × gdown quits (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection)
17:07:21 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Remote host closed the connection)
17:13:10 Akiva joins (~Akiva@user/Akiva)
17:13:16 cosimone joins (~user@93-47-229-38.ip115.fastwebnet.it)
17:13:22 <Benzi-Junior> geekosaur, when you say the full definition of Agent, do you mean the operations that it needs to support ?
17:13:53 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
17:13:58 × zer0bitz quits (~zer0bitz@dsl-hkibng32-54fbf8-224.dhcp.inet.fi) (Ping timeout: 256 seconds)
17:14:02 <geekosaur> as you discovered and merijn also noted, you can't write a Functor instance at all without the full definition of Agent
17:14:28 mvk joins (~mvk@2607:fea8:5cc3:7e00::45ee)
17:14:37 <geekosaur> and just knowing that (Agent msg) is a Functor, or even that it's a free Monad, isn't enough to tell you what to do with msg
17:15:46 <Benzi-Junior> ok, thanks,
17:16:09 × tubogram4 quits (~tubogram@user/tubogram) (Quit: See ya later!)
17:16:20 <Benzi-Junior> makes me feel better for getting stmped by it
17:17:54 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
17:19:57 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
17:23:11 tubogram4 joins (~tubogram@user/tubogram)
17:23:46 vysn joins (~vysn@user/vysn)
17:25:09 zer0bitz joins (~zer0bitz@dsl-hkibng32-54fbf8-224.dhcp.inet.fi)
17:26:34 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
17:27:15 Codaraxis joins (~Codaraxis@user/codaraxis)
17:27:34 × bahamas quits (~lucian@84.232.140.52) (Ping timeout: 256 seconds)
17:27:39 gdown joins (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net)
17:27:49 Codaraxis_ joins (~Codaraxis@user/codaraxis)
17:28:41 bahamas joins (~lucian@84.232.140.52)
17:32:06 × Codaraxis quits (~Codaraxis@user/codaraxis) (Ping timeout: 260 seconds)
17:32:52 k8yun joins (~k8yun@user/k8yun)
17:33:22 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
17:34:49 × michalz quits (~michalz@185.246.204.77) (Read error: No route to host)
17:35:22 michalz joins (~michalz@185.246.204.72)
17:35:24 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 240 seconds)
17:36:50 <dpratt> the readme for hpack says that cabal2nix supports package.yaml files; assuming I have a setup involving cabal2nix, does this imply that I would not need to separately run hpack to create/update the project cabal file?
17:37:27 × romesrf quits (~romes@44.190.189.46.rev.vodafone.pt) (Ping timeout: 256 seconds)
17:37:57 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
17:38:50 × kadobanana quits (~mud@user/kadoban) (Remote host closed the connection)
17:39:08 × gdown quits (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection)
17:39:15 kadobanana joins (~mud@user/kadoban)
17:42:42 Guest|24 joins (~Guest|24@cpc84763-aztw28-2-0-cust94.18-1.cable.virginm.net)
17:43:01 × jlamothe quits (~jlamothe@198.251.61.229) (Quit: leaving)
17:43:22 × Guest|24 quits (~Guest|24@cpc84763-aztw28-2-0-cust94.18-1.cable.virginm.net) (Client Quit)
17:46:14 × ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec)
17:47:59 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
17:48:07 ec joins (~ec@gateway/tor-sasl/ec)
17:48:26 jakalx joins (~jakalx@base.jakalx.net)
17:48:26 econo joins (uid147250@user/econo)
17:50:50 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Remote host closed the connection)
17:51:45 × ec quits (~ec@gateway/tor-sasl/ec) (Client Quit)
17:53:28 ec joins (~ec@gateway/tor-sasl/ec)
17:55:31 jlamothe joins (~jlamothe@198.251.61.229)
17:55:40 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
17:56:53 gdown joins (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net)
17:56:54 Unicorn_Princess joins (~Unicorn_P@46-54-248-191.static.kate-wing.si)
17:57:57 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
18:00:19 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
18:00:48 awpr joins (uid446117@id-446117.lymington.irccloud.com)
18:01:47 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
18:02:11 azimut joins (~azimut@gateway/tor-sasl/azimut)
18:03:16 × ishutin quits (~ishutin@178-164-208-216.pool.digikabel.hu) (Ping timeout: 256 seconds)
18:03:29 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
18:05:09 ishutin joins (~ishutin@178-164-235-213.pool.digikabel.hu)
18:06:32 × bahamas quits (~lucian@84.232.140.52) (Ping timeout: 240 seconds)
18:06:57 zebrag joins (~chris@user/zebrag)
18:10:18 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
18:11:04 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
18:12:09 simendsjo joins (~user@84.211.91.241)
18:13:18 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
18:17:57 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
18:20:34 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
18:20:49 LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao)
18:23:11 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
18:23:15 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
18:23:57 × k8yun quits (~k8yun@user/k8yun) (Read error: Connection reset by peer)
18:26:11 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
18:27:24 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Ping timeout: 240 seconds)
18:28:07 k8yun joins (~k8yun@user/k8yun)
18:28:55 coot joins (~coot@213.134.190.95)
18:30:34 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
18:32:38 × gehmehgeh quits (~user@user/gehmehgeh) (Remote host closed the connection)
18:33:19 gehmehgeh joins (~user@user/gehmehgeh)
18:33:45 × k8yun quits (~k8yun@user/k8yun) (Quit: Leaving)
18:34:37 pretty_d1 joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
18:34:38 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 260 seconds)
18:34:45 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
18:34:57 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 240 seconds)
18:36:04 CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
18:36:56 × MajorBiscuit quits (~MajorBisc@c-001-015-055.client.tudelft.eduvpn.nl) (Quit: WeeChat 3.4)
18:37:08 mikoto-chan joins (~mikoto-ch@213.177.151.239)
18:37:17 ChaiTRex joins (~ChaiTRex@user/chaitrex)
18:37:30 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
18:40:38 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
18:42:36 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
18:43:53 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
18:45:35 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 272 seconds)
18:47:17 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
18:48:53 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
18:48:53 × chele quits (~chele@user/chele) (Remote host closed the connection)
18:53:40 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
18:56:04 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
18:58:01 × wrengr quits (~wrengr@99.34.197.35.bc.googleusercontent.com) (Remote host closed the connection)
18:58:24 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
19:00:36 × burnsidesLlama quits (~burnsides@rrcs-76-81-82-250.west.biz.rr.com) (Ping timeout: 240 seconds)
19:01:14 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
19:02:25 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
19:03:01 × vglfr quits (~vglfr@88.155.117.136) (Ping timeout: 256 seconds)
19:04:29 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
19:05:03 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
19:05:37 × pretty_d1 quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 240 seconds)
19:05:54 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
19:06:36 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
19:07:50 × jespada quits (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net) (Read error: Connection reset by peer)
19:08:22 jespada joins (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net)
19:13:43 _ht joins (~quassel@231-169-21-31.ftth.glasoperator.nl)
19:15:05 wrengr joins (~wrengr@249.189.233.35.bc.googleusercontent.com)
19:15:29 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
19:16:37 nexeq joins (nexeq@user/nexeq)
19:20:04 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
19:22:20 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
19:22:41 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
19:22:52 ph88^ joins (~ph88@ip5f5af71f.dynamic.kabel-deutschland.de)
19:24:45 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
19:24:58 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
19:26:49 × deadmarshal_ quits (~deadmarsh@95.38.230.176) (Ping timeout: 256 seconds)
19:27:16 × ph88 quits (~ph88@2a02:8109:9e00:71d0:f90c:4552:5c2e:aa7d) (Ping timeout: 268 seconds)
19:28:25 neurocyte0917090 joins (~neurocyte@IP-094046072103.dynamic.medianet-world.de)
19:28:25 × neurocyte0917090 quits (~neurocyte@IP-094046072103.dynamic.medianet-world.de) (Changing host)
19:28:25 neurocyte0917090 joins (~neurocyte@user/neurocyte)
19:28:26 bahamas joins (~lucian@84.232.140.52)
19:29:08 Erutuon joins (~Erutuon@user/erutuon)
19:29:17 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
19:31:04 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
19:32:55 Cale joins (~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com)
19:35:08 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
19:36:18 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
19:37:08 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
19:43:06 × gdown quits (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection)
19:47:17 × ishutin quits (~ishutin@178-164-235-213.pool.digikabel.hu) (Ping timeout: 240 seconds)
19:49:20 ishutin joins (~ishutin@fibhost-67-47-53.fibernet.hu)
19:50:18 ProfSimm joins (~ProfSimm@87.227.196.109)
19:53:31 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Quit: CiaoSen)
19:55:58 dschrempf joins (~dominik@mobiledyn-62-240-134-189.mrsn.at)
19:56:13 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
19:57:02 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds)
19:57:31 kjak joins (~kjak@pool-108-45-56-21.washdc.fios.verizon.net)
19:57:31 Lord_of_Life_ is now known as Lord_of_Life
20:04:44 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 250 seconds)
20:06:39 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
20:10:16 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 240 seconds)
20:12:39 jpds joins (~jpds@gateway/tor-sasl/jpds)
20:12:57 × kuribas quits (~user@ptr-25vy0ia81ze2oltltpx.18120a2.ip6.access.telenet.be) (Remote host closed the connection)
20:14:10 InstX1 joins (~Liam@2601:6c4:4080:3f80:2cb5:4e42:6ff9:8715)
20:14:12 × Inst quits (~Liam@2601:6c4:4080:3f80:7996:fa87:bd3d:81c8) (Ping timeout: 240 seconds)
20:17:01 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
20:18:21 doyougnu joins (~doyougnu@cpe-67-249-83-190.twcny.res.rr.com)
20:19:18 × bahamas quits (~lucian@84.232.140.52) (Ping timeout: 272 seconds)
20:19:31 × dschrempf quits (~dominik@mobiledyn-62-240-134-189.mrsn.at) (Ping timeout: 256 seconds)
20:21:32 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
20:22:36 zincy_ joins (~zincy@host86-160-236-152.range86-160.btcentralplus.com)
20:23:23 × dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.4)
20:23:32 × doyougnu quits (~doyougnu@cpe-67-249-83-190.twcny.res.rr.com) (Remote host closed the connection)
20:25:02 × zincy_ quits (~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
20:28:13 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
20:29:34 liz_ joins (~liz@2a00:23c5:9680:501:b62e:99ff:fee4:47fa)
20:31:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Remote host closed the connection)
20:32:31 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
20:33:03 Batzy_ is now known as Batzy
20:35:37 × infandum quits (~user@205.189.58.89) (Ping timeout: 240 seconds)
20:37:09 infandum joins (~user@205.189.58.89)
20:38:20 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
20:38:36 ProfSimm joins (~ProfSimm@87.227.196.109)
20:41:09 deadmarshal_ joins (~deadmarsh@95.38.230.176)
20:41:53 × ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec)
20:43:04 InstX1_ joins (~Liam@2601:6c4:4080:3f80:a199:abec:3f6a:f180)
20:43:56 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
20:45:00 × InstX1 quits (~Liam@2601:6c4:4080:3f80:2cb5:4e42:6ff9:8715) (Ping timeout: 240 seconds)
20:45:54 × deadmarshal_ quits (~deadmarsh@95.38.230.176) (Ping timeout: 256 seconds)
20:47:35 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
20:49:55 <jackdk> you could probably get away without but FPCo recommends checking the generated file into VC regardless: https://www.fpcomplete.com/blog/storing-generated-cabal-files/
20:51:01 <jackdk> Personally, I would avoid hpack since the cabal file format got a lot of new features since hpack first came out (e.g., common stanzas, and the cabal-fmt tool can maintain lists of modules), and yaml is not a good format
20:54:28 <shapr> at SimSpace we switched to cabal files first, even though we use stack, but I don't know exactly why!
20:57:13 × unyu quits (~pyon@user/pyon) (Quit: brb)
21:00:07 acidjnk joins (~acidjnk@p200300d0c7049f95a8560519e34e318b.dip0.t-ipconnect.de)
21:02:32 × InstX1_ quits (~Liam@2601:6c4:4080:3f80:a199:abec:3f6a:f180) (Ping timeout: 240 seconds)
21:03:22 × _ht quits (~quassel@231-169-21-31.ftth.glasoperator.nl) (Remote host closed the connection)
21:03:24 × simendsjo quits (~user@84.211.91.241) (Ping timeout: 240 seconds)
21:05:54 kaph joins (~kaph@net-109-116-124-149.cust.vodafonedsl.it)
21:06:05 xkuru joins (~xkuru@user/xkuru)
21:11:34 × jinsun quits (~jinsun@user/jinsun) ()
21:15:00 jinsun joins (~jinsun@user/jinsun)
21:15:29 ArshiaAghaei[m] joins (~arshiaagh@2001:470:69fc:105::1:c382)
21:16:44 Inst joins (~Liam@c-98-208-218-119.hsd1.fl.comcast.net)
21:16:51 ec joins (~ec@gateway/tor-sasl/ec)
21:18:27 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
21:18:38 unyu joins (~pyon@user/pyon)
21:19:04 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
21:21:18 × ProfSimm quits (~ProfSimm@87.227.196.109) (Ping timeout: 256 seconds)
21:22:31 ProfSimm joins (~ProfSimm@87.227.196.109)
21:22:46 jushur joins (~human@user/jushur)
21:25:15 × nuh^ quits (~nuh@50.232.121.75) (Remote host closed the connection)
21:25:24 Pickchea joins (~private@user/pickchea)
21:25:58 <dpratt> wasn't aware of cabal-fmt, thanks jackdk
21:26:57 <jackdk> dpratt: There are certain magic comments you can add to your cabal file to tell cabal-fmt to build module lists, like `-- cabal-fmt: expand src/`
21:27:09 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:27:15 <dpratt> I guess I'm just confused as to why cabal2nix directly supports dealing with package.yaml files if it is necessary to keep a .cabal file around and in sync anyway
21:27:57 <shapr> me too
21:28:30 <geekosaur> it's not absolutely necessary unless you want to use one of the many things cabal files support but package.yamldoesn't
21:28:50 <jackdk> I think because some people don't [keep the generated files in vc]. Perhaps the recommendation changed at some point. This is another reason why I avoid hpack - more moving parts for not that much benefit
21:28:59 × xkuru quits (~xkuru@user/xkuru) (Ping timeout: 272 seconds)
21:31:04 <dpratt> jackdk: (re: magic comments) that's pretty cool
21:31:37 × ub quits (~Thunderbi@p200300ecdf3be98f4574cf7817efb211.dip0.t-ipconnect.de) (Quit: ub)
21:33:32 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 240 seconds)
21:35:32 mcgroin joins (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
21:36:30 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Remote host closed the connection)
21:38:31 × Topsi quits (~Tobias@dyndsl-095-033-023-104.ewe-ip-backbone.de) (Read error: Connection reset by peer)
21:41:04 son0p joins (~ff@181.136.122.143)
21:41:08 burnsidesLlama joins (~burnsides@rrcs-76-81-82-250.west.biz.rr.com)
21:41:56 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 240 seconds)
21:42:03 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
21:42:56 zincy_ joins (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8)
21:44:05 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
21:47:05 × jespada quits (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net) (Quit: Textual IRC Client: www.textualapp.com)
21:47:51 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
21:48:08 <janus> is there a way to avoid listing all the modules in the cabal file? i think that is the major advantage of package.yaml
21:48:29 <janus> for executables, i don't understand why it is important to list the modules
21:49:15 <sclv> discussion on it here https://github.com/haskell/cabal/issues/5343
21:52:00 dsrt^ joins (~dsrt@50.232.121.75)
21:52:12 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 240 seconds)
21:52:25 <dpratt> are computations involving the CReal data type (from the numbers package) precise? mostly for fun, I'm trying to calculate pi according to a prescribed method involving a summation of a series of fractions -- my value of pi diverges from the "official" value after ~40 digits
21:52:42 <sclv> the entire point of creal is that it is arbitrary precise
21:52:51 romesrf joins (~romes@198.177.63.94.rev.vodafone.pt)
21:52:55 <sclv> i'm not sure why it would diverge, hrm
21:53:22 <dpratt> sclv: it likely just means my code is bad :)
21:53:37 <dpratt> just surprising to me I get as far as 40 correct digits
21:54:06 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
21:54:40 <liz_> could the divergence be due to the slow convergence of the sum? or is it actually deviating from the value?
21:54:40 <dpratt> at some point I may be willing to suffer the embarrassment of sharing my code, but I'm trying to avoid that fate for now
21:55:09 <dpratt> liz_: if I understand you correctly, it could well be that
21:55:23 × zincy_ quits (~zincy@2a00:23c8:970c:4801:d22:fd9a:65d6:50a8) (Remote host closed the connection)
21:55:34 <liz_> what formula are you using?
21:55:53 geekosaur joins (~geekosaur@xmonad/geekosaur)
21:56:47 xkuru joins (~xkuru@user/xkuru)
21:57:37 × mcgroin quits (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds)
21:59:34 × ishutin quits (~ishutin@fibhost-67-47-53.fibernet.hu) (Ping timeout: 256 seconds)
22:00:25 infandum` joins (~user@bras-base-toroon0637w-grc-17-76-64-95-29.dsl.bell.ca)
22:00:58 ishutin joins (~ishutin@79-120-162-190.pool.digikabel.hu)
22:01:05 <dpratt> dumb question first: I assume there is a Haskell function to count combinations?
22:01:41 × coot quits (~coot@213.134.190.95) (Quit: coot)
22:02:32 <sclv> dpratt: not in base. there's combinatorics libs, but also the formula is simple enough that people tend to just code something up like that by hand
22:02:32 × infandum quits (~user@205.189.58.89) (Ping timeout: 272 seconds)
22:02:41 <monochrom> Not in the standard library. Though, the standard library has functions for enumerating all sublists and permutations.
22:02:53 <monochrom> I don't know what's on Hackage for this.
22:03:14 <sclv> https://hackage.haskell.org/package/exact-combinatorics-0.2.0.11/docs/Math-Combinatorics-Exact-Binomial.html
22:03:21 <monochrom> Ah that's nice.
22:04:18 × hololeap quits (~hololeap@user/hololeap) (Excess Flood)
22:05:00 <dpratt> shoot, have to step away for a bit :9
22:05:04 <dpratt> :(
22:05:38 hololeap joins (~hololeap@user/hololeap)
22:05:52 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Remote host closed the connection)
22:06:37 × Inst quits (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 256 seconds)
22:10:00 mcgroin joins (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
22:12:34 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
22:19:58 × xkuru quits (~xkuru@user/xkuru) (Ping timeout: 256 seconds)
22:20:47 × infandum` quits (~user@bras-base-toroon0637w-grc-17-76-64-95-29.dsl.bell.ca) (Remote host closed the connection)
22:22:59 <janus> sclv: i see the code-generators were merged. would that work with cabal-fmt, such that cabal would effectively regenerate the exposed-moduled like hpack would with stack?
22:25:08 <sclv> the code-generators pr? that's only for doctest like stuff
22:25:13 da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914)
22:25:14 <sclv> unrelated
22:25:44 <sclv> there's a desire for a cabal-fmt type command for regenerating exposed modules, but no such thing exists
22:26:02 <sclv> one blocker is a solid exactprint, which is a ticket that's moving very slowly, sadly
22:26:15 <janus> ah bummer
22:30:09 fendor joins (~fendor@91.141.34.180.wireless.dyn.drei.com)
22:31:10 xkuru joins (~xkuru@user/xkuru)
22:34:51 machinedgod joins (~machinedg@24.105.81.50)
22:36:50 × c1utt4r quits (~c1utt4r@vmi275462.contaboserver.net) (Ping timeout: 250 seconds)
22:36:58 × worldhelloworld2 quits (~quassel@vmi275462.contaboserver.net) (Ping timeout: 256 seconds)
22:38:47 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:39:48 <janus> but code-generators sound great! is this why cabal-doctest was deprecated?
22:41:03 × michalz quits (~michalz@185.246.204.72) (Remote host closed the connection)
22:41:08 <sclv> unrelated ish. but in general the existing solutions all became super flaky under v2 so this is a stab at stabilizing things
22:42:12 × mcgroin quits (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds)
22:42:26 x_kuru joins (~xkuru@user/xkuru)
22:43:00 <janus> sclv: do you know the disadvantages of 'cabal repl --with-ghc=doctest' ? i havn't seen anybody using it, except myself
22:43:48 x_kuru_ joins (~xkuru@user/xkuru)
22:43:48 × da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:d2a9:ecfc:ebe1:b77a:f914) (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:45:04 × xkuru quits (~xkuru@user/xkuru) (Ping timeout: 250 seconds)
22:47:25 × x_kuru quits (~xkuru@user/xkuru) (Ping timeout: 256 seconds)
22:48:18 jespada joins (~jespada@cpc121022-nmal24-2-0-cust171.19-2.cable.virginm.net)
22:48:32 × x_kuru_ quits (~xkuru@user/xkuru) (Ping timeout: 240 seconds)
22:49:47 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
22:50:31 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
22:56:19 <sclv> nope, if it works it works
22:56:33 <sclv> i guess it just can't work from `cabal test` which bothers some people, understandably
22:59:54 Lycurgus joins (~juan@98.4.112.204)
23:01:27 × romesrf quits (~romes@198.177.63.94.rev.vodafone.pt) (Quit: WeeChat 3.4)
23:02:06 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
23:02:16 tfeb joins (~tfb@88.98.95.237)
23:14:54 × tfeb quits (~tfb@88.98.95.237) (Quit: died)
23:15:15 EvanR_ is now known as EvanR
23:15:32 yauhsien joins (~yauhsien@61-231-43-120.dynamic-ip.hinet.net)
23:15:35 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:16:30 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
23:17:57 × kadobanana quits (~mud@user/kadoban) (Ping timeout: 240 seconds)
23:18:04 mud joins (~mud@user/kadoban)
23:19:19 merijn joins (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl)
23:20:17 × yauhsien quits (~yauhsien@61-231-43-120.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
23:26:02 × fendor quits (~fendor@91.141.34.180.wireless.dyn.drei.com) (Remote host closed the connection)
23:37:50 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8) (Remote host closed the connection)
23:38:04 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
23:38:12 alp joins (~alp@user/alp)
23:39:03 <dpratt> liz_: if you're still around, the answer to your question is: it's a summation where each term is computed by "(3 * choose (2 * n) n) / (16 ^n * (2 * n + 1))"
23:40:18 <dpratt> that is not how I am constructing the computation, mind you, it's just what the computation is supposed to be doing
23:47:49 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8852:a14c:a420:3fd8)
23:48:57 × merijn quits (~merijn@c-001-001-005.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds)
23:49:11 <liz_> dpratt: is that a summation from 1 to infinity? i've not seen that before :o
23:50:14 <dpratt> liz_: neither have I; came to me via a "math guy"
23:51:57 × spider__ quits (~spider@vps-951ce37a.vps.ovh.ca) (Ping timeout: 240 seconds)
23:52:52 × unyu quits (~pyon@user/pyon) (Quit: WeeChat 3.4)
23:54:12 <monochrom> I hate combinatorics. :)
23:54:13 × acidjnk quits (~acidjnk@p200300d0c7049f95a8560519e34e318b.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
23:57:05 justsomeguy joins (~justsomeg@user/justsomeguy)
23:58:37 <liz_> dpratt: i come from a maths world and i've never seen that before, it's so interesting

All times are in UTC on 2022-03-09.