Home liberachat/#haskell: Logs Calendar

Logs on 2021-09-10 (liberachat/#haskell)

00:00:40 × hendursaga quits (~weechat@user/hendursaga) (Quit: hendursaga)
00:01:06 hendursaga joins (~weechat@user/hendursaga)
00:05:53 × glguy quits (x@libera/staff/glguy) (Quit: Quit)
00:09:28 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c) (Remote host closed the connection)
00:09:49 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
00:22:34 × falafel quits (~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com) (Ping timeout: 260 seconds)
00:23:32 × pbrisbin quits (~patrick@pool-108-16-214-93.phlapa.fios.verizon.net) (Ping timeout: 265 seconds)
00:23:33 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer)
00:23:34 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c)
00:23:46 pony joins (~ed@101.53.218.157)
00:27:00 × unit73e quits (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Remote host closed the connection)
00:30:25 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
00:31:26 × proofofkeags_ quits (~proofofke@205.209.28.54) (Ping timeout: 260 seconds)
00:36:35 × beka quits (~beka@104.193.170.240) (Ping timeout: 265 seconds)
00:37:14 × hiruji quits (~hiruji@user/hiruji) (Quit: ZNC 1.8.2 - https://znc.in)
00:37:35 hiruji joins (~hiruji@user/hiruji)
00:39:32 elf_fortrez joins (~elf_fortr@adsl-72-50-5-53.prtc.net)
00:41:40 × AlistairB quits (~AlistairB@121-200-5-212.79c805.syd.nbn.aussiebb.net) (Quit: Client closed)
00:41:43 × euandreh quits (~euandreh@2804:14c:33:9fe5:c3ab:c75d:f803:b354) (Ping timeout: 252 seconds)
00:43:38 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c) (Remote host closed the connection)
00:45:44 × elf_fortrez quits (~elf_fortr@adsl-72-50-5-53.prtc.net) (Quit: Client closed)
00:45:56 favonia joins (~favonia@user/favonia)
00:47:46 <mjrosenb> and then there's integration, which they teach in nearly the same way, and is most definitely not recursive
00:55:41 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c)
00:57:06 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds)
00:58:51 pony is now known as lua
00:59:18 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Ping timeout: 265 seconds)
01:04:49 × aratamizuki quits (~aratamizu@p2135145-ipoe.ipoe.ocn.ne.jp) (Remote host closed the connection)
01:05:01 aratamizuki joins (~aratamizu@p2135145-ipoe.ipoe.ocn.ne.jp)
01:08:34 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
01:08:47 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
01:09:11 × mangoiv quits (~MangoIV@193.175.5.172) (Quit: WeeChat 3.2)
01:10:27 neurocyte6 joins (~neurocyte@94.16.66.63)
01:10:27 × neurocyte6 quits (~neurocyte@94.16.66.63) (Changing host)
01:10:27 neurocyte6 joins (~neurocyte@user/neurocyte)
01:11:50 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:12:21 dajoer joins (~david@user/gvx)
01:12:30 × neurocyte quits (~neurocyte@user/neurocyte) (Ping timeout: 260 seconds)
01:12:30 ezzieyguywuf joins (~Unknown@user/ezzieyguywuf)
01:12:30 neurocyte6 is now known as neurocyte
01:12:58 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:13:30 lua is now known as pony
01:15:18 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 260 seconds)
01:15:36 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
01:17:35 <koz> Is there a convenient way to prettyprint records?
01:17:50 <awpr> shameless self-promotion:
01:17:55 <awpr> @hackage portray
01:17:55 <lambdabot> https://hackage.haskell.org/package/portray
01:18:06 <c_wraith> there are some libraries that attempt to parse and format Show's output, especially for records
01:18:31 <koz> awpr - that looks _gorgeous_.
01:18:43 <awpr> comes with generics-based deriving that handles records nicely, even in really obtuse cases like having infix operators as field names
01:19:20 <koz> awpr: What's the general workflow to integrate with prettyprinter?
01:20:25 <awpr> currently the only document rendering library it's hooked up to is `pretty`, but the intent is that it could work with anything
01:20:37 <koz> How would you suggest interoperating then?
01:20:56 <koz> I'm already using prettyprinter quite heavily, so if I can avoid a port to 'pretty', that'd be good.
01:21:05 <awpr> so depending on what you mean by the question, it's either "you can't yet", or "write something like portray-pretty"
01:21:10 <awpr> @hackage portray-pretty
01:21:10 <lambdabot> https://hackage.haskell.org/package/portray-pretty
01:21:38 <koz> Ah, I see. So something like WrappedPortray basically?
01:22:07 <awpr> yep, if it's a direct equivalent, then you'd say "deriving ThePrettyPrinterClass via WrappedPortray MyRecord"
01:22:20 <koz> I can probably bash that into place. Thanks!
01:23:14 × xff0x quits (~xff0x@port-92-193-229-234.dynamic.as20676.net) (Ping timeout: 260 seconds)
01:23:38 <awpr> and then you're using `portray` as deriving for `prettyprinter`. although a big chunk of the functionality is in `portray-pretty`, since `portray` tells you what sort of syntax to render, and `portray-pretty` actually has all the details of how to format it
01:24:47 xff0x joins (~xff0x@2001:1a81:52f8:6100:708e:280b:baf5:c97b)
01:27:01 × aratamizuki quits (~aratamizu@p2135145-ipoe.ipoe.ocn.ne.jp) (Remote host closed the connection)
01:27:34 aratamizuki joins (~aratamizu@p2135145-ipoe.ipoe.ocn.ne.jp)
01:29:29 <awpr> oh, a caveat for that sort of usage: it can't call _back_ into `prettyprinter`'s typeclasses when deriving instances, so it'll expect you to have `Portray` instances for the whole transitive closure of the record you want. so it'll be great and low-overhead for a bunch of records with strings, ints, etc., but there'll be some up-front work if your records have tons of deeply nested domain types
01:30:55 sneedsfeed joins (~sneedsfee@rrcs-173-95-122-169.midsouth.biz.rr.com)
01:33:54 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
01:34:07 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
01:34:50 × aratamizuki quits (~aratamizu@p2135145-ipoe.ipoe.ocn.ne.jp) (Remote host closed the connection)
01:35:02 aratamizuki joins (~aratamizu@p2135145-ipoe.ipoe.ocn.ne.jp)
01:39:14 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
01:39:28 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
01:43:52 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 252 seconds)
01:47:57 × vysn quits (~vysn@user/vysn) (Ping timeout: 245 seconds)
01:51:18 × dsrt^ quits (~dsrt@68.101.54.227) (Remote host closed the connection)
01:51:51 beka joins (~beka@104.193.170.240)
01:53:36 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
02:00:07 glguy joins (x@libera/staff/glguy)
02:05:42 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 260 seconds)
02:05:57 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
02:07:31 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
02:14:34 × td_ quits (~td@94.134.91.64) (Ping timeout: 260 seconds)
02:16:02 td_ joins (~td@94.134.91.202)
02:16:09 alx741 joins (~alx741@186.178.109.214)
02:35:11 vs^ joins (~dsrt@68.101.54.227)
02:37:07 × alx741 quits (~alx741@186.178.109.214) (Quit: alx741)
02:38:35 × sneedsfeed quits (~sneedsfee@rrcs-173-95-122-169.midsouth.biz.rr.com) (Ping timeout: 256 seconds)
02:40:14 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
02:40:50 × jespada quits (~jespada@90.254.245.194) (Ping timeout: 260 seconds)
02:42:44 jespada joins (~jespada@90.254.245.194)
02:42:45 Tordek joins (tordek@triton.blinkenshell.org)
02:44:34 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
02:44:48 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
02:45:52 <Tordek> hi! https://paste.tomsmeding.com/nrP8eHRv I have a series of functions taht do this pattern a lot: they thread a parameter as state, by doing \p -> foo p (\p -> otherFooThatReceivesThatPotentiallyModifiedP); is there a cleaner way to handle this?
02:53:00 <Axman6> sounds a lot like the statew monad before I open the link...
02:53:14 <c_wraith> it definitely wants to be state
02:53:17 <Axman6> yes this definitely the state monad
02:53:29 <Axman6> State p, whatever the type of p is
02:54:20 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 265 seconds)
02:54:54 <Tordek> sounds reasonable I guess
02:54:55 <Tordek> thanks
02:55:11 <Axman6> You have successfully completely reinvented the state monad, which is basically nicer syntax for exactly what you've written
02:55:25 <Axman6> have you use it before?
02:55:48 <Tordek> I think I've never used State, no
02:57:11 <Axman6> ok, well the functions to know are get :: State p p, a.k.a, give me whatever the current state is. put :: p -> State p (), a.k.a, update the current state with a new value, and modify :: (p -> p) -> State p (), a.k.a, apply this function to the current state and update it
03:03:04 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 252 seconds)
03:03:13 <Tordek> https://paste.tomsmeding.com/TuzAz5OK roughly this?
03:04:02 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 260 seconds)
03:04:45 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
03:09:33 <Axman6> why do you pass in a and then return it?
03:09:56 <Axman6> that code doesn't compile right?
03:10:34 <Axman6> pushTick = modify (\p -> p {pc = pc p + 1 }) I think
03:10:37 <Tordek> arbitrary code; I was looking at the state part, not the real code
03:11:12 × haykam1 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection)
03:11:25 haykam1 joins (~haykam@static.100.2.21.65.clients.your-server.de)
03:13:49 <Axman6> actually I don't know what pushTick is supposed to do, in the original code it takes an input but I don't know what it's supposed to do with it.
03:14:53 <Tordek> https://paste.tomsmeding.com/BBxEVKhO it's... uh... weird, I guess
03:15:18 <Axman6> also, to access sub parts of the state, you can use gets: gets :: (p -> b) -> State p b, which is just fmap f get, a.k.a, use a function to access things. so you can use do {h <- gets (high . pc); pushTick h; ...}
03:16:37 <Tordek> it's meant to be a cycle-accurate 6502 emulator; the "readTick": "sends" a read request on the bus, and "waits" for the response on the next cycle, providing the value it read to the next funciton in the chain
03:17:39 <Axman6> Did you write all of this or are you modifying it?
03:18:02 <Axman6> This is like one of the classic examples of the state monad btw, writing CPU emulators, because it maps so naturally
03:18:28 <Tordek> I wrote it all, yeah
03:19:09 lavaman joins (~lavaman@98.38.249.169)
03:19:54 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
03:20:08 × vs^ quits (~dsrt@68.101.54.227) (Remote host closed the connection)
03:20:08 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
03:20:21 <Axman6> it feels like what you want is something like State (Data, ProcessorState, BusState) as the return type of basically all of your functions
03:23:23 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
03:29:12 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
03:30:09 <Axman6> I wouldn't recfommend using a tuple thoughm I would have a record which contains all the state, with field accessors for each subpart
03:32:17 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Quit: Leaving)
03:34:59 zmt01 joins (~zmt00@user/zmt00)
03:36:50 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 260 seconds)
03:38:06 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 260 seconds)
03:39:26 cjb joins (~cjbayliss@user/cjb)
03:40:39 <iqubic> Is hoogle down for anyone else?
03:41:04 <ldlework> @hoogle (a -> b -> a) -> a -> [b] -> a
03:41:05 <lambdabot> GHC.List foldl :: forall a b . (b -> a -> b) -> b -> [a] -> b
03:41:05 <lambdabot> GHC.List foldl' :: forall a b . (b -> a -> b) -> b -> [a] -> b
03:41:05 <lambdabot> GHC.OldList foldl :: forall a b . (b -> a -> b) -> b -> [a] -> b
03:41:32 abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
03:41:34 <iqubic> I think lambdabot has a local hoogle server it queries.
03:41:44 <iqubic> This is returning a 503 for me: https://hoogle.haskell.org/?hoogle=accumulate&scope=set%3Astackage
03:42:45 <monochrom> oh w00t cabal-instal 3.6
03:45:05 × favonia quits (~favonia@user/favonia) (Ping timeout: 265 seconds)
03:45:27 × monochrom quits (trebla@216.138.220.146) (Quit: NO CARRIER)
03:46:54 × shriekingnoise_ quits (~shrieking@186.137.144.80) (Quit: Quit)
03:48:07 <cjb> is there a way to convert a reStructuredText file with haskell code block to lhs that is better/nicer/easier-to-read than this? (i.e. no sed, no conversion to markdown and back to rst) http://ix.io/3yqp
03:49:08 <Axman6> Pandoc is also a library, so you could parse it and then modifty the AST
03:49:20 <iqubic> I was going to say use Pandoc, but that can't output lhs files.
03:49:35 <Tordek> thanks, Axman6
03:50:09 <Axman6> pandoc --from markdown --to rst+lhs --output test.lhs seems to imply it can?
03:50:17 dsrt^ joins (~dsrt@68.101.54.227)
03:51:39 <ldlework> iqubic: i actually didn't notice your message and was just using @hoogle because I tried hoogle web and it was down
03:51:41 <ldlework> :D
03:52:01 <cjb> Axman6: hm, yeah that might be the go. thanks :)
03:52:34 <Axman6> Tordek: this might be... extremely... relevant :P https://github.com/blitzcode/neskell/
03:52:51 <iqubic> Axman6: The front page of the Pandoc website doesn't list literate haskell as a format it can output. https://pandoc.org/#
03:53:19 <Tordek> oh no he stole my name (?)
03:54:24 <cjb> iqubic: https://pandoc.org/MANUAL.html#literate-haskell-support
03:55:16 <iqubic> cjb: Why is that not listed on the home page?
03:56:40 × spruit11 quits (~quassel@2a02:a467:ccd6:1:6cc9:33fd:d92c:45c) (Ping timeout: 260 seconds)
03:58:48 monochrom joins (trebla@216.138.220.146)
04:05:23 <iqubic> ldlework: hoogle is back up on the interwebs.
04:06:15 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
04:06:18 <Axman6> Tordek: is it becomming clear how to use the state monad to do what you want?
04:07:14 <Axman6> you might find that you want to not explicitly use State, but instead use MonadState SystemState m => m a instead - this means that you can also add other constraints later, like Writer if you want to store logs or history or something
04:10:12 <Tordek> sorta; I'm still trying to marry that implementation with my "bus" concept
04:10:16 <Tordek> thanks!
04:14:25 × haykam1 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection)
04:14:29 haykam2 joins (~haykam@static.100.2.21.65.clients.your-server.de)
04:15:06 × arkho quits (~ccc@dynamic-acs-24-112-153-241.zoominternet.net) (Remote host closed the connection)
04:15:24 arkho joins (~ccc@dynamic-acs-24-112-153-241.zoominternet.net)
04:17:38 × hyiltiz quits (~quassel@31.220.5.250) (Quit: No Ping reply in 180 seconds.)
04:18:26 × bgamari quits (~bgamari@72.65.101.163) (Ping timeout: 265 seconds)
04:18:57 hyiltiz joins (~quassel@31.220.5.250)
04:21:20 spruit11 joins (~quassel@2a02:a467:ccd6:1:6cc9:33fd:d92c:45c)
04:21:25 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
04:22:50 phma_ joins (~phma@host-67-44-208-90.hnremote.net)
04:22:59 <ldlework> I am so close with this keypad translator challenge
04:24:42 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
04:25:59 sleblanc joins (~sleblanc@user/sleblanc)
04:26:10 × spruit11 quits (~quassel@2a02:a467:ccd6:1:6cc9:33fd:d92c:45c) (Ping timeout: 260 seconds)
04:26:30 × hyiltiz quits (~quassel@31.220.5.250) (Remote host closed the connection)
04:26:38 × phma quits (~phma@host-67-44-208-90.hnremote.net) (Ping timeout: 252 seconds)
04:27:39 hyiltiz joins (~quassel@31.220.5.250)
04:27:42 <roboguy_> ldlework: nice!
04:27:55 <ldlework> It actually seems kind of ill-defined
04:28:14 <ldlework> Since if you want to type an 'l' you have to hit 5 three times
04:28:25 <ldlework> but if you want to spell hello it's 6 consecutive fives
04:28:29 <ldlework> and there's no way to translate back
04:29:01 <ldlework> 555555 could be jkl
04:30:14 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
04:30:27 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
04:32:15 × zmt01 quits (~zmt00@user/zmt00) (Quit: Gone.)
04:33:08 bgamari joins (~bgamari@71.241.201.27)
04:33:52 zmt00 joins (~zmt00@user/zmt00)
04:36:43 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
04:39:57 <roboguy_> ldlework: on a flip phone, you would usually use a time delay to distinguish between letters. IIRC, there was also often a button you could press to force it to go to the next symbol as well (my current printer is like that, actually). Not sure if the exercise has anything like that
04:40:09 <awpr> I don't have the HFFP book, but if it's the same exercise I found on Stack Overflow, it looks like the representation of presses it's concerned with is `[(Char, Int)]`, which already delimits where the letter boundaries are
04:44:44 phma joins (~phma@host-67-44-208-90.hnremote.net)
04:44:56 × phma quits (~phma@host-67-44-208-90.hnremote.net) (Read error: Connection reset by peer)
04:45:24 × beka quits (~beka@104.193.170.240) (Remote host closed the connection)
04:45:34 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
04:45:42 phma joins (~phma@host-67-44-208-90.hnremote.net)
04:45:52 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
04:46:13 × poljar quits (~poljar@93-139-113-226.adsl.net.t-com.hr) (Read error: Connection reset by peer)
04:46:20 beka joins (~beka@104.193.170.240)
04:46:37 poljar joins (~poljar@93-139-113-226.adsl.net.t-com.hr)
04:46:42 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
04:46:44 <ldlework> awpr: that's more of an intermediary representation, they want output like "5555" for [('5', 4)]
04:47:13 × hyiltiz quits (~quassel@31.220.5.250) (Remote host closed the connection)
04:47:20 <ldlework> I think I've gotten all I can get out of this one :D
04:47:28 <awpr> hm, the one I'm looking at is from https://codereview.stackexchange.com/questions/140494/key-phone-in-haskell/140517
04:47:32 × phma_ quits (~phma@host-67-44-208-90.hnremote.net) (Ping timeout: 252 seconds)
04:48:10 <awpr> must be slightly different, it sounds like a buggy exercise if it's asking to round-trip via a form that doesn't encode the pauses somehow
04:48:32 hyiltiz joins (~quassel@31.220.5.250)
04:50:24 spruit11 joins (~quassel@2a02:a467:ccd6:1:6cc9:33fd:d92c:45c)
04:51:33 <ldlework> awpr: it doesn't actually specify to go round trip on rereading
04:52:50 <awpr> huh, I guess it's just concatenating them for fun then
04:53:11 <awpr> :t foldMap (uncurry (flip replicate))
04:53:12 <lambdabot> Foldable t => t (a, Int) -> [a]
04:59:40 <ldlework> Here's my go, https://gist.github.com/dustinlacewell/9640ad9f66ca91847a42e2b57e62b94a
05:03:53 × spoonm quits (spoonm@inaba.spoonm.org) (Quit: I might be back. I might not.)
05:05:25 spoonm joins (spoonm@inaba.spoonm.org)
05:05:43 × spruit11 quits (~quassel@2a02:a467:ccd6:1:6cc9:33fd:d92c:45c) (Ping timeout: 252 seconds)
05:10:38 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
05:14:57 michalz joins (~michalz@185.246.204.41)
05:15:57 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
05:16:14 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
05:20:46 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:21:32 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
05:21:48 img joins (~img@user/img)
05:26:21 wonko joins (~wjc@62.115.229.50)
05:35:25 chele joins (~chele@user/chele)
05:37:04 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
05:42:00 <dsal> ldlework: as an if-hater, I'd probably do one of these: https://www.irccloud.com/pastebin/3flz7xOm/if.hs
05:45:58 <dsal> ldlework: also, you can avoid some nesting there. https://www.irccloud.com/pastebin/ASuf3zh3/maybe.hs
05:46:20 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
05:46:33 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
05:46:56 jtomas joins (~jtomas@95.red-88-11-64.dynamicip.rima-tde.net)
05:49:56 chop joins (~chattille@222.211.142.77)
05:50:21 <dsal> ldlework: and while I'm throwing out unwarranted opinions: `convertKeypadMessage phone = foldMap (seqForPress phone) . mapMaybe (pressFor phone) . normalizeMessage`
05:52:02 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 260 seconds)
05:52:12 <dsal> I've been arguing with people about this a bit, but I really don't like let. It makes everything look upside down to me. It's like, "hey, let's start with the least important ingredient" and then you get to the bottom and only then find out what the function is actually doing.
05:53:59 <dsal> So I read that function bottom to top and the actual thing it does is `ret` which is just a `concat` of another value which is just the result of a map, so those three things are really just one `foldMap`. And the input to that is a `catMaybes` of a `map` which is just `mapMaybe` and that's of a thing called `normalizedMsg` that's just the final parameter with `normalizeMessage` called on it.
05:54:15 <dsal> So you don't really need to name any of that other than the mapping.
05:54:45 × asivitz quits (uid178348@id-178348.tinside.irccloud.com) (Quit: Connection closed for inactivity)
05:56:40 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
05:56:56 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
05:58:34 aman joins (~aman@user/aman)
05:58:54 × roboguy_ quits (~roboguy_@cpe-98-156-4-161.kc.res.rr.com) ()
05:59:36 chop parts (~chattille@222.211.142.77) (WeeChat 3.2.1)
06:02:03 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
06:02:17 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
06:11:50 oxide joins (~lambda@user/oxide)
06:11:58 max22- joins (~maxime@2a01cb088335980070c545bb3ed78a74.ipv6.abo.wanadoo.fr)
06:12:29 Neuromancer joins (~Neuromanc@user/neuromancer)
06:15:16 <dsal> And if you want to get weird, you can do `pressFor` with fewer passes by remembering the position you found the char in right away instead of noting that you found it and then counting back to that list position and searching again: `pressFor (Keypad keys) c = listToMaybe . catMaybes $ zipWith (\k i -> (i,) . succ <$> elemIndex c k) keys [0..]`
06:15:22 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
06:18:27 dyeplexer joins (~dyeplexer@user/dyeplexer)
06:19:38 falafel joins (~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com)
06:20:37 Lycurgus joins (~juan@98.4.112.204)
06:22:35 fefufo[m] joins (~fefufomat@2001:470:69fc:105::f3a9)
06:22:48 Pickchea joins (~private@user/pickchea)
06:27:23 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
06:27:37 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
06:32:43 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
06:32:57 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
06:35:18 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
06:35:35 × oxide quits (~lambda@user/oxide) (Quit: oxide)
06:38:16 × cjb quits (~cjbayliss@user/cjb) ()
06:40:00 × m4lvin quits (~m4lvin@w4eg.de) (Quit: m4lvin)
06:40:23 m4lvin joins (~m4lvin@w4eg.de)
06:43:23 jakalx joins (~jakalx@base.jakalx.net)
06:45:47 × beka quits (~beka@104.193.170.240) (Ping timeout: 252 seconds)
06:46:22 × meinside quits (uid24933@id-24933.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
06:46:25 amahl joins (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi)
06:48:02 × falafel quits (~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com) (Ping timeout: 260 seconds)
06:48:47 cfricke joins (~cfricke@user/cfricke)
06:56:16 Akronymus joins (~Akronymus@85.31.8.180)
06:56:20 × max22- quits (~maxime@2a01cb088335980070c545bb3ed78a74.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
07:00:10 × ic2000_ quits (~ic2000_@cpc108265-brom11-2-0-cust119.16-1.cable.virginm.net) (Ping timeout: 260 seconds)
07:00:22 kuribas joins (~user@ptr-25vy0i7jzpijs82kd6g.18120a2.ip6.access.telenet.be)
07:02:19 × xff0x quits (~xff0x@2001:1a81:52f8:6100:708e:280b:baf5:c97b) (Ping timeout: 252 seconds)
07:02:58 xff0x joins (~xff0x@port-92-193-132-242.dynamic.as20676.net)
07:03:40 acidjnk_new joins (~acidjnk@p200300d0c7203080c0b3f2662aa27c56.dip0.t-ipconnect.de)
07:04:05 Gurkenglas joins (~Gurkengla@dslb-002-207-014-195.002.207.pools.vodafone-ip.de)
07:05:54 tzh_ joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
07:07:07 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Ping timeout: 265 seconds)
07:08:03 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
07:08:17 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
07:08:23 brandonh joins (brandonh@gateway/vpn/protonvpn/brandonh)
07:08:51 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:09:08 acidjnk_new3 joins (~acidjnk@p5487d0ba.dip0.t-ipconnect.de)
07:12:46 × acidjnk_new quits (~acidjnk@p200300d0c7203080c0b3f2662aa27c56.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
07:12:51 max22- joins (~maxime@2a01cb088335980093c01212af90dc30.ipv6.abo.wanadoo.fr)
07:13:00 mei joins (~mei@user/mei)
07:17:01 × tzh_ quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Ping timeout: 252 seconds)
07:17:07 × dagit quits (~dagit@2001:558:6025:38:6476:a063:d05a:44da) (Ping timeout: 250 seconds)
07:18:00 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
07:20:42 lavaman joins (~lavaman@98.38.249.169)
07:23:36 × nicbk quits (~nicbk@user/nicbk) (Ping timeout: 276 seconds)
07:24:25 dagit joins (~dagit@2001:558:6025:38:6476:a063:d05a:44da)
07:25:22 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 260 seconds)
07:28:43 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
07:30:10 mastarija joins (~mastarija@31.217.13.81)
07:40:23 × aratamizuki quits (~aratamizu@p2135145-ipoe.ipoe.ocn.ne.jp) ()
07:40:57 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
07:41:36 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
07:43:48 fm joins (~fm@user/fm)
07:45:52 × feliix42 quits (~felix@gibbs.uberspace.de) (Quit: ZNC 1.8.2 - https://znc.in)
07:46:04 feliix42 joins (~felix@gibbs.uberspace.de)
07:46:48 × mastarija quits (~mastarija@31.217.13.81) (Quit: Leaving)
07:49:57 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
07:55:56 chomwitt joins (~chomwitt@2a02:587:dc14:5d00:12c3:7bff:fe6d:d374)
08:00:28 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
08:01:46 × fm quits (~fm@user/fm) (Quit: fm)
08:03:12 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
08:06:08 hendursa1 joins (~weechat@user/hendursaga)
08:08:24 mikoto-chan joins (~mikoto-ch@84.199.144.235)
08:09:45 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
08:14:36 × azeem quits (~azeem@2a00:801:23e:e471:2966:ade4:f65d:e1fd) (Read error: Connection reset by peer)
08:14:51 azeem joins (~azeem@emp-182-240.eduroam.uu.se)
08:15:33 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: Textual IRC Client: www.textualapp.com)
08:17:31 meinside joins (uid24933@id-24933.helmsley.irccloud.com)
08:21:25 ubert joins (~Thunderbi@178.115.42.105.wireless.dyn.drei.com)
08:23:41 fendor joins (~fendor@e232-108.eduroam.tuwien.ac.at)
08:29:52 × mikoto-chan quits (~mikoto-ch@84.199.144.235) (Quit: mikoto-chan)
08:30:09 vysn joins (~vysn@user/vysn)
08:38:23 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
08:38:38 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
08:38:44 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Client Quit)
08:39:02 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
08:39:26 spruit11 joins (~quassel@2a02:a467:ccd6:1:d1b3:349a:ee3f:a17e)
08:41:18 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
08:41:54 jpds joins (~jpds@gateway/tor-sasl/jpds)
08:43:10 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c) (Remote host closed the connection)
08:45:48 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
08:50:42 × fendor quits (~fendor@e232-108.eduroam.tuwien.ac.at) (Remote host closed the connection)
08:51:31 × neo2 quits (~neo3@cpe-292712.ip.primehome.com) (Ping timeout: 265 seconds)
09:03:24 thyriaen joins (~thyriaen@dynamic-077-013-126-036.77.13.pool.telefonica.de)
09:05:45 arjun joins (~Srain@user/arjun)
09:05:54 <arjun> Hi
09:06:04 <arjun> `f :: forall b a. (Read a, Read b) => String -> (a,b)`
09:06:09 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
09:06:16 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net)
09:06:29 <arjun> what does the for all here do? isn't the (Read a, Read b) => constraint enough ?
09:06:56 <Hecate> arjun: sometimes for clarifiations
09:07:24 <Hecate> arjun: some other times to be able to access a and b (as defined in the signature) in inner bindings like `where` blocks
09:07:31 <Hecate> see ScopedTypedVariables
09:07:53 <Hecate> arjun: I know of people who systematically insert the forall
09:08:12 × azeem quits (~azeem@emp-182-240.eduroam.uu.se) (Read error: Connection reset by peer)
09:08:45 azeem joins (~azeem@emp-182-240.eduroam.uu.se)
09:08:49 <arjun> why do they do that Hecate?
09:12:19 <Hecate> arjun: so that they have less to infer by themselves when reading a type signature
09:12:35 <ldlework> Is it to correct to understand the HKT `:: *` as "is a concrete/constant type"
09:12:42 <ldlework> aka "not a type constructor"
09:12:43 <ldlework> ?
09:12:44 × phma quits (~phma@host-67-44-208-90.hnremote.net) (Read error: Connection reset by peer)
09:12:56 <Hecate> it's like having a "dramatis personæ" at the beginning of your theatre play script, arjun
09:13:15 <arjun> now i'll have to look _that_ up
09:13:33 <kuribas> arjun: a implicit forall containing all the free type variables is implied, when there is no explicit.
09:13:36 phma joins (~phma@host-67-44-208-57.hnremote.net)
09:13:48 <kuribas> arjun: except that some extensions (ScopedTypeVariables), only work on explicit foralls.
09:13:57 <arjun> but i think i get the tl;dr, its to be overtly explicit i guess
09:14:22 <arjun> kuribas: i see.
09:14:22 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
09:14:28 <kuribas> arjun: and it's always on toplevel, if you want RankN functions, you also need explicit forall.
09:14:34 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
09:14:42 <arjun> thanks Hecate: kuribas:
09:15:16 <Hecate> arjun: https://github.com/Kleidukos/effectful-contrib/blob/main/effectful-time/src/Effectful/Time.hs#L30-L32
09:15:19 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
09:15:22 <Hecate> see how it can be useful at times
09:18:04 <dminuoso> arjun: A few even think that `forall` should have been mandated for all type variables.
09:18:46 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Ping timeout: 260 seconds)
09:18:48 <kuribas> IMO it makes the intention clearer.
09:19:07 <dminuoso> Or rather whenever it would be implied.
09:19:41 <arjun> Hecate: i see, so everything before the "." are sort of like variable declarations, but at type level ?
09:20:03 <Hecate> I think it may be noise when the variables are utterly bland, but when you're doing stuff like forall (a :: [Effect]), then it provides much needed context
09:20:10 <Hecate> arjun: yus
09:20:16 <Hecate> at the signature level
09:20:29 <Hecate> and those variables can be re-used in inner bindings with ScopedTypeVariables
09:20:41 <arjun> es :: [Effect], is there another way to do that ? i can't think of any
09:20:42 <dminuoso> Hecate: You can use ∀ insead of forall to make it more terse.
09:21:22 dyeplexer joins (~dyeplexer@user/dyeplexer)
09:21:25 <Hecate> dminuoso: no I'm not taking about the keyword, I'm talking about the whole (possible) line of forall (a :: Type) (b :: Type) (c :: Type), or even forall a b c.
09:21:32 <Hecate> arjun: no
09:22:02 <arjun> then everything before the "=>" but after the "." deals with those type variables (eg putting constraints on them)
09:22:10 <Hecate> I have a simple heuristics: When some type variables are more complex than (:: Type), then I write them all down with their signature
09:22:24 <arjun> and then we can happily use them in our fn signatures after the "=>"
09:22:52 <Hecate> arjun: or without typeclass constraints, see https://github.com/Kleidukos/effectful-contrib/blob/main/effectful-time/src/Effectful/Time.hs#L25-L27
09:22:58 <Hecate> NO WAIT
09:23:00 <Hecate> I DIDN'T SAY ANYTHING
09:23:04 <Hecate> FORGET ABOUT WHAT I JUST SAID
09:23:15 <Hecate> arjun: so yes you're right
09:23:15 <arjun> about what ?
09:23:24 <Hecate> arjun: about the last link I posted
09:23:34 <arjun> i dont see anything
09:23:42 <Hecate> perfect
09:24:18 <Hecate> arjun: do you have any other question?
09:24:43 <arjun> no, thanks Hecate:
09:26:25 <Hecate> you're welcome
09:26:41 <Hecate> arjun: if you feel in need of exploring effect systems, I can recommend Effectful :)
09:27:07 <arjun> noted !
09:28:52 <tomsmeding> arjun: Another reason why people might use an explicit 'forall' is to fix the order of the type variables. GHC automatically inserts a forall that lists the type variables in a particular order; when giving the forall yourself, you can choose that order
09:29:20 <Akronymus> Does anyone here use shake?
09:29:22 <tomsmeding> normally this order does not matter at all, but it becomes relevant when you expect people to use your function with TypeApplications
09:29:29 <Akronymus> And how does it compare to cmake?
09:29:47 <tomsmeding> Witch does this to good effect: https://hackage.haskell.org/package/witch-0.3.4.0/docs/Witch.html
09:30:12 <Hecate> Akronymus: shake gives you the basis for making your own build system, while you need to conform to cmake for your project
09:30:30 <Hecate> arjun: oh yeah, type app order, very useful
09:30:39 <Akronymus> I used a bit a FAKE in the past.
09:30:51 <Akronymus> MUCH better than msbuild by itself.
09:31:00 × toms quits (~foobar@pogostick.net) (Remote host closed the connection)
09:31:01 <Hecate> arjun: https://hackage.haskell.org/package/pg-entity-0.0.1.0/candidate/docs/Database-PostgreSQL-Entity.html#v:selectById
09:31:09 <Hecate> Akronymus: oh, you're doing development on windows?
09:31:23 <Akronymus> Yeah.
09:31:29 <Akronymus> Altough it was for my own project
09:31:37 <Akronymus> Have to use msbuild/c# at work
09:33:35 <arjun> tomsmeding: Hecate: yus, thanks! that's what brought me here
09:33:50 <arjun> `f :: forall b a. (Read a, Read b) => String -> (a,b)
09:33:51 <arjun> f s = (read s, read s)
09:33:51 <arjun> λ f @Int @Double "1"`
09:34:06 <arjun> In this example b is getting the type Int, and a is getting the type Double.
09:34:32 <arjun> from this article here https://rebeccaskinner.net/posts/2021-08-25-introduction-to-type-level-programming.html
09:35:13 <Akronymus> Explaining monads well is impossible. :(
09:35:25 <Akronymus> I finally understood them but I dunno how to explain them
09:35:32 <arjun> tomsmeding: if we didn't, typedApplication will assign in-order right?
09:35:55 <Hecate> Akronymus: understanding and teaching are two different skills
09:36:29 <Akronymus> Even explaining why they are useful is hard.
09:36:38 <Hecate> Akronymus: I highly encourage you to read (and thus teach with) this book https://leanpub.com/finding-success-in-haskell
09:36:48 <Hecate> this has unlocked many "explaining" abilities for me
09:36:50 <Akronymus> I often get back that it'd be easier to not use a wrapper in any ase I give.
09:36:58 <arjun> Akronymus: i heard a joke flying around, based on the "heisenberg's uncertainty principle"
09:37:12 <Akronymus> Those who get monads can't explain them?
09:37:15 <arjun> you can either use Monads, or understand Monads, but not at once.
09:37:22 <Hecate> arjun: LOL
09:37:23 <Akronymus> Oh gotcha.
09:37:49 <ldlework> If I have a `Just a` is there a way to write `let Just a in print a` that doesn't require the let-just-to-pattern-match?
09:38:20 <tomsmeding> arjun: yes, I believe the default order that GHC chooses is the order of appearance, where kind variables are ordered to come before type variables
09:38:52 <arjun> i've been doing read 1 :: Int like an idiot all this time lol
09:39:07 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
09:39:10 <Akronymus> Kinda weird thing for me: I like both, haskell and lisp.
09:39:20 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
09:39:25 <Akronymus> But REALLY don't like languages that fall in between in terms of type system
09:39:25 <xsperry> ldlework, what should happen on Nothing?
09:39:28 burnsidesLlama joins (~burnsides@client-8-80.eduroam.oxuni.org.uk)
09:39:49 <ldlework> xsperry: but the function only takes Just a, so I assume the caller already figured that out
09:40:01 <tomsmeding> why not let it take an 'a' then :)
09:40:03 <Akronymus> Couldn't you just use a map?
09:40:24 <ldlework> I'm mostly asking if there's an easy way to get bits out of a datatype without having to wrap a thing in a let-expression
09:40:30 <ldlework> not about Just
09:40:43 <tomsmeding> only ways that are specific to datatypes
09:40:54 <tomsmeding> for maybe there's fromJust, which throws an error on Nothing
09:40:59 <ldlework> tomsmeding: you mean like how record types have the member functions
09:41:02 <tomsmeding> for record types there are the record selectors of course
09:41:03 <Akronymus> Seems like using a naked value is probably the right course of action.
09:41:07 <ldlework> I see
09:41:09 <ldlework> Thanks
09:41:10 <Akronymus> To me.
09:41:14 <xsperry> there's also fromMaybe and maybe
09:41:17 <tomsmeding> but yeah, from a program design standpoint, try to avoid getting in this situation :)
09:41:23 <tomsmeding> xsperry++
09:41:38 <xsperry> :t maybe (return ()) print
09:41:39 <ldlework> Just really was just the first datatype in mind
09:41:39 <lambdabot> Show a => Maybe a -> IO ()
09:41:52 <tomsmeding> ldlework: Just is not a datatype, 'Maybe a' is
09:41:57 <tomsmeding> Just is a constructor of Maybe
09:42:45 <ldlework> ah yeah i'm still working out the fog in nailing down the exact concepts
09:42:51 <Akronymus> Why do people keep saying loops are easier to understand?
09:42:59 <Akronymus> (for loops that is)
09:43:05 <kuribas> Akronymus: because it's all they ever did
09:43:09 <ldlework> Akronymus: momentum
09:43:11 <ldlework> yeah that
09:43:13 cafkafk joins (~cafkafk@user/cafkafk)
09:43:34 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c)
09:43:34 <Akronymus> When I see a "for" it may be doing anything and everything
09:43:38 <ldlework> the challenges in haskell are like
09:44:01 <ldlework> "change all the occurances of 'the' to 'a' when followed by a word starting with a vowel"
09:44:02 <Akronymus> While with map or fold I know that it converts the values without changing structure or that it changes structure.
09:44:08 <ldlework> and i sit here for hours thinking about how to do it
09:44:20 <ldlework> where in a language i'm comfortable with it would take maybe less than a minute
09:44:21 <ldlework> lol
09:44:27 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
09:44:40 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
09:44:56 <tomsmeding> yeah, folds are frequently easier to read because of their more limited capabilities, but sometimes for loops are easier to _write_
09:44:56 <ldlework> challenges in *Haskell From First Principles
09:45:15 <tomsmeding> because when you start writing the loop, sometimes you don't yet know what kind of accesses to the lists/arrays/whatever you need to do
09:45:17 <Akronymus> I'd solve that with a fold that keeps track of the last 2 tokens, and use that as a basic lookahead.
09:45:34 <tomsmeding> with a for loop, you can just start writing; with a fold, you need to nail down what you need before you can even start
09:45:36 <ldlework> it's really odd having to create a type to hold the state of the work for a given "loop"
09:45:52 <Akronymus> If "the" and a word starting with a vowel are the last 2, then insert a, otherse the original word.
09:45:54 <ldlework> and then writing something to "fold" over that state until its done
09:46:04 <Akronymus> And then have a extra function that takes care of the remainder.
09:46:05 <tomsmeding> I find myself writing a for loop sometimes first to figure out what I even want, and then afterwards convert it to a proper fold (which is usually simpler than the for loop was)(
09:46:07 <tomsmeding> )
09:46:20 <ldlework> Akronymus: yeah but it's the act of writing a type to hold the state, and a function to iterate it which is really strange
09:46:28 <Hecate> sometimes I just go with for_, or forM and it is the right answer
09:46:30 <ldlework> tomsmeding: have you tried F# :P
09:46:45 <ldlework> Hecate: haven't gotten to chapter 15 of HFFP yet :P
09:46:48 <ldlework> I'm on 12!
09:46:57 <Hecate> we don't always have to sacrifice our first-born loops to YHWH
09:47:01 <tomsmeding> no, what's it do, does it support for loops in pure code?
09:47:03 <Akronymus> For me, not having them is stranger nowadays ldlework
09:47:12 <tomsmeding> haskell does too, with the ST monad, but it's very unwieldy
09:47:13 <ldlework> Akronymus: I believe it
09:47:22 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
09:47:41 <ldlework> tomsmeding: yeah it's an ML with for-loop and other imperative support
09:47:41 <kuribas> ldlework: the only difference is that you create a new structure instead of modifying the existing one.
09:47:50 <kuribas> ldlework: and use recursion instead of a loop.
09:48:06 <ldlework> right but those are experientially and cognitively pretty different
09:48:06 <Akronymus> f# is pretty good.
09:48:10 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c) (Ping timeout: 260 seconds)
09:48:12 <kuribas> ldlework: also, use the `words` function.
09:48:19 <ldlework> hehe i will thanks
09:48:23 <Akronymus> I use that over haskell in my projects because of the great .net support.
09:48:31 <kuribas> ldlework: not really. Well structural recursion is much easier than a for loop.
09:48:31 <Akronymus> But I DO miss HKT.
09:48:41 <ldlework> yeah it doesn't have a do syntax either
09:48:51 <ldlework> but it has a kind of wierd frankenstein replacement
09:48:55 <ldlework> it's not bad in practice
09:49:02 <Akronymus> Yeah, the computation expressions
09:49:05 <ldlework> yeah
09:49:05 <Akronymus> Pretty useful.
09:49:46 <ldlework> it's a pretty wierd thing for MS to make
09:49:57 <ldlework> F# I mean
09:50:59 <ldlework> ah `words` is handy thanks kuribas
09:51:36 <tdammers> it does fit the original .NET concept though - one runtime environment / VM, with a whole zoo of languages to run on it, with seamless interop between them
09:52:50 <tdammers> it just so happened that "Managed C++" turned out an abomination, VB.NET was only useful as a stop-gap in migrating from legacy VB to C#, F# was "too academic", and rebranding Java.NET as J# or whatever was apparently not enough to keep in the clear legally, so the only one left, really, is C#
09:52:51 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
09:53:09 <tdammers> but back then, it made sense
09:53:12 <ldlework> F# is still there!
09:53:18 jpds joins (~jpds@gateway/tor-sasl/jpds)
09:53:26 <Akronymus> And still gets updates.
09:53:34 <Akronymus> And may even get HKT at some point.
09:53:34 <tdammers> well yes, so are managed c++ and vb.net, afaik
09:53:42 <Akronymus> (There is a HKT proposal for x#)
09:53:48 <Akronymus> s/x#/c#
09:53:55 <ldlework> tdammers: haha, I mean they still make releases for it
09:54:11 <ldlework> F# is actually a kind of proving ground for some of the features that go into C#
09:54:47 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
09:55:04 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
09:55:23 <ldlework> Oh shi- actually they said F# 5 is last release
09:55:26 <Akronymus> Lambdas, async await and such
09:55:27 <ldlework> that's sad
09:55:47 <ldlework> oh wait
09:55:52 <ldlework> i think i just misread this title
09:55:55 <Akronymus> source?
09:55:59 <ldlework> that was simply saying they were "done with F# 5"
09:56:03 <ldlework> as in they finished it
09:56:05 <Akronymus> Oh yeah.
09:56:09 <ldlework> rather than "we're finish with F# 5"
09:56:11 <ldlework> phew!
09:56:58 <Akronymus> https://github.com/fsharp/fslang-design/tree/main/preview ldlework
09:57:01 <Gurkenglas> <Gurkenglas> Why aren't the lens laws just "view l s ≡ view l s' implies set l b s ≡ set l b s'"? <- <nshepperd2> because that law isn't true? <- may I have an example?
09:57:06 <ldlework> kinda wish haskell had a maybeIf hehe
09:57:17 <Akronymus> Wait, wrong folder
09:57:21 <Akronymus> Or not
09:57:27 <Akronymus> I looked at the wrong tab
09:57:30 mangoiv joins (~MangoIV@193.175.5.172)
09:58:44 <Akronymus> Also: ldlework >New releases of F# typically align with a .NET and/or Visual Studio version.
09:58:53 <ldlework> C#, F#, TypeScript is not a bad repertoire I'll hand it to them
09:58:57 <Akronymus> So, when we get .net 6 we'll probably also get f# 6
09:59:04 <ldlework> I was learning about TypeScript mapped and conditional types a few months ago
09:59:12 <ldlework> mind-melting!
09:59:21 <Hecate> ldlework: what would be the type signature of this maybeIf ?
10:00:13 <ldlework> Hecate: I guess it would be like an if A then X else Y, evaluating to X when A is Just and Y when X is Nothing
10:00:50 <ldlework> just like a short hand sugar for a Maybe handling case-of
10:01:49 favonia joins (~favonia@user/favonia)
10:02:24 <ldlework> I guess case has the advantage of the destructure, allowing you to actually utilize the value
10:02:34 <ldlework> not sure how that'd work with a maybeIf
10:02:37 <ldlework> nevermind!
10:03:15 <ldlework> in lisp the macro would bind the Just value to `it` and call it a day :D
10:04:16 <Hecate> huhu
10:05:47 <tomsmeding> :t maybe -- ldlework
10:05:48 <lambdabot> b -> (a -> b) -> Maybe a -> b
10:06:18 <tomsmeding> > map (maybe 0 (*2)) [-2..2]
10:06:20 <lambdabot> error:
10:06:20 <lambdabot> • No instance for (Num (Maybe Integer))
10:06:20 <lambdabot> arising from a use of ‘e_10222’
10:06:21 <ldlework> one day i hope to be able to look at a function type and infer its utility
10:06:33 <tomsmeding> > map (maybe 0 (*2)) [Just 2, Just 4, Nothing, Just 5]
10:06:34 <lambdabot> [4,8,0,10]
10:06:48 <tomsmeding> (ignore the one that gave an error, brainfart)
10:07:05 <ldlework> so map the function over the list, for any Nothing's return the constant value
10:07:07 <ldlework> ?
10:07:17 <tomsmeding> well, I used 'map' to map it over the list
10:07:32 <ldlework> right
10:07:40 <tomsmeding> `maybe default fun x` is equivalent to `case x of Just value -> fun value ; Nothing -> default`
10:07:49 <tomsmeding> @src maybe
10:07:49 <lambdabot> maybe n _ Nothing = n
10:07:49 <lambdabot> maybe _ f (Just x) = f x
10:08:08 <ldlework> ah that's a nice bot command to know
10:08:11 <tomsmeding> @src fromMaybe
10:08:11 <lambdabot> fromMaybe d Nothing = d
10:08:11 <lambdabot> fromMaybe _ (Just v) = v
10:08:39 <Akronymus> How can people even live without algebraic data types?
10:08:43 <ldlework> @src maybeMap
10:08:43 <lambdabot> Source not found. :(
10:08:43 <tomsmeding> (@src only works for a select list of functions, and contains some simplified implementations sometimes for didactical reasons)
10:09:04 <ldlework> you mean pedagogical reasons
10:09:05 <ldlework> ?
10:09:24 <tomsmeding> maaaybe, I always switch those words around
10:09:25 <ldlework> oh
10:09:36 <ldlework> i think either kinda works here whatever
10:09:41 <ldlework> cool
10:09:45 <tomsmeding> right, yes
10:09:46 spruit11_ joins (~quassel@2a02:a467:ccd6:1:5542:2068:efaa:d531)
10:10:20 <tomsmeding> though in this case, @src didn't simplify anything :D https://hackage.haskell.org/package/base-4.15.0.0/docs/src/Data-Maybe.html#maybe
10:10:38 × arjun quits (~Srain@user/arjun) (Read error: Connection reset by peer)
10:11:09 arjun joins (~Srain@user/arjun)
10:11:38 <tomsmeding> :t either -- see also this one
10:11:39 <lambdabot> (a -> c) -> (b -> c) -> Either a b -> c
10:12:30 <tomsmeding> :t foldr -- and this one; the moment you understand how foldr is similar to maybe and either, you're going to have a big brain moment
10:12:31 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
10:12:36 <ldlework> i always tell young programmers how they'll have a better time with statically typed languages because of how much more powerful your editor/compiler can become when it has such explicit information
10:12:57 <ldlework> the vscode haskell plugin is not bad as refining expressions down to functions which cover that form
10:13:11 <ldlework> like a map to a concat can become a concatMap
10:13:24 <tomsmeding> (that foldr remark is about foldr on lists [a] specifically, not on arbitrary Foldables)
10:13:30 × spruit11 quits (~quassel@2a02:a467:ccd6:1:d1b3:349a:ee3f:a17e) (Ping timeout: 260 seconds)
10:13:52 <tomsmeding> ldlework: that's actually hlint that gives those suggestions, FYI
10:14:00 <ldlework> good to know
10:14:49 <ldlework> oh I need a concatMap that takes a delimeter :P
10:14:58 <tomsmeding> :t intercalate
10:14:59 <lambdabot> [a] -> [[a]] -> [a]
10:15:08 <ldlework> XD
10:15:15 <tomsmeding> > intercalate "," ["abc","def","ghi"]
10:15:17 <lambdabot> "abc,def,ghi"
10:15:19 <ldlework> I guess 'concatMapWith'
10:15:22 <ldlework> guessed*
10:15:50 <tomsmeding> https://hackage.haskell.org/package/bytestring-0.11.1.0/docs/Data-ByteString-Internal.html#v:accursedUnutterablePerformIO
10:16:33 <ldlework> 🎵 "It's time for intercalation." 🎵
10:16:41 dudek joins (~dudek@185.150.236.103)
10:17:52 <ldlework> oh "unwords"
10:17:54 <ldlework> hehe
10:18:40 <[exa]> btw is there some standard `untokens` ? (aka reverse strtok)
10:19:58 × azeem quits (~azeem@emp-182-240.eduroam.uu.se) (Ping timeout: 265 seconds)
10:20:38 <ldlework> my solution https://gist.github.com/dustinlacewell/06a6cb6e97c9fa70bc0342c36fe1374c
10:21:02 <ldlework> oh i forgot the vowel constraint
10:21:12 <tomsmeding> [exa]: isn't that intercalate?
10:21:54 <ldlework> oh that isn't an actual constraint
10:22:08 <[exa]> tomsmeding: it adds quotes and escapes
10:22:21 fusionr86 joins (~fusion@2a02-a44c-e6e5-1-cd1b-44f3-eefe-5182.fixed6.kpn.net)
10:22:27 <[exa]> it could be called `unshell` probably
10:22:52 <tomsmeding> (I thought strtok() was just splitOn)
10:26:49 azeem joins (~azeem@2a00:801:448:a48c:d59f:aee2:6d38:40c4)
10:26:54 <fusionr86> sup all. for my uni course we have to learn haskell and I'm currently working through my homework. I've got a few small questions about it though. Am I allowed to ask them here, or is that frowned upon? (ironically enough I can already see my teacher in this chat)
10:28:09 <tomsmeding> ;)
10:28:19 <tomsmeding> (can also ask in teams if you wish)
10:28:45 <tomsmeding> (assuming I'm the person you're talking about)
10:29:05 <fusionr86> (yeah but teams is a pita to use and less 'informal')
10:29:21 <tomsmeding> re:pita: yes, re:informal: /shrug/
10:29:43 <fusionr86> is it possible to send code blocks in irc? (like in markdown ``` code ```)?
10:30:05 <tomsmeding> irc is single-line-per-message; if you want to send multiple lines, use some kind of pastebin (see also the channel topic)
10:30:36 <tomsmeding> also: homework questions in #haskell is perfectly fine as long as you state that it's homework :)
10:32:19 × azeem quits (~azeem@2a00:801:448:a48c:d59f:aee2:6d38:40c4) (Read error: Connection reset by peer)
10:32:47 <Akronymus> https://hastebin.com/karaxagabi.typescript
10:33:11 <Akronymus> This is how I'd solve the replace the "the" with "a" if followed by a word starting with a vowel.
10:33:16 <Akronymus> Altough this is f#
10:33:19 <fusionr86> alrighty, you probably know what I'm talking about but I added comments with context in case anyone else looks at it -> https://paste.tomsmeding.com/3GfIgN6z
10:33:35 azeem joins (~azeem@emp-182-240.eduroam.uu.se)
10:33:51 <Akronymus> Only works with strings that are just one line though
10:33:54 <fusionr86> expected output should be "+-+--+---+----+" I messed that up in the example
10:34:03 <Akronymus> And only separated by a single space
10:35:48 × burnsidesLlama quits (~burnsides@client-8-80.eduroam.oxuni.org.uk) (Remote host closed the connection)
10:36:07 <tomsmeding> fusionr86: in my opinion, lambda _is_ prettier; "+" ++ intercalate "+" (map (\n -> replicate n '-') x) ++ "+" looks fine to me
10:36:33 <tomsmeding> alternative is using the infix function notation (like `div`), but together with an operator section
10:36:40 <Akronymus> Nvm, I messed the function up
10:36:42 <tomsmeding> :t (2 +)
10:36:43 <lambdabot> Num a => a -> a
10:36:50 <tomsmeding> > (2 +) 10
10:36:52 <lambdabot> 12
10:36:54 Akronymus parts (~Akronymus@85.31.8.180) ()
10:37:02 Akronymus joins (~Akronymus@85.31.8.180)
10:37:07 <tomsmeding> > (`replicate` '-') 5
10:37:09 <lambdabot> "-----"
10:37:39 <tomsmeding> but I think (\n -> replicate n '-') is significantly easier to read than (`replicate` '-') :p
10:38:04 <tomsmeding> fusionr86: exercise: use 'flip' to avoid a lambda
10:38:05 <tomsmeding> :t flip
10:38:06 × choucavalier_ quits (~choucaval@peanutbuttervibes.com) (Quit: ZNC 1.8.2 - https://znc.in)
10:38:07 <lambdabot> (a -> b -> c) -> b -> a -> c
10:39:01 <Akronymus> https://rebeccaskinner.net/posts/2021-08-25-introduction-to-type-level-programming.html
10:39:06 <Akronymus> Some may find this interesting
10:39:49 <tomsmeding> Akronymus: if you're using regex anyway, why not replace /\b[Tt][Hh][Ee]\s+([aeiouAEIOU])/ with "a \1"
10:40:01 <tomsmeding> I think using regex here is missing the point of the exercise :p
10:40:42 <Akronymus> I of course could have checked for each possibly letter through match
10:40:51 <Akronymus> But I messed up the code anyways.
10:41:10 <tomsmeding> isThe :: String -> Bool ; isThe w = map toLower w == "the"
10:41:15 <tomsmeding> inspiration :P
10:42:23 <Akronymus> I pretty much wrote it out in 5 minutes.
10:42:45 <Akronymus> But yeah, this is one of the cases, where an iterative approach is probably easier.
10:43:58 × arjun quits (~Srain@user/arjun) (Ping timeout: 252 seconds)
10:47:42 <ldlework> An easy way is to write a foldl2
10:48:11 <ldlework> foldl2 _ b [] = b; foldl2 _ b [_] = b; foldl2 f b (a:a2:as) =
10:48:13 <ldlework> foldl2 f b' (a2:as)
10:48:15 <ldlework> where b' = f b a a2
10:48:40 <ldlework> though this is for counting `the`s followed by a word starting with a vowel
10:48:50 <ldlework> so you just need isThe and startWithVowel
10:48:56 <ldlework> but you can do a map2 too
10:49:08 <tomsmeding> Akronymus: the cop-out approach where you ignore that folds are cool is to just write the loop as a recursive function directly: https://paste.tomsmeding.com/ZbIpppMe
10:49:23 <tomsmeding> this is barely more thinking work than writing an imperative loop
10:50:19 <fusionr86> okay, and "f1 = (`replicate` '-')" and "f2 x = replicate x '-'" are exactly the same, correct?
10:50:25 <tomsmeding> yes
10:50:49 <tomsmeding> just like "f1 = (+ 10)" and "f2 x = x + 10" are exactly the same
10:51:01 <fusionr86> coming from c-style languages stuff like this is completely mind shattering
10:51:32 <tomsmeding> it allows for very concise things sometimes :)
10:51:58 <tomsmeding> like, "map (*2)" is a function that returns a list containing all the elements in its argument list doubled
10:52:08 <tomsmeding> beat that in anything but a golfing language like GolfScript
10:52:50 <Akronymus> Yeah, that's fair
10:52:55 <Akronymus> tomsmeding
10:53:06 <Akronymus> I messed up MANY things with my fold solution anyways.
10:53:08 <Rembane> J!
10:53:10 × hpc quits (~juzz@ip98-169-35-13.dc.dc.cox.net) (Ping timeout: 240 seconds)
10:53:19 <tomsmeding> J is a golfing language, hot take :p
10:53:25 <tomsmeding> okay no it isn't
10:53:25 <carbolymer> I'm trying to understand linear types; is there any tl;dr what those are and when would I need them?
10:54:22 <tomsmeding> carbolymer: section 2 of https://arxiv.org/pdf/1710.09756.pdf is actually quite readable
10:54:46 <carbolymer> tomsmeding: thanks!
10:54:58 <Rembane> tomsmeding: It's just very good for golfing :D
10:55:04 hpc joins (~juzz@ip98-169-35-13.dc.dc.cox.net)
10:56:00 arjun joins (~Srain@user/arjun)
10:56:53 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
10:56:53 <Akronymus> Rembane Java is good at golfing /s
10:57:05 <carbolymer> s/golfing/loosing at golfing/
10:57:13 <Akronymus> s/loosing/losing
10:58:19 <carbolymer> your pattern is missing trailing slash - substitution failed
10:58:57 <Akronymus> Most IRC sed bots worked without a trailing slash
10:59:11 <Akronymus> I miss having a sed bot at all.
11:00:35 mitchell joins (~mitchell@185.64.41.91)
11:00:38 mitchell parts (~mitchell@185.64.41.91) ()
11:00:58 alx741 joins (~alx741@186.178.109.214)
11:03:01 <fusionr86> tomsmeding: Ah and this is what you meant by using flip? `printLine x = "+" ++ intercalate "+" (map (flip replicate '-') x) ++ "+"` Though I like the infix solution more (and so does hlint)
11:03:57 × ubert quits (~Thunderbi@178.115.42.105.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
11:04:02 <raehik> I'm getting a strange issue trying to build a package that uses hmatrix -- Cabal won't use my --extra-[lib,include]-dirs flags
11:04:43 <raehik> It keeps failing on hmatrix saying "cannot find blas, lapack". I downloaded hmatrix source and tried the same command, and that works (it was able to find my built libs)
11:05:18 <raehik> Does Cabal push --extra-x-flags down when building dependencies? How else can I solve this?
11:05:53 × azeem quits (~azeem@emp-182-240.eduroam.uu.se) (Ping timeout: 265 seconds)
11:06:01 arjun_ joins (~Srain@user/arjun)
11:06:31 × arjun quits (~Srain@user/arjun) (Ping timeout: 252 seconds)
11:06:32 arjun_ is now known as arjun
11:07:05 × pony quits (~ed@101.53.218.157) (Quit: WeeChat 2.8)
11:08:21 azeem joins (~azeem@2a00:801:448:a48c:d59f:aee2:6d38:40c4)
11:08:53 × azeem quits (~azeem@2a00:801:448:a48c:d59f:aee2:6d38:40c4) (Read error: Connection reset by peer)
11:09:02 <tomsmeding> fusionr86: that's indeed what I meant :)
11:09:10 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
11:09:11 azeem joins (~azeem@emp-182-240.eduroam.uu.se)
11:09:29 <tomsmeding> my preference would go to the lambda version though, hlint notwithstanding
11:09:36 <tomsmeding> but that's subjective
11:10:59 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:11:18 <tomsmeding> raehik: you might want to try using a cabal.project file https://arxiv.org/pdf/1710.09756.pdf
11:11:21 <tomsmeding> oh crap
11:11:25 <tomsmeding> this link https://cabal.readthedocs.io/en/3.4/cabal-project.html#foreign-function-interface-options
11:11:40 arjun_ joins (~Srain@user/arjun)
11:11:53 <tomsmeding> like, "packages: .\npackage hmatrix\n\textra-include-dirs: ...\n\textra-lib-dirs: ...\n"
11:12:10 × arjun quits (~Srain@user/arjun) (Ping timeout: 260 seconds)
11:12:10 × mangoiv quits (~MangoIV@193.175.5.172) (Ping timeout: 260 seconds)
11:12:10 arjun_ is now known as arjun
11:15:52 <raehik> tomsmeding: thank you! so that's what this (open, 2015) issue was about https://github.com/haskell/cabal/issues/2997
11:16:07 <raehik> I was writing that into the *.cabal file instead oops. not used cabal.project before
11:16:55 <raehik> It looks like the -I include dir flag is successfully added now, but not the -L lib dir one, & fails with same error
11:17:18 <raehik> ah nope -L s are there too, good
11:17:54 × mei quits (~mei@user/mei) (Read error: Connection reset by peer)
11:19:17 teo joins (~teo@137.220.120.222)
11:19:58 <raehik> Very weird. I'm building on Windows. --extra-x-dirs flags with Linux-style dirs (/x/y/z) work on building hmatrix directly
11:19:59 oxide joins (~lambda@user/oxide)
11:20:30 <raehik> but for a project that uses hmatrix as a dep, I need a cabal.project and I need to use Windows-style dirs (C:\x\y\z)
11:20:42 <tomsmeding> isn't that because ghc uses mingw internally, and that has a linux-path-to-windows-path conversion thing?
11:21:17 <tomsmeding> raehik: ghc versions?
11:22:26 <tomsmeding> 9 or 9.2 or something added a new windows layer for the RTS or something? that did away with some of the mingw stuff? just guessing
11:22:27 lavaman joins (~lavaman@98.38.249.169)
11:22:32 <raehik> GHC 9.0.1 via ghcup
11:23:08 <raehik> You're right I see lots of /x/ghcup/mingw32 paths in the verbose build logs
11:23:14 <fusionr86> tomsmeding: so which of these two solutions is prettier? https://paste.tomsmeding.com/TSpvZg9Q I kinda like 2a because it uses less () aka more readable imo, but abusing ++ like that feels wrong.
11:23:21 <ldlework> I'm having a hard time writing a map2
11:23:42 <ldlework> why are these cases incomplete? https://gist.github.com/dustinlacewell/0bd14c3457ee70b6a840149268d0c97f
11:23:58 × brandonh quits (brandonh@gateway/vpn/protonvpn/brandonh) (Ping timeout: 252 seconds)
11:24:26 <tomsmeding> ldlework: you need some () instead of some [], probably in your third and fourth cases
11:24:38 <jneira[m]> tomsmeding: i think it is not the default yet, at least in 9.9
11:24:40 <jneira[m]> 9.0
11:24:43 <ldlework> oh
11:24:45 <ldlework> that worked
11:25:10 <tomsmeding> jneira[m]: ah
11:25:39 <tomsmeding> fusionr86: 2a will cost you points for excessive pointfree notation lol
11:26:02 <tomsmeding> @pl \a b c d f -> f d b a c
11:26:02 <lambdabot> ((flip . (flip .)) .) . flip (flip . (flip .) . flip (flip . flip id))
11:26:49 <tomsmeding> fusionr86: the big question when writing "nice" haskell code is: how easy is it to figure out what it does by reading it
11:27:12 <tomsmeding> not any kind of metric-following where you want more or less pointfreeness
11:27:12 euandreh joins (~euandreh@2804:14c:33:9fe5:293c:729f:ef0:fde4)
11:27:15 <jneira[m]> <raehik> "but for a project that uses..." <- i would say that putting paths in the cabal.project for a dependency should work like putting them in the cabal global config file or the cli option for building it directly
11:27:33 <jneira[m]> so it is a cabal bug
11:27:47 <tomsmeding> fusionr86: for 2a I had to mentally convert it to 2b to even get what it's doing
11:28:02 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 260 seconds)
11:28:17 <raehik> jneira[m]: It looks like it's an open issue #2997 on the Cabal github
11:28:21 <jneira[m]> but i think putting windows paths in the config or cli option works as well no?
11:28:48 <sclv> its not a bug per se
11:28:49 <jneira[m]> hmm it talks about windows vs posix paths too?
11:29:16 <jneira[m]> a feature then 😆
11:29:17 <fusionr86> tomsmeding: alright I'll go with 2b, but tbh all haskell code I see looks like 2a to me (complexity wise)
11:29:21 <sclv> its a question of semantics -- if you have an option set _in general_ then you need to decide what packages it applies to
11:29:24 <raehik> no not that (I can imagine that's awkwardness with MSYS)
11:29:42 <sclv> if it gets applied to every package then you're rebuilding the full dep tree with that option, etc
11:29:48 <ldlework> this still doesn't work
11:29:50 <ldlework> https://gist.github.com/dustinlacewell/0bd14c3457ee70b6a840149268d0c97f
11:29:52 <sclv> the problem is nobody worked out the "right" way
11:29:52 <ldlework> leaves the string unchanged
11:29:57 <jneira[m]> i talk about handle paths the same way
11:29:59 <ldlework> it should iterate over it 2 chars at a time
11:30:11 <ldlework> replace any char who's followed by a vowel with '!'
11:30:13 <ldlework> what gives?
11:30:23 <ldlework> oh
11:30:25 <ldlework> see my problem
11:30:26 <sclv> so the solution punted and said "we'll just take specified options"
11:30:46 <sclv> and didn't try to figure out the "right meaning" for setting the extra lib stuff "in general"
11:30:49 <ldlework> no didn't fix it
11:31:03 <nshepperd> Gurkenglas: pretty much any object and lens on it
11:31:04 <ldlework> updated with fix though
11:31:06 <jneira[m]> sclv: agree on that, it is tricky
11:31:11 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Quit: ChaiTRex)
11:31:19 <jneira[m]> but paths should be handle the same way :-)
11:32:16 ChaiTRex joins (~ChaiTRex@user/chaitrex)
11:32:25 <nshepperd> Gurkenglas: s = (1, 0), s' = (2, 0), l = _2, for one
11:33:05 × lambdap quits (~lambdap@static.167.190.119.168.clients.your-server.de) (Quit: lambdap)
11:33:11 <tomsmeding> fusionr86: example of code in the wild that looks like that to you?
11:33:26 × acidjnk_new3 quits (~acidjnk@p5487d0ba.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
11:33:41 <tomsmeding> (not saying it doesn't exist, just want to see what it looks like)
11:33:44 lambdap joins (~lambdap@static.167.190.119.168.clients.your-server.de)
11:35:34 ManofLetters[m] joins (~manoflett@2001:470:69fc:105::3be)
11:37:08 × aman quits (~aman@user/aman) (Quit: aman)
11:39:43 <fusionr86> tomsmeding: nothing in particular, was just referring to the fact that haskell is a huge mindset switch compared to 'other' languages (well it is for me at least)
11:39:50 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Quit: FinnElija)
11:40:25 <tomsmeding> fusionr86: that makes sense; it is for most people :)
11:40:28 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
11:40:50 <tomsmeding> you'll get more familiar with the mindset as you go along
11:41:29 <ldlework> tomsmeding: where am i going wrong
11:45:31 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
11:45:36 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c)
11:48:30 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
11:48:36 <Gurkenglas> nshepperd, how silly of me, I thought quotient sets are the inverse of set product :)
11:49:40 ic2000_ joins (~ic2000_@cpc108265-brom11-2-0-cust119.16-1.cable.virginm.net)
11:49:52 <ldlework> stumped
11:50:02 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c1f1:b01b:5ae7:397c) (Ping timeout: 245 seconds)
11:50:48 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
11:52:39 <tomsmeding> ldlework: I don't see a word starting with a vowel?
11:53:11 <tomsmeding> (also note that the pattern '(a:[b])' is equivalent to the pattern '[a,b]')
11:53:52 <ldlework> lmao, changing it to "the ape" doesn't have any change in behavior
11:53:54 <tomsmeding> ldlework: also you're not using 'words' anywhere
11:54:25 <ldlework> tomsmeding: this is just iterating the characters
11:54:42 <ldlework> switching the first of any pair of characters to '!' if it's followed by a vowel
11:54:52 <ldlework> i made it simplier to try to figure out what's going on
11:55:00 × max22- quits (~maxime@2a01cb088335980093c01212af90dc30.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
11:55:03 <ldlework> this gist, just to be sure https://gist.github.com/dustinlacewell/0bd14c3457ee70b6a840149268d0c97f
11:55:19 <ldlework> grass should => g!ass
11:55:27 <tomsmeding> ah
11:55:40 <tomsmeding> `[a', b] ++ cs where a' = f a b` doesn't recurse
11:55:51 <ldlework> but there's only two elements
11:56:10 <ldlework> oh
11:56:14 brandonh joins (brandonh@gateway/vpn/protonvpn/brandonh)
11:56:42 <ldlework> I see
11:56:44 <tomsmeding> also, when you're done, the third case of map2 (a:[b]) is probably going to be redundant because it does the same as case 4 and case 2 together
11:57:41 jeicher joins (~jeicher@102.132.229.54)
11:58:11 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
11:59:07 <ldlework> I get an infinite type now
11:59:13 <tomsmeding> yay
11:59:19 × fusionr86 quits (~fusion@2a02-a44c-e6e5-1-cd1b-44f3-eefe-5182.fixed6.kpn.net) (Quit: Leaving)
11:59:32 × lambdap quits (~lambdap@static.167.190.119.168.clients.your-server.de) (Ping timeout: 265 seconds)
11:59:50 <ldlework> https://gist.github.com/dustinlacewell/0bd14c3457ee70b6a840149268d0c97f
12:00:07 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
12:00:31 <tomsmeding> ldlework: as the error says, f :: a -> a -> a and xs :: [a]
12:01:00 <tomsmeding> presumably s/map/map2/
12:01:08 <ldlework> oh
12:01:12 <ldlework> man I should go to sleep
12:01:15 <ldlework> 7am up all night
12:01:17 <ldlework> heh
12:01:34 <tomsmeding> it's 7am in the morning for you? please go to sleep now
12:01:52 <ldlework> it still somehow doesn't work XD
12:02:01 <ldlework> ok ok, night :) (thanks for the help btw)
12:02:21 <tomsmeding> after sleep you'll have a better time fixing the code :)
12:02:24 <ldlework> oh
12:02:25 <ldlework> now it does
12:02:27 <ldlework> nice
12:02:34 jeicher is now known as jcat
12:02:37 × parisienne quits (sid383587@id-383587.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
12:02:50 <ldlework> "t!e!a!e!a!e t!e g!ass??"
12:03:20 <ChaiTRex> What's a good name for a function that takes a list, xs, and produces the list of all possible lists of the same length as xs consisting of any elements from xs, but the elements have to be sorted in the same order they appear in xs? whatever [a,b,c] == [[a,a,a],[a,a,b],[a,a,c],[a,b,b],[a,b,c],[a,c,c],[b,b,b],[b,b,c],[b,c,c],[c,c,c]]
12:03:31 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
12:03:55 <ldlework> orderedPermutations ?
12:03:56 WorldSEnder joins (~martin@88.215.87.144)
12:04:16 <ldlework> cccomboMaker
12:04:39 <ChaiTRex> Well, they're not exactly permutations.
12:05:27 × WorldSEnder quits (~martin@88.215.87.144) (Client Quit)
12:05:33 <ChaiTRex> What is it called when you do whatever [a,b] and get [[a,a],[a,b],[b,a],[b,b]]?
12:05:49 <tomsmeding> if the length of the sublists was a parameter instead of hard-coded to be "the length of the input list", then it would be sublists
12:05:52 <Akronymus> Point free syntax, yay or nay?
12:06:03 <tomsmeding> well, sublistsWithReplacement, which is weird
12:06:10 <tomsmeding> ChaiTRex: combinations
12:06:21 <tomsmeding> Akronymus: if it makes the code more readable ;)
12:06:38 <ChaiTRex> combinationsWithReplacement maybe.
12:06:49 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
12:06:54 <Akronymus> Tbh, I don't think I have seen a case where point free made it actually more readable.
12:06:59 <tomsmeding> combinations to me implies that [b,a] is in the result
12:07:03 <Akronymus> Rather than less or the same.
12:07:19 <hpc> Akronymus: poınt free syntax :D
12:07:22 <ChaiTRex> So, orderedCombinationsWithReplacement
12:07:35 <tomsmeding> Akronymus: dumb case is simple operator sections: map (*2) is better than map (\x -> x * 2)
12:07:52 <Gurkenglas> ChaiTRex, are they in the same order because they're not supposed to have an order?
12:07:56 <Akronymus> Oh like that.
12:08:04 <tomsmeding> 'ordNub = uniq . sort' also
12:08:06 <Akronymus> Didn't even occur to me that it was points free.
12:08:55 <Akronymus> If you have a list of lists, for example, and I want to sum all things, I'd probably do something like this: fold (fold +)
12:09:29 <tomsmeding> :t fold (fold (+))
12:09:30 <lambdabot> (Foldable ((->) m), Monoid m, Num m) => m
12:09:34 <tomsmeding> not sure you meant that
12:09:37 <ChaiTRex> Gurkenglas: The order is irrelevant, so I want to avoid what are essentially duplicates with the same elements in different orders.
12:09:41 <tomsmeding> Akronymus: sum . map sum
12:09:46 <Akronymus> Oh that works too.
12:10:03 <tomsmeding> ChaiTRex: submultisets
12:11:29 <Gurkenglas> ChaiTRex, why are they the same size? I'd expect them to only be the same size if it is meaningful to zip them together.
12:12:06 × arjun quits (~Srain@user/arjun) (Ping timeout: 265 seconds)
12:12:36 <ChaiTRex> I'm making a program to relabel dice to get a certain distribution of sum-what-you-rolled outcomes.
12:13:29 <ChaiTRex> So, when you label a fair die, the order you label the sides doesn't matter.
12:13:49 <Gurkenglas> Why do you fix the labels to [1..6]?
12:13:50 <ChaiTRex> So, I want to choose labels for the sides from, say [0 .. 9] or something.
12:14:13 <Gurkenglas> Aka why dont you let them label a sixsided die 1,2,4,8,16,32?
12:14:49 <ChaiTRex> Well, I could do [1 .. 32] for the possible labels and that would eventually produce that labelling.
12:15:10 <Gurkenglas> no, that only labels 32-sided dice.
12:15:20 <ChaiTRex> No, those are the possible labels.
12:15:33 <ChaiTRex> 1,2,4,8,16,32 are all in [1 .. 32].
12:15:46 <Gurkenglas> "all possible lists of the same length as xs" you said
12:16:34 <ChaiTRex> Yeah, but someone suggested that the length of the sublists could be a parameter.
12:16:57 <Gurkenglas> Oh, sorry.
12:17:43 <ChaiTRex> tomsmeding: I think submultisetsOfLength might work.
12:18:03 <ChaiTRex> Or multisetsOfLength
12:18:09 <Gurkenglas> replicateM, for the Bag monad.
12:19:02 <Gurkenglas> (aka lists without order)
12:20:50 <Gurkenglas> (just another word for multisets)
12:23:14 <Gurkenglas> > replicateM 3 [x,y]
12:23:16 <lambdabot> [[x,x,x],[x,x,y],[x,y,x],[x,y,y],[y,x,x],[y,x,y],[y,y,x],[y,y,y]]
12:24:07 <ChaiTRex> Yeah, one implementation is this:
12:24:22 <ChaiTRex> > nub . map sort . replicateM 3 $ [x, y]
12:24:23 <lambdabot> [[x,x,x],[x,x,y],[x,y,y],[y,y,y]]
12:25:10 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
12:25:11 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
12:25:24 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
12:25:28 <Gurkenglas> Yeah but I'm going for nubbing at each step to help with the combinatorial runtime
12:25:58 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.2)
12:26:38 <Gurkenglas> (oh, it's replicateM for the MultiSet monad *with [] replaced by MultiSet as well*)
12:27:12 <ChaiTRex> @let multisetsOfSize :: Word8 -> [a] -> [[a]]; multisetsOfSize 0 = const [[]]; multisetsOfSize n = concatMap (\ yys@(y : _) -> map (y :) (multisetsOfSize (n - 1) yys)) . init . tails
12:27:14 <lambdabot> Defined.
12:27:30 <ChaiTRex> That's an implementation that doesn't produce duplicates or require Ord.
12:27:41 <ChaiTRex> > moltisetsOfSize 3 [x, y]
12:27:43 <lambdabot> error:
12:27:43 <lambdabot> • Variable not in scope: moltisetsOfSize :: t0 -> [Expr] -> t
12:27:43 <lambdabot> • Perhaps you meant ‘multisetsOfSize’ (line 154)
12:27:46 <ChaiTRex> > multisetsOfSize 3 [x, y]
12:27:48 <lambdabot> [[x,x,x],[x,x,y],[x,y,y],[y,y,y]]
12:29:23 Vajb joins (~Vajb@n1xq4ni1adi29tefj-2.v6.elisa-mobile.fi)
12:29:24 acidjnk_new3 joins (~acidjnk@p200300d0c7203080b51432c313ea99eb.dip0.t-ipconnect.de)
12:29:49 <Gurkenglas> Data.Monoid.Combinators says to use reducers instead, but where's the replicate?
12:32:34 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
12:34:27 <Gurkenglas> oh well, not like it needs an import.
12:37:03 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
12:37:03 × Vajb quits (~Vajb@n1xq4ni1adi29tefj-2.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
12:38:08 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
12:46:28 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
12:48:39 <Gurkenglas> Is there a proposal to have Typeclasses propagate constraints automatiaclly, so that Set could have a monad instance?
12:48:49 × ic2000_ quits (~ic2000_@cpc108265-brom11-2-0-cust119.16-1.cable.virginm.net) (Ping timeout: 252 seconds)
12:50:10 pera joins (~pera@user/pera)
12:51:06 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Ping timeout: 260 seconds)
12:51:49 zmt01 joins (~zmt00@user/zmt00)
12:54:10 × burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Remote host closed the connection)
12:54:22 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 260 seconds)
13:05:58 shriekingnoise joins (~shrieking@186.137.144.80)
13:08:50 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 260 seconds)
13:09:07 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
13:16:17 geekosaur joins (~geekosaur@xmonad/geekosaur)
13:19:02 mei joins (~mei@user/mei)
13:19:25 slowButPresent joins (~slowButPr@user/slowbutpresent)
13:20:15 × mei quits (~mei@user/mei) (Read error: Connection reset by peer)
13:20:49 × dudek quits (~dudek@185.150.236.103) (Read error: Connection reset by peer)
13:21:06 dudek joins (~dudek@185.150.236.103)
13:22:07 mei joins (~mei@user/mei)
13:24:50 pottsy joins (~pottsy@2400:4050:b560:3700:6306:be47:d72c:aeef)
13:25:50 vpan joins (~vilius@212.117.1.172)
13:27:04 × mei quits (~mei@user/mei) (Quit: mei)
13:27:35 mei joins (~mei@user/mei)
13:31:30 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
13:34:15 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
13:34:23 n3t joins (n3t@s45.mydevil.net)
13:35:03 Vajb joins (~Vajb@n1xq4ni1adi29tefj-2.v6.elisa-mobile.fi)
13:35:30 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
13:35:48 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
13:35:55 × burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Ping timeout: 260 seconds)
13:36:32 Guest|1 joins (~Guest|1@p1627016-ipngn200910fukuokachu.fukuoka.ocn.ne.jp)
13:37:11 × Guest|1 quits (~Guest|1@p1627016-ipngn200910fukuokachu.fukuoka.ocn.ne.jp) (Client Quit)
13:37:16 max22- joins (~maxime@2a01cb088335980003a066e559758211.ipv6.abo.wanadoo.fr)
13:38:34 rond_ joins (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
13:41:29 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
13:43:24 tureba_ joins (~tureba@tureba.org)
13:43:45 × tureba_ quits (~tureba@tureba.org) (Client Quit)
13:43:50 × sleblanc quits (~sleblanc@user/sleblanc) (Ping timeout: 260 seconds)
13:45:07 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
13:45:19 × thyriaen quits (~thyriaen@dynamic-077-013-126-036.77.13.pool.telefonica.de) (Ping timeout: 252 seconds)
13:45:37 hendursaga joins (~weechat@user/hendursaga)
13:45:53 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
13:46:06 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
13:46:49 tureba joins (~tureba@tureba.org)
13:49:54 × favonia quits (~favonia@user/favonia) (Ping timeout: 260 seconds)
13:53:19 × jcat quits (~jeicher@102.132.229.54) (Quit: WeeChat 3.2)
13:55:55 pbrisbin joins (~patrick@pool-108-16-214-93.phlapa.fios.verizon.net)
13:58:01 × wolfshappen quits (~waff@irc.furworks.de) (Ping timeout: 252 seconds)
13:58:45 wolfshappen joins (~waff@irc.furworks.de)
13:59:27 TranquilEcho joins (~grom@user/tranquilecho)
14:01:54 zebrag joins (~chris@user/zebrag)
14:05:44 burnsidesLlama joins (~burnsides@client-8-80.eduroam.oxuni.org.uk)
14:05:54 × teo quits (~teo@137.220.120.222) ()
14:10:32 favonia joins (~favonia@user/favonia)
14:12:46 × jinsun quits (~quassel@user/jinsun) (Ping timeout: 260 seconds)
14:13:48 aman joins (~aman@user/aman)
14:15:50 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
14:20:48 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
14:20:58 × amahl quits (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi) (Remote host closed the connection)
14:21:04 img joins (~img@user/img)
14:21:13 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
14:21:26 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
14:22:07 × Akronymus quits (~Akronymus@85.31.8.180) (Quit: Client closed)
14:24:33 Sgeo joins (~Sgeo@user/sgeo)
14:24:40 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
14:26:14 × pottsy quits (~pottsy@2400:4050:b560:3700:6306:be47:d72c:aeef) (Quit: Leaving)
14:32:45 × azeem quits (~azeem@emp-182-240.eduroam.uu.se) (Ping timeout: 265 seconds)
14:34:42 × favonia quits (~favonia@user/favonia) (Ping timeout: 260 seconds)
14:36:11 mangoiv joins (~MangoIV@193.175.5.172)
14:41:10 × cafkafk quits (~cafkafk@user/cafkafk) (Quit: WeeChat 3.1)
14:41:32 × slep quits (~slep@cpc150002-brnt4-2-0-cust437.4-2.cable.virginm.net) (Ping timeout: 252 seconds)
14:41:33 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
14:41:47 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
14:41:47 × gentauro quits (~gentauro@user/gentauro) (Read error: Connection reset by peer)
14:45:23 × pera quits (~pera@user/pera) (Ping timeout: 252 seconds)
14:45:30 pera joins (~pera@137.221.132.212)
14:45:54 pera is now known as Guest265
14:47:00 azeem joins (~azeem@2a00:801:3c7:c672:c46:3e15:33ac:e08b)
14:47:43 gentauro joins (~gentauro@user/gentauro)
14:48:13 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
14:48:14 × brandonh quits (brandonh@gateway/vpn/protonvpn/brandonh) (Ping timeout: 260 seconds)
14:50:38 × dsrt^ quits (~dsrt@68.101.54.227) (Remote host closed the connection)
14:50:49 brandonh joins (~brandonh@151.36.214.216)
14:52:42 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
14:52:54 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Ping timeout: 260 seconds)
14:53:23 × Guest265 quits (~pera@137.221.132.212) (Quit: leaving)
14:57:50 × mei quits (~mei@user/mei) (Read error: Connection reset by peer)
14:59:05 <c_wraith> Gurkenglas: I'm not a big fan of breaking parametricity
14:59:42 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
14:59:49 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
14:59:49 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
14:59:49 wroathe joins (~wroathe@user/wroathe)
15:00:28 hexfive joins (~eric@50.35.83.177)
15:01:30 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
15:01:40 × burnsidesLlama quits (~burnsides@client-8-80.eduroam.oxuni.org.uk) (Remote host closed the connection)
15:02:44 × hexfive quits (~eric@50.35.83.177) (Client Quit)
15:03:05 <c_wraith> I really like looking at (>>=) :: Monad m => m a -> (a -> m b) -> m b and knowing that it can't do arbitrary things based on the types `a' and `b', or what values of each may or may not exist.
15:03:29 acidjnk_new joins (~acidjnk@p200300d0c7203049d04185c247f1acfb.dip0.t-ipconnect.de)
15:06:17 × acidjnk_new3 quits (~acidjnk@p200300d0c7203080b51432c313ea99eb.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
15:06:54 <Gurkenglas> c_wraith, can you give an example of an arbitrary thing you could do if (>>=) specialized to (Ord a, Ord b) => Set a -> (a -> Set b) -> Set b?
15:07:22 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 260 seconds)
15:07:39 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
15:07:52 <c_wraith> No, but I could give you plenty of examples of bad things if (>>=) specialized to (Typeable a, Typeable b) => Foo a -> (a -> Foo b) -> (Foo b)
15:09:26 <Gurkenglas> Ooh! Such as?
15:10:10 × jespada quits (~jespada@90.254.245.194) (Ping timeout: 252 seconds)
15:11:43 jespada joins (~jespada@90.254.245.194)
15:12:07 goepsilongo joins (~chacho@2603-7000-ab00-62ed-0000-0000-0000-0bd0.res6.spectrum.com)
15:13:28 ic2000_ joins (~ic2000_@cpc108265-brom11-2-0-cust119.16-1.cable.virginm.net)
15:14:22 <c_wraith> newtype Foo a = Foo (Maybe a) ; Foo (Just x) >>= Foo (Just f) = case (eqT :: Maybe (b :~: Double)) of Just Refl -> Foo Nothing ; Nothing -> f x
15:14:29 × brandonh quits (~brandonh@151.36.214.216) (Read error: Connection reset by peer)
15:14:31 brandonh_ joins (brandonh@gateway/vpn/protonvpn/brandonh)
15:14:32 favonia joins (~favonia@user/favonia)
15:14:36 <c_wraith> left a bunch out, but that should be enough to get the point across
15:15:28 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
15:15:36 <c_wraith> err. that second arg should just be f, not a pattern match. forgot I wasn't writing (<*>)
15:15:40 <Gurkenglas> I agree that you could do such a thing, but have not yet demonstrated the badness.
15:15:44 sneedsfeed joins (~sneedsfee@rrcs-173-95-122-169.midsouth.biz.rr.com)
15:15:47 <Gurkenglas> *you
15:15:55 <c_wraith> that is the badness
15:16:04 <Gurkenglas> Is there something that relies on such things being impossible?
15:16:07 <c_wraith> I can no longer reason about the behavior of (>>=)
15:16:10 <Gurkenglas> Why not?
15:16:17 <c_wraith> it lost parametricity
15:16:19 slep joins (~slep@cpc150002-brnt4-2-0-cust437.4-2.cable.virginm.net)
15:16:32 <c_wraith> Right now, I know that's impossible
15:16:56 <c_wraith> This is explicitly documented by the type
15:16:57 <Gurkenglas> You can reason out what it will do depending on the type signature it ends up with
15:17:16 <c_wraith> Right now you can reason out what it will do by looking at the type of (>>=)
15:17:31 <c_wraith> you propose to replace that with having to know what type it will be used at before you can know what it does
15:17:36 <c_wraith> that's a massive downgrade
15:19:03 <Gurkenglas> The behavior of (>>=) already depends on the instance it is used with, is there something about drawing the line where it is drawn that is optimal?
15:20:16 <c_wraith> the behavior only depends on m
15:20:25 <c_wraith> You're proposing to make it also depend on a and b
15:20:40 <c_wraith> despite the fact that only m is used to select an implementation
15:20:43 Phantastes joins (~Phantaste@c-67-173-229-120.hsd1.co.comcast.net)
15:20:54 <c_wraith> Once again, it comes down to the types
15:21:09 <c_wraith> The type signature shows m is constrained, but a and b are parametric
15:21:17 × acidjnk_new quits (~acidjnk@p200300d0c7203049d04185c247f1acfb.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
15:21:32 <c_wraith> This is *documentation*
15:21:52 <c_wraith> It says that what it does will depend on m, but not a and b
15:22:16 Phantastes is now known as Fufu
15:22:35 <Gurkenglas> I think your monad instance breaks the functor laws
15:22:50 <c_wraith> laws are not enforced by the compiler.
15:22:51 lambdap joins (~lambdap@static.167.190.119.168.clients.your-server.de)
15:22:57 <c_wraith> parametricity is
15:23:00 × Fufu quits (~Phantaste@c-67-173-229-120.hsd1.co.comcast.net) (Client Quit)
15:23:04 <c_wraith> It is stronger than laws
15:24:02 <Gurkenglas> Can you give a scenario where you would be negatively surprised by Foo's existence or something like it?
15:24:14 <c_wraith> (yes, there are some dirty things you can do to break parametricity using ghc internals. But even they can't see newtype wrappers at runtime, for instance)
15:24:19 <Gurkenglas> (or someone else, if you want using an existing library)
15:24:27 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.2)
15:25:11 lavaman joins (~lavaman@98.38.249.169)
15:25:49 <c_wraith> Every single place I see an unconstrained type variable, I use that knowledge
15:26:31 <c_wraith> It's the sort of documentation almost every other language lacks badly, and suffers for
15:26:35 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
15:26:59 <c_wraith> (Unlike other documentation, it's actually correct)
15:27:22 <c_wraith> You're proposing to remove the correctness
15:27:44 <c_wraith> that seems like giving up far more than you're gaining.
15:29:46 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 260 seconds)
15:33:12 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
15:35:35 × brandonh_ quits (brandonh@gateway/vpn/protonvpn/brandonh) (Ping timeout: 265 seconds)
15:38:50 brandonh joins (~brandonh@151.82.39.118)
15:43:13 × rond_ quits (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
15:44:26 ec_ joins (~ec@gateway/tor-sasl/ec)
15:46:35 Erutuon joins (~Erutuon@user/erutuon)
15:46:44 × dajoer quits (~david@user/gvx) (Quit: leaving)
15:49:46 × chele quits (~chele@user/chele) (Remote host closed the connection)
15:51:31 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
15:53:35 × xsperry quits (~as@user/xsperry) (Ping timeout: 252 seconds)
16:00:52 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
16:01:08 × dudek quits (~dudek@185.150.236.103) (Quit: Leaving)
16:05:03 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
16:07:05 texasmynsted joins (~texasmyns@99.96.221.112)
16:07:39 × vpan quits (~vilius@212.117.1.172) (Quit: Leaving.)
16:08:19 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:08:20 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
16:08:20 wroathe joins (~wroathe@user/wroathe)
16:08:30 <texasmynsted> What is a great way to handle configuration? I like dhall but it feels like a better yaml. What if yaml is not the ideal way to describe configuration? Is there some language or package this is just config?
16:09:54 <kritzefitz> texasmynsted, I'm not sure I understand your question correctly, but maybe TOML might be in the right direction? https://toml.io/en/
16:10:23 × xff0x quits (~xff0x@port-92-193-132-242.dynamic.as20676.net) (Ping timeout: 265 seconds)
16:11:36 <texasmynsted> Toml is good, but it is still a file. Why not a language w/o a human readable file?
16:11:36 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer)
16:11:55 <texasmynsted> Maybe what I am looking for is a bad idea or does not really make sense.
16:12:12 xff0x joins (~xff0x@2001:1a81:531e:3c00:7633:19f7:d2d8:9bde)
16:12:36 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
16:12:47 <geekosaur> in general tose turn out badly because you can't use standard tools to query or manipulate them
16:13:16 <texasmynsted> Do you have an example of one?
16:13:27 <maerwald> XML... it's not readable after 10 lines of code
16:13:57 <geekosaur> with JSON you have to use jq to do anything useful
16:14:00 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
16:14:28 <texasmynsted> JSON is just a human readable description of Javascript data
16:14:34 <dminuoso> texasmynsted: for haskell configuration?
16:14:39 <geekosaur> sometimes you want to look up one or two settings for use in a shell script
16:14:56 <texasmynsted> dminuoso: Ideally but just anything would be a good start.
16:15:03 <dminuoso> texasmynsted: I'm a big fan of config-schema
16:15:15 <texasmynsted> config-schema?
16:15:16 <dminuoso> Yes.
16:15:18 texasmynsted googles
16:15:20 <dminuoso> https://hackage.haskell.org/package/config-schema
16:15:27 qbt joins (~edun@user/edun)
16:16:01 <dminuoso> It's a cute package with built-in schema verification, good enough error messages, easy custom schemas, and documentation output you can directly glue into your program
16:16:22 <sm> texasmynsted, "language" but not "human readable file" ? could you clarify ?
16:17:15 × aman quits (~aman@user/aman) (Quit: aman)
16:17:26 <dminuoso> All my programs have some kind of --config-help option that prints out the generated docs, meaning I dont need to separately document that format either. :)
16:17:29 <texasmynsted> dminuoso: Nice. I like this.
16:17:51 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
16:18:12 <dsal> % traverse_ print (Just 2) -- ldlework, in your initial question, you were asking about `let Just a in print a` without the Let binding (and presumably not printing when `Nothing`). That's what `traverse_` does.
16:18:13 <yahb> dsal: 2
16:18:24 <texasmynsted> sm: Most things build a config file that is human readable like toml, yaml, ini files, etc. Then the program reads the human and computer readable file.
16:20:01 <texasmynsted> What if the language was a haskell DSL or something, specifically for configuration and the result was not human readable but very efficient for the program to load and use
16:21:06 ec_ joins (~ec@gateway/tor-sasl/ec)
16:21:47 <dminuoso> I'd pick lisp then.
16:22:08 <texasmynsted> It feels like there are challenges because we want a file format that works for both humans and programs, then we need tools to have more control over producing those human and computer readable files.
16:22:19 <dminuoso> Bu not really, dhall would be that thing I guess
16:22:48 <[exa]> texasmynsted: the best language probably depends on environment and users. For exampel if they are unixy, you might be better off just sourcing the config file with bash and taking out environment/stdout
16:22:49 <dminuoso> Well, any programming or configuration language is for unidirectional communication between a human and a computer.
16:22:58 × ic2000_ quits (~ic2000_@cpc108265-brom11-2-0-cust119.16-1.cable.virginm.net) (Ping timeout: 260 seconds)
16:23:01 neo2 joins (~neo3@cpe-292712.ip.primehome.com)
16:23:06 <[exa]> otherwise +1 for lisp-ish scheme-ish configs
16:23:40 <dminuoso> at least lispy syntax, simply so you dont have the overhead of some complicated syntax.
16:25:21 × phma quits (~phma@host-67-44-208-57.hnremote.net) (Read error: Connection reset by peer)
16:25:26 <sm> texasmynsted: well I'd call haskell human readable, compared to say a sqlite db, but I see. xmonad uses haskell for config, the problem with that is you need to do an expensive recompile to change any config
16:26:00 <dminuoso> And you need to be a haskell programmer to deal with virtually any typo.
16:26:06 <sm> propellor, shake also use haskell for "config", if you squint at it
16:26:10 ormaaj2 is now known as ormaaj
16:26:28 <geekosaur> not very expensive, it's not like you're dealing with e.g. lots of type families
16:26:52 phma joins (~phma@host-67-44-208-118.hnremote.net)
16:26:57 <geekosaur> xmonad gets away with it because 100 lines is an unusually large config
16:26:59 <dminuoso> Indeed, I have a moderately complex xmonad configuration, and rebuilding takes about 3-4 seconds?
16:27:05 <texasmynsted> Dhall is nice. Like why Json or Yaml over something like messagepack
16:27:10 <[exa]> geekosaur: unfortunately you're talking to a channel where every second person will start the config with UndecidableInstances pragma
16:27:11 <sm> it's relatively expensive compared to tweaking an ini file, no matter how you look at it (consider all the requirements and opportunities for it to fail)
16:28:11 <texasmynsted> I think that viewing/understanding the config from looking at the file could be different than "tweaking" it.
16:28:59 <sm> ie, it's not that recompiling xmonad config once you're all set up takes a long time, it's that you have to install a haskell toolchain on your random platform, and keep it working, both non-trivial
16:30:03 <texasmynsted> So dhall or config-schema...
16:32:03 <dsal> I really liked dhall until I tried using it. heh
16:32:46 vicfred joins (~vicfred@user/vicfred)
16:33:37 <sm> lua is an option - programmable, but embeddable within your program so the user doesn't have to install anything. pandoc uses this for certain things
16:33:48 <dsal> The case where I'm still using it was simple enough. I don't format "correctly" because their canonical format is unusable. I can't remember what my last attempt was, but it wasn't expressive enough.
16:33:49 <sm> ...but you have to write lua
16:33:55 <texasmynsted> Oh yeah, I forgot about lua
16:34:08 <dsal> Ha. Yeah, I've embedded lua in a few projects and then got to that "now I have to write lua" part.
16:34:35 <sm> one of these days we'll have "haskellscript" !
16:34:40 <texasmynsted> I would rather an embeddable haskell-like language though
16:34:55 <janus> what would be the difference between haskellscript and cabal script?
16:35:25 <texasmynsted> Maybe there is some part of nix that could be used this way
16:35:45 <geekosaur> arguably hugs is haskellscript
16:36:01 <sm> a "cabal/stack script" is haskell, requiring all the know-how and toolchain etc. "haskellscript" is an easier low-install just-works no-compilation-step language
16:36:38 dunj3 joins (~dunj3@2001:16b8:3076:ac00:597e:94f1:37b7:cb6c)
16:36:53 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
16:37:07 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
16:37:08 <geekosaur> the remaining problem is "already installed everywhere" which, well, glwt
16:37:21 <janus> aah ok, so we're talking about how all linux distros have a python interpreter with most of the stdlib installed by default
16:37:23 <dminuoso> If you need `already installed everywhere`, there's realistically only sh, bash and perl.
16:37:41 <geekosaur> python also fits, especially these days
16:38:00 <geekosaur> and most machines have some flavor of js around
16:38:07 <sm> it might look like modern tooling like deno or zig, where you download one small executable for any platform and it does everything (build, run, stdlib, packages etc)
16:38:22 × brandonh quits (~brandonh@151.82.39.118) (Quit: brandonh)
16:38:33 __monty__ joins (~toonn@user/toonn)
16:40:06 <janus> would be intresting to see if it is possible to have a distro with all the usual linux parts written in haskell
16:40:18 <janus> like, how hard is it to write an init system in haskell?
16:40:25 pavonia joins (~user@user/siracusa)
16:40:51 <janus> and how hard would it be to provide systemd-like services written in haskell? i guess the ghc api is not geared for that now
16:41:42 <sm> there was http://programatica.cs.pdx.edu/House/
16:41:57 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
16:42:03 <geekosaur> sadly that requires a lot of signal hhandling, and the ghc runtime's signal handling is badly broken
16:42:04 <janus> right, but wasn't that lower level? it mentions vga and ps2
16:42:36 <sm> oh, well there's https://hackage.haskell.org/package/angel, is that the sort of thing ?
16:43:16 <janus> yeah i was thinking of something like systemd
16:43:29 <janus> this is way simpler probably if it is inspired by djb
16:43:44 <janus> but i guess the systemd debate is another can o worms :P
16:45:11 × sneedsfeed quits (~sneedsfee@rrcs-173-95-122-169.midsouth.biz.rr.com) (Ping timeout: 256 seconds)
16:45:17 brandonh_ joins (brandonh@gateway/vpn/protonvpn/brandonh)
16:45:42 <janus> geekosaur: do you have any links about what is wrong with the RTS? just curious
16:46:22 <geekosaur> most of them are not well documented. talk to merijn, pretty sure he can give you a lot of detail
16:46:38 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
16:46:53 <geekosaur> ...timing
16:46:56 <janus> i don't wanna bother people too much since i don't really have an actual problem, just armchair programming here :P
16:47:31 <geekosaur> trust me, if merijn had been paying attention here he'd have jumped in immediately and volubly :)
16:47:32 <__monty__> Don't worry merijn likes being vocal about it : )
16:48:57 ec_ joins (~ec@gateway/tor-sasl/ec)
16:50:37 <dminuoso> And very emotional.
16:51:24 texasmynsted googles deno and zig
16:53:41 mikoto-chan joins (~mikoto-ch@83.137.2.248)
16:53:53 × brandonh_ quits (brandonh@gateway/vpn/protonvpn/brandonh) (Ping timeout: 265 seconds)
16:54:25 mc47 joins (~mc47@xmonad/TheMC47)
16:55:32 brandonh joins (~brandonh@151.82.75.211)
16:55:40 <sm> yes https://ziglang.org, https://deno.land, good inspiration for us haskellers
16:56:39 <Hecate> one day we'll have `cabal build --target <triplet>`
16:57:03 <texasmynsted> wow, both zig and deno are fascinating
16:57:13 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
16:57:28 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
16:57:53 texasmynsted now wonders if Unsion could be made to work this way
16:58:44 <sm> they are winners, we should interop with them :)
17:01:07 × mc47 quits (~mc47@xmonad/TheMC47) (Ping timeout: 252 seconds)
17:02:38 <maerwald> we can barely interop with C++
17:02:49 econo joins (uid147250@user/econo)
17:07:02 justsomeguy joins (~justsomeg@user/justsomeguy)
17:07:33 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
17:07:46 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
17:09:04 kayprish joins (~kayprish@cable-188-2-153-140.dynamic.sbb.rs)
17:09:29 × hpc quits (~juzz@ip98-169-35-13.dc.dc.cox.net) (Ping timeout: 252 seconds)
17:09:46 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
17:09:48 proofofkeags_ joins (~proofofke@205.209.28.54)
17:09:54 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
17:11:23 hpc joins (~juzz@ip98-169-35-13.dc.dc.cox.net)
17:14:39 <kuribas> hmm, I have a exe and a library, it doesn't seem that stack recompiles when I just change the library...
17:17:14 ec_ joins (~ec@gateway/tor-sasl/ec)
17:17:47 gehmehgeh joins (~user@user/gehmehgeh)
17:18:32 <kuribas> strange, now it does...
17:22:21 jinsun joins (~quassel@user/jinsun)
17:26:54 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
17:29:19 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 252 seconds)
17:29:32 <maerwald> kuribas: why are you using stack again? You don't seem like you're enjoying it
17:30:19 <kuribas> maerwald: it's not about enjoying, about letting my coworkers use intellij...
17:30:29 <maerwald> that only works with stack?
17:30:34 <kuribas> maerwald: yeah
17:30:40 <maerwald> also, why not use stack2cabal?
17:30:49 <kuribas> it works ok with the latests snapshot.
17:31:13 <maerwald> you don't have to be confined to stack just bc your coworkers use it
17:31:43 <dminuoso> maerwald: really?
17:31:54 <dminuoso> does stack2cabal generate appropriate constraints matching the resolver?
17:31:57 <maerwald> yes
17:32:01 <dminuoso> Ah great.
17:32:03 <kuribas> maerwald: I cannot force them to use emacs :)
17:32:05 <kuribas> or vim
17:32:23 <maerwald> dminuoso: it doesn't understand ALL pantry syntax (most users don't use all of it) and doesn't translate flags yet
17:32:31 <glguy> maerwald: assuming it was you, thanks for getting cabal-install-3.6.0.0 into ghcup so quickly
17:32:34 <maerwald> but works on non-trivial projects
17:36:39 <maerwald> glguy: it took so long because I had to build darwin-aarch64 bindists and then got stuck with CI
17:37:00 <maerwald> there are no official darwin-aarch64 bindists
17:37:34 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 252 seconds)
17:38:30 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
17:38:48 <maerwald> I think github actions still doesn't provide it
17:38:54 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Remote host closed the connection)
17:38:56 × mikoto-chan quits (~mikoto-ch@83.137.2.248) (Quit: mikoto-chan)
17:45:24 × vicfred quits (~vicfred@user/vicfred) (Quit: Leaving)
17:45:41 ec_ joins (~ec@gateway/tor-sasl/ec)
17:48:22 × alanz quits (sid110616@highgate.irccloud.com) (Ping timeout: 250 seconds)
17:48:22 × obviyus quits (sid415299@user/obviyus) (Ping timeout: 250 seconds)
17:48:22 × b20n quits (sid115913@id-115913.highgate.irccloud.com) (Ping timeout: 250 seconds)
17:48:42 × totbwf__ quits (sid402332@id-402332.highgate.irccloud.com) (Read error: Connection reset by peer)
17:48:42 × bradparker quits (sid262931@id-262931.highgate.irccloud.com) (Read error: Connection reset by peer)
17:48:42 × systemfault quits (sid267009@id-267009.highgate.irccloud.com) (Read error: Connection reset by peer)
17:48:44 × etrepum quits (sid763@highgate.irccloud.com) (Read error: Connection reset by peer)
17:48:44 × T_S_ quits (sid501726@highgate.irccloud.com) (Read error: Connection reset by peer)
17:48:44 × davetapley quits (sid666@id-666.highgate.irccloud.com) (Read error: Connection reset by peer)
17:48:56 × aarchi quits (sid486183@id-486183.highgate.irccloud.com) (Read error: Connection reset by peer)
17:49:06 × SrPx quits (sid108780@highgate.irccloud.com) (Read error: Connection reset by peer)
17:49:06 × vito quits (sid1962@user/vito) (Write error: Connection reset by peer)
17:50:18 justsomeguy joins (~justsomeg@user/justsomeguy)
17:50:32 × stevenxl quits (uid133530@highgate.irccloud.com) (Ping timeout: 250 seconds)
17:51:10 alanz joins (sid110616@id-110616.highgate.irccloud.com)
17:51:13 davetapley joins (sid666@id-666.highgate.irccloud.com)
17:51:15 etrepum joins (sid763@id-763.highgate.irccloud.com)
17:51:20 T_S_ joins (sid501726@id-501726.highgate.irccloud.com)
17:51:21 SrPx joins (sid108780@id-108780.highgate.irccloud.com)
17:51:33 b20n joins (sid115913@id-115913.highgate.irccloud.com)
17:51:46 totbwf__ joins (sid402332@highgate.irccloud.com)
17:51:53 obviyus joins (sid415299@user/obviyus)
17:52:22 systemfault joins (sid267009@id-267009.highgate.irccloud.com)
17:52:29 aarchi joins (sid486183@id-486183.highgate.irccloud.com)
17:52:33 vito joins (sid1962@user/vito)
17:52:34 bradparker joins (sid262931@id-262931.highgate.irccloud.com)
17:53:40 MQ-17J joins (~MQ-17J@2607:fb90:1d3a:e28c:515f:1bae:68b2:8409)
17:53:49 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
17:54:36 × MQ-17J quits (~MQ-17J@2607:fb90:1d3a:e28c:515f:1bae:68b2:8409) (Read error: Connection reset by peer)
17:54:46 stevenxl joins (sid133530@id-133530.highgate.irccloud.com)
17:54:54 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
17:57:56 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:57:56 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
17:57:56 wroathe joins (~wroathe@user/wroathe)
18:01:44 <jneira[m]> <maerwald> "I think github actions still..." <- nope, the gitlab arm image is gold for now
18:02:13 <maerwald> they aren't cheap :)
18:03:45 × kuribas quits (~user@ptr-25vy0i7jzpijs82kd6g.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
18:04:03 asivitz joins (uid178348@id-178348.tinside.irccloud.com)
18:05:39 × brandonh quits (~brandonh@151.82.75.211) (Quit: brandonh)
18:06:27 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
18:06:52 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
18:07:11 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
18:07:40 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
18:08:13 × alx741 quits (~alx741@186.178.109.214) (Ping timeout: 252 seconds)
18:10:36 xsperry joins (~as@user/xsperry)
18:14:43 abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
18:17:53 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
18:18:07 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
18:22:50 alx741 joins (~alx741@186.178.109.89)
18:24:08 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
18:24:15 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
18:24:15 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
18:24:15 wroathe joins (~wroathe@user/wroathe)
18:24:21 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
18:29:06 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
18:29:53 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Remote host closed the connection)
18:31:18 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
18:32:18 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:32:50 pooryorick joins (~pooryoric@87-119-174-173.tll.elisa.ee)
18:33:31 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Remote host closed the connection)
18:35:45 × max22- quits (~maxime@2a01cb088335980003a066e559758211.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
18:38:15 <mrianbloom> Does anyone know how to persuade cabal to notice when an embedded file has changed?
18:38:22 pmk joins (~user@2a02:587:9416:c4cd:a38a:dea2:e28e:646d)
18:39:11 <sclv> add it to the extra-files iirc
18:39:37 <lechner> Hi, which type does Lucid's title_ take, please? Efforts to replace a literal string with Text or a String produce errors like this: https://dpaste.org/th9v
18:39:59 <sclv> mrianbloom: `extra-source-files` rather
18:41:10 <[exa]> lechner: you may put an underscore instead of the title_ and see what ghc thinks should be there
18:41:42 <mrianbloom> sclv : I see, trying that out.
18:42:43 <geekosaur> at a guess, Html has an IsString instance
18:42:56 <geekosaur> that produces an html-encoded literal string
18:43:13 <geekosaur> (properly escaped etc.)
18:44:01 <[exa]> I have to say the type on hoogle is opaque
18:44:12 <[exa]> title :: Term arg result => arg -> result
18:44:25 <lechner> [exa]: thanks! here it is. (Take another look at the nice short URL!) maybe i should pass the expression (title_ "Literal") instead? https://dpaste.org/buGs
18:44:33 <[exa]> title = term "title"
18:44:59 ec_ joins (~ec@gateway/tor-sasl/ec)
18:45:25 <lechner> i posted this by accident on #hackage earlier Hi, is the name 'result' appropriate fo a type? https://hackage.haskell.org/package/lucid-2.9.12.1/docs/Lucid-Html5.html
18:46:32 <[exa]> lechner: I guess you want to add another custom tag into the head?
18:46:57 <[exa]> anyway `result` is technically perfectly same type variable name as `a` or `b` or `oiruweoiruqweiurqwioeruqwiur`
18:46:58 <lechner> [exa]: just a page title, really
18:47:54 <lechner> maybe those types are chainable. i think i have to pass (title- "Literal"0 :: Html
18:48:00 <lechner> titel_
18:48:05 <lechner> title_
18:48:11 <[exa]> then `title_ "YourTitle"` should work
18:48:12 <mrianbloom> sclv FYYI that doesn't seem to work. I also tried data-files
18:48:29 <[exa]> the problem with title_ is that they want it both as a tag and as argument, therefore the typeclass in there
18:48:59 <maerwald> extra-source-files should work
18:49:01 <sclv> i'm pretty sure extra-source-files works, if you have a recent enough cabal
18:49:07 <sclv> i just tested/improved it
18:49:33 <maerwald> how do you embed the file?
18:50:34 <maerwald> I'm not sure if `qAddDependentFile` makes any difference in the TH expression
18:51:01 <lechner> [exa]: thanks! maybe one day i'll understand why
18:51:23 <maerwald> https://hackage.haskell.org/package/file-embed
18:51:48 <maerwald> https://github.com/snoyberg/file-embed/blob/548430d2a79bb6f4cb4256768761071f59909aa5/file-embed.cabal#L16
18:51:50 <maerwald> checks out
18:52:37 <sclv> adding a dependent file hints ghc, but it can't get transmitted back to cabal -- there's no interface for it
18:52:51 <[exa]> lechner: anyway you need to wrap the inner `pageTitle` into HTML
18:53:03 brandonh joins (brandonh@gateway/vpn/protonvpn/brandonh)
18:53:06 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Remote host closed the connection)
18:53:08 <[exa]> lechner: in the instance you can see that title_ doesn't wrap text, it needs inner html already
18:53:20 <[exa]> s/instance/error message with the instance/
18:53:45 <lechner> [exa]: but how does the overloaded string satisfy it?
18:54:19 <geekosaur> fromString provided by the IsString instance
18:54:26 <[exa]> overloaded strings only work with string literals
18:54:37 <[exa]> it's not an autoconversion
18:55:19 <lechner> i thought they only provide String, ByteString and Text, but that must be wrong
18:55:39 <geekosaur> those are the standard ones. the package you're using added one
18:55:49 <geekosaur> remember, typeclasses are open
18:56:12 <geekosaur> you could define your own IsString instance for some type and OverloadedStrings would start working with it
18:56:22 <lechner> not the first time i saw type magic here. so cool!
18:56:31 <janus> sclv: so in summary, addDependentFile and extra-source-files should be sufficient to always get the right modules build when the embedded file changes?
18:57:57 <lechner> [exa]: did you mean "Html ()" when you referred to html inner?
18:58:01 <[exa]> is there anything standard that would do `FromString a => Text -> a` ?
18:58:26 <[exa]> lechner: quick check: if you write `title_ "asasdasd"` it works, right?
18:58:39 <sclv> i believe so. also file-embed should be calling addDependentFile for you https://hackage.haskell.org/package/file-embed-0.0.15.0/docs/src/Data.FileEmbed.html
18:58:41 <lechner> yes, with a literal
18:58:46 × oxide quits (~lambda@user/oxide) (Quit: oxide)
18:59:07 <[exa]> lechner: good, so you just need to push your variable into the correct type
18:59:39 <[exa]> something crude like `title_ . fromString . T.unpack $ pageTitle` could work
18:59:56 <[exa]> but I guess people here will have better suggestions (I don't use the text libs often)
19:00:40 <lechner> i just pulled (title_ "Literal") :: Html () into the caller
19:00:59 <lechner> String has the same issue
19:01:42 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
19:01:50 <geekosaur> for String you can cheat and call fromString directly
19:02:11 <geekosaur> sadly this doesn't work for Text, you have to unpack it into a String
19:03:55 max22- joins (~maxime@2a01cb08833598002b7e84d0aaf65199.ipv6.abo.wanadoo.fr)
19:05:16 timCF joins (~timCF@m91-129-108-244.cust.tele2.ee)
19:05:44 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
19:06:19 <timCF> Hello! There is a method to avoid Proxy types on class methods using TypeApplications. But is there any way to do the same thing with normal functions as well?
19:06:36 <lechner> geekosaur: not sure that works https://dpaste.org/65Kr
19:08:52 × neo2 quits (~neo3@cpe-292712.ip.primehome.com) (Ping timeout: 252 seconds)
19:11:02 Guest81 joins (~Guest81@2804:14c:109:2a81:b85d:234a:ff63:99ad)
19:12:16 ec_ joins (~ec@gateway/tor-sasl/ec)
19:14:33 <[exa]> lechner: do you have perhaps a fuller code example?
19:17:00 × dunj3 quits (~dunj3@2001:16b8:3076:ac00:597e:94f1:37b7:cb6c) (Remote host closed the connection)
19:17:33 <lechner> [exa]: https://dpaste.org/m8NX#L28
19:17:34 vicfred joins (~vicfred@user/vicfred)
19:18:13 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
19:18:27 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
19:23:29 ic2000_ joins (~ic2000_@cpc108265-brom11-2-0-cust119.16-1.cable.virginm.net)
19:25:39 <[exa]> lechner: you probably want title_ (fromString pageTitle) instead of the dot there
19:27:19 <[exa]> also, having the type as `commonHeader :: Html () -> Html ()`, you shouldn't need fromString there, and the string type below in `indexPage` should get properly autoconverted
19:28:09 <lechner> with your first suggestion, i get this https://dpaste.org/f0HD
19:28:37 <[exa]> ah, import it, it should be in Data.String
19:29:20 <lechner> i see. the second one works,but seems super unsafe
19:29:33 <lechner> sorry about the import error
19:29:41 <[exa]> np
19:30:16 <[exa]> yeah you don't want any inner Html in title, it was just the easiest way how to do the conversion at the spot where it's already present
19:31:23 <lechner> [exa]: the second one is super weird, though. how can a module work well (or be safe) that does not distriguish between quoted and literal HTML?
19:31:58 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 252 seconds)
19:32:03 × Guest81 quits (~Guest81@2804:14c:109:2a81:b85d:234a:ff63:99ad) (Quit: Client closed)
19:32:20 <[exa]> well you're using the same there, passing in the string as html content as if nothing happened :]
19:32:26 <[exa]> title_ doesn't magically wrap it
19:32:42 <lechner> i guess it's literally only a problem with literal strings
19:32:47 <[exa]> anyway, you can disable this whole behavior by turning off the overloadedStrings, yes
19:32:48 <awpr> presumably the IsString instance should escape its contents?
19:33:06 <[exa]> what you could do is:
19:33:50 <awpr> indeed it does: https://hackage.haskell.org/package/lucid-2.9.12.1/docs/src/Lucid.Base.html#line-200
19:33:58 <[exa]> (ah noes sorry, bad idea)
19:34:33 <lechner> awpr: more magic! haskell always outsmarts me
19:34:43 × xff0x quits (~xff0x@2001:1a81:531e:3c00:7633:19f7:d2d8:9bde) (Ping timeout: 252 seconds)
19:34:49 × AkechiShiro quits (~licht@user/akechishiro) (Quit: WeeChat 2.9)
19:34:55 <mrianbloom> sclv: alright not sure what my error is but this is how my cabal file is setup: https://pastebin.com/me24hifY
19:35:01 <[exa]> lechner: the literal overloading is tricky but once you see it it's pretty straightforward
19:35:23 xff0x joins (~xff0x@2001:1a81:531e:3c00:3db9:e43a:c387:7efa)
19:35:30 <mrianbloom> sclv check line 43
19:35:54 <[exa]> lechner: the same goes with numbers, `1+1` desugars to something like `fromInteger 1 + fromInteger 1` in which the 1's are of fixed type Integer
19:36:10 <mrianbloom> I can also show you how the embed is set up in the repository if you are interested.
19:36:55 <[exa]> lechner: then you can make e.g. an instance of lists that behave like numbers, where you go stuff like `1 + [2,3,4] == [3,4,5]` etc.
19:37:18 <lechner> [exa]: thanks for taking the time to explore all that1 for now, i'll probably stick to passing Lucid's own stuff as Html (), and use title_ in the caller
19:37:27 <lechner> ti meant !
19:37:29 <lechner> i
19:37:59 × favonia quits (~favonia@user/favonia) (Remote host closed the connection)
19:38:28 <sclv> and which version of cabal-install are you using?
19:38:57 Lycurgus joins (~juan@98.4.112.204)
19:40:43 <sclv> mrianbloom: it only started working in 3.4: https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.4.0.0.md
19:41:33 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
19:41:33 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
19:41:33 wroathe joins (~wroathe@user/wroathe)
19:41:56 <[exa]> lechner: that may be even more problematic since someone can stick a tagless string into the head then
19:42:35 <[exa]> go with the String->Html(), that's good
19:42:41 <lechner> [exa]: would you please rephrase that?
19:42:44 <[exa]> the extra fromString is the safety there
19:43:13 <[exa]> if you call the function as `commonHeader (title_ "asd")`, it doesn't the restrict the user from calling just `commomHeader "asd"` right?
19:43:24 <lechner> right!
19:43:48 <lechner> so it's more confusing. i get it now
19:43:55 <[exa]> or `commonHeader (h1_ "oh hello there")`
19:43:57 <lechner> good call
19:44:39 × caubert quits (~caubert@136.244.111.235) (Quit: WeeChat 3.2)
19:44:41 <[exa]> or inject javascript.
19:44:42 <[exa]> :D
19:45:35 <lechner> [exa]: why did geekosaur call it cheating though?
19:45:57 caubert joins (~caubert@136.244.111.235)
19:46:19 <[exa]> not sure, need to scrollback
19:46:39 <geekosaur> there's usually some "proper" way to do conversions rather than manually evoking fromString
19:46:43 <lechner> 12:01:50
19:47:06 <awpr> `toHtml` probably
19:47:16 <janus> geekosaur: what's your take on Data.Convertible?
19:47:26 <[exa]> geekosaur: otoh some conversion there kinda ensures that it's a string that arrives, not a js bitcoin miner
19:48:00 <[exa]> anyway, yeah, the concern is valid, we should write the least amount of conversions possible
19:48:13 <janus> what i don't like about Data.Convertible is that every call site has to decide whether to do a partial conversion or not
19:48:31 <janus> and then if you have lots of conversions, you may not notice one 'convert' that should have been 'safeConvert'
19:48:33 <[exa]> especially if the literal is literally sitting there waiting to be converted to html
19:48:56 <janus> but names are hard, so i also feel like it is cumbersome to invent a new name for every conversion, especially all the ones that can never fail
19:49:03 <geekosaur> pretty much
19:49:27 <geekosaur> also I sort of distrust "magical" conversions, I prefer to be as explicit as possible
19:49:57 <janus> so that means you'd make an alias of coerce instead of using it directly?
19:50:12 <geekosaur> it may be cumbersome but it feels safer
19:50:16 <[exa]> this would call for something like: `commonHeader :: IsString s, ToHtml s => s -> Html ()`
19:51:26 <awpr> seems to me the `IsString` shouldn't be necessary there, if you can convert `s` directly to HTML
19:51:48 <[exa]> awpr: we want to ensure no one passes in HTML with shenanigans
19:51:49 beka joins (~beka@104.193.170.240)
19:52:23 <awpr> then just `IsString` and no `ToHtml`?
19:52:25 <[exa]> ah there's `StringLike` that does that much better
19:52:43 <[exa]> if we don't have ToHtml, we have no idea how to convert it
19:53:01 <awpr> `toHtml . toString`
19:53:45 <[exa]> ah ofc
19:54:05 <[exa]> I wanted to go with just toHtml, possibly bypassing the string
19:54:15 <[exa]> good point. :D
19:54:45 <awpr> anyway if it should be plain text, there are several types for that (Text, String)
19:54:58 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
19:55:40 kenran joins (~kenran@200116b82b2f0f0026d2b42ae928c649.dip.versatel-1u1.de)
19:55:43 <awpr> the `IsString`-polymorphic signature might behave poorly with `OverloadedStrings`, since literals in its argument would be ambiguous types
19:55:56 jakalx joins (~jakalx@base.jakalx.net)
19:56:30 favonia joins (~favonia@user/favonia)
19:56:39 <[exa]> yeah
19:56:54 <[exa]> like, probably best to have a look what Html is using internally and make sure the later conversion doesn't hurt
19:56:58 unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
20:00:59 <awpr> I'm thinking `Text` is the way to go, since a) using `String` could result in actually using `String`s if GHC doesn't optimize magically enough, b) even though it uses `ByteString` internally, it has to take a pass over the bytes anyway for HTML escaping, and c) `Text` is meant for text, unlike `ByteString`
20:03:19 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
20:03:33 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
20:03:46 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
20:05:17 × juhp quits (~juhp@128.106.188.220) (Ping timeout: 265 seconds)
20:07:02 juhp joins (~juhp@128.106.188.220)
20:07:15 clever joins (~clever@99.192.114.98)
20:07:47 <__monty__> janus: This is an init written in Haskell fyi, https://github.com/cleverca22/nix-tests/blob/master/haskell-init/hello_world.hs
20:08:01 <__monty__> Very basic but it's a proof of concept.
20:09:48 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
20:10:31 × timCF quits (~timCF@m91-129-108-244.cust.tele2.ee) (Quit: leaving)
20:13:06 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
20:16:31 × goepsilongo quits (~chacho@2603-7000-ab00-62ed-0000-0000-0000-0bd0.res6.spectrum.com) (Quit: Konversation terminated!)
20:18:47 acidjnk_new joins (~acidjnk@p200300d0c7203049d04185c247f1acfb.dip0.t-ipconnect.de)
20:19:42 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:19:43 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
20:19:43 wroathe joins (~wroathe@user/wroathe)
20:20:27 wrengr is now known as wrengr_away
20:22:58 × brandonh quits (brandonh@gateway/vpn/protonvpn/brandonh) (Ping timeout: 252 seconds)
20:24:37 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
20:25:27 <janus> nice to see that someones trying it out :D
20:25:27 epolanski joins (uid312403@id-312403.helmsley.irccloud.com)
20:27:23 brandonh joins (~brandonh@151.82.85.99)
20:34:46 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:34:46 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
20:34:46 wroathe joins (~wroathe@user/wroathe)
20:38:46 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Remote host closed the connection)
20:41:13 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
20:47:39 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds)
20:48:18 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Ping timeout: 265 seconds)
20:49:10 hololeap joins (~hololeap@user/hololeap)
20:53:53 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
20:54:07 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
20:55:27 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 276 seconds)
20:56:17 gehmehgeh joins (~user@user/gehmehgeh)
20:57:02 × brandonh quits (~brandonh@151.82.85.99) (Quit: brandonh)
20:58:13 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
20:58:21 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
20:58:50 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
20:58:56 <monochrom> I am OK with OverloadedStrings for Text because String and Text are really informationally equivalent, any conflation doesn't really hurt. But that's an exception.
20:59:37 Lord_of_Life_ is now known as Lord_of_Life
20:59:59 <monochrom> When a type is informationally less than String, for example Bytestring, one should use an explicit "conversion" function name to make explicit what the "conversion" is losing.
21:00:36 <lechner> monochrom: +1
21:00:39 lavaman joins (~lavaman@98.38.249.169)
21:01:05 <Gurkenglas> -1
21:01:13 <monochrom> In the same way I agree with Haskell's "floor, ceiling, truncate, round" for "converting" Double to Integer, I disagree with C's reckless approach.
21:02:19 <Gurkenglas> compromise: use optics for all that
21:05:10 <Gurkenglas> makes you use two words for each direction, incentivizing a restructuring of code that mentions the optic once
21:06:42 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
21:08:55 × vicfred quits (~vicfred@user/vicfred) (Quit: Leaving)
21:13:19 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
21:13:59 stiell joins (~stiell@gateway/tor-sasl/stiell)
21:14:15 ic2000_ parts (~ic2000_@cpc108265-brom11-2-0-cust119.16-1.cable.virginm.net) (Leaving)
21:16:30 × favonia quits (~favonia@user/favonia) (Ping timeout: 260 seconds)
21:16:32 × kenran quits (~kenran@200116b82b2f0f0026d2b42ae928c649.dip.versatel-1u1.de) (Quit: WeeChat info:version)
21:17:25 <janus> what is the reason that overflowed literals compile?
21:17:33 <janus> > 0x100000000000000000000 :: Word
21:17:35 <lambdabot> 0
21:17:55 <monochrom> Actually with not-old GHC you get a warning.
21:18:10 <janus> right, but why is it a warning in the first place and not an error?
21:18:33 <janus> i am trying to think of a use case, but nothing comes up especially because it isn't using mod 32 or anything
21:18:52 <geekosaur> because they compile to Integer and the actual conversion is done at runtime?
21:19:19 <geekosaur> I imagine the warning is an ugly hack somewhere in the typechecker
21:19:33 <janus> oooooh that does make more sense now
21:20:02 <awpr> I know this isn't exactly a complete answer, but `-Werror=overflowed-literals` will make it an error
21:20:10 <monochrom> I would reduce it to "that ship has sailed".
21:20:25 <awpr> (my `stack.yaml`s all have `-Werror -Wall` for local builds)
21:21:01 <monochrom> The Haskell Reports do not say to reject that code. Implicitly it means accepting that code and doing some undefined behaviour.
21:21:13 <janus> monochrom: well, the situation also exists in idris. so the ship is still influencing its departure port
21:21:18 <janus> Main> the Bits8 0x100000000000000000
21:21:21 <janus> 0
21:21:26 <monochrom> Your question should be reduced to "why didn't the Haskell committee make it an error". Well, that ship has sailed.
21:21:57 <awpr> I suppose making it an error would give a false sense of security: does `x :: Num a => a; x = 0x100000000000000000` give that error?
21:22:06 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
21:22:13 <monochrom> That other ship is in #idris or something.
21:22:44 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
21:23:16 × hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection)
21:23:42 <janus> awpr: right, so i guess the fundamental issue is whether fromIntegral should return an error? hmmm
21:24:32 wroathe joins (~wroathe@96-88-30-181-static.hfc.comcastbusiness.net)
21:24:32 × wroathe quits (~wroathe@96-88-30-181-static.hfc.comcastbusiness.net) (Changing host)
21:24:32 wroathe joins (~wroathe@user/wroathe)
21:24:41 hololeap joins (~hololeap@user/hololeap)
21:24:42 <janus> hmmm but fromIntegral _can_ do modN on overflow
21:25:05 <awpr> IIUC it does do that for most types
21:25:20 <awpr> > 65537 :: Word8
21:25:22 <lambdabot> 1
21:25:30 <awpr> eh, I meant Word16, but same idea
21:26:01 kayprish_ joins (~kayprish@cable-188-2-153-140.dynamic.sbb.rs)
21:26:14 <xsperry> does -Wall include overflowed-literals warning?
21:26:24 × kayprish quits (~kayprish@cable-188-2-153-140.dynamic.sbb.rs) (Read error: Connection reset by peer)
21:26:33 <janus> what is the function that the compiler inserts that returns 0 on overflow?
21:27:10 <janus> ooooh since the warning is a hack, i guess the function doesn't necessarily have a name
21:27:12 <monochrom> On one hand, the compiler can't do anything to "1600 :: MonochromSecretNumberType", because I am not going to tell the compiler the range of my secret number type.
21:27:24 <awpr> xsperry: I'm amused that that's actually a sensible question given it's called `-Wall`
21:27:42 <hpc> > floor (1/0) -- just to shake things up
21:27:43 <lambdabot> 1797693134862315907729305190789024733617976978942306572734300811577326758055...
21:27:55 <hololeap> one approach is to use "-Weverything" and then turn off the stuff you don't want
21:28:06 <awpr> xsperry: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/using-warnings.html says overflowed-literals is enabled by default
21:28:08 <monochrom> On the other hand, the compiler, even the Haskell Report, could still insist on checking the standard number types.
21:28:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
21:28:41 <monochrom> or maybe s/could/could have/
21:28:51 <awpr> janus: that's not what happens, it just was coincidentally the case that your literal modulo 2^64 was 0
21:29:15 <monochrom> But the implementation could get ugly, yeah.
21:29:16 × max22- quits (~maxime@2a01cb08833598002b7e84d0aaf65199.ipv6.abo.wanadoo.fr) (Quit: Leaving)
21:29:49 <janus> awpr: aaaah! makes sense, yeah
21:30:22 <geekosaur> > 0x1000000000000000000001 :: Word
21:30:24 <lambdabot> 1
21:31:20 acidjnk_new3 joins (~acidjnk@p200300d0c720304924f33c3f96bd7d34.dip0.t-ipconnect.de)
21:31:36 <xsperry> awpr, thanks. so at least it is a warning by default
21:32:35 <hololeap> https://medium.com/mercury-bank/enable-all-the-warnings-a0517bc081c3 -- good info
21:32:46 × Gurkenglas quits (~Gurkengla@dslb-002-207-014-195.002.207.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
21:33:53 × FragByte quits (~christian@user/fragbyte) (Quit: Quit)
21:34:37 × acidjnk_new quits (~acidjnk@p200300d0c7203049d04185c247f1acfb.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
21:35:06 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Quit: leaving)
21:35:41 FragByte joins (~christian@user/fragbyte)
21:39:54 × wroathe quits (~wroathe@user/wroathe) (Quit: Lost terminal)
21:41:22 × mangoiv quits (~MangoIV@193.175.5.172) (Quit: WeeChat 3.2)
21:43:00 wroathe joins (~wroathe@96-88-30-181-static.hfc.comcastbusiness.net)
21:43:01 × wroathe quits (~wroathe@96-88-30-181-static.hfc.comcastbusiness.net) (Changing host)
21:43:01 wroathe joins (~wroathe@user/wroathe)
21:44:44 favonia joins (~favonia@user/favonia)
21:48:21 jess is now known as j
21:50:20 acidjnk_new joins (~acidjnk@p200300d0c720304924f33c3f96bd7d34.dip0.t-ipconnect.de)
21:52:37 Guest16 joins (~Guest16@pool-108-17-124-115.pitbpa.fios.verizon.net)
21:53:22 × acidjnk_new3 quits (~acidjnk@p200300d0c720304924f33c3f96bd7d34.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
21:54:28 × Guest16 quits (~Guest16@pool-108-17-124-115.pitbpa.fios.verizon.net) (Client Quit)
21:54:49 Guest46 joins (~Guest46@pool-108-17-124-115.pitbpa.fios.verizon.net)
22:02:44 × favonia quits (~favonia@user/favonia) (Ping timeout: 265 seconds)
22:04:40 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
22:07:45 mikoto-chan joins (~mikoto-ch@83.137.2.248)
22:08:05 × Guest46 quits (~Guest46@pool-108-17-124-115.pitbpa.fios.verizon.net) (Quit: Client closed)
22:11:31 × michalz quits (~michalz@185.246.204.41) (Remote host closed the connection)
22:12:36 gioyik joins (~gioyik@gateway/tor-sasl/gioyik)
22:14:11 × wonko quits (~wjc@62.115.229.50) (Ping timeout: 252 seconds)
22:19:13 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
22:19:26 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
22:19:45 × xff0x quits (~xff0x@2001:1a81:531e:3c00:3db9:e43a:c387:7efa) (Ping timeout: 260 seconds)
22:20:34 xff0x joins (~xff0x@2001:1a81:531e:3c00:25c1:193a:5cc2:a16c)
22:21:12 <mrianbloom> svlc I got it working with cabal 3.6, thank you.
22:22:08 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:23:56 <janus> with Aeson, if i have a 'Parser (Maybe a)' and an error message, how do i make a 'Parser a'? i have '\errMsg -> join . fmap (maybe (fail errMsg) pure)' but i feel like i am reinventing the wheel
22:24:00 benin0369323 joins (~benin@183.82.24.241)
22:25:27 <janus> :t \errMsg -> join . fmap (maybe (fail errMsg) pure)
22:25:28 <lambdabot> MonadFail m => String -> m (Maybe a) -> m a
22:26:32 <adamse> you could go with `\msg -> (>>= maybe (fail msg) pure)`
22:26:45 <adamse> :t \msg -> (>>= maybe (fail msg) pure)
22:26:46 <lambdabot> MonadFail m => String -> m (Maybe b) -> m b
22:28:19 vicfred joins (~vicfred@user/vicfred)
22:29:13 Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
22:29:41 <janus> it just feels like it should be such a common thing to turn a Nothing into a fail inside a functor
22:31:19 <janus> maybe i should specialize to Aeson and make it "Parser a -> (a -> Maybe b) -> Parser b -> Parser b" where the third param would be the failure
22:32:12 <janus> in a minute it's gonna be traverse or sequenceA :P
22:35:04 <adamse> :t fromMaybe (fail "err") . sequenceA
22:35:05 <lambdabot> (MonadFail m, Traversable m) => m (Maybe a) -> m a
22:35:26 <adamse> maybe not...
22:36:36 <janus> well Parser is not Traversable ..
22:36:59 <monochrom> I don't feel it common at all. If I need a mandatory X, I would have Parser X in the first place.
22:38:31 <janus> well Aeson is full of functions that return 'Parser (Maybe a)', so it doesn't seem like they discourage having a Maybe inside. But i do get your point
22:39:33 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
22:40:13 <monochrom> I use (.:)
22:40:51 <janus> witherable has mapMaybe which is "Filterable f => (a -> Maybe b) -> f a -> fb" which is a generalization of 'Parser a -> (a -> Maybe b) -> Parser b -> Parser b'
22:41:02 <monochrom> If I used (.:?) it would be because I really considered a field to be optional, not any kind of error condition if it's missing.
22:42:06 <janus> thing is, i am working with a type that has no FromJSON instance, so i am calling _their_ function to get a 'Maybe theirType'. so it's either orphan or this. and i prefer this over orphan
22:43:10 <monochrom> I respect that, but it is not common.
22:44:33 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
22:44:46 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
22:45:38 Erutuon joins (~Erutuon@user/erutuon)
22:45:39 × kayprish_ quits (~kayprish@cable-188-2-153-140.dynamic.sbb.rs) (Remote host closed the connection)
22:48:55 × vysn quits (~vysn@user/vysn) (Ping timeout: 260 seconds)
22:50:42 <mrianbloom> sclv I got it working with cabal 3.6, thank you.
22:51:35 gioyik_ joins (~gioyik@gateway/tor-sasl/gioyik)
22:55:42 × gioyik quits (~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds)
22:57:08 random-jellyfish joins (~random-je@user/random-jellyfish)
22:58:28 aegon joins (~mike@174.127.249.180)
22:58:48 <aegon> hey all, does the fusion step / system in ghc have access to lifted nats / datakinds / that level of machinery?
23:03:30 × pmk quits (~user@2a02:587:9416:c4cd:a38a:dea2:e28e:646d) (Ping timeout: 260 seconds)
23:08:45 × TranquilEcho quits (~grom@user/tranquilecho) (Ping timeout: 260 seconds)
23:12:08 <aegon> * rewrite rules
23:15:14 × jtomas quits (~jtomas@95.red-88-11-64.dynamicip.rima-tde.net) (Ping timeout: 265 seconds)
23:15:17 favonia joins (~favonia@user/favonia)
23:18:36 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
23:19:26 × son0p quits (~ff@181.136.122.143) (Remote host closed the connection)
23:26:21 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
23:29:53 harveypwca joins (~harveypwc@2601:246:c180:a570:2435:ba7:e573:bc26)
23:32:18 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 260 seconds)
23:32:46 × acidjnk_new quits (~acidjnk@p200300d0c720304924f33c3f96bd7d34.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
23:33:57 × zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving)
23:35:25 zaquest joins (~notzaques@5.128.210.178)
23:44:13 <ldlework> I'm annoyed every module I wanna doctest needs a main
23:44:53 × amitnjha quits (~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
23:45:11 amitnjha joins (~amit@024-216-124-116.res.spectrum.com)
23:45:14 × epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
23:49:14 Codaraxis_ joins (~Codaraxis@user/codaraxis)
23:49:19 × cheater quits (~Username@user/cheater) (Quit: (BitchX) Life is like BitchX. Ya never know what yer gunna git.)
23:50:27 <ldlework> It'd also be cool if doctest had a flag to you the cases it was testing
23:51:15 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:51:16 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
23:51:16 wroathe joins (~wroathe@user/wroathe)
23:53:18 × Codaraxis quits (~Codaraxis@user/codaraxis) (Ping timeout: 260 seconds)
23:53:29 <lechner> Hi, what's a nice way to deal with long string literals in Lucid templates, please?
23:53:51 gioyik joins (~gioyik@gateway/tor-sasl/gioyik)
23:54:57 <awpr> lechner: not sure if this answers your question, but you can break strings onto multiple lines by surrounding whitespace in backslashes
23:55:56 <monochrom> Here is an example. I have spaces, but line breaks are OK too:
23:56:03 <monochrom> > "ab\ \c"
23:56:04 <lambdabot> "abc"
23:56:21 cheater joins (~Username@user/cheater)
23:56:43 <monochrom> You can have line breaks there. You can have extra spaces to get indentation to look right too.
23:56:48 × gioyik_ quits (~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds)
23:57:07 <monochrom> > "abc" == "ab\ \c"
23:57:09 <lambdabot> True
23:57:56 <glguy> but you better have *some* whitespace in there
23:58:00 <glguy> > "ab\\c"
23:58:01 <lambdabot> "ab\\c"
23:58:07 × random-jellyfish quits (~random-je@user/random-jellyfish) (Ping timeout: 256 seconds)
23:58:09 <monochrom> Yeah :)
23:58:42 <awpr> > "ab\​\c"
23:58:43 <lambdabot> <hint>:1:5: error:
23:58:44 <lambdabot> lexical error in string/character literal at character '\8203'
23:58:48 <monochrom> I usually don't warn about these details because programmers don't troll themselves with corner cases.
23:59:03 awpr just trolled himself with a corner case...
23:59:16 × chomwitt quits (~chomwitt@2a02:587:dc14:5d00:12c3:7bff:fe6d:d374) (Ping timeout: 252 seconds)
23:59:49 × proofofkeags_ quits (~proofofke@205.209.28.54) (Ping timeout: 252 seconds)

All times are in UTC on 2021-09-10.