Home liberachat/#haskell: Logs Calendar

Logs on 2022-11-10 (liberachat/#haskell)

00:00:50 × king_gs quits (~Thunderbi@187.201.139.206) (Read error: Connection reset by peer)
00:01:06 king_gs joins (~Thunderbi@187.201.139.206)
00:01:24 × shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit)
00:01:26 × polo_ quits (~polo@user/polo) (Ping timeout: 276 seconds)
00:02:11 justsomeguy joins (~justsomeg@user/justsomeguy)
00:04:23 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
00:10:28 cdoltb^ joins (~cdoltb@76.145.185.103)
00:12:41 × gentauro quits (~gentauro@user/gentauro) (Read error: Connection reset by peer)
00:15:26 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds)
00:15:44 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.6)
00:17:37 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
00:18:24 gentauro joins (~gentauro@user/gentauro)
00:20:04 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 252 seconds)
00:35:01 × Tuplanolla quits (~Tuplanoll@91-159-69-11.elisa-laajakaista.fi) (Quit: Leaving.)
00:36:18 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
00:38:05 × thegeekinside quits (~thegeekin@189.180.56.84) (Ping timeout: 246 seconds)
00:38:22 × titibandit quits (~titibandi@xdsl-87-78-8-6.nc.de) (Remote host closed the connection)
00:38:27 thegeekinside joins (~thegeekin@187.145.44.76)
00:39:30 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
00:43:47 × Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
00:44:09 talismanick joins (~talismani@76.133.152.122)
00:46:28 Xeroine joins (~Xeroine@user/xeroine)
00:52:38 titibandit joins (~titibandi@xdsl-87-78-8-6.nc.de)
00:53:05 × titibandit quits (~titibandi@xdsl-87-78-8-6.nc.de) (Remote host closed the connection)
00:56:10 iqubic joins (~iqubic@2601:602:9502:c70:512:a30e:b15a:1a46)
00:57:34 <iqubic> Does anyone know why the Read instance of Data.Time.LocalTime's TimeZone only accepts abbreviations for a limited number of time zones?
00:57:41 × mmhat quits (~mmh@p200300f1c70f4134ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1)
00:58:00 × king_gs quits (~Thunderbi@187.201.139.206) (Read error: Connection reset by peer)
00:58:13 king_gs joins (~Thunderbi@187.201.139.206)
00:58:25 <geekosaur> because abbreviations aren't reliable (quick, what's IST?) and can change
00:58:44 <geekosaur> so only the most common and most likely to be unique and fixed are provided
00:58:50 <iqubic> I think IST is India Standard Time.
00:58:58 <geekosaur> or Iceland or Israel
00:59:01 <dsal> How about EST?
00:59:21 <iqubic> EST is definitely Eastern Standard Time
00:59:49 <dsal> Yeah, Australians agree.
01:00:01 <iqubic> I see... That makes sense.
01:02:08 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
01:10:44 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds)
01:11:58 <EvanR> the TimeZone in Data.Time is just a shift and some letters
01:12:31 <EvanR> nothing official, unlike timezone-series + timezone-olsen
01:13:22 <EvanR> if the meaning of the letters isn't that imporant TimeZone is fine
01:13:33 <iqubic> What are timezone-series and timezone-olsen?
01:14:06 <EvanR> TimeZoneSeries is a historical progression of what a timezone meant through history
01:14:22 <EvanR> timezone-olsen gives you access to read the database files to load the series
01:14:52 <EvanR> e.g. Central Time (US & Canada) is more complex than a single shift
01:15:02 <iqubic> I'm not sure when those would ever be used over just the standard time library.
01:15:13 <EvanR> though now I'm skeptical US and Canada always agreed on Central time at all points in time
01:15:13 <geekosaur> when you want accurate timezone information
01:15:39 <geekosaur> the olsen databases are regularly updated as timezone information changes
01:16:20 <geekosaur> and retains historical information so you can accuratelky reconstruct timezones (to the extent it's possible) for past times as well
01:16:37 <iqubic> Are there Haskell library for those?
01:16:46 <EvanR> that's what I was talking about, those are on hackage
01:16:46 <geekosaur> those are the haskell library names
01:16:56 <iqubic> Oh. I see.
01:17:01 <geekosaur> your OS already uses the olsen database
01:18:10 <geekosaur> (or equivalent e.g. on windows)
01:18:44 Feuermagier joins (~Feuermagi@user/feuermagier)
01:18:44 × beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 248 seconds)
01:18:58 <iqubic> You don't know what OS I'm on. But yeah, I assume NixOS uses the olsen db
01:19:36 × xff0x quits (~xff0x@2405:6580:b080:900:8031:9588:bb65:20be) (Ping timeout: 252 seconds)
01:19:40 <EvanR> since the order I read words in messages is undefined, you don't know if I don't know that xD
01:20:10 <iqubic> Haha....
01:20:51 <dsal> hasql th's fold thing introduces a local called `init` which causes a shadow warning. I guess that sort of makes sense.
01:21:03 <geekosaur> right, but everyone except windows uses olsen. microsoft has an equivalent in their own proprietary format
01:21:29 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds)
01:21:56 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
01:21:56 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
01:22:00 <iqubic> MS always has an equivalent in their own proprietary format. Doesn't matter what it is we're talking about, but MS has their own version
01:22:33 azimut joins (~azimut@gateway/tor-sasl/azimut)
01:22:37 lisbeths joins (uid135845@id-135845.lymington.irccloud.com)
01:24:08 × acidjnk_new3 quits (~acidjnk@p200300d6e7137a22148497ca67644ae3.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
01:25:34 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
01:27:52 <iqubic> What's the canonical way to pronounce "hasql"?
01:29:55 <dsal> Many things are best left unsaid.
01:30:14 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds)
01:30:30 causal joins (~user@2001:470:ea0f:3:329c:23ff:fe3f:1e0d)
01:30:49 <dsal> I did get this working under postgresql-simple, but along the way I learned that it's terrible and will never improve.
01:31:05 <sm> haskwl, of course
01:34:18 stiell joins (~stiell@gateway/tor-sasl/stiell)
01:36:50 × causal quits (~user@2001:470:ea0f:3:329c:23ff:fe3f:1e0d) (Ping timeout: 252 seconds)
01:41:24 chromoblob joins (~user@37.113.164.122)
01:46:22 shriekingnoise joins (~shrieking@186.137.167.202)
01:48:46 <iqubic> How does Servant convert a text based QueryParam into a piece of usable data?
01:49:03 nate4 joins (~nate@98.45.169.16)
01:49:41 <iqubic> Like, how does Servant handle something of type: QueryParam "value" Integer
01:50:57 causal joins (~user@50.35.83.177)
01:52:30 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
01:54:07 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds)
01:57:19 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 260 seconds)
02:02:36 xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
02:04:04 × thegeekinside quits (~thegeekin@187.145.44.76) (Ping timeout: 248 seconds)
02:05:10 thegeekinside joins (~thegeekin@189.180.42.11)
02:10:50 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds)
02:11:57 <Axman6> iqubic: look at the instances for https://hackage.haskell.org/package/servant-0.19.1/docs/Servant-API.html#t::-62- - you'll see: (KnownSymbol sym, ToHttpApiData v, HasLink sub, SBoolI (FoldRequired mods)) => HasLink (QueryParam' mods sym v :> sub :: Type)
02:12:17 <Axman6> https://hackage.haskell.org/package/servant-0.19.1/docs/Servant-API.html#t:ToHttpApiData is what takes care of the convertion
02:12:22 <Axman6> conversion*
02:15:16 × libertyprime quits (~libertypr@118-92-78-165.dsl.dyn.ihug.co.nz) (Ping timeout: 248 seconds)
02:15:16 × king_gs quits (~Thunderbi@187.201.139.206) (Read error: Connection reset by peer)
02:15:57 king_gs joins (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924)
02:22:32 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
02:25:31 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
02:25:56 <iqubic> Axman6: You sure it's not instead? https://www.servant.dev/servant/Servant-Common-Text.html#t:FromText
02:26:12 <iqubic> s/not/not this/
02:26:35 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 246 seconds)
02:29:37 notzmv joins (~zmv@user/notzmv)
02:31:31 frost12 joins (~frost@user/frost)
02:31:47 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
02:32:22 × frost12 quits (~frost@user/frost) (Client Quit)
02:32:27 libertyprime joins (~libertypr@118-92-78-165.dsl.dyn.ihug.co.nz)
02:32:43 frost52 joins (~frost@103.164.81.123)
02:34:09 × beka quits (~beka@104.193.170.240) (Ping timeout: 252 seconds)
02:40:05 frostsdasd joins (~frostsdas@103.164.81.123)
02:41:16 Kaiepi joins (~Kaiepi@108.175.84.104)
02:42:06 razetime joins (~quassel@117.193.3.56)
02:43:17 × frostsdasd quits (~frostsdas@103.164.81.123) (Client Quit)
02:43:38 frost48 joins (~frost@user/frost)
02:43:39 × frost52 quits (~frost@103.164.81.123) (Quit: Client closed)
02:43:53 × frost48 quits (~frost@user/frost) (Client Quit)
02:44:00 frost56 joins (~frost@user/frost)
02:44:46 × frost56 quits (~frost@user/frost) (Client Quit)
02:52:41 × iqubic quits (~iqubic@2601:602:9502:c70:512:a30e:b15a:1a46) (Quit: Client closed)
03:05:45 iqubic joins (~iqubic@2601:602:9502:c70:512:a30e:b15a:1a46)
03:06:04 <iqubic> Axman6: Did I miss your response? My irc client disconnected me for some reason
03:06:31 <Axman6> uh, yeah actually that's the wrong instance, I missed that that was the HasLink instance
03:07:04 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
03:07:11 <Axman6> It would be this lovely instance: (KnownSymbol sym, FromHttpApiData a, HasServer api context, SBoolI (FoldRequired mods), SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (QueryParam' mods sym a :> api :: Type) context
03:07:17 <Axman6> https://hackage.haskell.org/package/servant-server-0.19.2/docs/Servant-Server.html#t:HasServer
03:07:35 <Axman6> which requires FromHttpApiData
03:08:46 <iqubic> That sounds complex
03:08:52 <Axman6> it's not
03:09:13 <iqubic> Parsing a QueryParam into anything other than the predefined things sounds hard.
03:09:26 <Axman6> "the predefined things"?
03:09:59 <Axman6> you just need to implement the FromHttpApiData class, which is usually pretty easy: https://hackage.haskell.org/package/http-api-data-0.5/docs/Web-Internal-HttpApiData.html#t:FromHttpApiData
03:10:06 <iqubic> Predefined as in something like QueryParam "value" Integer
03:10:31 <iqubic> Because Parsing something into an Integer is easy
03:11:03 <Axman6> it's pretty rare that you'd want something much more complex than a number, string, data or ID in a query param
03:11:34 <iqubic> What are data and ID there?
03:12:23 <iqubic> Also, I know that you can have Servant Parse out Filter and Sort options using a predefined syntax. I don't know much about how that works though.
03:12:26 <Axman6> uh, data = date
03:12:40 <Axman6> ID I mean a number, or UUID generally
03:13:01 <iqubic> Oh? What does Date mean in this context?
03:14:43 beka joins (~beka@104-244-24-117.PUBLIC.monkeybrains.net)
03:14:53 <Axman6> ... a date?
03:15:42 <iqubic> Yeah, but what's the datatype associated with dates? How do I tell Servant that a given QueryParam should be parsed as a date?
03:15:55 <Axman6> Day
03:16:08 <Axman6> >>> toGregorian <$> parseUrlPiece "2016-12-01"
03:16:09 <Axman6> Right (2016,12,1)
03:16:14 <Axman6> from the docs I linked to
03:16:35 <iqubic> I se.
03:17:05 <iqubic> Is that using Day from Data.Time?
03:17:41 <Axman6> how about you tell me by going to the link I already provided you and not being so lazy? I thought you stopped doing this months ago
03:17:43 × td_ quits (~td@83.135.9.26) (Ping timeout: 252 seconds)
03:17:52 <dibblego> lol nah
03:18:07 <iqubic> Yeah. Sorry about that. I should really get better at reading the docs
03:18:18 <iqubic> I'll stop wasting everyone's time.
03:19:19 td_ joins (~td@83.135.9.55)
03:19:53 <Axman6> you're welcome to ask questions, but when you've been given the answer, you should probably read it before asking more
03:20:03 <iqubic> I agree
03:20:08 <iqubic> I'll do that from now on.
03:20:28 <dibblego> good job
03:21:04 <monochrom> If you are licensed to drive a car, and your region has a thing called "stop sign", you probably have heard of "rolling stop", meaning at the stop sign you don't stop as legally required, you merely don't step on the throttle pedal (nor the brake pedal though) and just let the car slowly go past.
03:21:05 × king_gs quits (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) (Ping timeout: 260 seconds)
03:21:29 <monochrom> Well, some of my students' idea of "reading" my slides is equivalent to rolling stop.
03:21:34 <dibblego> (not in Australia)
03:21:48 <iqubic> What does that mean monochrom_?
03:22:04 <iqubic> Does that mean your students just  skim your slides?
03:22:35 <monochrom> Well, my student asks my a question. The answer is already on my slides. So I say "find it in my lecture 5 slides". The student scrolls quickly and reports "not found".
03:22:57 <iqubic> I'm sorry you have to deal with that.
03:24:07 <dibblego> when a licenced pilot asks you a question that is answered directly in the legal document... it's because their instructor did not hurt them enough about during initial training
03:24:49 × thegeekinside quits (~thegeekin@189.180.42.11) (Ping timeout: 260 seconds)
03:27:04 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
03:27:41 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
03:27:41 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
03:27:41 finn_elija is now known as FinnElija
03:31:47 nate4 joins (~nate@98.45.169.16)
03:34:24 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
03:36:07 chromoblob joins (~user@37.113.164.122)
03:40:34 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
03:42:41 × terrorjack quits (~terrorjac@2a01:4f8:1c1e:509a::1) (Quit: The Lounge - https://thelounge.chat)
03:43:39 terrorjack joins (~terrorjac@2a01:4f8:1c1e:509a::1)
03:47:30 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
03:53:47 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 248 seconds)
04:00:44 × jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
04:00:45 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
04:01:41 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds)
04:02:17 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
04:08:11 × razetime quits (~quassel@117.193.3.56) (Ping timeout: 248 seconds)
04:10:24 king_gs joins (~Thunderbi@187.201.139.206)
04:11:04 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 252 seconds)
04:11:43 mbuf joins (~Shakthi@49.204.118.65)
04:21:06 chromoblob joins (~user@37.113.164.122)
04:21:17 Neuromancer joins (~Neuromanc@user/neuromancer)
04:29:24 johnw joins (~johnw@2600:1700:cf00:db0:8ded:5d2b:1bf3:1aca)
04:31:58 × lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
04:34:19 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 248 seconds)
04:36:36 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 248 seconds)
04:49:37 <dsal> It doesn't look like hasql provides an abstraction for running a SQL query and reflectively processing the results. Am I missing something?
04:52:19 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
04:53:55 EsoAlgo8 joins (~EsoAlgo@129.146.136.145)
04:54:37 × EsoAlgo quits (~EsoAlgo@129.146.136.145) (Read error: Connection reset by peer)
04:54:37 EsoAlgo8 is now known as EsoAlgo
04:55:48 × beka quits (~beka@104-244-24-117.PUBLIC.monkeybrains.net) (Ping timeout: 248 seconds)
04:59:33 <iqubic> I have a Time package question. If I have a TimeZone value, is it possible to get the current UTC Time (in an IO function) and convert it via said TimeZone
05:03:35 <dsal> https://hackage.haskell.org/package/time-1.12.2/docs/Data-Time-LocalTime.html#v:utcToLocalTime
05:03:57 <dsal> @hoogle
05:03:58 <lambdabot> package base
05:03:58 <lambdabot> package bytestring
05:03:58 <lambdabot> package containers
05:04:22 <iqubic> Thank you
05:04:27 <dsal> @hoogle (TimeZone -> UTCTime -> LocalTime) -- oops, accidentally hit enter
05:04:28 <lambdabot> Data.Time.LocalTime utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
05:04:28 <lambdabot> RIO.Time utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
05:04:28 <lambdabot> Data.Thyme.Time.Core utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
05:04:42 <dsal> You'd expect timezone first because the curry is tastier.
05:05:25 <iqubic> @hoogle IO UTCTime
05:05:26 <lambdabot> Util getModificationUTCTime :: FilePath -> IO UTCTime
05:05:43 <iqubic> Really? There's no way to just get the current UTCTime?
05:06:30 × Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
05:08:14 Xeroine joins (~Xeroine@user/xeroine)
05:10:25 <dsal> @hoogle (IO UTCTime)
05:10:26 <lambdabot> Data.Time.Clock getCurrentTime :: IO UTCTime
05:10:26 <lambdabot> Data.Time.Clock.POSIX getCurrentTime :: IO UTCTime
05:10:26 <lambdabot> ClassyPrelude getCurrentTime :: IO UTCTime
05:10:43 <iqubic> Oh? Do the parens change things?
05:10:45 <iqubic> Weird
05:14:03 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
05:18:44 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
05:19:44 × Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds)
05:19:50 razetime joins (~quassel@117.193.3.56)
05:25:52 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
05:26:58 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
05:28:26 polo_ joins (~polo@pool-100-11-18-203.phlapa.fios.verizon.net)
05:29:42 × polo_ quits (~polo@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host)
05:29:42 polo_ joins (~polo@user/polo)
05:29:53 chromoblob joins (~user@37.113.164.122)
05:30:00 money is now known as Guest1504
05:30:00 polo_ is now known as money
05:32:10 × money quits (~polo@user/polo) (Client Quit)
05:32:52 Guest1504 is now known as money
05:34:36 <sm> is there a map of the time types like
05:34:37 <sm> @where numbers ?
05:34:37 <lambdabot> https://blog.plover.com/prog/haskell/numbers.html A map of Haskell's numeric types
05:35:46 <sm> hmm, yes: https://wiki.haskell.org/Time
05:37:25 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
05:38:19 × monochrom quits (trebla@216.138.220.146) (Quit: NO CARRIER)
05:43:07 monochrom joins (trebla@216.138.220.146)
05:46:33 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
05:46:43 × jargon quits (~jargon@184.101.188.35) (Remote host closed the connection)
05:46:58 × jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer)
05:47:18 ski noted that numbers link doesn't list `Bounded'
05:47:23 <ski> (nor `Ix')
05:47:56 jinsun joins (~jinsun@user/jinsun)
05:53:09 <fvr> those who use nixpkgs infra to build haskell projects, do you use nixpkgs-unstable in prod?
05:54:07 <iqubic> Yes, I use nixpkgs-unstable in prod. I don't notice any major issues.
05:55:07 <fvr> ah okay, just realised today that unstable has openssl pinned to openssl_3 which HsOpenSSL is depending on. So need to upgrade I guess
05:56:36 × king_gs quits (~Thunderbi@187.201.139.206) (Read error: Connection reset by peer)
05:57:26 king_gs joins (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924)
05:57:35 × king_gs quits (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) (Client Quit)
05:59:24 × talismanick quits (~talismani@76.133.152.122) (Ping timeout: 260 seconds)
06:05:22 × shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit)
06:07:16 mikoto-chan joins (~mikoto-ch@164.5.249.78)
06:11:31 × cdoltb^ quits (~cdoltb@76.145.185.103) (Remote host closed the connection)
06:12:04 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
06:16:01 L29Ah parts (~L29Ah@wikipedia/L29Ah) ()
06:17:34 talismanick joins (~talismani@76.133.152.122)
06:18:13 jmorris joins (uid537181@id-537181.uxbridge.irccloud.com)
06:23:01 bgs joins (~bgs@212-85-160-171.dynamic.telemach.net)
06:23:34 × mikoto-chan quits (~mikoto-ch@164.5.249.78) (Ping timeout: 252 seconds)
06:26:32 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
06:29:40 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 252 seconds)
06:30:11 hsw joins (~hsw@2001-b030-2303-0104-0172-0025-0012-0132.hinet-ip6.hinet.net)
06:37:44 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:39:03 jakalx parts (~jakalx@base.jakalx.net) ()
06:39:35 jakalx joins (~jakalx@base.jakalx.net)
06:40:22 × vglfr quits (~vglfr@145.224.100.100) (Remote host closed the connection)
06:41:07 vglfr joins (~vglfr@145.224.100.100)
06:42:15 mikoto-chan joins (~mikoto-ch@164.5.249.78)
06:44:41 odnes joins (~odnes@5-203-198-172.pat.nym.cosmote.net)
06:44:53 × odnes quits (~odnes@5-203-198-172.pat.nym.cosmote.net) (Remote host closed the connection)
06:46:10 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds)
06:57:15 × razetime quits (~quassel@117.193.3.56) (Ping timeout: 248 seconds)
07:05:28 mmhat joins (~mmh@p200300f1c70f4134ee086bfffe095315.dip0.t-ipconnect.de)
07:07:04 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
07:08:59 × jinsun quits (~jinsun@user/jinsun) (Ping timeout: 248 seconds)
07:10:41 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
07:11:05 Feuermagier joins (~Feuermagi@user/feuermagier)
07:11:41 × Feuermagier quits (~Feuermagi@user/feuermagier) (Max SendQ exceeded)
07:11:59 jinsun joins (~jinsun@user/jinsun)
07:12:57 Feuermagier joins (~Feuermagi@user/feuermagier)
07:13:06 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
07:15:14 × mikoto-chan quits (~mikoto-ch@164.5.249.78) (Ping timeout: 260 seconds)
07:23:00 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
07:27:46 <chreekat> yeah i wouldn't touch unstable with a 10 foot pole, but ymmv
07:28:03 × bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
07:31:15 mncheck joins (~mncheck@193.224.205.254)
07:33:46 × mmhat quits (~mmh@p200300f1c70f4134ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1)
07:39:46 <fvr> what issues would one be facing?
07:40:02 <fvr> I have been using it close to a year now
07:48:01 <chreekat> I previously worked in a team where most of us used NixOS for our work machines. On nixos-stable, I had 0 problems ever. My colleagues using nixos-unstable would occasionally have packages break or stop working for a little while
07:48:56 <chreekat> Plus, a backward-incompatible change could come at any time
07:49:16 <chreekat> it wasn't frequent, so maybe it's worth it, but I liked to not have to think about it ever
07:51:45 kenran joins (~user@user/kenran)
07:54:35 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
08:00:00 mikoto-chan joins (~mikoto-ch@nat4.panoulu.net)
08:00:06 × Yumemi quits (~Yumemi@chamoin.net) (*.net *.split)
08:00:06 × pie_ quits (~pie_bnc@user/pie/x-2818909) (*.net *.split)
08:00:06 × vgtw_ quits (~vgtw@user/vgtw) (*.net *.split)
08:00:06 × dtman34 quits (~dtman34@c-75-73-141-79.hsd1.mn.comcast.net) (*.net *.split)
08:00:06 × jludwig quits (~justin@li657-110.members.linode.com) (*.net *.split)
08:00:06 × _xor quits (~xor@74.215.182.83) (*.net *.split)
08:00:06 × SoF quits (~skius@user/skius) (*.net *.split)
08:00:06 × chronon quits (~chronon@user/chronon) (*.net *.split)
08:00:06 × hexeme quits (~hexeme@user/hexeme) (*.net *.split)
08:00:06 × xsarnik quits (xsarnik@lounge.fi.muni.cz) (*.net *.split)
08:00:06 × lbseale quits (~quassel@user/ep1ctetus) (*.net *.split)
08:00:06 × koala_man quits (~vidar@157.146.251.23.bc.googleusercontent.com) (*.net *.split)
08:00:06 × detuneattune quits (~detuneatt@user/detuneattune) (*.net *.split)
08:00:06 × koolazer quits (~koo@user/koolazer) (*.net *.split)
08:00:06 × sm[i] quits (~user@plaintextaccounting/sm) (*.net *.split)
08:00:06 × natto quits (~natto@140.238.225.67) (*.net *.split)
08:00:06 × Ekho quits (~Ekho@user/ekho) (*.net *.split)
08:00:06 × reda quits (~reda@user/reda) (*.net *.split)
08:00:06 × aforemny quits (~aforemny@static.248.158.34.188.clients.your-server.de) (*.net *.split)
08:00:06 × stefan-_ quits (~cri@42dots.de) (*.net *.split)
08:00:06 × dminuoso quits (~dminuoso@user/dminuoso) (*.net *.split)
08:00:06 × GoldsteinQ quits (~goldstein@goldstein.rs) (*.net *.split)
08:00:06 × drlkf quits (~drlkf@chat.drlkf.net) (*.net *.split)
08:00:06 × coldtom quits (~coldtom@coldrick.cc) (*.net *.split)
08:00:06 × Clint quits (~Clint@user/clint) (*.net *.split)
08:00:06 × hpc quits (~juzz@ip98-169-32-242.dc.dc.cox.net) (*.net *.split)
08:00:06 × echoreply quits (~echoreply@45.32.163.16) (*.net *.split)
08:00:06 × mzan quits (~quassel@mail.asterisell.com) (*.net *.split)
08:00:06 × LambdaDuck quits (~anka@ksit.fixme.fi) (*.net *.split)
08:00:06 × kraftwerk28 quits (~kraftwerk@178.62.210.83) (*.net *.split)
08:00:06 × mcfrdy quits (~mcfrdy@user/mcfrdy) (*.net *.split)
08:00:06 × dextaa quits (~DV@user/dextaa) (*.net *.split)
08:00:06 × bcoppens quits (~bartcopp@vpn2.bartcoppens.be) (*.net *.split)
08:00:06 × Zemyla quits (~ec2-user@ec2-54-80-174-150.compute-1.amazonaws.com) (*.net *.split)
08:00:06 × shane quits (~shane@ana.rch.ist) (*.net *.split)
08:00:06 × alp quits (~alp@user/alp) (*.net *.split)
08:00:06 × hippoid quits (~idris@user/hippoid) (*.net *.split)
08:00:06 × dfordivam1 quits (~dfordivam@tk2-219-19469.vs.sakura.ne.jp) (*.net *.split)
08:00:06 × Hecate quits (~mariposa@user/hecate) (*.net *.split)
08:00:06 × polux quits (~polux@51-15-169-172.rev.poneytelecom.eu) (*.net *.split)
08:00:06 × WzC quits (~Frank@77-162-168-71.fixed.kpn.net) (*.net *.split)
08:00:06 × andreas303 quits (andreas303@ip227.orange.bnc4free.com) (*.net *.split)
08:00:06 × gnyeki quits (~gnyeki@user/gnyeki) (*.net *.split)
08:00:06 × zachel quits (~zachel@user/zachel) (*.net *.split)
08:00:06 × asm quits (~alexander@user/asm) (*.net *.split)
08:00:06 × haskl quits (~haskl@user/haskl) (*.net *.split)
08:00:06 × laman1 quits (~laman@rego.ai) (*.net *.split)
08:00:06 × mht-wtf quits (~mht@mht.wtf) (*.net *.split)
08:00:06 × tomjaguarpaw quits (~tom@li367-225.members.linode.com) (*.net *.split)
08:00:06 × acro quits (~acro@user/acro) (*.net *.split)
08:00:06 × davl quits (~davl@207.154.228.18) (*.net *.split)
08:00:12 tomjagua1paw joins (~tom@li367-225.members.linode.com)
08:00:12 gnyeki_ joins (~gnyeki@li578-216.members.linode.com)
08:00:14 shane joins (~shane@ana.rch.ist)
08:00:15 LambdaDuck joins (~anka@ksit.fixme.fi)
08:00:19 WarzoneCommand joins (~Frank@77-162-168-71.fixed.kpn.net)
08:00:20 Clint joins (~Clint@thumb.scru.org)
08:00:20 hpc joins (~juzz@ip98-169-32-242.dc.dc.cox.net)
08:00:21 bcoppens joins (~bartcopp@vpn2.bartcoppens.be)
08:00:22 × gnyeki_ quits (~gnyeki@li578-216.members.linode.com) (Changing host)
08:00:22 gnyeki_ joins (~gnyeki@user/gnyeki)
08:00:24 chronon joins (~chronon@user/chronon)
08:00:27 × Clint quits (~Clint@thumb.scru.org) (Changing host)
08:00:27 Clint joins (~Clint@user/clint)
08:00:42 _xor joins (~xor@74.215.182.83)
08:00:43 echoreply joins (~echoreply@2001:19f0:9002:1f3b:5400:ff:fe6f:8b8d)
08:00:43 laman1 joins (~laman@rego.ai)
08:00:49 zachel joins (~zachel@user/zachel)
08:00:56 aforemny joins (~aforemny@static.248.158.34.188.clients.your-server.de)
08:01:07 xsarnik joins (xsarnik@lounge.fi.muni.cz)
08:01:18 asm joins (~alexander@burner.asm89.io)
08:01:36 dfordivam1 joins (~dfordivam@tk2-219-19469.vs.sakura.ne.jp)
08:01:43 Yumemi joins (~Yumemi@chamoin.net)
08:01:48 andreas303 joins (andreas303@ip227.orange.bnc4free.com)
08:01:55 davl joins (~davl@207.154.228.18)
08:01:55 kraftwerk28 joins (~kraftwerk@178.62.210.83)
08:01:59 jludwig joins (~justin@li657-110.members.linode.com)
08:02:15 dtman34 joins (~dtman34@2601:447:d080:83c8:a3db:9010:bf80:cdf5)
08:02:15 vgtw joins (~vgtw@user/vgtw)
08:02:17 mht-wtf joins (~mht@mht.wtf)
08:02:19 pie_ joins (~pie_bnc@user/pie/x-2818909)
08:02:22 lortabac joins (~lortabac@2a01:e0a:541:b8f0:fd7d:bd88:d842:b1bb)
08:02:22 mzan joins (~quassel@mail.asterisell.com)
08:02:26 lbseale joins (~quassel@user/ep1ctetus)
08:02:33 × asm quits (~alexander@burner.asm89.io) (Changing host)
08:02:33 asm joins (~alexander@user/asm)
08:02:45 natto joins (~natto@140.238.225.67)
08:02:46 acro joins (~acro@user/acro)
08:02:47 GoldsteinQ joins (~goldstein@goldstein.rs)
08:02:48 mcfrdy joins (~mcfrdy@user/mcfrdy)
08:02:51 dminuoso joins (~dminuoso@user/dminuoso)
08:02:52 haskl joins (~haskl@user/haskl)
08:02:52 stefan-_ joins (~cri@42dots.de)
08:03:00 alp joins (~alp@user/alp)
08:03:11 SoF joins (~skius@user/skius)
08:03:52 hippoid joins (~idris@user/hippoid)
08:03:53 drlkf joins (~drlkf@chat.drlkf.net)
08:04:12 cfricke joins (~cfricke@user/cfricke)
08:04:23 hexeme joins (~hexeme@user/hexeme)
08:04:43 × chomwitt quits (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) (Remote host closed the connection)
08:05:15 koala_man joins (~vidar@157.146.251.23.bc.googleusercontent.com)
08:05:17 Hecate joins (~mariposa@user/hecate)
08:05:35 koolazer joins (~koo@user/koolazer)
08:05:39 reda joins (~reda@user/reda)
08:06:39 defanor_ is now known as defanor
08:06:40 Ekho joins (~Ekho@user/ekho)
08:07:48 sm[i] joins (~user@plaintextaccounting/sm)
08:07:59 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
08:10:21 Zemyla joins (~ec2-user@ec2-54-80-174-150.compute-1.amazonaws.com)
08:11:05 chomwitt joins (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1)
08:15:15 chromoblob joins (~user@37.113.164.122)
08:20:30 MajorBiscuit joins (~MajorBisc@c-001-030-015.client.tudelft.eduvpn.nl)
08:21:05 razetime joins (~quassel@117.193.3.56)
08:22:23 × ft quits (~ft@p508dbd59.dip0.t-ipconnect.de) (Quit: leaving)
08:22:57 acidjnk joins (~acidjnk@p200300d6e7137a22458dfbf66917fb17.dip0.t-ipconnect.de)
08:24:19 × FragByte quits (~christian@user/fragbyte) (Quit: Quit)
08:26:19 FragByte joins (~christian@user/fragbyte)
08:26:34 × MajorBiscuit quits (~MajorBisc@c-001-030-015.client.tudelft.eduvpn.nl) (Quit: WeeChat 3.6)
08:31:11 nate4 joins (~nate@98.45.169.16)
08:35:36 MajorBiscuit joins (~MajorBisc@c-001-030-015.client.tudelft.eduvpn.nl)
08:36:05 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds)
08:39:27 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
08:40:02 vpan joins (~0@212.117.1.172)
08:40:36 Kaiepi joins (~Kaiepi@108.175.84.104)
08:40:56 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
08:42:18 polux joins (~polux@51-15-169-172.rev.poneytelecom.eu)
08:44:07 machinedgod joins (~machinedg@clnet-p10-126.ikbnet.co.at)
08:49:48 × jrm quits (~jrm@user/jrm) (Quit: ciao)
08:50:29 Guest75 joins (~Guest75@178.141.177.81)
08:51:19 jrm joins (~jrm@user/jrm)
08:51:34 kuribas joins (~user@ptr-17d51enh7x68c2qjbwe.18120a2.ip6.access.telenet.be)
09:05:08 ubert1 joins (~Thunderbi@178.165.161.121.wireless.dyn.drei.com)
09:07:13 `2jt joins (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net)
09:07:58 × jmorris quits (uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
09:10:22 × zer0bitz quits (~zer0bitz@196.244.192.57) (Read error: Connection reset by peer)
09:10:37 zer0bitz joins (~zer0bitz@196.244.192.61)
09:20:04 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 260 seconds)
09:20:43 × [_________] quits (~oos95GWG@user/oos95GWG) (Ping timeout: 255 seconds)
09:20:59 azimut_ joins (~azimut@gateway/tor-sasl/azimut)
09:21:38 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
09:22:21 [_________] joins (~oos95GWG@user/oos95GWG)
09:23:58 fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7)
09:24:20 × Flow quits (~none@gentoo/developer/flow) (Ping timeout: 252 seconds)
09:24:57 ub joins (~Thunderbi@178.165.160.24.wireless.dyn.drei.com)
09:24:59 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds)
09:26:14 × ubert1 quits (~Thunderbi@178.165.161.121.wireless.dyn.drei.com) (Ping timeout: 246 seconds)
09:26:26 chele joins (~chele@user/chele)
09:26:29 × ubert quits (~Thunderbi@178.165.161.121.wireless.dyn.drei.com) (Ping timeout: 260 seconds)
09:26:29 ub is now known as ubert
09:27:52 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 252 seconds)
09:29:41 <probie> Is there a pragma to indicate that providing an implementation of a class method is deprecated?
09:31:03 chromoblob joins (~user@37.113.164.122)
09:32:20 <ski> "You can only attach to entities declared at top level in the module being compiled" <https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/pragmas.html#warning-and-deprecated-pragmas>
09:34:09 <ski> "Warnings and deprecations are not reported for [..] defining a method in a class instance"
09:35:45 Inst joins (~Liam@c-98-208-218-119.hsd1.fl.comcast.net)
09:35:53 <Inst> is it valid to think of monads as generics of generics?
09:36:02 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
09:36:15 <ski> what do you mean by "generic" ?
09:36:45 <Inst> mainstream programming generics, not haskell generics
09:36:56 <c_wraith> parametric polymorphism?
09:37:00 Flow joins (~none@gentoo/developer/flow)
09:37:12 <ski> like in Java, C#, C++, Ada ?
09:38:14 akegalj joins (~akegalj@93-136-80-143.adsl.net.t-com.hr)
09:38:56 <lortabac> Inst: do you mean that monads require higher-order kinds?
09:39:00 <lortabac> :k Monad
09:39:01 <lambdabot> (* -> *) -> Constraint
09:39:35 <Inst> i've developed a nasty hobby of trying to develop better monad tutorials
09:39:57 <lortabac> maybe that's what you mean by "generics of generics"
09:40:16 <Inst> strangely enough, i'm sort of veering toward the category theory definition
09:41:14 <Inst> monads are just monoids in the category of endofunctors seems to me to be increasingly obvious as the easiest way to explain monads
09:41:26 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61)
09:41:37 <dminuoso> Not really.
09:41:38 <Inst> by generics of generics, i mean that you have a common interface toward certain generics
09:41:49 <dminuoso> That phrase is by no means a vehicle for explaining them
09:42:00 <c_wraith> note that this is not what monads "are"
09:42:09 <Inst> define monad, then
09:42:11 <ski> @where burrito
09:42:12 <lambdabot> http://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/
09:42:13 thyriaen joins (~thyriaen@2a01:aea0:dd4:470d:4c78:c477:402b:896a)
09:42:16 <ski> obligatory ^
09:42:24 <c_wraith> a monoid in the category of endofunctors.
09:42:26 <dminuoso> Inst: A monad is just an an abstract interface.
09:42:26 <Inst> iirc some people bashed it because analogy is how people learn
09:42:37 <Inst> dminuoso: an abstract interface bound by certain laws
09:42:46 <Inst> kind * -> * (or reduceable to such)
09:42:55 <Inst> map, mu, and eta operations
09:42:59 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
09:43:03 <Inst> a specific relationship between mu and eta
09:43:09 <ski> the monad interface is similar to the priority queue interface
09:43:38 [exa] makes a priority queue for the burritos here
09:43:43 <ski> both provide a couple of operations for manipulating the data structure described by the interface
09:44:27 <dminuoso> Inst: Do take a read at Byorgey's blog post, it captures it really well.
09:44:29 <Inst> and i agree re dminuoso that the best explanation is just an interface
09:44:41 <Inst> i disagree with monad tutorial fallacy
09:44:54 <c_wraith> I don't think you can "disagree" with a non-opinion
09:44:58 <Inst> i.e, i think we should develop better monad tutorials so you can teach the monad concept toward the start of a semester
09:45:02 <ski> both are interfaces of "generics" : a priority queue type is (or at least can be) parameterized by its element type, a monad is parameterized by its "monadic result type"
09:45:25 <Inst> monadic result type?
09:45:29 <dminuoso> Inst: We dont need tutorials for them. Learning them is easy. Just study each individual instance, let the intuition develop on its own.
09:45:31 <dminuoso> Done.
09:45:34 <ski> @type getLine
09:45:35 <lambdabot> IO String
09:45:39 <ski> the `String' there ^
09:45:43 <dminuoso> What is in the way, is pretending that "monads are a thing needing to learn"
09:46:02 <dminuoso> Rather than just focusing on the instances themselves, which each take just a few minutes to fully teach, learn and absorb.
09:46:05 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61) (Ping timeout: 260 seconds)
09:46:27 <Inst> ehhh, learn monads as a typeclass, then learn each individual monads as their need / utility pops up
09:46:40 <dminuoso> Sort of like "teaching monoid" is pointless until the student has learned addition and multiplication. Its only when you're equipped with enough tools to recognize the common theme.
09:46:44 <c_wraith> that isn't how humans actually learn
09:46:51 <c_wraith> humans learn concrete -> abstract
09:46:56 <Inst> man it'd be totally cool to learn monoids before addition / multiplication
09:46:59 <merijn> Lemme find a relevant quote from a math journal
09:47:18 <dminuoso> Inst: Go try and teach monoid in elementary before addition. Good luck.
09:47:26 <merijn> Suppose that you want to teach the 'cat' concept to a very young child. Do you explain that a cat is a relatively small, primarily carnivorous mammal with retractible claws, a distinctive sonic output, etc.? I'll bet not. You probably show the kid a lot of different cats, saying 'kitty' each time, until it gets the idea. To put it more generally, generalizations are best made by abstraction from
09:47:27 <[exa]> you guys didn't play with train models?
09:47:32 <merijn> experience.
09:47:33 <[exa]> I mean, transportation monoids
09:47:35 <merijn> - R. P. Boas (Can we make mathematics intelligible?, American Mathematical Monthly 88 (1981), pp. 727-731)
09:47:46 <ski> Inst : there are (a few) better ones. they tend to focus on the practical affordances (which type of boiler-plate code the particular monad captures, and abstracts away, what relevant extra operations that monad supports) .. or else do a proper abstract mathematical introduction (without all the fluffy analogical handwaving)
09:47:49 <dminuoso> [exa]: well yes, and again the children would practice on actual *examples* first.
09:48:22 <merijn> tbh, I wanna watch Inst teach monoids to kids
09:48:27 <merijn> That sounds very entertaining
09:48:34 <merijn> (for me, not for Inst or the kids)
09:49:02 <[exa]> also the modeling clay aka color monoid
09:49:16 <merijn> [exa]: What's the identity element?
09:49:23 <merijn> Pretty sure that's a semigroup
09:49:23 <dminuoso> transparent clay? I want that!
09:49:34 bjourne joins (~bjourne@2001:6b0:1:1140:42bf:ff4:f8fa:50e5)
09:49:37 <[exa]> merijn: no clay is ok
09:49:45 <dminuoso> and I would bet transparent clay would still change the color
09:49:52 <dminuoso> because it diffuses
09:50:15 InstX1 joins (~Liam@2600:1006:b012:4ba6:915c:623e:d292:5624)
09:50:19 <InstX1> hi
09:50:42 <InstX1> got a bad storm, my internet cut out
09:50:43 <InstX1> <merijn> Lemme find a relevant quote from a math journal
09:50:45 <InstX1> cut out over here
09:50:53 <InstX1> tbh, this just came up to me
09:50:53 <dminuoso> InstX1: check the topic, we have a chatlog.
09:51:06 <InstX1> thanks
09:51:07 × Inst quits (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 248 seconds)
09:51:09 <InstX1> but tbh, got a small question
09:51:28 <InstX1> we have a bit of a problem because monads strictly refer to the interface and the category theory concept
09:52:23 <InstX1> the idea of using maybe, etc, to inject a null value, or using state to propagate an accumulating parameter
09:52:45 bloomndoom joins (~user@115.240.194.54)
09:52:45 <InstX1> what is it called when you have complex parameterized types
09:52:58 <InstX1> and you use them to do cool things?
09:52:59 <dminuoso> what does "complex" mean here?
09:53:00 <ski> Inst : unlike priority queues (where most relevant operations are in the abstract interface), most of the relevant operations on a particular monad are *not* in the monad interface. even, if you only have the interface operations available, you can't do too much (basically describe ways to sequence parameter actions, traverse data structures) .. and you can't use those usefully, without some particular
09:53:06 <ski> monadic actions not constructible by the abstract operations
09:53:32 <InstX1> well, the standard monads seem to be more a function of the haskell type system, gadts
09:53:45 <InstX1> i recall uncle bob having a video (which I paid for) that claimed to explain monads
09:53:52 <InstX1> he was actually explaining the monadic pattern, not monads themselves
09:54:05 <dminuoso> ski: I stand by the opinion, that `Monad` is really only captured well in code that is polymorphic over some arbitrary Monad. e.g. `mapM`
09:54:18 <dminuoso> Outside of those combinators, you dont observe the real Monad interface well enough
09:54:27 <dminuoso> pretty much because of what you just said
09:54:38 <InstX1> w/e, sorry, getting late, going to sleep
09:54:45 <InstX1> i just got up to 2 kyu in Haskell on codewars :D
09:54:55 <InstX1> in only 1.5 months
09:55:10 <dminuoso> But it turns out, writing code that is polymorphic over Monad is not something most programmers do often, which makes it more difficult for beginners to understand what the point of it is
09:55:24 <kuribas> dminuoso: traverse?
09:55:38 <bloomndoom> im trying to install juicypixels and i get this error "cannot satisfy -package-id primitive-0.7.4.0-8hFPeuOq4VcHQCYtOnPDT3", what does it mean?
09:55:47 <dminuoso> kuribas: Yes, but I intentionally used `mapM` to avoid some nitpicking about how traverse only requires `Applicative`.
09:56:06 <ski> dminuoso : yea, otherwise you're talking about particular monad "implementations", not about the monad interface itself. you could compare with a module which only uses the abstract operations on priority queues (perhaps using Backpack to be able to swap out concrete implementations implementing the same module interface, or else perhaps using a typeclass)
09:56:27 <kuribas> most language have "do syntax" in the form of list comprehension.
09:56:56 × FragByte quits (~christian@user/fragbyte) (Quit: Quit)
09:58:43 <ski> "Escaping Hell with Monads" by Philip Nillson in 2017-05-08 at <https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/> is a nice short (non-tutorial) teaser of monads
09:58:57 <Franciman> ski: what do you think about moggi's original article about monads?
09:59:11 <Franciman> is it intelligible for the not quite experienced user?
09:59:36 <bloomndoom> ive tried doing `cabal install --dependencies-only` and install `ghc-static` on arch but i'm still getting that error
09:59:57 teo joins (~teo@user/teo)
10:00:02 <kuribas> The problem is that the term Monad scares people away. If you would just tell them, hey, you can overload list comprehension syntax so it works for different usecases, nobody would object.
10:00:43 × thyriaen quits (~thyriaen@2a01:aea0:dd4:470d:4c78:c477:402b:896a) (Remote host closed the connection)
10:00:51 FragByte joins (~christian@user/fragbyte)
10:03:00 <ski> i also quite like the (rather short, to the point) "What the hell are Monads?" by Noel Winstanley in 1999-02 at <https://www-users.mat.umk.pl/~fly/materialy/fp/haskell-doc/Monads.html>, which is possibly the first (non-paper) general monad tutorial
10:04:10 InstX1_ joins (~Liam@2601:6c4:4081:54f0:481:19c9:5bb6:fc21)
10:04:14 <ski> then there's "You Could Have Invented Monads! (And Maybe You Already Have.)" by dpiponi in 2006-08-07 at <http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html>
10:05:01 Lycurgus joins (~juan@user/Lycurgus)
10:05:50 <ski> Franciman : you should probably have some experience with reading about programming language semantics, from what i (vaguely) recall
10:05:53 × InstX1 quits (~Liam@2600:1006:b012:4ba6:915c:623e:d292:5624) (Ping timeout: 252 seconds)
10:05:57 InstX1_ is now known as Inst
10:06:06 <ski> otoh, the Wadler papers are good for (relative) beginners
10:06:24 <Inst> ski: tbh, I'm trying to argue that monads aren't monads
10:06:29 <bloomndoom> does anyone know what the error `cannot satisfy -package-id primitive-0.7.4.0-8hFPeuOq4VcHQCYtOnPDT3` means?
10:06:44 <ski> then there's
10:06:45 <Inst> we're referring to the monadic pattern as equivalent to monads
10:06:58 <ski> @where Typeclassopedia
10:06:58 <lambdabot> http://www.haskell.org/haskellwiki/Typeclassopedia
10:07:16 × cfricke quits (~cfricke@user/cfricke) (Ping timeout: 248 seconds)
10:07:23 <ski> (which also introduces `Functor',`Applicative', and also a bunch of other somewhat related type classes)
10:07:26 <ski> and
10:07:27 <ski> @where AAM
10:07:27 <lambdabot> http://www.haskell.org/haskellwiki/All_About_Monads
10:07:28 <merijn> bloomndoom: Something has gone Very Wrong (TM)
10:07:43 <merijn> What are you trying to do?
10:08:04 <Franciman> ty
10:08:18 <Franciman> Inst: monads aren't monads? What dost thou mean?
10:08:36 <bloomndoom> merijn: im trying to install juicypixels
10:08:59 <Inst> that there should be a more specific term used for creating types with an interface in order to handle certain common programming tasks
10:09:11 <dminuoso> bloomndoom: Do you use stack or cabal?
10:09:12 <bloomndoom> ive mentioned it in my .cabal file and then tried cabal run
10:09:15 <bloomndoom> cabal
10:09:22 <dminuoso> bloomndoom: try nuking your dist-newstyle directory.
10:09:40 <bloomndoom> alright
10:09:41 <bloomndoom> done
10:09:53 × libertyprime quits (~libertypr@118-92-78-165.dsl.dyn.ihug.co.nz) (Quit: leaving)
10:09:55 <dminuoso> Will it run now?
10:10:01 <bloomndoom> still no luck
10:10:15 <bloomndoom> <command line>: cannot satisfy -package-id primitive-0.7.4.0-8hFPeuOq4VcHQCYtOnPDT3
10:10:34 <Franciman> Inst: sounds orthogonal to «monads are not monads»
10:10:46 <dminuoso> bloomndoom: can you run with -v3 and share the output on https://paste.tomsmeding.com/
10:10:49 × xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 260 seconds)
10:11:27 <merijn> bloomndoom: Which version of cabal-install? which ghc?
10:11:28 <ski> as for Philip Wadler's papers, see <https://homepages.inf.ed.ac.uk/wadler/topics/monads.html> (start from oldest. perhaps skip the composable continuations one, at least to begin with, as well as the idiom one, the constraint one, and the arrow one)
10:11:46 <Franciman> i kinda liked arrows
10:11:54 <Franciman> a bit sad they aren't used much these days
10:11:57 <ski> anyway, (barring any one i may've forgot) these are more or less the only ones i suggest to beginners
10:12:18 <Inst> supposedly proc notation is utter garbage
10:12:26 <Inst> not sure if someone fixed it, but proc desugars into extremely inefficient code
10:12:26 <ski> (perhaps there were also a couple of other early papers, by other authors, i don't recall atm)
10:12:57 <merijn> Franciman: why?
10:13:08 <merijn> Franciman: They're just an extremely "meh" abstraction
10:13:11 <bloomndoom> dminuoso: i sent it
10:13:22 <Franciman> i liked how they were used for parser combinators
10:13:30 <Franciman> to obtain offline analysis of the grammar
10:13:30 <dminuoso> bloomndoom: Share the link please.
10:13:35 <ski> Inst : what do you mean by "we're referring to the monadic pattern as equivalent to monads" ?
10:13:39 <Franciman> i think swiestra et al. did it
10:14:00 <ski> Swiersta & Duponcheel, yes
10:14:12 <ski> main practical problem with `Arrow' is `arr'
10:14:20 <bloomndoom> merijn: ghc version is 9.0.2, cabal is 3.4.1.0
10:14:40 <Inst> bleh, forget it, i'm full of it
10:15:31 <ski> perhaps there should be a flag that translates `proc' notation into the `Category' hierarchy classes (possibly adding a few more, e.g. for the "product" not being a proper bifunctor, or categorical product)
10:15:43 <ski> s/flag/extension/
10:16:22 <ski> hmm .. i wonder if Lava ever used arrows
10:16:29 <ski> (hardware description language)
10:18:26 × vglfr quits (~vglfr@145.224.100.100) (Remote host closed the connection)
10:19:03 vglfr joins (~vglfr@145.224.100.100)
10:19:17 <ski> Inst : "tbh, I'm trying to argue that monads aren't monads" -- huh ?
10:20:54 thyriaen joins (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1)
10:21:53 cfricke joins (~cfricke@user/cfricke)
10:21:54 × bloomndoom quits (~user@115.240.194.54) (Ping timeout: 252 seconds)
10:28:10 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
10:33:36 × iqubic quits (~iqubic@2601:602:9502:c70:512:a30e:b15a:1a46) (Quit: Client closed)
10:34:52 × Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt https://tinyurl.com/4m8d4kd5)
10:36:05 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
10:37:34 thyriaen_ joins (~thyriaen@2a01:aea0:dd4:470d:4c78:c477:402b:896a)
10:38:09 × thyriaen_ quits (~thyriaen@2a01:aea0:dd4:470d:4c78:c477:402b:896a) (Client Quit)
10:39:40 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
10:40:29 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
10:41:01 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
10:41:22 <ski> @where MTSS
10:41:22 <lambdabot> "Monad Transformers Step by Step" by Martin Grabmüller in 2006-10-16 (draft) at <https://web.archive.org/web/20201108001845/https://page.mi.fu-berlin.de/scravy/realworldhaskell/materialien/monad-
10:41:22 <lambdabot> transformers-step-by-step.pdf>
10:43:32 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 255 seconds)
10:43:54 chexum joins (~quassel@gateway/tor-sasl/chexum)
10:45:37 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
10:50:24 beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt)
10:51:25 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds)
10:51:32 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
10:52:45 nilradical joins (~nilradica@user/naso)
10:54:05 <ski> @where escaping-hell
10:54:05 <lambdabot> I know nothing about escaping-hell.
10:54:21 <ski> @where+ escaping-hell (non-tutorial teaser) "Escaping Hell with Monads" by Philip Nillson in 2017-05-08 at <https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/>
10:54:21 <lambdabot> It is forever etched in my memory.
10:54:31 <ski> @where hell-monads
10:54:31 <lambdabot> I know nothing about hell-monads.
10:54:56 <ski> @where+ hell-monads "What the hell are Monads?" by Noel Winstanley in 1999-02 at <https://www-users.mat.umk.pl/~fly/materialy/fp/haskell-doc/Monads.html>. Possibly the first (non-paper) general monad tutorial
10:54:56 <lambdabot> Okay.
10:55:09 <ski> @where invented-monads
10:55:10 <lambdabot> I know nothing about invented-monads.
10:55:20 <ski> @where+ invented-monads "You Could Have Invented Monads! (And Maybe You Already Have.)" by dpiponi in 2006-08-07 at <http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html>
10:55:20 <lambdabot> Done.
10:55:32 <ski> @where wadler-monads
10:55:32 <lambdabot> I know nothing about wadler-monads.
10:55:50 <ski> @where+ wadler-monads Monad(ic (, idiomatic/applicative and arrow) effects) introduction papers by Philip Wadler in 1992-01 - 2010 at <https://homepages.inf.ed.ac.uk/wadler/topics/monads.html>. Start from oldest. Perhaps skip the ones touching upon composable continuations, idioms, constraints, arrows, on a first read
10:55:50 <lambdabot> It is forever etched in my memory.
10:58:43 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
10:58:53 × Guest75 quits (~Guest75@178.141.177.81) (Ping timeout: 260 seconds)
10:59:17 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
11:01:46 __monty__ joins (~toonn@user/toonn)
11:01:59 <nilradical> what is a good and simple option for a server that will just read and write json files for someone with no experience doing servers
11:03:53 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 246 seconds)
11:06:00 <dminuoso> "json files" from the disk?
11:06:07 L29Ah joins (~L29Ah@wikipedia/L29Ah)
11:06:19 <dminuoso> Do you mean a kind of daemon that reads files from the filesystem?
11:06:35 <dminuoso> Or do you intend to receive/send json data over a network?
11:07:13 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
11:07:39 <nilradical> dminuoso: yes on disk, i guess daemon on the filesystem is what i mean
11:08:04 <dminuoso> Okay, what pieces of the puzzle are you missing?
11:08:45 <dminuoso> And is performance relevant at all?
11:09:58 <nilradical> i am basically trying to do a simulation of what will eventually be a network program where there is a client and a host communicating. i thought it may be easy to do this with just hte two programs running on the same disk reading and writing from .json files, but perhaps i'm wrong about that
11:10:21 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
11:11:22 <nilradical> right now i have the two programs reading a file and writing to it using Aeson and readFile/writeFile
11:11:53 <nilradical> i guess there could be some problem with one tryign to read while the other is trying to write as well
11:12:01 <nilradical> maybe the network way would be better?
11:12:11 xff0x joins (~xff0x@2405:6580:b080:900:6c11:61e0:a694:e7f1)
11:12:21 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
11:12:24 <nilradical> performance is not really relevant
11:22:08 × Inst quits (~Liam@2601:6c4:4081:54f0:481:19c9:5bb6:fc21) (Ping timeout: 255 seconds)
11:24:33 CiaoSen joins (~Jura@p200300c9571247002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
11:29:29 chromoblob joins (~user@37.113.164.122)
11:35:18 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
11:35:56 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
11:39:09 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
11:43:17 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61)
11:45:22 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1)
11:47:46 <chreekat> nilradical: For the server i'd use any of the webserver tools . https://hackage.haskell.org/package/wai has basic ideas. Then you can use some of the fancier systems that layer on top it (e.g. most haskell web frameworks... servant, yesod, IHP) if things get complicated. For the client, http-client is maybe the easiest to recommend.
11:47:47 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61) (Ping timeout: 255 seconds)
11:47:49 <chreekat> and yeah I think setting up actual network apps is probably easiest
11:48:31 <nilradical> chreekat: thanks very much, i'll give it a go
11:49:24 × Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds)
11:49:50 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
11:49:59 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
12:06:31 Kaiepi joins (~Kaiepi@108.175.84.104)
12:08:25 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:15:19 × xff0x quits (~xff0x@2405:6580:b080:900:6c11:61e0:a694:e7f1) (Ping timeout: 252 seconds)
12:16:17 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
12:16:17 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
12:16:17 finn_elija is now known as FinnElija
12:18:48 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
12:20:32 mestre joins (~mestre@191.177.185.178)
12:21:07 xff0x joins (~xff0x@2405:6580:b080:900:6c11:61e0:a694:e7f1)
12:21:14 jakalx parts (~jakalx@base.jakalx.net) ()
12:23:23 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
12:24:02 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
12:24:35 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
12:24:47 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds)
12:29:15 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
12:32:41 nate4 joins (~nate@98.45.169.16)
12:35:20 bloomndoom joins (~user@115.240.194.54)
12:36:10 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
12:36:26 jakalx joins (~jakalx@base.jakalx.net)
12:37:19 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds)
12:43:44 <bloomndoom> im getting this error when installing JuicyPixels `<command line>: cannot satisfy -package-id primitive-0.7.4.0-8hFPeuOq4VcHQCYtOnPDT3`, my ghc version is 9.0.2 and cabal version is 3.4.1.0 , on arch
12:44:27 × mikoto-chan quits (~mikoto-ch@nat4.panoulu.net) (Ping timeout: 248 seconds)
12:44:48 <maerwald[m]> bloomndoom: remove all arch GHCs
12:44:52 <maerwald[m]> And start over
12:45:24 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
12:45:28 <maerwald[m]> https://www.haskell.org/ghcup/
12:45:37 <bloomndoom> maerwald: install through ghcup?
12:51:10 <maerwald[m]> bloomndoom: can
12:52:24 <merijn> bloomndoom: oh, you're on arch?
12:52:30 <bloomndoom> fyeah
12:52:32 <merijn> RIP
12:52:39 <bloomndoom> huh?
12:52:40 <merijn> nuke all system packages and start over
12:52:48 <bloomndoom> wdym system packages?
12:52:58 <merijn> as in, haskell package installed via arch
12:53:03 <bloomndoom> like all haskell stuff?
12:53:22 <merijn> bloomndoom: The compiler shipped by arch is (intentionally) broken in the default configuration
12:53:45 <merijn> There's a bunch of stuff on the Arch wiki too on how you can workaround that, but the easiest method is just "don't use arch packages"
12:53:54 <bloomndoom> ah damn
12:54:05 <bloomndoom> so all haskell packages installed through pacman?
12:54:16 <dminuoso> Yes.
12:54:34 <merijn> It's been awhile since the great flood of arch users, or I woulda asked that first with errors like these
12:54:35 <dminuoso> The GHC maintainer on Arch has some.. peculiar opinions.
12:54:52 <merijn> dminuoso: Pretty sure it's all of Arch maintainers
12:55:01 <bloomndoom> wow lol
12:55:09 <merijn> bloomndoom: Essentially Arch belives "dynamic linking is The One True Way"
12:55:13 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
12:55:15 <bloomndoom> i actually wanted to use nix but seemed to buggy
12:55:18 <merijn> bloomndoom: So they only install dynamic versions of haskell libraries
12:55:28 <bloomndoom> so just `pacman -Qeq | grep haskell | sudo pacman -Rsn -` ?
12:55:45 <merijn> bloomndoom: Except, GHC (in its default configuration) links statically by default, and they can't be arsed to fix/patch GHC to default to dynamic on arch
12:55:47 <tomsmeding> '^haskell-' to be safer
12:56:08 <tomsmeding> bloomndoom: actually it's probably easier to `pacman -Rsc ghc`
12:56:08 <bloomndoom> merijn: ah that sucks
12:56:24 <merijn> So by default GHC will try to statically link, encounter all these packages that are installed (according to the database) but don't have static versions, so it's only conclusion is "package must be broken"
12:56:30 <bloomndoom> tomsmeding: yeah that makes sense lol
12:56:32 <tomsmeding> and then see if you have any *ghc* or *haskell* packages left and look more carefully at those
12:56:43 <dminuoso> merijn: to be absolutely blunt, GHC could have better diagnostics.
12:56:52 <dminuoso> It could tell you "missing static version of XYZ"
12:57:07 <dminuoso> Just saying "cannot satisfy" is about the poorest thing to tell.
12:57:08 <merijn> dminuoso: Sure, it did at one point, I think?
12:57:49 <bloomndoom> tomsmeding: ran it, have hls, ghc and a few related packages left
12:58:03 <dminuoso> merijn: Anyway. What is kind of funny about the whole arch haskell business, is that one of the primary reasons for breaking things the way they are, is because the maintainer has slow internet speed.
12:58:10 <tomsmeding> bloomndoom: if you did -Rsc ghc then you cannot have ghc left :p
12:58:24 <dminuoso> Not judging, but it is really the driving reason why arch haskell is all dynamically built.
12:58:50 <bloomndoom> tomsmeding: wait nvm, it isnt there, it was just showing up on autocomplete for a sec lol
12:59:18 <dminuoso> Well and the fact, that it seems that the Arch Haskell packages were built on his personal PC...
12:59:26 <dminuoso> Which meant compiling things locally was slow, and uploading even slower...
12:59:29 <dminuoso> It's kind of absurd.
12:59:56 <bloomndoom> wait
13:00:09 <maerwald[m]> dminuoso: it's an amateur distro
13:01:17 <maerwald[m]> There has always been Synergy of packagers taking ideas from each others build recipes. E.g. gentoos have usually high quality or fedora. But no one looks at arch PKGBUILDs. They're generally trash.
13:02:13 <bloomndoom> tomsmeding: could running -Rsc break my system? some applications arent closing rn
13:02:24 <bloomndoom> it isnt a big deal cuz this is a vm but yeah
13:02:58 <tomsmeding> bloomndoom: what did it remove :p
13:03:04 <bloomndoom> not sure lol
13:03:06 <tomsmeding> lol
13:03:11 <maerwald[m]> There's good news though: there are better distros than arch
13:03:18 <bloomndoom> but i cant seem to close windows anymore tho
13:03:19 <tomsmeding> if I told you to `rm -rf --no-preserve-root /`, would you do it too?
13:03:23 <dminuoso> maerwald[m]: Im not even talking about PKGBUILD itself, but the mere fact that there's a maintainer just punching in commands on their local computer, and hitting some upload button - and the artifacts are what are in pacman.
13:03:32 <dminuoso> There's something deeply flawed about it.
13:03:32 <tomsmeding> always check what commands do before you run them
13:03:34 <bloomndoom> tomsmeding: nah i know what that does lmao
13:03:59 <dminuoso> You'd think they have some kind of CI infrastructure to do this, running on dedicated computing hardware
13:04:00 <tomsmeding> bloomndoom: it should have removed all packages that depend on ghc, as well as everything that was not explicitly installed and has become redundant after removing all the other stuff
13:04:14 <tomsmeding> perhaps you actually needed some of the dependencies?
13:04:16 <maerwald[m]> Legit, lol
13:04:36 <bloomndoom> tomsmeding: yeah true, i had a vague idea of what it did but wasnt exactly sure
13:04:38 <tomsmeding> bloomndoom: check /var/log/pacman.log, it shows a log of all the things it did
13:05:55 <bloomndoom> maerwald[m]: what distros do you recommend over arch?
13:06:05 dminuoso smells gentoo coming
13:06:21 tomsmeding smells fedora coming actually
13:06:24 <maerwald[m]> dminuoso: no god no
13:06:56 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
13:07:05 <dminuoso> Either way, its particularly the Haskell side that is broken on Arch. Whether you are fine with the rest of it is up to you *shrugs*
13:07:21 <dminuoso> I dont have any strong feelings to tell people not to use a particular distribution
13:07:37 <maerwald[m]> bloomndoom: Fedora or opensuse is a good compromise, although Fedors packagers sometimes break shit too carelessly
13:07:38 <maerwald[m]> I consider debian trash too
13:08:04 × jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer)
13:08:17 <bloomndoom> tomsmeding: it removed the haskell packages , doesnt looklike it should break anything
13:08:40 <tomsmeding> bloomndoom: try turning it off and on again?
13:09:00 <bloomndoom> yeah i'll do that
13:09:07 <maerwald[m]> dminuoso: GHC build on debian and executed on most non debian distros spams stderr with trash
13:09:23 × bloomndoom quits (~user@115.240.194.54) (Remote host closed the connection)
13:09:31 <maerwald[m]> Because they manage to build libraries in ways no one else does
13:10:08 <dminuoso> Perhaps the thing that is really broken is not operating systems, but lack of cohesive tooling or good build systems.
13:10:24 × kenran quits (~user@user/kenran) (Remote host closed the connection)
13:10:38 bloomndoom joins (~user@115.240.194.54)
13:10:55 <bloomndoom> okay yeah restarting seemed to fix it
13:11:01 <dminuoso> Linux distributions areparticularly problematic due to the organic nature, you have a gigantic mixture of pieces software that are glued together randomly, built with very adhoc build systems making so many assumptions..
13:11:29 <maerwald[m]> dminuoso: with arch you could argue it's lack of knowledge. But with Debian it's outright stupidity, because they know what they are doing and do it anyway
13:11:50 <bloomndoom> what about void?
13:12:06 <maerwald[m]> This is not a technical problem
13:12:39 <maerwald[m]> Cannot be solved by tech
13:13:02 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 246 seconds)
13:13:35 <bloomndoom> do i need both cabal and stack?
13:13:39 × akegalj quits (~akegalj@93-136-80-143.adsl.net.t-com.hr) (Quit: leaving)
13:13:44 <maerwald[m]> bloomndoom: I wanted to try it, but afair I got alienated by how to build packages
13:13:45 <maerwald[m]> You need either docker or some other isolated layer afair
13:13:45 <maerwald[m]> Felt kinds clunky go hack on build recipes
13:13:56 <maerwald[m]> bloomndoom: no, cabal is enough
13:15:50 bloomndo` joins (~user@223.187.114.68)
13:16:02 <ski> @where cabal-stack-disambiguation
13:16:02 <lambdabot> "The Cabal/Stack Disambiguation Guide" at <https://gist.github.com/merijn/8152d561fb8b011f9313c48d876ceb07> by Merijn
13:17:50 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 260 seconds)
13:17:53 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
13:18:02 × mbuf quits (~Shakthi@49.204.118.65) (Quit: Leaving)
13:20:06 × bloomndoom quits (~user@115.240.194.54) (Ping timeout: 268 seconds)
13:21:11 <dminuoso> maerwald[m]: Honestly, I think if I could restart my life, I would just pick FreeBSD.
13:21:22 <dminuoso> In so many ways its actually sane and cohesive.
13:21:27 <dminuoso> And it comes with a great manual too.
13:21:55 <maerwald[m]> dminuoso: but it's so messy
13:22:06 <dminuoso> There is not a single non-messy operating system.
13:22:31 <dminuoso> With great complexity, there comes great responsiblity to use a vacuum cleaner.
13:22:57 <maerwald[m]> FreeBSD broke cabal with an upgrade from 13.0 to 13.1 i think. It just installs the broken version and doesn't care
13:23:11 <maerwald[m]> Then there is this issue with having two copies of ncurses
13:23:31 <maerwald[m]> And they sometimes break major things
13:24:17 <maerwald[m]> There was this filesystem? change a fer years ago or so that impacted haskell too
13:24:26 <maerwald[m]> Maintaining FreeBSD CI is a plague
13:27:23 <maerwald[m]> I think was the 64bit inode change
13:27:58 <maerwald[m]> https://github.com/commercialhaskell/stack/issues/3515
13:28:00 <maerwald[m]> gg
13:28:28 <maerwald[m]> I got no love for this :p
13:30:35 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
13:31:03 azimut joins (~azimut@gateway/tor-sasl/azimut)
13:31:49 × bloomndo` quits (~user@223.187.114.68) (Ping timeout: 268 seconds)
13:37:11 mikoto-chan joins (~mikoto-ch@164.5.249.78)
13:44:02 <bjourne> suppose i have a class like this:
13:44:04 <bjourne> class Pretty a where
13:44:05 <bjourne> pretty :: a -> String
13:44:49 <bjourne> how can i make lists instances of this class?
13:45:41 <dminuoso> You can use OVERLAPPABLE over OVERLAPPING
13:45:55 <dminuoso> https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/instances.html#instance-overlap
13:46:03 <dminuoso> Aside from that, consider not using a typeclass for this.
13:46:27 <bjourne> show me an example
13:46:40 <dminuoso> Using OVERLAPPING/OVERLAPPABLE, or without a typeclass?
13:47:23 <bjourne> its deprecated so its moot
13:47:41 <dminuoso> No using them as language pragmas is deprecated
13:47:48 <dminuoso> You can use them as pragmas directly inside an instance
13:48:11 <dminuoso> `instance {-# OVERLAPPING #-} Pretty [a] where ...`
13:48:29 <dminuoso> But honestly, I would recommend you do not use a typeclass to begin with for this, but rather just `ppr*` functions. It tends to be better long time
13:49:21 <bjourne> i don't want to write {-# OVERLAPPING #-} in my code
13:49:55 <dminuoso> Do not use a typeclass instance, then. There's no good reason you should anyway
13:50:03 <dminuoso> `pprList = ...` and then use that function.
13:50:42 <dminuoso> I've recently written an SO answer about a very similar topic, most of which applies to Pretty as well: https://stackoverflow.com/a/74380240/6636995
13:51:06 × alphabeta quits (~kilolympu@213.144.144.24) (Read error: Connection reset by peer)
13:52:47 <bjourne> yes i can work around it, but having one function prettifying every element in the dom is nice
13:53:35 <bjourne> pprList = ..., pprLeaf = ..., pprId = ..., very ugly
13:54:42 alphabeta joins (~kilolympu@213.144.144.24)
13:57:03 <dminuoso> Why is that ugly?
13:57:07 <dminuoso> You are writing each such line anyway.
13:57:16 <dminuoso> `pretty = ...`, `pretty = ....`, `pretty = ...`
13:57:54 irrgit_ joins (~irrgit@146.70.27.250)
13:58:11 <kuribas> dminuoso: I think you need Pretty a => Instance Pretty [a]
13:58:23 <bjourne> cause i also have to swrite pprList, pprLeaf, etc on each callsite
13:58:23 <kuribas> dminuoso: why is the OVERLAPPING needed?
13:58:30 <dminuoso> kuribas: Perhaps. Im not making any assumptions about what they intend to do.
13:58:40 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds)
13:58:48 <dminuoso> kuribas: Im making the implicit assumption they already have an `instance Pretty String` :P
13:58:50 <kuribas> bjourne: also consider using a pretty printing library.
13:59:19 <dminuoso> bjourne: I do not consider that to be a problem. Actually, I see the opposite as an actual problem.
13:59:23 <dminuoso> Outlined in the SO answer.
13:59:28 <dminuoso> It hides what code does.
13:59:33 <kuribas> dminuoso: but he wants [a], not String
13:59:47 <dminuoso> You have to a) know the types involved and b) do instance resolution in your head, just to figure out what `pretty x` actually ends up doing.
13:59:57 <dminuoso> And if types change, suddenly their representation change too
14:00:12 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
14:00:56 <bjourne> it's a problem because if i change the dom i have to replace lots of pprWhatever with pprWhateverNew
14:01:46 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
14:01:51 <dminuoso> It can be a simple `sed` or editor command to do this for you, if you demand so.
14:02:06 <dminuoso> I think of this as a benefit, since I get control over if I want that to happen
14:04:07 × Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
14:04:50 Xeroine joins (~Xeroine@user/xeroine)
14:07:16 Guest75 joins (~Guest75@178.141.177.81)
14:09:30 × nilradical quits (~nilradica@user/naso) (Remote host closed the connection)
14:10:05 nilradical joins (~nilradica@user/naso)
14:10:59 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
14:14:39 × nilradical quits (~nilradica@user/naso) (Ping timeout: 260 seconds)
14:18:27 shriekingnoise joins (~shrieking@186.137.167.202)
14:18:43 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
14:18:50 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
14:25:46 <tomsmeding> bjourne: do you want both `Pretty [a]` and `Pretty String`, and have the second do something different than the [a] instance?
14:39:18 <int-e> :t showList
14:39:19 <lambdabot> Show a => [a] -> ShowS
14:40:56 <int-e> (Do we know who came up with that trick?)
14:42:57 coldtom joins (~coldtom@coldrick.cc)
14:42:59 nilradical joins (~nilradica@user/naso)
14:43:20 <int-e> (The trick being to delegate the implementation of Show for [a] to the Show instance for a... so [Char] can have a different Show implementation than other lists)
14:44:33 × fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 252 seconds)
14:45:43 Sgeo joins (~Sgeo@user/sgeo)
14:46:46 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
14:52:41 <geekosaur> sadly, that doesn't scale very well. I can't mod Show to have a different mechanism for Show (Set Char) at this point, for example
14:56:21 o-90 joins (~o-90@gateway/tor-sasl/o-90)
14:57:09 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
14:57:37 Tuplanolla joins (~Tuplanoll@91-159-68-194.elisa-laajakaista.fi)
15:00:31 fserucas joins (~fserucas@2001:8a0:6d00:2500:4717:7619:c4e9:3aa2)
15:02:27 × o-90 quits (~o-90@gateway/tor-sasl/o-90) (Remote host closed the connection)
15:14:20 × nilradical quits (~nilradica@user/naso) (Ping timeout: 255 seconds)
15:17:03 enoq joins (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7)
15:17:07 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
15:28:09 × ec_ quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
15:28:58 ec_ joins (~ec@gateway/tor-sasl/ec)
15:30:54 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
15:31:25 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds)
15:32:24 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
15:32:33 × Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
15:32:35 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
15:32:42 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
15:32:52 Xeroine joins (~Xeroine@user/xeroine)
15:33:17 azimut joins (~azimut@gateway/tor-sasl/azimut)
15:33:25 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
15:38:11 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 255 seconds)
15:42:48 azimut_ joins (~azimut@gateway/tor-sasl/azimut)
15:45:02 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
15:46:03 <bjourne> tomsmeding: i dont want "Pretty String"
15:46:18 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
15:46:40 <tomsmeding> bjourne: in that case, what is the problem with `instance Pretty a => Pretty [a] where`
15:46:54 <tomsmeding> the whole OVERLAPPING discussion was assuming that you wanted String and [a] to have different instances
15:47:02 <tomsmeding> dminuoso: you assumed :p
15:47:59 crns joins (~netcrns@p4ff5e3ac.dip0.t-ipconnect.de)
15:47:59 × crns quits (~netcrns@p4ff5e3ac.dip0.t-ipconnect.de) (Changing host)
15:47:59 crns joins (~netcrns@user/crns)
15:50:22 jinsun joins (~jinsun@user/jinsun)
15:50:33 × acidjnk quits (~acidjnk@p200300d6e7137a22458dfbf66917fb17.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
15:55:01 <bjourne> tomsmeding: the problem was that i didn't know the syntax
15:55:08 <tomsmeding> ah :)
15:55:15 <tomsmeding> ignore the whole discussion above then
15:55:23 × Guest75 quits (~Guest75@178.141.177.81) (Quit: Client closed)
15:55:38 <tomsmeding> well, I guess dminuoso's opinion that he doesn't like to use a type class for this still stands
15:56:12 <tomsmeding> one of the motivations being that _if_ you end up wanting `Pretty String` to do something different than the generic lists instance, you need hacks
15:58:20 <bjourne> ic, i dont know much about haskell's warts and limitations
15:58:43 <tomsmeding> bjourne: the thing is that String = [Char]
15:58:55 <kuribas> bjourne: they their for reasons.
15:58:58 <tomsmeding> so if you now want to pretty-print a String, it ends up getting treated as a list of characters
15:59:42 <kuribas> bjourne: they are there for reasons. Some good, and some historical. In general, you don't want type classes to overlap.
16:00:41 <tomsmeding> overlapping instances being the "hacks" I mentioned
16:01:32 <bjourne> ic, very bad design i suppose
16:02:34 <dminuoso> I think at the very least String should have been newtyped.
16:02:37 <kuribas> bjourne: type class instances are open, so they can come from any place. That's why normally they shouldn't overlap, since then you get ambiguity.
16:02:55 <kuribas> bjourne: however, sometimes you do want it, and then the OVERLAP pragma can be helpful.
16:05:03 <kuribas> bjourne: it's not "bad design", you just need to know when it is appropriate.
16:05:48 <kuribas> And in applications overlapping instances aren't a problem, because then all the instances are known. Only in libraries type are.
16:06:14 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
16:06:30 elevenkb joins (~elevenkb@105.184.125.168)
16:08:20 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
16:08:44 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:fd7d:bd88:d842:b1bb) (Ping timeout: 246 seconds)
16:11:51 sadmax joins (~user@209.205.174.253)
16:17:01 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
16:19:51 vn36 joins (~vn36@123.63.203.210)
16:20:25 blomberg joins (~default_u@89-39-107-192.hosted-by-worldstream.net)
16:20:27 <blomberg> hi
16:20:44 <vn36> elo
16:21:12 <blomberg> i=3;while cond;... i=2*i^3+4 ; can fodl do this
16:22:14 <tomsmeding> blomberg: what have you tried?
16:22:44 <blomberg> haskell no loops simulation problem
16:22:58 <kuribas> :t iterate (\i -> 2 * i*i*i + 4)
16:22:59 <lambdabot> Num a => a -> [a]
16:23:18 <tomsmeding> :t iterate (\i -> 2 * i^3 + 4)
16:23:19 <lambdabot> Num a => a -> [a]
16:24:14 <blomberg> where is the iterate function mentioned in learn you a haskell book
16:24:28 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61)
16:25:34 <blomberg> are there other functools like map filter fold
16:25:59 <tomsmeding> https://hackage.haskell.org/package/base-4.14.0.0/docs/Prelude.html
16:27:11 <blomberg> btw that line iterate needs i=3 initialization
16:27:44 <kuribas> :t iterate (\i -> 2 * i^3 + 4) 3
16:27:45 <lambdabot> Num a => [a]
16:28:38 <kuribas> > fix (\f i -> if i > 30 then i else f (2 * i^3 + 4)) 3
16:28:39 <lambdabot> 58
16:29:03 jmdaemon joins (~jmdaemon@user/jmdaemon)
16:29:06 <tomsmeding> > iterate (\i -> 2 * i^3 + 4) 3
16:29:07 <lambdabot> [3,58,390228,118846194466264708,33572666422292922482173017929660337310850854...
16:29:19 <int-e> > takeWhile (< 10^9) (iterate (\i -> 2*i^3 + 4) 3)
16:29:21 <lambdabot> [3,58,390228]
16:29:41 <kuribas> > find (< 10^9) (iterate (\i -> 2*i^3 + 4) 3)
16:29:43 <lambdabot> Just 3
16:30:36 <int-e> AFAICS LYAH doesn't use `iterate` much but it is mentioned when it describes Data.List
16:30:38 <kuribas> > find (> 10^9) (iterate (\i -> 2*i^3 + 4) 3)
16:30:40 <lambdabot> Just 118846194466264708
16:30:45 <int-e> explicit recursion is always an option
16:31:14 × causal quits (~user@50.35.83.177) (Quit: WeeChat 3.7.1)
16:31:29 <int-e> kuribas: head . dropWhile (<= 10^9) is safe when the input is an infinite list
16:31:31 × Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
16:31:42 <int-e> (the `find` will never return Nothing anyway)
16:31:57 <kuribas> int-e: well, it's a "no loop challenge".
16:32:27 × enoq quits (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) (Quit: enoq)
16:32:34 <kuribas> int-e: not on an infinite list
16:32:40 Xeroine joins (~Xeroine@user/xeroine)
16:32:40 <blomberg> but haskell has no loops?
16:32:42 <int-e> kuribas: I've seen that, but I'm being pragmatic here... and defending LYAH for not going into depth on `iterate`
16:32:57 <int-e> or its friend `unfoldr`
16:33:07 <kuribas> blomberg: I thought you meant no recursion by "no loops".
16:34:00 <blomberg> iterate is also missing the condition say i<900
16:34:05 <int-e> > let loop i | i >= 10^9 = [] | otherwise = i : loop (2*i^3 + 4) in loop 3
16:34:07 <lambdabot> [3,58,390228]
16:34:11 nate4 joins (~nate@98.45.169.16)
16:34:25 acidjnk joins (~acidjnk@p200300d6e7137a38458dfbf66917fb17.dip0.t-ipconnect.de)
16:34:41 <dminuoso> blomberg: Well, we have no *structured* loops in the sense that we have syntactical constructs of them. But recursion is really the same, and in fact after code generation, you generally get comparable code as a loop in most structured programming languages.
16:34:58 <int-e> blomberg: you can tack the check on later, see the `takeWhile` things above
16:34:59 <dminuoso> blomberg: So dont think of it as simulation, we just encode loops differently.
16:35:37 <int-e> the joy of being lazy
16:35:46 <kuribas> you can think of loops as simulating recursion :)
16:36:10 <blomberg> dminuoso:i meant a function for loops, like iterate
16:36:37 <int-e> :t unfoldr
16:36:38 <lambdabot> (b -> Maybe (a, b)) -> b -> [a]
16:36:43 <dminuoso> blomberg: Okay, whats wrong with iterate?
16:36:53 × vpan quits (~0@212.117.1.172) (Quit: Leaving.)
16:37:14 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
16:37:47 <kuribas> blomberg: it's more typical in haskell to combine different functions that do a single thing, rather than having functions that include everything (as in common lisp).
16:37:49 <blomberg> iterate (\i -> 2 * i^3 + 4) 3 ; i<900 condition is misssing
16:38:00 <int-e> (FWIW, I hardly ever use unfoldr. I *do* use the takeWhile/iterate thing quite often.)
16:38:15 <dminuoso> blomberg: I would just write explicit recursion.
16:38:24 <kuribas> blomberg: iterate returns an infinite list
16:38:34 <blomberg> takeWhile (< 10^9) (iterate (\i -> 2*i^3 + 4) 3) is that i<10^9?
16:39:02 <int-e> (< 10^9) is the same as (\i -> i < 10^9)
16:39:04 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds)
16:39:11 <kuribas> (< 10^9) == (\i -> i < 10^9)
16:39:40 <dminuoso> % f = go 0 where go i | i < 900 = go (2 * i^3 + 4); go i = i
16:39:40 <yahb2> <no output>
16:39:48 <dminuoso> blomberg: Is how I would write it I guess?
16:40:08 <int-e> % f
16:40:08 <yahb2> 4599940
16:40:26 <dminuoso> Oh, it should start at 3, sorry
16:40:28 <dminuoso> % f = go 3 where go i | i < 900 = go (2 * i^3 + 4); go i = i
16:40:28 <yahb2> <no output>
16:40:31 <dminuoso> f
16:40:32 <dminuoso> % f
16:40:32 <yahb2> 390228
16:41:16 <dminuoso> blomberg: With a slight bit of squinting, it looks the same as: i=3; while (i < 900) { i=2*i^3+4 }
16:41:42 × Maeda quits (~Maeda@91-161-10-149.subs.proxad.net) (Ping timeout: 255 seconds)
16:41:46 <blomberg> takeWhile (< 10^9) (iterate (restofLOOPCODE + \i -> 2*i^3 + 4) 3) can resofLOOPCODE be a function; i see it's much more complex functionally
16:42:26 <kuribas> blomberg: you cannot add to a function
16:42:55 <blomberg> i know
16:43:17 <kuribas> blomberg: then what is that supposed to do?
16:43:48 <blomberg> so overall we need three functions takeWhile , iterate and loopCODE content
16:43:55 <kuribas> :t \x -> x + \y -> y*3
16:43:56 <lambdabot> (Num a, Num (a -> a)) => (a -> a) -> a -> a
16:44:17 <int-e> kuribas: nice, it looks like a Church numeral now...
16:44:32 <kuribas> ok, you CAN add to a function :)
16:44:33 <int-e> numbers all around
16:45:06 <int-e> lambdabot even used to have a Num instance for functions by default
16:45:15 <blomberg> takeWhile (< 10^9) (iterate (restofLOOPCODE) 3) is it valid
16:45:28 <blomberg> if the loop is like 5 lines big or more
16:45:34 <int-e> (using pointwise evaluation, f + g = \x -> f x + g x)
16:47:55 <blomberg> so haskell avoids for loops using fold which is relatively easier than while but this line is way too much takeWhile (< 10^9) (iterate (\i -> 2*i^3 + 4) 3)
16:48:12 <kuribas> > let while i t f | t i = i | otherwise = while (f i) t f in while 3 (< 10^9) (\i -> 2*i^3 + 4)
16:48:14 <lambdabot> 3
16:48:30 <kuribas> > let while i t f | t i = i | otherwise = while (f i) t f in while 3 (> 10^9) (\i -> 2*i^3 + 4)
16:48:32 <lambdabot> 118846194466264708
16:48:39 <kuribas> blomberg: here is your while loop :)
16:48:41 <int-e> boolean blindness :)
16:48:50 <int-e> it's really "until" now
16:49:20 <kuribas> true
16:49:24 <int-e> IIRC there's a hackage package provding stuff like that
16:49:35 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
16:49:35 <EvanR> jeez, it seems like there's a simple piece of code struggling to get out. But it might not fit on a line, which is honestly fine
16:50:14 <blomberg> using recursion is much simpler
16:50:32 <EvanR> the higher order functions are great only if they do exactly what you want and don't need any shoehorning
16:51:06 <kuribas> EvanR: that's why you combine them?
16:52:00 <kuribas> but yeah, sometimes a custom recursive function is easier
16:53:03 <int-e> @hoogle while
16:53:03 <lambdabot> Sound.Tidal.UI while :: Pattern Bool -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
16:53:03 <lambdabot> Development.NSIS while :: Exp Bool -> Action () -> Action ()
16:53:03 <lambdabot> Language.C.Syntax While :: Exp -> Stm -> SrcLoc -> Stm
16:53:13 <int-e> nah
16:53:46 <int-e> (but yes to explicit recursion often being the clearest way to write code)
16:54:14 <blomberg> if haskell doesn't care about simple computations then how will we even use it but surprisingly it has list comprehenstions which are iterations
16:54:15 <EvanR> so you want to write a while loop. First let me introduce you to some category theory xD
16:54:26 <blomberg> EvanR:NO
16:54:35 <EvanR> this has been a meme
16:54:59 <int-e> http://pages.cpsc.ucalgary.ca/~robin/class/449/Evolution.htm
16:55:32 <blomberg> so in reality how would you even use haskell to do real stuff
16:55:39 <int-e> (hmm is there a version of this with properly declared encoding...)
16:56:05 <dolio> I don't understand the problem here. If you can do what you want with recursion, then you can do it in Haskell.
16:56:20 <int-e> ah, this one seems to work: http://www.willamette.edu/~fruehr/haskell/evolution.html
16:56:25 <int-e> @where evolution
16:56:25 <lambdabot> http://www.willamette.edu/~fruehr/haskell/evolution.html
16:56:39 <int-e> ...why did I think of that last
16:57:25 <int-e> @botsnack
16:57:25 <lambdabot> :)
16:57:33 <dolio> The iterate version doesn't really look that bad to me either, though.
16:57:39 Maeda joins (~Maeda@91-161-10-149.subs.proxad.net)
16:58:18 <EvanR> blomberg, if you define real stuff to mean "imperative programming" well we have that too. do notation. But you still need to understand recursion to get iteration
16:58:37 <int-e> it's nicely compositional, it often matches how I think of what I want to do: "generate elements by iterating a function... until a certain criterion matches"
16:58:50 <EvanR> that being said it's nice when real world doesn't require imperative programming
16:59:08 <int-e> so "iterate" does the generation part and "takeWhile" or "dropWhile" checks the criterion.
16:59:44 <dolio> I pretty much never find myself wanting functions like `while` above, if that's what's meant, because they just aren't significantly better than writing recursion.
16:59:57 <EvanR> it's enlightening to go back and think about all your real world problems and consider where imperative was the best way
17:00:16 <EvanR> or if it was just the only way you knew about at the time
17:00:21 <dolio> And usually I want to do stuff like pattern guards in my custom function, which are really awkward to use in a function like `while`.
17:00:52 <int-e> EvanR: ...array manipulation.
17:00:56 <dolio> Or, you wouldn't use them. You'd do something really awkward instead.
17:01:05 <EvanR> probably
17:01:09 <kuribas> I actually find my haskell code more "real", as in, it focusses on the solution, rather that on the low level implementation.
17:02:48 × sadmax quits (~user@209.205.174.253) (Remote host closed the connection)
17:04:02 <dolio> `while x (isJust . f) (g . fromJust . f)` or whatever.
17:04:22 × machinedgod quits (~machinedg@clnet-p10-126.ikbnet.co.at) (Ping timeout: 252 seconds)
17:04:23 <dsal> I tried doing `real` work in haskell last night, but then found that `real` was actually a postgres alias to float4 and I was using a `Double` which encoded differently in hasql and my tests were failing. So now I'm doing `float8` work instead.
17:04:58 <EvanR> 🥁
17:06:27 <dsal> Oh, this codebase does have a `whileM_` in it.
17:06:42 <kuribas> dsal: that's why database libraries should have strict conversion for types.
17:06:58 <kuribas> dsal: my hasqlator library has it.
17:07:38 <dsal> I wrote a ton of code in go for a while. The only loop it's got is `for` so you do that for everything and have to spend a while trying to figure out what the person is trying to accomplish. Haskell simultaneously has no loops and a large number of loops (nearly infinite loops), but what you're doing is always clear.
17:08:25 <dsal> kuribas: It was a new and exciting kind of failure for me. My first attempt at hasql, but I at least had good tests. Surprisingly bad failure modes, though. And yeah, would be nice if that weren't possible.
17:08:44 <dsal> As a hasql user, would you happen to know how to run a query and dynamically interpret the results?
17:08:56 <blomberg> what is hasql just writee haskell or hs
17:09:05 <dsal> It's a library for talking to postgres
17:09:09 <EvanR> blomberg, I think a good starting paradigm shift is to think about your real task as computing data from some other data. What data do you have, and what data to you need to output. Then use higher level transformations to bridge the gap. Many times you won't need explicit loops for this
17:09:51 <EvanR> even in more common languages like ruby, python
17:10:16 <dsal> ^ yeah. many of the for loops I read were either fmap or a fold, but they couldn't express that, so they'd do a bunch of junk in the middle of a for loop.
17:10:40 <kuribas> dsal: I don't know hasql
17:11:03 <dsal> It's nice saying "I know how to make an `a` into a `b`" and then realizing that means you can also make an IO action that maybe produces an `a` into maybe a `b` by using the same thing you've already tested.
17:11:21 × mikoto-chan quits (~mikoto-ch@164.5.249.78) (Ping timeout: 268 seconds)
17:11:31 <dsal> kuribas: Oh, I see. I thought that was related to hasql.
17:11:57 × ec_ quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
17:11:59 × vn36 quits (~vn36@123.63.203.210) (Ping timeout: 260 seconds)
17:12:17 <EvanR> at least those languages do have map and foldl (reduce)
17:12:49 ec_ joins (~ec@gateway/tor-sasl/ec)
17:13:02 <kuribas> EvanR: but reduce is discouraged in python
17:13:03 <dsal> I thought python really wanted to get rid of that stuff.
17:13:08 <EvanR> unsurprised
17:13:25 <kuribas> because "there should be only one way to do things"
17:13:52 ph88 joins (~ph88@ip5f5af71f.dynamic.kabel-deutschland.de)
17:14:28 × ph88 quits (~ph88@ip5f5af71f.dynamic.kabel-deutschland.de) (Client Quit)
17:14:43 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
17:14:44 × kuribas quits (~user@ptr-17d51enh7x68c2qjbwe.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 27.1))
17:15:22 <EvanR> "that you (the tioowtdi police) know of!"
17:15:55 nilradical joins (~nilradica@user/naso)
17:16:07 × nilradical quits (~nilradica@user/naso) (Remote host closed the connection)
17:16:50 <EvanR> I have noticed when recently going back to web tech languages there is a big push for uniformity of style in the code, like alarms go off if you do something considered unidiomatic
17:17:01 <EvanR> does haskell have that
17:18:11 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds)
17:18:48 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
17:18:54 <dsal> I've worked in a codebase that really tried to push some bizarre concepts in a similar way. That worked quite poorly.
17:19:00 <EvanR> maybe a zillion dollar signs in a row is discouraged in haskell xD
17:19:29 <dsal> I now work in a pretty large codebase that tries to push you in a direction, but won't get too upset if you go the other way (particularly if you don't force others to do your thing by making it part of your API).
17:19:46 <dsal> Personally, I like naming my functions a number of dollar signs. So much easier than naming.
17:20:21 <darkling> No, it's cat emojis all the way here.
17:21:37 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
17:21:58 <dsal> The new hotness in haskell is to use `.` for everything. It's very versatile and since it's so tiny, it hardly takes up any space.
17:22:11 <EvanR> when the OS on atari ST crashed it displayed a number of bombs instead of a textual error message, brilliant. The number of bombs was the indicator
17:22:11 <darkling> Saves on RAM. :)
17:23:25 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
17:24:50 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
17:25:03 <EvanR> by . do you mean function composition, fmap, or Category
17:25:15 <dsal> OverloadedRecordDot
17:25:32 <EvanR> is that seriously the new hotness?
17:25:43 <dsal> Which is kind of like lens composition, but less useful and differently magical.
17:25:47 <dsal> People at work seem to like it a lot.
17:27:12 <dsal> It helps a lot, specifically, with some of the giant names generated by persistent table mapping stuff. It's kind of like OverloadedLabels, but with half a lens. And it uses `.`
17:29:10 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
17:29:43 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
17:29:48 <dsal> (but I still think it's gross and would rather just use lens)
17:31:39 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
17:36:01 × elevenkb quits (~elevenkb@105.184.125.168) (Ping timeout: 268 seconds)
17:37:14 jakalx joins (~jakalx@base.jakalx.net)
17:37:29 × razetime quits (~quassel@117.193.3.56) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
17:40:22 bgs joins (~bgs@212-85-160-171.dynamic.telemach.net)
17:41:17 × teo quits (~teo@user/teo) (Ping timeout: 252 seconds)
17:41:22 <blomberg> dsal: why you think python is getting rid of reduce(foldl)
17:43:04 <dsal> I've not really followed python much. It's not something I look at for examples of good decision making in general, though.
17:43:29 <blomberg> `while x (isJust . f) (g . fromJust . f)` wat is this saying
17:44:11 <c_wraith> it's saying that loop really should have been written differently
17:44:56 <dsal> "while" is particularly confusing when everything's immutable because when is `x` changing?
17:45:09 <c_wraith> also, note that `while' isn't a standard library thing, so figure out where it's coming from first
17:45:43 <blomberg> c_wraith: differently?
17:46:17 <EvanR> while is a function someone defined somewhere
17:46:24 <EvanR> presumably
17:46:42 <dsal> It's unclear what "while" means in a general sense. What are you trying to accomplish? Is the concept of "while" the best way?
17:46:48 <c_wraith> blomberg: it applies f twice each pass through, and it exhibits a case of boolean blindness by depending on a predicate passing before using an unsafe function
17:47:11 <c_wraith> dsal: that's not a helpful discussion when exactly what that function does is pretty clear from context
17:47:22 <ski> @let let while init test step | test init = init | otherwise = while (step init) test step -- definition given by kuribas above
17:47:22 <lambdabot> Parse failed: Parse error: EOF
17:47:29 <ski> @let while init test step | test init = init | otherwise = while (step init) test step -- definition given by kuribas above
17:47:31 <lambdabot> Defined.
17:48:04 <yushyin> blomberg: guido really really dislikes functional programming apis. it had come up again and again in the past that he would want to remove it from python if he had the chance.
17:48:51 <ski> blomberg : so, first argument, `x' is initial value of the state that it's iterating over. `isJust . f' is checking when to terminate, and `g . fromJust . f' tells how to update the state, otherwise (and then loop back again to testing)
17:48:57 <EvanR> https://paste.tomsmeding.com/PYwPiyTy that while function on 3 lines for readability
17:50:00 <int-e> :t init
17:50:01 <lambdabot> [a] -> [a]
17:50:08 <ski> in `while 3 (> 10^9) (\i -> 2*i^3 + 4)', it starts at `3', has `(> 10^9)' as termination condition, and updates with `\i -> 2*i^3 + 4'
17:50:26 <dsal> c_wraith: I didn't see the definition above, but I still think it's a valid question. If you want to use something called "while" because that's how you'd write a particular bit of code in C, then that's a different answer from "I wish to interact with an API repeatedly until the response meets some criteria."
17:50:34 <ski> @type until
17:50:36 <lambdabot> (a -> Bool) -> (a -> a) -> a -> a
17:50:38 <ski> @src until
17:50:38 <lambdabot> until p f x | p x = x
17:50:38 <lambdabot> | otherwise = until p f (f x)
17:50:56 × CiaoSen quits (~Jura@p200300c9571247002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
17:51:24 <ski> is a standard looping function, of a similar ilk. using a slightly different argument ordering
17:51:27 <c_wraith> dsal: but it's a totally natural thing to name such a function if you ignore the meaning of while loops in other languages
17:51:46 <EvanR> ah, until is a Prelude function and does the same thing
17:51:55 × MajorBiscuit quits (~MajorBisc@c-001-030-015.client.tudelft.eduvpn.nl) (Ping timeout: 252 seconds)
17:51:58 <blomberg> @src while
17:51:58 <lambdabot> Source not found. I've seen penguins that can type better than that.
17:52:07 <EvanR> oh harsh
17:52:15 <ski> `while' was defined by kuribas above, on the fly
17:52:44 <dolio> The predefined one (which I think people rarely use) is until.
17:52:50 <ski> yes
17:53:06 <c_wraith> that is a weird definition. It returns the first succeeding element?
17:53:27 <EvanR> of an iteration
17:53:31 <dsal> c_wraith: I don't know if "natural" is the right word. I don't think I would've considered it, but I have mental contamination.
17:54:31 <c_wraith> returning the first succeeding doesn't line up with the quoted use. The quoted use only makes sense if you return the last succeeding element
17:54:36 econo joins (uid147250@user/econo)
17:54:37 <EvanR> jokerOnTop shuffle standardDeck
17:54:49 <c_wraith> Or rather, the element before the first failing element
17:54:50 <EvanR> er
17:54:54 <EvanR> until jokerOnTop shuffle standardDeck
17:55:20 <EvanR> what's "last" ?
17:55:30 <c_wraith> see the correction
17:55:49 <EvanR> oh
17:55:58 <EvanR> also would be interesting to have
17:56:46 emmanuelux joins (~emmanuelu@user/emmanuelux)
17:58:10 <dsal> So both are just uses of `iterate` where `until` returns the first iteration that meets the predicate. What does while return? `Maybe a` for the last one before it stopped satisfying the predicate?
17:59:42 <ski> blomberg : as for the `isJust' and `fromJust' stuff .. apparently in `while x (isJust . f) (g . fromJust . f)', `f' is an operation on the state which can fail (in the sense of possibly giving `Nothing' as result). state update/step extracts the non-`Nothing' result (with `fromJust'), and then uses `g' to further transform to the next iteration state. however, if `f' gave nothing, we instead (presumably)
17:59:42 <dsal> > until (== 5) succ 0
17:59:44 <lambdabot> 5
17:59:48 <ski> want to terminate with that state (since we cant' move further). however, this means that, with the above definition of `while', there should be an extra negation in the termination test (alternatively it should be using `isNothing')
17:59:49 <dsal> > while 0 (== 5) succ
17:59:51 <lambdabot> 5
18:00:45 <ski> anyway, `while x (isNothing . f) (g . fromJust . f)' is somewhat annoying, because you're recomputing `f' each time .. so it'd be better to write a looping abstraction directly for such a loop with a "middle of the loop exit condition"
18:01:42 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
18:02:18 <blomberg> i=1;i=i+2 in hs will throw error , so if hs has a loop it for while it should give error?
18:02:50 <ski> (arguably kuribas' `while' from above ought to have negated its termination test anyway, since it sounds like it'll continue loop while the test gives `True', but actually it was defined to do the opposite .. which explains why the above `while' example was out of whack ..)
18:03:26 <ski> @type \f g x -> while x (isNothing . f) (g . fromJust . f) -- the type of this alternative looping abstraction
18:03:27 <lambdabot> (a -> Maybe b) -> (b -> a) -> a -> a
18:04:55 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:05:10 stiell joins (~stiell@gateway/tor-sasl/stiell)
18:05:11 <EvanR> > i=1;i=i+2
18:05:12 <lambdabot> <hint>:1:2: error: parse error on input ‘=’
18:05:24 <EvanR> error confirmed
18:05:47 <dsal> blomberg: It doesn't have C's for loop. `i` cannot equal both a number and that number plus 2. Whatever you're trying to accomplish can't be done exactly that way.
18:05:51 <EvanR> it doesn't look like valid haskell
18:06:01 <ski> @let whileDo test step init = case test init of Nothing -> init ; Just mid -> whileDo test step (step mid)
18:06:02 <lambdabot> Defined.
18:06:07 <ski> @type whileDo
18:06:07 <lambdabot> (t1 -> Maybe t2) -> (t2 -> t1) -> t1 -> t1
18:06:45 <ski> (or maybe it could be called `whileJust')
18:06:51 <EvanR> dsal, i = ⊥ solves the equations right xD
18:07:02 <dolio> Yeah.
18:07:09 wootehfoot joins (~wootehfoo@user/wootehfoot)
18:07:18 <ski> @hoogle whileJust
18:07:18 <lambdabot> Control.Monad.Loops whileJust :: Monad m => m (Maybe a) -> (a -> m b) -> m [b]
18:07:18 <lambdabot> Util whileJust :: (Alternative f, Monad m) => m (Maybe a) -> (a -> m b) -> m (f b)
18:07:18 <lambdabot> Control.Monad.Extra whileJustM :: (Monad m, Monoid a) => m (Maybe a) -> m a
18:07:29 <ski> hm, those look like something else
18:09:13 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
18:09:26 <blomberg> ok stop not more of this
18:10:03 <ski> `i = i+2' already is a loop (an infinite loop)
18:10:06 <dsal> blomberg: What are you actually trying to do? The names are causing a lot of confusion, IMO.
18:10:06 stiell joins (~stiell@gateway/tor-sasl/stiell)
18:10:14 <ski> > let i = i + 2 in i
18:10:16 <lambdabot> *Exception: <<loop>>
18:10:25 <blomberg> i can't stand haskell code just learnt haskell yesterday
18:10:26 <dsal> loops are the exception to that rule
18:10:51 <ski> it'll probably grow on you, if you give it time
18:10:59 <dsal> I've been learning haskell for years. :)
18:11:24 <blomberg> dsal:really? exception?
18:12:14 <dsal> blomberg: In that example, ski was trying to define `i` as `i + 2` which means that in order to know what `i` equals, you have to evaluate `i` which is whatever `i` is plus 2. It infinitely recurses (which the runtime recognizes and complains about)
18:12:14 <EvanR> haskell is very different. But my previous language was PHP4 so it was simple by comparison xD
18:12:49 <dsal> Haskell seems pretty simple relative to other languages I've used. It's got a few parts that are a little complicated like… exceptions.
18:13:28 <ski> `=' works like in mathematics, not like in Fortran or C. `i = i + 2' doesn't here mean "update `i' to henceforth refer to two more than what it previously referred to". it means `i' already *is* two more than itself .. so `i' is kinda infinite already
18:14:11 <dsal> Sometimes, that's actually what you want. Like in cycle.
18:14:20 <ski> > let ones = 1 : ones in ones -- an infinite list of ones
18:14:22 <lambdabot> [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1...
18:15:26 <blomberg> ok so i = i+2 is like func x = .... thx i didn't knew assignments were functions!
18:15:28 <ski> > let primes = sieve [2 ..] where sieve (p:ns) = p : sieve [n | n <- ns,n `mod` p /= 0] in primes -- an infinite list of all (positive) prime numbers
18:15:30 <lambdabot> [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,...
18:15:44 <dsal> blomberg: Assignments aren't functions, they're just definitions.
18:16:07 <dsal> You're defining i to be a number plus 2. What number? i. What's i? a number plus two…
18:16:18 <ski> `=' is not assignment (as in "update to new value"), in Haskell. it is definition (you could say "single assignment" or "initialization", if you want to. there is no change/update of variables, they are immutable)
18:16:24 <blomberg> dsal: f x =... that's a function definition just like f = ... without args
18:17:01 <blomberg> fact n = n*fact n-1
18:17:12 <EvanR> it's not even an assignment. It's a defining equation
18:17:12 × EvanR quits (~EvanR@user/evanr) (Remote host closed the connection)
18:17:22 <sm> is there anything for calling rust from haskell or vice versa, newer than https://www.reddit.com/r/rust/comments/3ms7gm/combining_rust_and_haskell ?
18:17:23 <dsal> Yes, that's calling a function. Just like `i = i + 2` is calling a function in its definition.
18:17:26 <blomberg> it's a function assignments are functions in haskell
18:17:31 EvanR joins (~EvanR@user/evanr)
18:17:39 <ski> > let fibonaccis = 0 : 1 : [m + n | m <- fibonaccis | n <- tail fibonaccis] in fibonaccis -- the infinite list of all fibonacci numbers (starting from `0')
18:17:40 <lambdabot> [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,...
18:17:44 <dsal> Functions all have one argument and one result. `i` doesn't have an argument.
18:17:54 <blomberg> because the compiler won't know which syntax is function and which is an assignment
18:18:29 <dsal> Not everything you name is a function. That's a weird way of thinking about things.
18:18:42 <EvanR> what makes you think there's a function involved there
18:18:44 <blomberg> dsal: in haskell we can have a constant function that just returns some other variable
18:19:06 <dsal> In haskell, every function takes one argument and returns one value.
18:19:14 <EvanR> a constant function: \_ -> 3
18:19:20 <dsal> If you're getting a value out without providing an argument, that's not a function.
18:19:51 <ski> `ones' and `fibonaccis' are examples where (slightly more complicated) "cyclic" definitions akin to `i = i + 2' actually work. `primes' uses the function `sieve', which is also recursive (cyclic) .. but that kind of cyclicness shouldn't be quite as novel (although it does generate its infinite result incrementally (just as `ones',`fibonaccis' does), somewhat akin to "generators"/"iterators" in other
18:19:57 <ski> languages)
18:20:17 <dsal> You're confusing "that calls a function" with "That is a function." You can call functions while naming things, but that doesn't make those things you named functions.
18:20:36 <dsal> `i = 1 + 2` calls a function while naming `i` but it doesn't make `i` a function.
18:20:36 <ski> (well, `ones = 1 : ones' isn't really much more complicated than `i = i + 2' .. the difference is that `ones' (and `fibonacci's) *work*, while `i = i + 2' doesn't)
18:21:18 dsal is being sloppy with "call" here
18:21:51 × chele quits (~chele@user/chele) (Quit: Leaving)
18:22:13 <ski> (`+' is a function, written as an infix operator)
18:22:27 <ski> > (+) 2 3 -- calling it prefix, like any other function
18:22:28 <lambdabot> 5
18:22:55 × beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 260 seconds)
18:23:39 <ski> > cycle [0,1,3]
18:23:42 <lambdabot> [0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1,3,0,1...
18:23:46 <ski> cycle xs = ys
18:23:51 <ski> where
18:23:52 <ski> ys = xs ++ ys
18:24:26 <ski> (defines a cyclic (infinite) list that loops around the elements of the input list, repeatedly)
18:24:37 <blomberg> map (<2) list ; (<2) is a strange argument as it's not a data type, don't write too much code though not more of hs code please i can't stand it
18:24:59 <ski> `(< 2)' is just the "is less than two ?" function
18:25:26 <ski> > map (< 2) [0,1,2,3,4,5,6,7]
18:25:28 <lambdabot> [True,True,False,False,False,False,False,False]
18:25:42 <blomberg> ok but if it's anonymouse function \_-> (< 2)
18:25:52 <EvanR> \x -> x < 2
18:25:56 <c_wraith> it's already an anonymous function
18:26:04 <ski> it's the same as what EvanR just said, yea
18:26:05 AlexNoo_ joins (~AlexNoo@178.34.160.122)
18:26:19 <c_wraith> you don't need to eta expand everything
18:27:34 <ski> (if you don't want to see more Haskell code for the moment, then perhaps you could take a break. go fetch a coffee, or your choice of brewery .. or take a walk, read a book, or whatever you fancy)
18:27:36 <c_wraith> also, mapping (< 2) over a list is a weird thing in and of itself. Whatever code base you're looking at *loves* boolean blindness
18:27:37 <blomberg> what i mean is lamda syntax is the only thing i have know for nameless function this is new to me
18:28:01 <ski> (if you stay and discuss in #haskell, chances are it's likely you'll see some more Haskell code)
18:28:15 <dsal> I guess any partially applied function might be considered lambdas.
18:28:31 × Alex_test quits (~al_test@178.34.163.65) (Ping timeout: 252 seconds)
18:28:31 × AlexZenon quits (~alzenon@178.34.163.65) (Ping timeout: 252 seconds)
18:28:37 <blomberg> < 2 can't be function is this unique syntax to haskell i guess
18:28:51 <blomberg> i have never seen this type of syntax before
18:28:52 <c_wraith> No, (< 2) is a function
18:28:57 <c_wraith> the parentheses are required
18:29:03 <dsal> :t (< 2)
18:29:04 <lambdabot> (Ord a, Num a) => a -> Bool
18:29:05 <c_wraith> It's called a "section"
18:29:05 <ski> yea, lambda abstractions are "anonymous functions". but you can have an "anonymous function", witbout writing a lambda abstraction, e.g. if you call a function which gives another function as result .. which is actually what the `(< 2)' example did
18:29:38 <ski> @let makeAdder x = \y -> x + y
18:29:40 <lambdabot> Defined.
18:29:55 × AlexNoo quits (~AlexNoo@178.34.163.65) (Ping timeout: 260 seconds)
18:29:59 <ski> here `makeAdder 2' is an "anonymous function" (equivalent to `\y -> 2 + y')
18:30:16 <ski> but `makeAdder 2' itself is not a lambda abstraction (it's just defined to be equal to one)
18:30:32 <ski> > map (makeAdder 2) [2,3,5,7]
18:30:34 <lambdabot> [4,5,7,9]
18:31:31 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds)
18:31:44 <ski> if we wanted to, we could name the anonymous function `makeAdder 2', but calling it e.g. `addTwo' (so then that's not anonymous anymore, it has a (direct) name
18:31:51 <ski> @let addTwo = makeAdder 2
18:31:52 <lambdabot> Defined.
18:31:58 <ski> > map addTwo [2,3,5,7]
18:32:00 <lambdabot> [4,5,7,9]
18:32:07 beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt)
18:33:57 <ski> a "section" is when you supply an infix operator, like `<' or `+' or whatever, with one operand, but not the other. it will give you back a function that expects the other one as input (and then computes the original operator used with those two operands)
18:34:02 <EvanR> blomberg, other examples of sections (+ 2), (>> getChar), (:[2,3,4]), (1.0 /)
18:34:06 × Volt_ quits (~Volt_@c-73-167-118-200.hsd1.ma.comcast.net) (Quit: )
18:34:29 <dsal> > map (^2) [1..5]
18:34:31 <lambdabot> [1,4,9,16,25]
18:34:32 <dsal> > map (2^) [1..5]
18:34:34 <lambdabot> [2,4,8,16,32]
18:34:43 <ski> so `(< 2)' is `\x -> x < 2' the "less than two ?" function, while `(2 <)' is `\y -> 2 < y', the "greater than two ?" function
18:34:53 <dsal> You can pick which end of the operator is missing.
18:35:13 × bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
18:35:14 <ski> `(^2)' is the squaring function. `(2^)' is the "power of two" function
18:35:22 <EvanR> > map (1.0 /) [1..]
18:35:24 <lambdabot> [1.0,0.5,0.3333333333333333,0.25,0.2,0.16666666666666666,0.14285714285714285...
18:35:26 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
18:35:45 × fserucas quits (~fserucas@2001:8a0:6d00:2500:4717:7619:c4e9:3aa2) (Quit: Leaving)
18:35:51 <ski> `(1.0 /)' is the "one divided by" function. also called `recip' (short for "reciprocal")
18:36:34 × beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 260 seconds)
18:36:47 nate4 joins (~nate@98.45.169.16)
18:36:51 <ski> (`map' calls a given argument function (callback) on each of the elements of the input list, giving back as output a list of all the individual results)
18:37:34 <dsal> Naming things is hard. "square" and "cube" and "fourthify" are more painful to read than (^2) and (^3) and (^4)
18:38:04 <ski> > [n ^ 2 | n <- [1 .. 5]] -- another way to write that list of squares, using "list comprehension" syntax instead of calling the `map' (higher-order) function. read as : "the list of all `n ^ 2's, where `n' is drawn from the list `[1 .. 5]'
18:38:05 <lambdabot> [1,4,9,16,25]
18:39:06 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
18:40:38 Alex_test joins (~al_test@178.34.160.122)
18:41:48 AlexZenon joins (~alzenon@178.34.160.122)
18:42:00 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds)
18:42:16 <ski> (.. possibly "bisquare" ? "biquadratic" is sometimes used for degree four polynomials, equations, and forms, in math. also "quartic" is used)
18:44:50 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
18:44:57 <EvanR> and sometimes 8th power is called Zenzizenzizenzic
18:45:13 <EvanR> just kidding
18:45:28 stiell joins (~stiell@gateway/tor-sasl/stiell)
18:45:30 <ski> blomberg : anyway, if you just want to quickly pass a simple function as an argument, often naming the input to that argument is basically just syntactic noise (and perhaps also a minor headache to come up with an appripriate name for the intermediate value passed to it). there, "anonymous functions" can nicely help side-step the issue, by passing an operator section, or a partially applied function (a
18:45:36 <ski> function which has another function as result, when called. such a function is said to use "currying" or be "curried"), rather than explicitly passing a lambda abstraction ..
18:46:00 <ski> .. or worse, (also) naming the function that' you're passing (in addition to naming its argument)
18:46:16 <ski> > let square x = x ^ 2 in map square [0 .. 9]
18:46:17 <lambdabot> [0,1,4,9,16,25,36,49,64,81]
18:46:22 <ski> > let square = \x -> x ^ 2 in map square [0 .. 9]
18:46:24 <lambdabot> [0,1,4,9,16,25,36,49,64,81]
18:46:31 ft joins (~ft@p508dbd59.dip0.t-ipconnect.de)
18:46:36 <ski> > map (\x -> x ^ 2) [0 .. 9]
18:46:37 <lambdabot> [0,1,4,9,16,25,36,49,64,81]
18:46:40 <ski> > map (^ 2) [0 .. 9]
18:46:41 <lambdabot> [0,1,4,9,16,25,36,49,64,81]
18:47:03 <ski> these are all equivalent pieces of code .. but readability and style differs
18:47:34 <ski> *sometimes* you do want to name the input argument, and possibly the function itself (it helps document the code). but sometimes, it's just a nuisance
18:49:47 <ski> (people don't put naming labels on all their loops, in languages like e.g. Java which allow you to label your (`for',`while',`do'-`while') loops (to be able to `break' out from and `continue' with the non-innermost loop) .. similarly, in Haskell, people don't name their loop bodies (being functions) all the time)
18:51:11 <ski> > map (map (^ 2)) [[],[0],[1,2],[3,4,5],[6,7,8,9]] -- partial application of a function (`map'), defined in curried style, in action
18:51:13 <lambdabot> [[],[0],[1,4],[9,16,25],[36,49,64,81]]
18:51:43 <ski> > map (\xs -> map (^ 2) xs) [[],[0],[1,2],[3,4,5],[6,7,8,9]] -- non-partial ("full") application of `map'
18:51:44 <lambdabot> [[],[0],[1,4],[9,16,25],[36,49,64,81]]
18:51:54 <ski> which of these two would you prefer to read ?
18:52:14 <EvanR> so many numbers, maybe some string oriented examples are in order
18:52:33 <ski> after a while, with some familiarity with the language, people commonly (not always, though), prefer the former way, not naming each individual list `xs'
18:53:10 <ski> > (unwords . map reverse . words) "You wanted words?"
18:53:12 <lambdabot> "uoY detnaw ?sdrow"
18:55:47 <ski> `.' is function composition. input comes in from the right, passes through each function in the composition chain, on to the next one, final result pops out at the left. this is like Unix pipes (like `sort | uniq | rev | head -n 10'), except using reverse ordering
18:57:10 <ski> (that Unix example would correspond more or less to `take 10 . map reverse . nub . sort' .. possibly with `unlines . ' added at the front, and `. lines' added at the end, if you wanted the overall composition to transform a stream of characters to a stream of characters, rather than a stream of lines to a stream of lines)
18:58:35 <blomberg> kk
18:58:36 <ski> (`(f . g . h) x' does the same as `f (g (h x)))')
18:59:23 <ski> anything else you're wondering about, are concerned about, worry about, or annoyed about, blomberg ?
18:59:36 <blomberg> kk
18:59:56 <ski> > words "Split this string into words, please"
18:59:58 <lambdabot> ["Split","this","string","into","words,","please"]
19:00:15 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
19:00:28 × thyriaen quits (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) (Quit: Leaving)
19:00:31 <blomberg> no i am interested in haskell
19:00:50 <blomberg> i came here for recursion only
19:00:56 <ski> > lines "Or\ninto\nlines\n"
19:00:58 <lambdabot> ["Or","into","lines"]
19:00:58 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
19:01:22 <ski> > (map words . lines) "Or both\ninto\nwords and lines\n"
19:01:24 <lambdabot> [["Or","both"],["into"],["words","and","lines"]]
19:02:51 <ski> > sortBy (comparing length <> length) (words "The quick brown fox jumps over the lazy dog") -- sort the words in a list, primarily on word length, secondarily (within each group of words of the same length) using the usual (lexicographic) ordering
19:02:52 <lambdabot> error:
19:02:52 <lambdabot> • Couldn't match type ‘Int’ with ‘[Char] -> Ordering’
19:02:52 <lambdabot> Expected type: [Char] -> [Char] -> Ordering
19:02:58 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61) (Remote host closed the connection)
19:03:00 <ski> er
19:03:04 <ski> > sortBy (comparing length <> compare) (words "The quick brown fox jumps over the lazy dog") -- sort the words in a list, primarily on word length, secondarily (within each group of words of the same length) using the usual (lexicographic) ordering
19:03:06 <lambdabot> ["The","dog","fox","the","lazy","over","brown","jumps","quick"]
19:03:08 <ski> (sorry)
19:03:16 <blomberg> hey stop this scrolling of crap
19:03:48 <blomberg> use a /query lambdabot like me, this a chat channel
19:04:22 <ski> hey sure, i could stop. i just wanted to show *you* (and perhaps other interested lurkers) a few examples of the concepts that came up into the conversation
19:04:45 <blomberg> there is no one here except me
19:04:53 <EvanR> nobody here but us chickens
19:04:54 <ski> there are often lurkers in here
19:04:55 <blomberg> i doubt entire day anyone was here at all
19:04:57 <chreekat> 👀
19:05:08 mikoto-chan joins (~mikoto-ch@85-76-19-119-nat.elisa-mobile.fi)
19:05:09 <blomberg> i am not talking about shadows ski
19:05:36 <EvanR> you said you were interested in haskell
19:05:43 <EvanR> ski loves that stuff
19:05:45 <blomberg> i never said that
19:05:53 <EvanR> you did, 6 minutes ago
19:05:55 rodental joins (~rodental@38.146.5.222)
19:05:58 <ski> i've often seen people say they've learned a lot by lurking and listening in here, seeing what's going on, and if it's something which they can understand at the time (in case it's something they're interested in)
19:07:06 <blomberg> do you understand julia and it's crazy array syntax i think julia is crappy given it's complexity
19:07:21 <EvanR> I like julia
19:07:48 <blomberg> there are 3 ways to declare an array and it's docs too are unclear on how it all works i can't imagine multidimensional arrays and it's docs doesn't say a shit
19:08:06 <ski> EvanR : well, it's true, i do :)
19:08:10 <blomberg> EvanR: do you know it's complex indexing system
19:08:18 <EvanR> yes
19:08:31 <EvanR> maybe you should look at haskell Vector instead xD
19:09:36 <blomberg> a[2,3,4,2] how to visual multidimensionality using lists python it's very clear
19:09:47 nate4 joins (~nate@98.45.169.16)
19:10:46 <blomberg> even there docs are terrible
19:10:52 <EvanR> a good reason to define higher order operations on matrices and don't worry about the indexes xD
19:11:10 <blomberg> https://docs.julialang.org/en/v1/manual/arrays/
19:11:22 <EvanR> er higher level
19:11:29 × mikoto-chan quits (~mikoto-ch@85-76-19-119-nat.elisa-mobile.fi) (Quit: WeeChat 3.6)
19:11:30 <EvanR> matrix multiplication, transpose
19:11:31 <geekosaur> not sure Haskell Array is much better; Vector exists for a reason
19:11:53 <blomberg> no i am talking about nested listed it's easier to visual not matrices
19:12:15 <EvanR> a matrix is simply a list of rows (or a list of columns depending on your mood)
19:12:18 <blomberg> a[2,3,4,2] is a general list not a matrix you don't understand arrays then
19:12:32 <geekosaur> visualize for what? some operations really want a matrix
19:13:21 <blomberg> non-homogenous non-same row / column like in pythonic lists first can be [1] then [1,2] no row vs column crap
19:13:30 <EvanR> not understanding arrays makes me think there is some "what are arrays really" quote somewhere
19:14:14 <EvanR> @quote arrays
19:14:14 <lambdabot> gwern says: Haskell has the best arrays around; problem is, we don't know which module it is.
19:14:50 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds)
19:15:01 <blomberg> i am talking about non-homegenous lists and that too [ [a], [b,c], [d,e,f] ] so there is no row or column at all but a general list
19:15:39 <EvanR> a list of lists can work
19:15:52 chromoblob joins (~user@37.113.164.122)
19:15:58 <blomberg> problem is julia is very murky in it's docs and doesn't say what's the syntax to access let's say d
19:16:18 <geekosaur> apparently engineers and scientists don't exist
19:16:34 mikoto-chan joins (~mikoto-ch@85-76-19-119-nat.elisa-mobile.fi)
19:16:44 <blomberg> but with space or , or ; [a b c] vs [a,c,b] there are two main syntaxes
19:17:24 <blomberg> in terms of accessing those elements the docs are just terrible read it if you dont believe me https://docs.julialang.org/en/v1/manual/arrays/
19:17:36 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
19:17:44 <blomberg> it's just talking about matrices or homogenous arrays not lists
19:17:48 <EvanR> you can comprehend that "jagged" list of lists as a form of matrix if you wanted, to be clear
19:17:53 <dsal> What's the link to Haskell WRT Julia arrays?
19:18:06 dsal has never used julia
19:18:28 <dolio> Yeah, what does this all have to do with Haskell?
19:19:22 <dsal> I like Haskell arrays, but they're a little weird.
19:20:40 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 260 seconds)
19:22:05 ph88 joins (~ph88@ip5f5af71f.dynamic.kabel-deutschland.de)
19:22:23 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
19:22:24 <blomberg> The ordinary way to index into an N-dimensional array is to use exactly N indices; each index selects the position(s) in its particular dimension. For example, in the three-dimensional array A = rand(4, 3, 2), A[2, 3, 1] will select the number in the second row of the third column in the first "page" of the array. This is often referred to as cartesian indexing.
19:22:53 <blomberg> now i mean a= ...what... to get that dimensionality and comma or space syntax
19:23:02 <EvanR> haha, nice. Pages
19:23:06 <blomberg> so that i can visualize it
19:23:34 <EvanR> the 4th number would go deeper into the 4th dimension like a hypercube
19:24:15 <dsal> In haskell, we have an abstraction that allows you to use arbitrary types for indexing your arrays. They can be an arbitrary range of numbers (want two-based indexes? have at it) or just a collection of things (e.g., the Blue row of column 9 (the first column).
19:24:17 <dsal> )
19:24:24 <blomberg> no no i mean list= [ [2,3], [a,b,c], [d,e,f] ] like in python
19:24:47 AlexNoo_ is now known as AlexNoo
19:24:54 <blomberg> code visualisation not space visualization
19:24:55 <EvanR> you'll need to ask in another channel for julia help probably
19:25:04 × mikoto-chan quits (~mikoto-ch@85-76-19-119-nat.elisa-mobile.fi) (Read error: Connection reset by peer)
19:25:11 <dsal> A list isn't an array, but you can do something like that with lists. Arrays don't have variable cardinality, though.
19:25:12 <blomberg> i asked there channel is empty i will try slack tommoroww
19:25:22 <blomberg> but this shows how crappy julia is
19:25:24 <dsal> I heard this channel is also empty.
19:25:40 <blomberg> 46 vs 678
19:25:47 <ski> clearly there are no lurkers here, dsal
19:26:13 <EvanR> even (especially?) at the late era patience is key to getting questions answered on IRC
19:26:29 <blomberg> on the reception side it's empty not on the answerer side
19:26:41 <blomberg> i am the ONLY one here
19:27:05 <dsal> If you ask a Haskell question I might be able to help. I don't know any Julia. Doesn't sound like something I should pay attention to.
19:27:31 <dsal> I don't think I've used arrays in any Real Code™ (just AoC stuff).
19:27:35 ski would suggest waiting at least half an hour (preferably more), after asking a question (or making some relevant comment), in a technical channel, especially slow ones (sometimes you can get a reply after a couple of days, even)
19:28:17 <dolio> Also, get a better attitude.
19:28:41 <geekosaur> "<blomberg> i am the ONLY one here " that's awfully insulting to ~675 people
19:29:06 <geekosaur> especially the ones who've been talking to you
19:29:20 dsal got distracted working on Haskell code at work
19:30:03 <yushyin> blomberg: https://julialang.org/community/ try the slack, zulip or discord chats?
19:30:47 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
19:30:56 mikoto-chan joins (~mikoto-ch@85-76-19-119-nat.elisa-mobile.fi)
19:31:43 <blomberg> i nailed it on my own guys a=[1,2,[3,4],5,[6,[1,2]]];a[5][2][2] just eerror and trial and your inspiration
19:31:52 <blomberg> positivity can do a lot
19:32:18 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
19:32:34 × `2jt quits (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Ping timeout: 260 seconds)
19:32:51 <dsal> That doesn't look like valid haskell. What type is `a`?
19:33:12 <ski> presumably it's Julia ?
19:33:14 <dsal> You I guess you could make a num type that's also a list.
19:33:16 <EvanR> I think blomberg has been writing julia in here for the last few hours
19:33:24 <blomberg> a[5] is [6,[1,2]] a[5][2] is [1,2] and a[5][2][2] is 2 but i can't a[5,2,2] which is called cartesian indexing
19:33:35 <blomberg> few seconds...
19:33:42 <EvanR> i=1;i=i+1
19:34:32 <ski> "<blomberg> i=3;while cond;... i=2*i^3+4 ; can fodl do this" -- presumably `foldl' was meant ?
19:35:16 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:35:27 <ski> (from that, blomberg was not only talking about Julia, but also asking about Haskell, at least a bit)
19:36:02 <EvanR> good eye
19:36:41 <blomberg> this proves julia is wrong it gives wrong result look a=[1,2,[3,4],5,[6,[7,8]]];a[1,1,1,1,1,1,1,1,1,1,1,1] =>1 what the hell
19:36:44 <ski> (that's from a little bit over three hours ago, in case you'd like to check the conversation at that point)
19:37:30 × mikoto-chan quits (~mikoto-ch@85-76-19-119-nat.elisa-mobile.fi) (Ping timeout: 268 seconds)
19:37:44 <ski> it seems Julia treats a "scalar value" (a non-array) as an array of length one, blomberg ?
19:37:46 <blomberg> it doesn't give Error when it should
19:38:10 <ski> (iirc, Matlab & Octave also does this)
19:38:36 <blomberg> but i crossed dimensionality bound so that's error
19:38:37 <ski> apparently Julia designers thought this was a good idea
19:39:01 <geekosaur> perl does the same with lists
19:39:11 <ski> (not commenting on whether it is or not, just noting that this is presumably by design)
19:39:40 <blomberg> i talked to them and complained about the lack of elegance and quantity of bullshit
19:40:02 × AlexNoo quits (~AlexNoo@178.34.160.122) (Read error: Connection reset by peer)
19:40:02 × Alex_test quits (~al_test@178.34.160.122) (Read error: Connection reset by peer)
19:40:02 × AlexZenon quits (~alzenon@178.34.160.122) (Read error: Connection reset by peer)
19:40:23 <EvanR> julia strives to be like a dynamic language, introducing autoconversions for convenience. But it omits a lot of dynamic typing checks thanks to static types
19:40:25 AlexNoo joins (~AlexNoo@178.34.160.122)
19:40:27 <blomberg> it would be better if it was more pythonic but they enjoy it
19:40:40 jakalx joins (~jakalx@base.jakalx.net)
19:40:41 <EvanR> so it's a weird hybrid and good example of how dynamic languages don't need to be slow
19:41:16 <ski> hm .. now i'm wondering what Julia does, if you add a vector to a matrix .. or one matrix to another one, having a different width (or height)
19:41:16 <geekosaur> seems like complaining about julia in a haskell channel is not ideal. there is #haskell-offtopic for things like that
19:42:06 <blomberg> no they enjoy excess baggage for ex: function... end if... elseif end... what is that end; nothing instead of nil; mutable struct..end ; i get tired of writing over and over the same thing
19:42:43 <geekosaur> also, unpopular opinion: if you're working with arrays you should be using APL
19:42:56 × phma quits (phma@2001:5b0:215d:9f08:82a6:5ea7:d17:d96d) (Read error: Connection reset by peer)
19:42:58 <EvanR> shots fired
19:43:19 <blomberg> EvanR: who fired the shots geekosaur or me?
19:43:29 <EvanR> no one just kidding
19:43:40 phma joins (~phma@host-67-44-208-167.hnremote.net)
19:43:59 × Luj3 quits (~Luj@2a01:e0a:5f9:9681:82ee:b48:2fc3:8107) (Quit: Ping timeout (120 seconds))
19:44:01 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
19:44:01 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Read error: Connection reset by peer)
19:44:01 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Read error: Connection reset by peer)
19:44:13 <blomberg> apparently it's growing more and more popular i asked one of the inventors the growth rate and it will be like python by 2030
19:44:20 Luj3 joins (~Luj@2a01:e0a:5f9:9681:5880:c9ff:fe9f:3dfb)
19:44:38 chexum joins (~quassel@gateway/tor-sasl/chexum)
19:44:48 <blomberg> 100k pkges by 2020
19:44:53 <blomberg> 2030*
19:44:56 <ski> (if a vector is just a matrix with size in one dimension being one, then should adding two matrices of different sizes have `zipWith'-like behaviour (then matrix-vector addition would truncate, for consistency). or perhaps it should use the product (or least common multiple) of the (respective) sizes of the two matrices ? that does seem not too commonly useful, in the general case)
19:45:09 stiell joins (~stiell@gateway/tor-sasl/stiell)
19:45:09 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
19:45:11 Alex_test joins (~al_test@178.34.160.122)
19:45:29 werneta joins (~werneta@137.78.30.207)
19:46:08 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds)
19:46:30 <EvanR> addition only works when they have the same shape
19:46:34 Inst joins (~Liam@c-98-208-218-119.hsd1.fl.comcast.net)
19:46:51 <ski> there's no scalar-vector or scalar-matrix addition ?
19:47:11 <ski> (how about multiplication ?)
19:47:30 <EvanR> I did get scalar to work by doing .+
19:48:37 × Alex_test quits (~al_test@178.34.160.122) (Remote host closed the connection)
19:49:02 <EvanR> usually it's DimensionMismatch though
19:49:24 <EvanR> whatever * sqrt(2) is fine though
19:50:56 <blomberg> EvanR:i have used julia more than you, and i know it has multiple ways of doing similar things unlike python
19:51:14 <blomberg> i have seen that excess "baggage" it's not a light weight language
19:51:23 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
19:51:47 <blomberg> and also the trailing end line... looks so weird like html code
19:51:49 titibandit joins (~titibandi@xdsl-87-78-8-6.nc.de)
19:52:00 Alex_test joins (~al_test@178.34.160.122)
19:52:21 <blomberg> they could've removed it but all four founders lost their minds
19:56:44 AlexZenon joins (~alzenon@178.34.160.122)
19:57:43 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
20:00:53 <ski> "it has multiple ways of doing similar things unlike python" -- sounds like a good thing (if done tastefully, as orthogonally as reasonably), to me
20:02:05 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
20:05:44 <blomberg> ok
20:06:24 × werneta quits (~werneta@137.78.30.207) (Ping timeout: 260 seconds)
20:09:40 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds)
20:09:47 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
20:10:44 ski . o O ( <https://wiki.haskell.org/GHC/Data_Parallel_Haskell> )
20:15:30 × _xor quits (~xor@74.215.182.83) (Quit: WeeChat 3.7)
20:15:58 _xor joins (~xor@74.215.182.83)
20:16:15 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
20:17:20 stackdroid18 joins (14094@user/stackdroid)
20:18:32 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
20:19:51 ph88^ joins (~ph88@2a02:8109:9e00:71d0:a90d:e7d5:fe91:a32a)
20:19:55 × mestre quits (~mestre@191.177.185.178) (Quit: Lost terminal)
20:21:43 vn36 joins (~vn36@123.63.203.210)
20:22:00 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
20:22:28 stiell joins (~stiell@gateway/tor-sasl/stiell)
20:23:28 × ph88 quits (~ph88@ip5f5af71f.dynamic.kabel-deutschland.de) (Ping timeout: 252 seconds)
20:26:32 chromoblob joins (~user@37.113.164.122)
20:28:11 son0p joins (~ff@181.136.122.143)
20:30:16 elevenkb joins (~elevenkb@105.184.125.168)
20:36:42 × chromoblob quits (~user@37.113.164.122) (Ping timeout: 268 seconds)
20:37:31 <blomberg> ski: it's very complex i nailed it A = [2 6; 4 7; 3 "li"] is not a matrix but works A[5] => 7 linearindexing and cartesian works A[2,2]=>7 ;
20:38:23 <blomberg> a=[1, 2, [3, 4], 5, [6, [7, 8]]] only cartesianIndexing works + python indexing not Linear
20:40:01 <EvanR> riddle me this: if someone says the maximum length of a URL (here, now) shall be 2048. And you couldn't get further clarification. 2048 what, bytes?
20:40:27 <blomberg> a=[1 2 [3 4] 5 [6 [7 8]]] not pythonINdexing works but Linear
20:41:29 <blomberg> would you like such several nasty ways of doing the same thing, and the docss don't say either i just figured it out by error and trial, even worse i couldn't find a name for pythonIndexing!!
20:42:18 <EvanR> "python indexing" does seem like a good name for python's indexing
20:46:15 × vglfr quits (~vglfr@145.224.100.100) (Remote host closed the connection)
20:46:44 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
20:47:09 vglfr joins (~vglfr@145.224.100.100)
20:47:10 <blomberg> it's much worse than i thought not only the name is absent the syntax too is absent in the OFFICIAL documentation a[5][2] type of syntax is not official a part of the language
20:47:47 <blomberg> I just DISCOVERED it by error and trial... if now you don't believe me how crappy this language is, i don't know
20:48:03 <dsal> I guess I'll stick with haskell, then.
20:48:12 <blomberg> https://docs.julialang.org/en/v1/manual/arrays/ I challenge you to find that syntax in the docs here
20:48:29 <blomberg> I look the whole docs it's not there
20:48:38 pavonia joins (~user@user/siracusa)
20:49:19 <EvanR> if you think documentation missing is bad, try electrician work
20:49:25 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
20:49:48 <money> your either a mechanic or not
20:50:37 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
20:50:46 <blomberg> https://docs.julialang.org/en/v1/manual/arrays/#Typed-array-literals it talks about concatenation but not var[2][3]
20:50:52 <EvanR> unless you're a quantum mechanic
20:50:52 × stackdroid18 quits (14094@user/stackdroid) (Quit: hasta la vista... tchau!)
20:53:03 <dsal> I need a button to express my appreciation for that joke.
20:53:27 <money> quantum mechanic <- still mechanic
20:53:43 × elevenkb quits (~elevenkb@105.184.125.168) (Ping timeout: 252 seconds)
20:54:11 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds)
20:55:01 <EvanR> the accuracy of the pun was limited by uncertainty principle
20:55:16 <dsal> I don't know where you are, but I saw where you were going with that.
20:55:45 <blomberg> EvanR:have you had contact with electricians they go and repair like a car mechanic and you expect them to READ that alone is too much let alone docs
20:56:20 <EvanR> I resemble that remark
20:56:23 ec_ joins (~ec@gateway/tor-sasl/ec)
20:58:25 <blomberg> a[5][2] ->Right; a[5] [2] syntax: space before "[" not allowed in "a[5] [" at In[287]:2 so i ctrl+f that page and searched ][ as spaces are not allowed and that is the only pattern null search result. PROVING that docs are crazy.
20:59:09 <blomberg> this is not a minor syntax ; this is pythonIndexing syntax that works for the compiler but not in the docs!!
20:59:21 `2jt joins (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net)
21:00:01 <blomberg> i told you their founders are nutty and you didn't believe me, or atleast the language
21:00:04 <dsal> I don't even know what you're trying to do, but I also don't care about julia at all. It's not clear why you're ranting about it here. Is it in any way related to Haskell?
21:00:22 <blomberg> dsal: sorry for the rant
21:00:27 <EvanR> because monochrom is asleep or busy probably
21:00:29 <dsal> Like, I think elm's canonical formatting is awful, but I only rant about it here when it's relevant.
21:00:44 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Quit: pillow time)
21:00:49 <blomberg> EvanR: what will he do monochrom
21:00:57 <geekosaur> I'm thinking this has been going on for long enough and any continuation should be in offtopic
21:00:59 <EvanR> use harsh language
21:01:07 <dsal> like julia
21:01:33 <blomberg> join me on offtopic channel then. which name #haskell-offtopic?
21:01:39 <geekosaur> yes
21:01:58 <geekosaur> people rant about lots of languages in there 🙂
21:04:04 <ski> blomberg : oh (itym `A[4]', not `A[5]'). i dunno what "python indexing" means, in this context. "would you like such several nasty ways of doing the same thing" -- nah, that just seems like non-orthogonal ways of achieving the same thing, with only minor variations
21:04:47 ski goes thither
21:15:22 Guest2922 joins (~Guest29@pool-108-54-69-191.nycmny.fios.verizon.net)
21:17:26 <Guest2922> can any explain why I get a Non-exhaustive patterns error with this?
21:17:36 <Guest2922> prettyPrint :: Size -> [Coord] -> String
21:17:36 <Guest2922> prettyPrint size coord = prettyPrint' (size,size) coord where
21:17:37 <Guest2922>   prettyPrint' (x,y) ((row,col):coords) = case y /= 0 of
21:17:37 <Guest2922>     True -> case x /= 0 of
21:17:38 <Guest2922>       True -> case x == row && y == col of
21:17:39 <Guest2922>         True -> 'Q' : prettyPrint' (x-1,y) coords
21:17:39 <Guest2922>         False -> '.' : prettyPrint' (x-1,y) coords
21:17:39 <Guest2922>       False -> '\n' : prettyPrint' (size,y-1) coord
21:17:40 <Guest2922>     False -> []
21:18:01 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds)
21:18:17 <geekosaur> because prettyprint' doesn't handle [] as second parameter
21:18:35 <geekosaur> er, prettyPrint'
21:18:37 werneta joins (~werneta@137.79.201.248)
21:19:03 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61)
21:19:04 × mrianbloom quits (uid350277@id-350277.ilkley.irccloud.com) (Quit: Connection closed for inactivity)
21:19:20 <byorgey> Guest2922: FYI, in the future, if you have some code to share you can use something like https://paste.tomsmeding.com/ rather than pasting it into IRC
21:20:34 <Guest2922> hmm not getting the result I anticipated
21:20:46 <Guest2922> prettyPrint 3 [(1,1),(2,3),(3,2)] ==> "Q..\n..Q\n.Q.\n"
21:20:53 <Guest2922> supposed to get something like that
21:21:21 <Guest2922> *Set9b> prettyPrint 3 [(1,1),(2,3),(3,2)]
21:21:21 <Guest2922> ".Q."
21:21:34 <Guest2922> looks backwards and doesn't go through all the columns
21:23:20 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:a09f:2a20:ea37:7e61) (Ping timeout: 255 seconds)
21:26:33 <EvanR> did you mix up the variable coord and coords?
21:26:56 <EvanR> which have the same type and almost the same spelling
21:27:31 <Guest2922> I was trying to have it iterate multiple times through the same list
21:27:39 <Guest2922> and had a counter in place
21:27:55 <Guest2922> I think the counter should accumulate rather than subtract
21:28:38 nate4 joins (~nate@98.45.169.16)
21:29:06 <EvanR> application notes for the atmega microcontroller suggests running loop counters from top to bottom since checking the Z flag is free/cheap compared to doing an extra comparison each loop </probablyirrelevant>
21:29:55 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
21:30:35 zeenk joins (~zeenk@2a02:2f04:a105:5d00:c862:f190:2ea:d494)
21:33:03 <EvanR> you seem to have a list of coords which acts as the "set of ON cells", and then using a nested 2D loop, attempting a query to see if you should output a Q or a .
21:33:24 <EvanR> it seems to me using an actual Set Coord would make that task more straightforward
21:33:54 × nate4 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds)
21:34:09 <Guest2922> -- Ex 2: Implement the function prettyPrint that, given the size of
21:34:10 <Guest2922> -- the chessboard and a list of distinct coordinates of queens (that
21:34:10 <Guest2922> -- is, a list of (row,col) pairs), prints the chessboard with the
21:34:11 <Guest2922> -- queens on it. Empty squares must be printed as '.'s and queens as
21:34:11 <Guest2922> -- 'Q's. The special line break character '\n' must be appended to the
21:34:12 <Guest2922> -- end of each row.
21:34:12 <Guest2922> --
21:34:13 <Guest2922> -- Examples:
21:34:13 <Guest2922> --   prettyPrint 3 [(1,1),(2,3),(3,2)] ==> "Q..\n..Q\n.Q.\n"
21:34:14 <Guest2922> --   prettyPrint 3 [(2,3),(1,1),(3,2)] ==> "Q..\n..Q\n.Q.\n"
21:34:14 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds)
21:34:14 <Guest2922> --   prettyPrint 3 [(1,3),(2,1),(3,2)] ==> "..Q\nQ..\n.Q.\n"
21:34:15 <Guest2922> that's the task
21:34:23 <EvanR> as it stands I have a hard time trusting your list is in the right order for whatever you're doing to always work
21:35:47 <EvanR> they key thing test x == row && y == col
21:37:03 <EvanR> the loop iteration might not coincide with the first element being the one you're querying
21:37:24 <Guest2922> https://paste.tomsmeding.com/IWvazAfA
21:37:38 <Guest2922> that only gets me "Q.."
21:37:54 <Guest2922> because of the terminating condition with the empty list
21:38:17 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds)
21:38:26 <EvanR> you ran out of coordinates before the board indexes were traversed
21:38:59 <EvanR> you'll probably have less queen coordinates in the set than squares on the board
21:39:24 <Guest2922> yeah but I also have a y counter
21:39:35 <Guest2922> so it should reset if that reaches size+1
21:39:44 <Guest2922>       False -> '\n' : prettyPrint' (1,y+1) coord
21:40:01 <Guest2922> never reaches this and it doesn't seem to work correctly that way
21:40:31 ec_ joins (~ec@gateway/tor-sasl/ec)
21:41:37 <EvanR> what if resetting is too late
21:43:18 <Guest2922> not sure I follow
21:46:26 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
21:46:45 <ski> Guest2922 : generally, i'd put short (especially non-nested) `case' branches before long ones .. although, you're doing `case' on `Bool', so you could instead be (chaining) `if'-`then'-`else's .. or better, in this case, simply use guards
21:48:23 <Guest2922> yeah probably would look cleaner with guards
21:54:32 × irrgit_ quits (~irrgit@146.70.27.250) (Quit: Leaving)
21:54:54 × blomberg quits (~default_u@89-39-107-192.hosted-by-worldstream.net) (Ping timeout: 260 seconds)
21:56:44 blomberg joins (~default_u@89-39-107-192.hosted-by-worldstream.net)
21:56:54 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
22:03:11 jakalx joins (~jakalx@base.jakalx.net)
22:04:49 × werneta quits (~werneta@137.79.201.248) (Ping timeout: 260 seconds)
22:06:52 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
22:08:15 beteigeuze joins (~Thunderbi@a79-169-109-107.cpe.netcabo.pt)
22:11:46 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:11:47 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:19:01 × vglfr quits (~vglfr@145.224.100.100) (Remote host closed the connection)
22:19:08 bgs joins (~bgs@212-85-160-171.dynamic.telemach.net)
22:20:14 vglfr joins (~vglfr@145.224.100.100)
22:20:16 × vglfr quits (~vglfr@145.224.100.100) (Remote host closed the connection)
22:20:57 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
22:22:09 vglfr joins (~vglfr@145.224.100.100)
22:24:25 × `2jt quits (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Ping timeout: 260 seconds)
22:24:29 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
22:25:44 × bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
22:28:46 <Inst> my point that monad /= monad
22:28:52 <Inst> represents that monad is an overloaded term
22:29:04 <Inst> defining monad as a typeclass / cat theory abstraction is valid, so's a dozen other definitions
22:29:32 <Inst> it makes sense to speak of monads as a typeclass / cat theory, but also refer to monad pattern programming
22:29:44 werneta joins (~werneta@137.79.216.58)
22:32:32 × Guest2922 quits (~Guest29@pool-108-54-69-191.nycmny.fios.verizon.net) (Quit: Client closed)
22:33:14 <EvanR> wait wait, I've never heard more than essentially 1 definition of monad, unless you're talking about leibniz or maybe marvel cosmology
22:34:02 jmd_ joins (~jmdaemon@user/jmdaemon)
22:34:12 <EvanR> or botched identifications such as "jquery is a monad"
22:34:26 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 255 seconds)
22:34:45 azimut joins (~azimut@gateway/tor-sasl/azimut)
22:34:53 <monochrom> Such idle and smug philosophy. One can simply clarify with "monad as in Haskell's type class" or "monad as in category theory" or ... and save everyone a lot of trouble.
22:39:05 <Inst> what is actually being asked when someone asks "What's a monad (in the context of programming)?"
22:39:51 <monochrom> Well that depends on the asker and the context of the conversation, doesn't it?
22:40:25 <monochrom> Generally true of all questions really, no?
22:40:44 <monochrom> It's a dead horse.
22:40:48 <hpc> it's a bit like asking "what's v in this equation?"
22:41:11 <Inst> it's an overloaded question, they want to know what a monadic type is, what monad pattern programming is, what Haskell monad typeclass is, and perhaps what a category theory monad is
22:41:56 <EvanR> actually what. No, someone who has no idea might be asking literally what is a monad and not know how many alternatives there would be
22:42:04 <EvanR> how could they
22:42:05 <int-e> hpc: That sounded properly contextualized, akin to "how is Maybe a monad?"
22:42:24 mrianbloom joins (uid350277@id-350277.ilkley.irccloud.com)
22:42:50 <Inst> or rather, EvanR, they're not familiar with the overloading
22:42:51 <EvanR> usually when this happens, in non-monads, there is a canned response which ignores all nuance. I guess for monads this is "like a burrito"
22:42:57 <int-e> ask "what's v in mathematics" and you get a million possible answer
22:43:00 <int-e> +s
22:43:06 <mrianbloom> Is there a way to read the code that template haskell is generating?
22:43:17 <geekosaur> -ddump-splices
22:43:26 <hpc> sure, up until someone says "it's https://en.wikipedia.org/wiki/V_number" and now you need a deeper explanation
22:43:38 <mrianbloom> geekosaur thanks
22:43:55 <mrianbloom> There's no ide support for that is there?
22:44:04 <geekosaur> not that I'm aware of
22:44:38 <hpc> generally you're asking about monads in the implicit context of that you were already talking about something that got you to that point
22:44:57 <geekosaur> except you may not have let us in on that
22:44:59 <Inst> but the context often still has overloading
22:45:00 × califax quits (~califax@user/califx) (Remote host closed the connection)
22:45:26 <Inst> on Discord and on ##programming, I'm practicing explaining monads
22:45:29 califax joins (~califax@user/califx)
22:45:36 <hpc> i guess it's more like asking "what's v?"
22:45:42 <geekosaur> imo that's usually a mistake
22:45:48 <hpc> sometimes you're talking to a networking person, sometimes you're talking to a physicist
22:45:55 <hpc> or a movie buff
22:46:00 <EvanR> calling out that the question makes no sense or isn't specific enough doesn't seem to be helping
22:46:03 <Inst> so the context is more like, dealing with a total beginner to monadic programming etc
22:46:20 <EvanR> I found a canned response that seems kind of relevant
22:46:30 <geekosaur> @where ychim
22:46:30 <lambdabot> http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html
22:47:02 <EvanR> sure there you go
22:47:41 <EvanR> but again, I have to insist they first consider Functor and functorial programming and demand their languages steals that from haskell
22:47:50 <geekosaur> I like that one. shows 3 different programming situations and how you'd solve them, then shows that they have a framework in common and we call that "monad"
22:48:49 <monochrom> You know what, speaking of overloading, Haskell's solution to overloading is type classing, eh? :)
22:49:09 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
22:49:28 <geekosaur> what happens when you overload overloading?
22:49:31 <hpc> especially if you consider the more precise name for overloading
22:49:35 <hpc> type-directed name resolution
22:49:36 <monochrom> P.S. Now I have one more reason to continue avoiding Discord.
22:49:48 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
22:49:58 <monochrom> I prefer type-directed type resolution :)
22:50:13 azimut joins (~azimut@gateway/tor-sasl/azimut)
22:50:25 <monochrom> BTW dependent typing is value-directed type resolution, isn't it? :)
22:52:10 <hpc> eh, sort of
22:52:33 <hpc> there's not really any "resolution" at that point, since you are already thinking about your types as types and not as a symbol table of some sort
22:52:54 <hpc> name resolution is "i typed print(something), what function definition is that?"
22:53:07 <monochrom> I just like the "___-directed ___ resolution" template. :)
22:53:35 <hpc> and annoyingly also distracts people from the fact that each different print(args) is a completely different function
22:53:42 <hpc> that all happen to overlap in the symbol table
22:53:43 <monochrom> I may also like to s/name/value/ . I like puns and symmetries and dualities.
22:53:57 <hpc> even shakespeare knew the name isn't the thing
22:54:58 <Inst> i guess we're not really understanding each other
22:55:20 <Inst> i know the literature, i.e, stop making monad tutorials, and grokking monads is essentially a Chan / Zen process
22:55:24 <Inst> gotta "feel da monad"
22:56:04 <Inst> that just seems like a dumb process to me
22:56:10 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
22:56:12 <davean> I'd say its more "you have to give up your assumptions" most people only do that via exposure. You can also learn the skill.
22:56:22 <davean> Most people aren't exposed to enough new ideas to practice it though.
22:56:25 <Inst> i have a friend who's demanding to be spoonfed, and forcing her to "feel da monad" is probably sexual harassment
22:56:44 <hpc> the monad tutorial said forget everything you know about monads
22:56:45 <hpc> so i did
22:56:46 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
22:56:53 <hpc> then it started talking about monads, but i didn't know what the hell they were!
22:57:09 <monochrom> hpc: Wait, which monad tutorial?
22:57:21 <monochrom> Oh haha OK
22:57:21 <Inst> i'm thinking, monadic pattern programming -> monad types -> monads as a typeclass / cat theory monads
22:57:33 azimut joins (~azimut@gateway/tor-sasl/azimut)
22:57:42 <hpc> https://www.youtube.com/watch?v=QJ3kCxsOjLc
22:58:10 <monochrom> heh
22:59:31 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
22:59:59 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
23:00:02 <Inst> but is monadic pattern programming a thing?
23:00:22 <Inst> that's what i'm sort of looking for, a term for this kind of stuff
23:00:30 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
23:00:30 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
23:00:30 × ec_ quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
23:00:30 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
23:01:11 stiell joins (~stiell@gateway/tor-sasl/stiell)
23:01:19 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
23:01:22 <jbggs[m]> Inst Are you trying to understand monads or are you trying to explain monads to someone?
23:01:27 chexum joins (~quassel@gateway/tor-sasl/chexum)
23:01:46 <Inst> tbh, being able to explain monads without resorting to Zen is equivalent to understanding monads
23:01:51 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
23:01:52 <hpc> https://en.wikipedia.org/wiki/Design_Patterns#Patterns_by_type if you don't mind being even more confused :P
23:01:55 <monochrom> Neither. Trying to talk about trying to explain monads to someone.
23:02:03 <hpc> @src Monad
23:02:03 <lambdabot> class Applicative m => Monad m where
23:02:03 <lambdabot> -- Note: Applicative wasn't a superclass before GHC 7.10
23:02:03 <lambdabot> (>>=) :: m a -> (a -> m b) -> m b
23:02:03 <lambdabot> (>>) :: m a -> m b -> m b
23:02:03 <lambdabot> return :: a -> m a
23:02:05 <lambdabot> fail :: String -> m a
23:02:05 <hpc> ^ that's it
23:02:06 × titibandit quits (~titibandi@xdsl-87-78-8-6.nc.de) (Remote host closed the connection)
23:02:11 <Inst> bleh, i'll go ruin another guineapig on discord
23:02:43 <hpc> make sure you're covering the prerequisite concepts first
23:02:51 ec_ joins (~ec@gateway/tor-sasl/ec)
23:03:28 <hpc> if Monad isn't super easy to explain, you're not explaining it wrong, you just missed something beforehand
23:03:51 <EvanR> Zen, what
23:04:36 <hpc> EvanR: you've clearly never written the codeless code :D
23:05:36 <EvanR> I have combined two opposing causal stream transducers with each other to form a nothing and called it the yin yang unicode character, does that count
23:06:25 <jbggs[m]> That's Tao, that's different
23:06:33 <Inst> i'm literally reading
23:06:47 <Inst> i wonder if nothing === dao
23:07:46 <hpc> that's a data access object
23:08:31 <jbggs[m]> What do you all think of this comparison:
23:08:31 <jbggs[m]> Category Theory : Design Patterns :: Biologists : Zoologist
23:08:42 <ski> perhaps there should be a "Monad prerequisites" page ..
23:08:46 <jbggs[m]> s/Biologists/Biology/
23:08:51 <jbggs[m]> s/Biologists/Biology/, s/Zoologist/Zoology/
23:09:05 <EvanR> Monad prerequistists: (among other things) Functor
23:09:51 <EvanR> made somewhat more complicated by hpc opening up the actual definition of Monad and it doesn't mention Functor xD
23:10:02 <ski> @where prerequisite
23:10:02 <lambdabot> "Prerequisite for Learning Haskell" <http://www.vex.net/~trebla/haskell/prerequisite.xhtml>
23:10:56 <hpc> it mentions Applicative, which is the better segue from Functor imo
23:11:03 <EvanR> ;_;
23:11:18 <geekosaur> but that just gives you "so what's Applicative?"
23:11:59 × ph88^ quits (~ph88@2a02:8109:9e00:71d0:a90d:e7d5:fe91:a32a) (Quit: Leaving)
23:11:59 <EvanR> if someone actually gets Functor in whatever process, the job is probably done
23:12:11 <EvanR> inertia carries them the rest of the way
23:14:44 <Inst> functor is actually extremely easy to explain, just call it mappable
23:17:09 × blomberg quits (~default_u@89-39-107-192.hosted-by-worldstream.net) (Ping timeout: 260 seconds)
23:17:33 <monochrom> Soon we will be talking about talking about talking about trying to explain monads.
23:18:34 <EvanR> monad is easy, call it flatmappable
23:18:48 <Inst> what we talk about when we talk about love <3
23:18:51 <Inst> yeah, i know
23:19:02 <Inst> that's like the general "explain monads like I'm 5" to an experienced programmer
23:19:04 <EvanR> comonad, mapflattable
23:19:22 <Inst> functor = map, monad = flatmap
23:19:29 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
23:19:34 <EvanR> there you go
23:19:55 <Inst> afaik it works
23:20:43 <ski> no, monad needs `return'/`pure'/`unit/`eta'/⌜η⌝ as well
23:20:47 <hpc> instead of foldable we can call it foldmappable
23:21:15 <Inst> foldable has a functor constraint?
23:21:41 <hpc> there's a method in Foldable called foldMap
23:21:43 <ski> EvanR : more like "mapUnflattened" ?
23:21:45 <Inst> i'm looking for the spoonfed "explain monads like I'm 5" to an inexperienced programmer who's never heard of map / flatmap
23:22:27 <ski> "foldable has a functor constraint?" -- it doesn't
23:22:48 <Inst> ummm, okay, iirc foldmap is implemented via Endo and appEndo
23:22:59 <Inst> to force a monoid to exist for the <>
23:23:30 <ski> it's a type class, every type that's an instance of it can implement it in its own way
23:23:52 × acidjnk quits (~acidjnk@p200300d6e7137a38458dfbf66917fb17.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
23:25:05 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
23:25:07 <EvanR> I try not to encourage the trend of monads as a "thing that desperately need to be explained, and also are so hard to understand it never works"
23:25:18 <EvanR> because it's just another thing among things
23:25:36 <EvanR> other things that are cool but no one cares about one way or another, like monoids
23:25:39 <EvanR> or functor
23:26:40 <geekosaur> agreed, but sadly there's already this meme that haskell is about monads and monads are incomprehensible
23:26:59 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
23:27:04 ski . o O ( multiplate )
23:27:20 <hpc> just tell them to enable MonadComprehensions
23:27:25 <EvanR> lol
23:27:58 chexum joins (~quassel@gateway/tor-sasl/chexum)
23:27:59 <ski> that's surely aid comprehension
23:28:11 <hpc> i mean... maybe?
23:29:09 <ski> should also enable `TransformListComp', employing familiarity with SQL
23:29:57 × rubin55 quits (sid175221@id-175221.hampstead.irccloud.com) (Read error: Software caused connection abort)
23:30:08 rubin55 joins (sid175221@id-175221.hampstead.irccloud.com)
23:33:06 × Pent quits (sid313808@id-313808.lymington.irccloud.com) (Read error: Software caused connection abort)
23:33:19 Pent joins (sid313808@id-313808.lymington.irccloud.com)
23:35:14 × vn36 quits (~vn36@123.63.203.210) (Ping timeout: 260 seconds)
23:39:19 × Inst quits (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 260 seconds)
23:46:26 <Axman6> I've always found this is quite a good article to dispel the "monads are difficult" idea: https://tomstu.art/refactoring-ruby-with-monads
23:50:52 × zeenk quits (~zeenk@2a02:2f04:a105:5d00:c862:f190:2ea:d494) (Quit: Konversation terminated!)
23:52:48 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
23:53:59 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
23:55:15 azimut joins (~azimut@gateway/tor-sasl/azimut)
23:57:45 × freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
23:59:18 <hpc> like many things in programming, it's only as difficult as you make it
23:59:45 <monochrom> In fact, like many things in general.

All times are in UTC on 2022-11-10.