Logs on 2021-09-25 (liberachat/#haskell)
| 00:00:00 | <geekosaur> | 8" or 5¼"? |
| 00:00:10 | <monochrom> | Although, I think he botched the floppy diskette explanation. I think it's more effective to say "imagine today you are required to put your files on a thumb drive and bring it to a dedicated computer in person". |
| 00:00:35 | <monochrom> | Might even be 3.5" in his case, I think, IIRC. |
| 00:00:37 | → | xsperry joins (~as@user/xsperry) |
| 00:01:41 | <hpc> | i enjoyed explaining core rope memory to a younger coworker |
| 00:10:45 | × | daDude quits (~daDude@cpc91646-hart11-2-0-cust432.11-3.cable.virginm.net) (Quit: Client closed) |
| 00:12:46 | × | n3t quits (n3t@s45.mydevil.net) (Changing host) |
| 00:12:46 | → | n3t joins (n3t@user/n3t) |
| 00:12:51 | sm | checks for that talk on youtube, not yet |
| 00:13:05 | × | _bin quits (~bin@user/bin/x-1583188) (Quit: ZNC - https://znc.in) |
| 00:13:33 | × | MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds) |
| 00:16:50 | → | MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com) |
| 00:21:51 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
| 00:22:13 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 00:27:33 | × | statusbot quits (~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com) (Remote host closed the connection) |
| 00:27:48 | → | statusbot joins (~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com) |
| 00:34:13 | × | Tuplanolla quits (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.) |
| 00:36:18 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.2.1) |
| 00:37:48 | × | hatds quits (~hatds@c-107-4-136-72.hsd1.mn.comcast.net) (Quit: Leaving) |
| 00:40:07 | × | acidjnk quits (~acidjnk@p200300d0c703cb77bd57d6e6b991bf0a.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 00:41:03 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 00:44:13 | × | lbseale quits (~lbseale@user/ep1ctetus) (Read error: Connection reset by peer) |
| 00:47:52 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds) |
| 00:49:45 | → | sneedsfeed joins (~sneedsfee@rrcs-173-95-122-169.midsouth.biz.rr.com) |
| 00:49:47 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 00:50:19 | × | jespada quits (~jespada@2803:9800:9842:7a62:2546:af34:8714:120f) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 00:52:47 | → | ub joins (~Thunderbi@178.165.202.105.wireless.dyn.drei.com) |
| 00:53:16 | × | ubert quits (~Thunderbi@91.141.79.118.wireless.dyn.drei.com) (Ping timeout: 252 seconds) |
| 00:53:16 | ub | is now known as ubert |
| 00:53:43 | <sneedsfeed> | I just made a program thats a lot more involved than anything I've done before. If anyone feels up for it, I would welcome anyone who wants to look at it and give advise/critique. I have made it as good as I know how by this point. https://paste.tomsmeding.com/NedjJZ4x |
| 00:54:00 | <sneedsfeed> | it solves mazes by the way |
| 00:55:03 | <c_wraith> | why did you create those type aliases? |
| 00:55:34 | <sneedsfeed> | for clarity. almost like comments. I thought it was better than commenting. |
| 00:55:56 | <sneedsfeed> | the types of the functions communicate really well what the functions do I think with those named aliases |
| 00:56:27 | <c_wraith> | I really don't like type aliases for simple types. They don't make bugs harder - they just make you have to keep more in your head. |
| 00:56:40 | <sneedsfeed> | hm okay |
| 00:56:56 | <c_wraith> | Not saying they're wrong. |
| 00:57:07 | <c_wraith> | Just... they do less than you hope. |
| 00:57:32 | <sneedsfeed> | kk |
| 00:58:11 | <c_wraith> | I don't like using (==) in the definition of turn, because you're matching against nullary constructors of a known type. |
| 00:58:28 | <c_wraith> | But I see why you did it - it let you put each direction on one line |
| 00:58:32 | <sneedsfeed> | yea i didnt really like that either |
| 00:58:38 | <sneedsfeed> | but yea thats why i did it |
| 00:58:45 | <sneedsfeed> | think its better to just have it 8 lines? |
| 00:58:51 | <c_wraith> | I think I'd write something like: fromTurn :: a -> a -> Turn -> a |
| 00:59:08 | <c_wraith> | And then use it for each direction |
| 01:01:27 | × | ph88 quits (~ph88@2a02:8109:9e00:7e5c:7cb7:e630:89c:9583) (Ping timeout: 240 seconds) |
| 01:02:18 | <c_wraith> | in testmove, the first four cases match the same pattern - you only need to repeat the guard. Hmm, actually, I don't see why you're using a list for your position type, unless you intend to extend it to n dimensions |
| 01:03:22 | <c_wraith> | Hmm. Looks like you're using a depth-first search. I guess that does work in n dimensions, though your Maze representation doesn't |
| 01:03:52 | <sneedsfeed> | no it is never intended to be multidimensional |
| 01:04:06 | <c_wraith> | Then I'd recommend using (Int, Int) for position instead of [Int] |
| 01:04:19 | <c_wraith> | then you never need to worry about accidentally passing the wrong number of things |
| 01:04:39 | <sneedsfeed> | tuples can hold as many things as a list no? |
| 01:04:55 | <c_wraith> | Well, they're just entirely different. It's not like python. |
| 01:05:18 | <c_wraith> | Tuples are fixed-length. Tuples of different length are different types. Each position can have a different type. |
| 01:05:30 | <sneedsfeed> | just better in general for something that you intend to be of fixed short length. |
| 01:05:35 | <sneedsfeed> | (y) |
| 01:06:35 | <c_wraith> | Huh. Looking at that algorithm - that's... not ideal. You're going to spend a *lot* of time exploring already-rejected paths. That's not Haskell style criticism, though. :) |
| 01:06:54 | <sneedsfeed> | Oh man I know. I tried so hard to do that a different way. |
| 01:07:15 | <sneedsfeed> | I wanted to make it so that if I ended up on the starting position that was a fail, but that didnt work. |
| 01:07:29 | <sneedsfeed> | theres an edge case |
| 01:07:56 | <c_wraith> | I think the most obvious fix is to keep track of everywhere you've checked already. |
| 01:08:12 | <c_wraith> | Never return to a square you've visited before. |
| 01:08:20 | <sneedsfeed> | that wont work |
| 01:08:37 | <c_wraith> | It does as long as you keep your path queue separate from your seen queue |
| 01:08:39 | <sneedsfeed> | imagine a situation where there is a path then a room and you have to go back along that path but there is still an exit |
| 01:09:29 | <c_wraith> | You'd go back up the stack to find where you could have branched the other direction instead of going into the dead end |
| 01:09:46 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 252 seconds) |
| 01:09:50 | <sneedsfeed> | until there is no other path |
| 01:10:38 | <c_wraith> | Ideally you'd use a shortest-path algorithm, but that's more work. Breadth-first search would get you there. Something like A* could get you there with less fumbling around. |
| 01:11:02 | <sneedsfeed> | yea to be honest this challenged my skills |
| 01:11:18 | <sneedsfeed> | I was happy to get here, but I wouldnt mind going back and doing it better. |
| 01:11:20 | <c_wraith> | in Haskell or just search knowledge? |
| 01:11:31 | <sneedsfeed> | both |
| 01:12:11 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 01:12:11 | <c_wraith> | Well - my biggest feedback is to change the position type. Making it a pair instead of a list is just a huge improvement. |
| 01:12:23 | <sneedsfeed> | if you wanted to implement it like that, would you just keep a stack in the form of a list, and pop elements off the top as you have to go back? |
| 01:12:36 | <c_wraith> | yes, that's one approach |
| 01:12:44 | <sneedsfeed> | feels not so efficient |
| 01:12:54 | <c_wraith> | [] is actually a fine stack type |
| 01:13:15 | <c_wraith> | But that inherently implies a depth-first search, which doesn't guarantee you an efficient route. |
| 01:13:34 | <sneedsfeed> | sure sure im just talking about a follow the left wall rule |
| 01:15:31 | <c_wraith> | oh. that is what you're doing. That's not so bad, as long as the start and exit are on outer walls. |
| 01:15:48 | <sneedsfeed> | yes, this was for a challenge project on codewars |
| 01:15:55 | <sneedsfeed> | the exit is always at bottom right |
| 01:15:56 | <c_wraith> | looks like you guarantee the start and end locations are on outer walls |
| 01:17:53 | <sneedsfeed> | this definitely has me interested in trying to make better maze solving algorithms though. it was a fun and interesting project with a lot of room for improvement. |
| 01:18:20 | <c_wraith> | Do you have any experience with computer science education? |
| 01:18:57 | <sneedsfeed> | no i'm completely self taught |
| 01:19:09 | <sneedsfeed> | I have a couple of books. |
| 01:19:41 | <c_wraith> | Maze solving is a form of graph search problem. |
| 01:19:46 | <geekosaur> | that sounds familiar |
| 01:20:12 | <c_wraith> | If you're curious, look into things like "breadth-first search" as a starting point |
| 01:20:44 | <sneedsfeed> | okay I'll check it out |
| 01:23:41 | → | neurocyte01323 joins (~neurocyte@185.117.68.47) |
| 01:23:41 | × | neurocyte01323 quits (~neurocyte@185.117.68.47) (Changing host) |
| 01:23:41 | → | neurocyte01323 joins (~neurocyte@user/neurocyte) |
| 01:24:11 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 01:25:46 | × | neurocyte0132 quits (~neurocyte@user/neurocyte) (Ping timeout: 252 seconds) |
| 01:25:46 | neurocyte01323 | is now known as neurocyte0132 |
| 01:31:26 | × | emf quits (~emf@2620:10d:c090:400::5:38ea) (Quit: emf) |
| 01:41:06 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) (Remote host closed the connection) |
| 01:43:16 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 01:45:34 | × | alx741 quits (~alx741@181.196.68.94) (Quit: alx741) |
| 01:46:31 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) |
| 01:47:13 | × | xff0x quits (~xff0x@2001:1a81:5287:3100:448c:6d89:40d5:fb1d) (Ping timeout: 252 seconds) |
| 01:48:17 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 265 seconds) |
| 01:48:45 | → | xff0x joins (~xff0x@2001:1a81:52a2:cc00:4234:2859:27a7:60ed) |
| 01:56:42 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) (Remote host closed the connection) |
| 02:00:14 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) |
| 02:00:23 | → | shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 02:01:00 | × | shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection) |
| 02:03:58 | → | korvos joins (uid486420@id-486420.tinside.irccloud.com) |
| 02:07:38 | → | hyiltiz joins (~quassel@31.220.5.250) |
| 02:12:27 | × | td_ quits (~td@94.134.91.253) (Ping timeout: 265 seconds) |
| 02:12:38 | × | yinghua_ quits (~yinghua@2800:2121:1400:1db:c0c5:a435:cabe:dd29) (Quit: Leaving) |
| 02:14:15 | → | td_ joins (~td@muedsl-82-207-238-146.citykom.de) |
| 02:17:26 | × | Skyfire quits (~pyon@user/pyon) (Quit: brb) |
| 02:20:33 | → | harveypwca joins (~harveypwc@2601:246:c180:a570:2435:ba7:e573:bc26) |
| 02:34:26 | <TDANG_> | I tried to learn Monad but it is still very tough to me. |
| 02:35:06 | <TDANG_> | Any idea where I can get started and unsderstand it well. |
| 02:35:09 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 02:36:18 | <dsal> | TDANG_: What did you try? What is your goal? |
| 02:36:44 | <TDANG_> | I learned from http://book.realworldhaskell.org/ |
| 02:37:18 | <TDANG_> | my goal is to understand Monad so that I can understand syntax of Plutus smartcontract |
| 02:37:39 | <dsal> | That looks like a really hard way to learn monads. heh. |
| 02:38:09 | <dsal> | :t (>>=) |
| 02:38:10 | <lambdabot> | Monad m => m a -> (a -> m b) -> m b |
| 02:38:29 | <dsal> | Monad isn't much more than that. |
| 02:38:47 | <dsal> | But starting from there and trying to work out isn't the easiest way to understand anything. |
| 02:39:06 | <dsal> | If there's just a syntax you want to understand, then one can typically *use* monads without having a super deep understanding. |
| 02:39:34 | <TDANG_> | Ok. Just understand to use |
| 02:39:48 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) (Remote host closed the connection) |
| 02:40:04 | <TDANG_> | can you give some hint of how to interpret the meaning (or usage) or Monad |
| 02:40:08 | <dsal> | It's pretty hard to explain things to people without a good understanding of what they already know. |
| 02:40:39 | <TDANG_> | ;-) |
| 02:40:41 | <TDANG_> | \ |
| 02:41:37 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 252 seconds) |
| 02:41:50 | <dsal> | Can you understand the bind definition above? |
| 02:42:01 | <TDANG_> | yes I can |
| 02:42:49 | <dsal> | OK. That's pretty much all there is to a monad. If you're using `do` syntax, it just does the binding for you in a way that's slightly convenient in some cases. |
| 02:43:04 | <dsal> | @undo do { a <- f; ga } |
| 02:43:04 | <lambdabot> | f >>= \ a -> ga |
| 02:43:30 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 02:43:39 | <dsal> | There was supposed to be a space there. heh. |
| 02:44:12 | <TDANG_> | Oh, I've never seen ; operator |
| 02:44:52 | <dsal> | You wouldn't see it too much in the wild. You can read it as a newline. |
| 02:45:07 | <dsal> | and {} are pretty uncommon as well, unless you want to shove things on a single line. |
| 02:45:26 | <TDANG_> | oh, I got it |
| 02:45:29 | <dsal> | @undo { a <- f ; print a ; g a } |
| 02:45:29 | <lambdabot> | <unknown>.hs:1:1:Parse error: { |
| 02:45:34 | <dsal> | @undo do { a <- f ; print a ; g a } |
| 02:45:34 | <lambdabot> | f >>= \ a -> print a >> g a |
| 02:46:37 | <dsal> | You don't need to have a deep understanding of category theory to put that into use. |
| 02:46:54 | <TDANG_> | a ha |
| 02:47:21 | <dsal> | Do you have an example of something you find hard to understand? |
| 02:47:37 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) |
| 02:48:40 | × | zebrag quits (~chris@user/zebrag) (Remote host closed the connection) |
| 02:49:10 | <TDANG_> | Ok. I think I need invest more time reading + learning |
| 02:50:11 | × | hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection) |
| 02:50:42 | <sneedsfeed> | this video kinda made sense to me https://www.youtube.com/watch?v=Nq-q2USYetQ even though i'm new to this stuff too |
| 02:50:46 | <sneedsfeed> | might help |
| 02:51:27 | <TDANG_> | great. thanks |
| 02:51:31 | → | hololeap joins (~hololeap@user/hololeap) |
| 02:54:50 | × | waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 260 seconds) |
| 03:00:02 | × | haasn quits (~nand@haasn.dev) (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
| 03:01:26 | → | haasn joins (~nand@haasn.dev) |
| 03:11:33 | → | xiongxin joins (~quassel@119.123.100.167) |
| 03:20:39 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 03:25:07 | × | doyougnu quits (~user@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 252 seconds) |
| 03:38:19 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 03:49:11 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 03:51:46 | → | shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 03:54:53 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 03:56:40 | <hololeap> | that Brian Beckman video, Don't Fear the Monad, is actually pretty helpful |
| 03:57:15 | <hololeap> | TDANG_: ^ |
| 03:59:05 | <TDANG_> | ;-) |
| 04:00:50 | → | yauhsien_ joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 04:00:50 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Read error: Connection reset by peer) |
| 04:04:22 | × | xff0x quits (~xff0x@2001:1a81:52a2:cc00:4234:2859:27a7:60ed) (Ping timeout: 260 seconds) |
| 04:04:58 | → | xff0x joins (~xff0x@2001:1a81:52a2:cc00:afd6:85eb:5a44:1d7e) |
| 04:08:31 | × | xiongxin quits (~quassel@119.123.100.167) (Ping timeout: 252 seconds) |
| 04:09:13 | → | xiongxin joins (~quassel@113.116.32.113) |
| 04:14:33 | → | Cajun joins (~Cajun@user/cajun) |
| 04:19:59 | <mrianbloom> | What is the best library to use to serialize a bytestring into an array of floats? Data.Binary? I'm looking for a fast way to load a (very large) accelerate array. |
| 04:25:22 | → | agoraphobic_ joins (~agoraphob@ip11-173.bon.riksnet.se) |
| 04:25:22 | × | agoraphobic quits (~agoraphob@ip11-173.bon.riksnet.se) (Read error: Connection reset by peer) |
| 04:27:28 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 04:28:37 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 04:40:04 | <hololeap> | mrianbloom: I think that depends on how the floats are encoded |
| 04:42:33 | <mrianbloom> | hololeap I'm actually encoding and decoding them but there is another python program that needs to import them into a numpy array. |
| 04:43:03 | <hololeap> | possibly something like conduit (or pipes) would help if you need to chunk up the bytestring and process it as it's read |
| 04:44:29 | <mrianbloom> | I see, currently I'm trying to write the bytestring into an Vector.Storable and then just pass the pointer into the accelerate array with Data.Array.Accelerate.IO.Foreign.Ptr |
| 04:44:49 | <mrianbloom> | Just seems a little wonky to write this code myself. |
| 04:45:19 | <mrianbloom> | I'm using Data.Binary to parse the Bytestring |
| 04:49:20 | × | yauhsien_ quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 04:51:36 | × | _xor quits (~xor@74.215.232.67) (Quit: brb) |
| 04:52:00 | <hololeap> | mrianbloom: try using Data.Binary.Get to create a (Get (Vector Float)) and then apply it to a your (lazy) bytestring |
| 04:53:20 | <hololeap> | using runGet |
| 04:54:04 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 04:56:03 | → | _xor joins (~xor@74.215.232.67) |
| 05:00:51 | <mrianbloom> | hololeap, that's what I'm almost doing. |
| 05:00:59 | <mrianbloom> | Here's my current code https://gist.github.com/ianmbloom/fb8e81f23af7db578bbc515460c7933b |
| 05:01:59 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Ping timeout: 252 seconds) |
| 05:02:08 | <mrianbloom> | Basically they provide me with a (huge) csv file (13000,2500,3) and in order to speed things up on the next run I first store it as binary and then I need to hold it in ram. |
| 05:02:41 | <hololeap> | mrianbloom: why Data.ByteString.Lazy.Char8 ? |
| 05:03:05 | → | emf joins (~emf@2620:10d:c090:400::5:f81e) |
| 05:03:08 | <hololeap> | the Char8 is kind of a hack to get ASCII from a bytestring |
| 05:03:51 | <mrianbloom> | Hmmm... I could try swapping in another bytestring. |
| 05:04:15 | <hololeap> | Just use Data.ByteString.Lazy |
| 05:04:38 | <hololeap> | unless you plan to convert each byte to a Char |
| 05:04:55 | × | emf quits (~emf@2620:10d:c090:400::5:f81e) (Client Quit) |
| 05:05:13 | × | korvos quits (uid486420@id-486420.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
| 05:05:20 | <mrianbloom> | I see, Char8 implements the 'lines' function which I'm using to parse the csv |
| 05:05:25 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 05:05:54 | <mrianbloom> | It's double duty obviously, but if I can use the same library for both tasks I'd like to for now. |
| 05:06:48 | <hololeap> | oh |
| 05:07:31 | <mrianbloom> | I guess I can use both I'll just put a different qualifier on it. |
| 05:07:46 | <hololeap> | you should probably use attoparsec |
| 05:08:08 | <hololeap> | I thought it was in binary format |
| 05:08:30 | <mrianbloom> | I'm doing both |
| 05:08:59 | <hololeap> | you can build up a (Vector Flaot) with attoparsec |
| 05:08:59 | <mrianbloom> | Basically I load the csv into a binary file if its the first run |
| 05:09:09 | <hololeap> | *Float |
| 05:09:30 | <mrianbloom> | I'll look into that. |
| 05:09:46 | <hololeap> | is it too big to hold the entire vector in ram? |
| 05:10:22 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 05:10:28 | <mrianbloom> | No, so, loading the csv is very slow because it's very large |
| 05:10:46 | <hololeap> | do you need to consume the vector as it is built, or do you want to build it and store it in ram |
| 05:10:59 | <mrianbloom> | I'm actually loading it into ram so that I can encode slices into files that get sent to python scripts |
| 05:11:50 | <mrianbloom> | I need to construct a vector hold it in ram and write it to files as well (I write both the whole array as well as slices.) |
| 05:12:19 | <hololeap> | well, just make an attoparsec parser which reads the CSV into the data type you want. you can append to the vector using its Monoid instance, which should simplify things |
| 05:15:33 | <mrianbloom> | I'll try appending a vector. That might work well thanks. |
| 05:16:00 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 05:20:09 | → | mei joins (~mei@user/mei) |
| 05:20:41 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 05:21:07 | → | arpl joins (~arpl@84-107-171-239.cable.dynamic.v4.ziggo.nl) |
| 05:23:50 | <hololeap> | mrianbloom: are those numbers always integers or could you get something with a decimal in the CSV file? |
| 05:26:45 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 265 seconds) |
| 05:31:49 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 05:32:06 | → | img joins (~img@user/img) |
| 05:35:52 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 05:38:17 | ← | arpl parts (~arpl@84-107-171-239.cable.dynamic.v4.ziggo.nl) () |
| 05:40:22 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 05:41:15 | × | jinsun quits (~quassel@user/jinsun) (Ping timeout: 265 seconds) |
| 05:43:30 | → | jinsun joins (~quassel@user/jinsun) |
| 05:43:54 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) (Remote host closed the connection) |
| 05:47:04 | <hololeap> | mrianbloom: maybe this would work for you: http://sprunge.us/aMJ35R |
| 05:48:12 | <hololeap> | http://sprunge.us/7nux2t -- with the imports cleaned up |
| 05:49:17 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 05:51:15 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 06:05:48 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 06:05:48 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 06:05:48 | → | wroathe joins (~wroathe@user/wroathe) |
| 06:10:44 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds) |
| 06:15:34 | × | MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer) |
| 06:15:57 | × | zmt01 quits (~zmt00@user/zmt00) (Ping timeout: 250 seconds) |
| 06:20:13 | → | MQ-17J joins (~MQ-17J@8.6.144.233) |
| 06:21:38 | × | mei quits (~mei@user/mei) (Quit: mei) |
| 06:25:43 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 06:26:06 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:27:52 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 06:29:02 | × | hammock quits (~Hammock@2600:1700:19a1:3330::588) (Ping timeout: 260 seconds) |
| 06:31:22 | <hololeap> | http://sprunge.us/W3ghSa -- mrianbloom: this uses lazy bytestrings and can handle file endings a little better |
| 06:31:56 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 06:34:23 | → | chomwitt joins (~chomwitt@2a02:587:dc0a:5800:12c3:7bff:fe6d:d374) |
| 06:36:54 | → | ksqsf joins (~user@2001:da8:d800:189:1d6f:35b0:8e7:c962) |
| 06:41:11 | → | aaaaaaaaaaaaaaaa joins (~aaaaaaaaa@byc46.neoplus.adsl.tpnet.pl) |
| 06:43:42 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 06:44:17 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) |
| 06:48:38 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) (Ping timeout: 260 seconds) |
| 06:49:18 | × | hololeap quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds) |
| 06:51:54 | × | xiongxin quits (~quassel@113.116.32.113) (Ping timeout: 260 seconds) |
| 06:52:19 | → | xiongxin joins (~quassel@119.123.102.171) |
| 06:54:19 | <tomsmeding> | mrianbloom: I've found the bytestring-lexing package to be reasonably fast at parsing float values from bytestrings -- many times faster than plain Read, but you're already doing something different than that |
| 06:54:52 | <tomsmeding> | that remark is useful depending on what your bottleneck is :) |
| 06:56:03 | × | aaaaaaaaaaaaaaaa quits (~aaaaaaaaa@byc46.neoplus.adsl.tpnet.pl) (Ping timeout: 256 seconds) |
| 06:56:37 | → | fendor joins (~fendor@178.165.207.87.wireless.dyn.drei.com) |
| 07:02:43 | → | hololeap joins (~hololeap@user/hololeap) |
| 07:03:39 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 07:04:20 | → | neurocyte01322 joins (~neurocyte@212.232.84.248) |
| 07:04:20 | × | neurocyte01322 quits (~neurocyte@212.232.84.248) (Changing host) |
| 07:04:20 | → | neurocyte01322 joins (~neurocyte@user/neurocyte) |
| 07:06:50 | × | neurocyte0132 quits (~neurocyte@user/neurocyte) (Ping timeout: 252 seconds) |
| 07:06:51 | neurocyte01322 | is now known as neurocyte0132 |
| 07:07:01 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 07:07:02 | → | max22- joins (~maxime@2a01cb088335980064e1e8ac26e1f95e.ipv6.abo.wanadoo.fr) |
| 07:07:14 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 07:07:24 | → | alzgh joins (~alzgh@user/alzgh) |
| 07:08:26 | × | hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection) |
| 07:10:33 | → | hololeap joins (~hololeap@user/hololeap) |
| 07:11:14 | × | python476 quits (~user@88.160.31.174) (Ping timeout: 252 seconds) |
| 07:11:47 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 07:22:41 | × | hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection) |
| 07:24:26 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 252 seconds) |
| 07:29:07 | → | ksqsf` joins (~user@2001:da8:d800:189:4d9b:cfa5:8d1d:283) |
| 07:29:41 | → | wonko joins (~wjc@62.115.229.50) |
| 07:30:58 | × | ksqsf quits (~user@2001:da8:d800:189:1d6f:35b0:8e7:c962) (Ping timeout: 252 seconds) |
| 07:31:51 | → | hololeap joins (~hololeap@user/hololeap) |
| 07:37:44 | × | xiongxin quits (~quassel@119.123.102.171) (Ping timeout: 265 seconds) |
| 07:37:51 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 07:45:17 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 07:45:58 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) |
| 07:46:05 | → | oxide joins (~lambda@user/oxide) |
| 07:46:08 | × | hnOsmium0001 quits (uid453710@id-453710.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 07:49:36 | → | vysn joins (~vysn@user/vysn) |
| 07:50:42 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:49b6:f37c:5898:ff80) (Ping timeout: 260 seconds) |
| 07:52:32 | → | waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) |
| 07:59:36 | → | acidjnk joins (~acidjnk@p200300d0c703cb72bd57d6e6b991bf0a.dip0.t-ipconnect.de) |
| 08:06:39 | → | _ht joins (~quassel@82-169-194-8.biz.kpn.net) |
| 08:11:56 | × | hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection) |
| 08:12:11 | → | nfd joins (~nfd@user/nfd) |
| 08:13:21 | → | xiongxin joins (~quassel@113.116.32.113) |
| 08:15:55 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:15c6:decf:bd32:9e19) |
| 08:16:04 | × | qwedfg quits (~qwedfg@user/qwedfg) (Ping timeout: 252 seconds) |
| 08:18:16 | → | eggplant_ joins (~Eggplanta@2600:1700:bef1:5e10:2882:621e:ea09:67b5) |
| 08:18:51 | → | Pickchea joins (~private@user/pickchea) |
| 08:19:18 | → | ksqsf`` joins (~user@2001:da8:d800:189:91e6:fa37:d466:604b) |
| 08:20:34 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:15c6:decf:bd32:9e19) (Ping timeout: 260 seconds) |
| 08:21:01 | × | ksqsf` quits (~user@2001:da8:d800:189:4d9b:cfa5:8d1d:283) (Ping timeout: 252 seconds) |
| 08:21:39 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 08:21:44 | → | kuribas joins (~user@ptr-25vy0ia6bff50uvref3.18120a2.ip6.access.telenet.be) |
| 08:22:54 | × | eggplant_ quits (~Eggplanta@2600:1700:bef1:5e10:2882:621e:ea09:67b5) (Ping timeout: 260 seconds) |
| 08:27:34 | × | xff0x quits (~xff0x@2001:1a81:52a2:cc00:afd6:85eb:5a44:1d7e) (Ping timeout: 260 seconds) |
| 08:27:54 | → | ksqsf``` joins (~user@2001:da8:d800:189:98a2:a71a:35ff:a8dd) |
| 08:28:07 | → | xff0x joins (~xff0x@2001:1a81:52a2:cc00:e5a6:b6dd:762:ffad) |
| 08:28:30 | × | waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 260 seconds) |
| 08:29:49 | × | ksqsf`` quits (~user@2001:da8:d800:189:91e6:fa37:d466:604b) (Ping timeout: 252 seconds) |
| 08:37:13 | → | Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) |
| 08:39:45 | × | nrl^ quits (~nrl@12.203.127.82) (Remote host closed the connection) |
| 08:43:08 | → | qwedfg joins (~qwedfg@user/qwedfg) |
| 08:52:22 | → | Brumaire joins (~quassel@81-64-14-121.rev.numericable.fr) |
| 08:55:21 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 08:56:10 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 09:00:03 | × | masaeedu[m] quits (~masaeedum@2001:470:69fc:105::e256) (Quit: You have been kicked for being idle) |
| 09:01:47 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 09:07:27 | → | Skyfire joins (~pyon@user/pyon) |
| 09:08:42 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 09:10:21 | × | mousey quits (~sky@gateway/tor-sasl/mousey) (Ping timeout: 276 seconds) |
| 09:11:37 | × | ksqsf``` quits (~user@2001:da8:d800:189:98a2:a71a:35ff:a8dd) (Ping timeout: 252 seconds) |
| 09:13:13 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 09:20:12 | → | acidjnk_new joins (~acidjnk@p200300d0c703cb723ce418ea93e3eeac.dip0.t-ipconnect.de) |
| 09:23:43 | × | acidjnk quits (~acidjnk@p200300d0c703cb72bd57d6e6b991bf0a.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 09:24:46 | → | python476 joins (~user@88.160.31.174) |
| 09:38:34 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds) |
| 09:38:58 | × | xiongxin quits (~quassel@113.116.32.113) (Ping timeout: 260 seconds) |
| 09:40:01 | → | xiongxin joins (~quassel@113.116.34.58) |
| 09:46:15 | × | wonko quits (~wjc@62.115.229.50) (Quit: See You Space Cowboy..) |
| 09:47:22 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds) |
| 09:58:29 | → | python47` joins (~user@88.160.31.174) |
| 10:00:19 | × | python476 quits (~user@88.160.31.174) (Ping timeout: 265 seconds) |
| 10:00:47 | × | alaspeanutcheese quits (~alaspeanu@52pc67.sshunet.nl) (Ping timeout: 240 seconds) |
| 10:02:30 | → | __monty__ joins (~toonn@user/toonn) |
| 10:04:05 | <Guest372> | addOne x f = f x; addTwo x f = do { let r = f x; doSomething; return r }; could we say addOne and addTwo have same type signature? |
| 10:05:37 | <c_wraith> | they don't have the same most-general type |
| 10:05:46 | <c_wraith> | (also known as principle type) |
| 10:06:27 | <c_wraith> | actually, they don't have the same type at all. I think you get an infinite type error if you try to unify those |
| 10:07:18 | <c_wraith> | yeah, you'd be trying to unify the type of (f x) with the type of (return (f x)) |
| 10:07:33 | <c_wraith> | those will never unify. infinite type error |
| 10:11:28 | <tomsmeding> | (for the sake of nitpicking: principal type, not principle type :) ) |
| 10:11:47 | <c_wraith> | It's the type I feel in my heart! |
| 10:11:55 | <tomsmeding> | :D |
| 10:12:44 | × | xiongxin quits (~quassel@113.116.34.58) (Ping timeout: 252 seconds) |
| 10:12:45 | × | fendor quits (~fendor@178.165.207.87.wireless.dyn.drei.com) (Remote host closed the connection) |
| 10:12:54 | × | FragByte quits (~christian@user/fragbyte) (Quit: Quit) |
| 10:13:11 | → | xiongxin joins (~quassel@113.116.32.113) |
| 10:13:34 | <Guest372> | that withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r, withFile get (Handle -> IO r) result them close file, return result, what if we creat a withFileCPS that take (Handle -> IO r) in the last, they have the same type right? |
| 10:14:40 | → | FragByte joins (~christian@user/fragbyte) |
| 10:15:03 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 10:15:26 | <c_wraith> | did you mean r <- f x in your addTwo? |
| 10:15:44 | <c_wraith> | If you did, then you could at least unify the types of those two |
| 10:16:08 | <tomsmeding> | :t \x f -> f x |
| 10:16:09 | <lambdabot> | t1 -> (t1 -> t2) -> t2 |
| 10:16:10 | <Guest372> | kimd of |
| 10:16:22 | <tomsmeding> | :t \x f -> do { r <- f x ; undefined ; return r } |
| 10:16:22 | <lambdabot> | Monad m => t -> (t -> m b) -> m b |
| 10:17:02 | <c_wraith> | those unify, though one is clearly more general than the other. |
| 10:17:05 | <kuribas> | Guest372: did you mean addOne x f = pure $ f x? |
| 10:17:27 | <Guest372> | no, just f x |
| 10:17:35 | <c_wraith> | are you the same person who asked about withFile and CPS a few days ago? |
| 10:17:57 | <Guest372> | I asked withFile a few days ago |
| 10:18:44 | <kuribas> | Guest372: well, a -> (a -> b) -> b and Monad m => a -> (a -> b) -> m b are clearly different. |
| 10:21:51 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 10:21:54 | × | xiongxin quits (~quassel@113.116.32.113) (Ping timeout: 260 seconds) |
| 10:26:06 | → | tfeb joins (~tfb@88.98.95.237) |
| 10:27:15 | → | chris joins (~chris@81.96.113.213) |
| 10:27:19 | chris | is now known as Guest7748 |
| 10:28:26 | × | xff0x quits (~xff0x@2001:1a81:52a2:cc00:e5a6:b6dd:762:ffad) (Ping timeout: 260 seconds) |
| 10:29:20 | → | xff0x joins (~xff0x@2001:1a81:52a2:cc00:e316:3cc6:4da2:e9d8) |
| 10:30:21 | → | fendor joins (~fendor@178.165.207.87.wireless.dyn.drei.com) |
| 10:31:52 | × | Guest7748 quits (~chris@81.96.113.213) (Ping timeout: 252 seconds) |
| 10:33:16 | × | tfeb quits (~tfb@88.98.95.237) (Quit: died) |
| 10:38:45 | <maerwald> | too bad you can't use a where-clause function in a viewpattern of the top-level definitoin |
| 10:40:57 | <tomsmeding> | that feels like an unnecessary restriction |
| 10:43:24 | <maerwald> | it's simple sugar I guess |
| 10:43:44 | <maerwald> | not refined carbs |
| 10:44:49 | × | terrorjack quits (~terrorjac@ec2-35-181-134-114.eu-west-3.compute.amazonaws.com) (Quit: The Lounge - https://thelounge.chat) |
| 10:46:12 | <tomsmeding> | perhaps they didn't want to deal with the situation where the where-bindings refer to the value being matched with the view pattern? |
| 10:46:31 | <tomsmeding> | f (thing -> x) = ... where thing = .. x .. |
| 10:46:49 | <tomsmeding> | there's no reason it _couldn't_ work I think |
| 10:47:07 | → | terrorjack joins (~terrorjac@ec2-35-181-134-114.eu-west-3.compute.amazonaws.com) |
| 10:51:13 | → | ubert1 joins (~Thunderbi@178.165.202.105.wireless.dyn.drei.com) |
| 10:52:23 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 10:53:07 | → | [_] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 10:54:33 | <wz1000> | what goes wrong if you try to use this function? dne :: ((a -> Void) -> Void) -> a; dne k = absurd $ k (unsafeCoerce id) |
| 10:55:54 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 265 seconds) |
| 10:55:56 | <tomsmeding> | wz1000: what are you going to call it with? |
| 10:58:07 | → | evertedsphere joins (sid434122@id-434122.hampstead.irccloud.com) |
| 11:00:39 | × | slep quits (~slep@cpc150002-brnt4-2-0-cust437.4-2.cable.virginm.net) (Quit: slep) |
| 11:00:57 | → | alx741 joins (~alx741@181.196.68.94) |
| 11:02:43 | → | slep joins (~slep@cpc150002-brnt4-2-0-cust437.4-2.cable.virginm.net) |
| 11:02:49 | <tomsmeding> | hm, I guess (\f -> f 42) |
| 11:03:08 | <kuribas> | ($ 42) |
| 11:03:29 | <tomsmeding> | (`id` 42) |
| 11:04:18 | <kuribas> | wz1000: coredump? |
| 11:04:46 | <kuribas> | wz1000: I read "unsafeCoerce" as "coredump unless you know what you do". |
| 11:05:01 | <wz1000> | but this isn't usafeCoerce |
| 11:05:17 | <evertedsphere> | good day |
| 11:05:25 | <kuribas> | wz1000: it uses unsafeCoerce |
| 11:05:48 | × | evertedsphere quits (sid434122@id-434122.hampstead.irccloud.com) (Quit: Updating details, brb) |
| 11:05:59 | → | evertedsphere joins (sid434122@id-434122.hampstead.irccloud.com) |
| 11:06:13 | <wz1000> | Do you have a program which coredumps using dne? |
| 11:06:27 | <kuribas> | wz1000: sorry, I was just guessing. |
| 11:06:28 | <evertedsphere> | curious: what's dne |
| 11:06:32 | ← | evertedsphere parts (sid434122@id-434122.hampstead.irccloud.com) () |
| 11:06:35 | <kuribas> | wz1000: let me try it then :) |
| 11:07:39 | → | evertedsphere joins (sid434122@id-434122.hampstead.irccloud.com) |
| 11:08:02 | <tomsmeding> | wz1000: well it's certainly behaving fishy |
| 11:08:24 | <tomsmeding> | 'print (dne ($ "abc"))' gives "abc" for me with -O0 and "abc with -O2 |
| 11:08:45 | <tomsmeding> | feels like a coredump is just some experimentation away |
| 11:10:13 | <kuribas> | dne ($ 2) => 2 |
| 11:10:14 | <kuribas> | |
| 11:12:52 | <tomsmeding> | the core also looks _very_ fishy: 'print (dne ($ "hoi"))' prints a value 'GHC.Types.: @ Char GHC.Show.$fShow(,)3 Main.main2' (where that $fShow(,)3 is a `"`, presumably), where main2 is an empty case on the string to print unsafe-coerced to Void |
| 11:12:56 | <amirouche> | re full-stack declarative webui, that is basically what hyperfiddle does |
| 11:12:58 | <amirouche> | https://hyperfiddle.notion.site/Reactive-Clojure-You-don-t-need-a-web-framework-you-need-a-web-language-44b5bfa526be4af282863f34fa1cfffc |
| 11:13:04 | <Franciman> | hi amirouche ^^ |
| 11:13:14 | <tomsmeding> | this probably half-works by accident due to the right values being in the right registers by accident |
| 11:13:23 | <amirouche> | ref: https://github.com/hyperfiddle/hyperfiddle |
| 11:13:33 | <amirouche> | Franciman: hey :) |
| 11:13:47 | × | python47` quits (~user@88.160.31.174) (Ping timeout: 252 seconds) |
| 11:14:57 | <tomsmeding> | wz1000: and when I try to enlarge the program a bit, ghc just collapses the whole thing down to an empty case on void, and the final executable is a nop :p |
| 11:15:17 | <tomsmeding> | nice try but ghc doesn't like your proof of DNE |
| 11:15:25 | <wz1000> | don't use optimisation |
| 11:15:28 | [_] | is now known as [itchyjunk] |
| 11:16:45 | <tomsmeding> | right, so "what goes wrong if you try to use this function?" -- using optimisation is what goes wrong, perhaps among other things :p |
| 11:17:40 | × | zaquest quits (~notzaques@5.128.210.178) (Remote host closed the connection) |
| 11:18:57 | → | zaquest joins (~notzaques@5.128.210.178) |
| 11:19:03 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 11:19:11 | <tomsmeding> | if you want to out-law optimisation, you can pull similar tricks in C as well: int bar() { return 42; } int foo() { bar(); } int main() { printf("%d\n", foo()); } |
| 11:19:22 | <tomsmeding> | that prints 42 without optimisations, but sensibly doesn't with optimisations |
| 11:19:25 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 11:20:22 | <wz1000> | what is wrong with that C? |
| 11:20:30 | → | ulvarrefr joins (~user@185.24.53.152) |
| 11:20:46 | <wz1000> | oh, is it the missing return? |
| 11:20:50 | <oak-> | foo missing return? |
| 11:21:10 | × | martin02 quits (~silas@141.84.69.76) (Ping timeout: 260 seconds) |
| 11:21:19 | <wz1000> | I don't see what that has to do with optimisation |
| 11:22:21 | → | hololeap joins (~hololeap@user/hololeap) |
| 11:22:57 | → | xiongxin joins (~quassel@113.116.34.58) |
| 11:26:21 | × | dumbsharka quits (~amirvince@user/amirvincent64) (Ping timeout: 265 seconds) |
| 11:26:46 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 11:28:55 | → | martin02 joins (~silas@141.84.69.76) |
| 11:30:44 | → | bontaq joins (~user@ool-45779fe5.dyn.optonline.net) |
| 11:33:56 | → | __monty__ joins (~toonn@user/toonn) |
| 11:36:06 | → | slowButPresent joins (~slowButPr@user/slowbutpresent) |
| 11:36:08 | × | kuribas quits (~user@ptr-25vy0ia6bff50uvref3.18120a2.ip6.access.telenet.be) (Remote host closed the connection) |
| 11:43:43 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 11:44:20 | <tomsmeding> | yeah foo missing return |
| 11:44:52 | <tomsmeding> | what that has to do with optimisation is that _without_ optimisation, the call to bar() won't be elided, and because of C calling conventions (at least on x64) it will put the return value in $rax |
| 11:45:13 | <tomsmeding> | so even though foo doesn't return (and hence doesn't write anything in $rax), the value from bar() will still be there, so main will print 42 |
| 11:45:46 | <tomsmeding> | _with_ optimisation, the compiler actually makes use of the language semantics as distinct from accidental leakage of machine semantics, and elides the call to bar |
| 11:46:05 | <tomsmeding> | after which printf will print a value from a register that was never initialised, and that will probably not contain 42 |
| 11:46:42 | <tomsmeding> | optimisation enforces language semantics, while non-optimisation lets you make use of accidental properties of the translation to machine code, that you can't rely on in larger programs |
| 11:46:49 | <tomsmeding> | same here :p |
| 11:46:54 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 11:47:29 | <tomsmeding> | with respect to Haskell's language semantics you're doing nonsense of course, but some accidental properties of the translation to machine code might make the dne trick work when optimisations don't interfere |
| 11:47:38 | <wz1000> | You can {- NOINLINE dne #-} and disable optimisation in that module so it acts as a primitive |
| 11:48:31 | <tomsmeding> | yeah and that works until the next ghc point release where they made some changes to the machine code translation :p |
| 11:49:04 | <tomsmeding> | it's fun to figure out what's going on, but it's not directly practically useful (but you knew that already) |
| 11:51:50 | → | Guest68 joins (~Guest68@130.226.132.96) |
| 11:53:33 | × | Guest68 quits (~Guest68@130.226.132.96) (Client Quit) |
| 11:58:03 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:01:31 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 12:04:54 | → | korvos joins (uid486420@id-486420.tinside.irccloud.com) |
| 12:05:59 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds) |
| 12:08:08 | <maerwald> | HLS stopped working. Only checks some modules and ignores others |
| 12:08:19 | <tomsmeding> | $ haskell-language-server-wrapper |
| 12:13:43 | → | chris joins (~chris@81.96.113.213) |
| 12:13:47 | chris | is now known as Guest2479 |
| 12:16:50 | → | jespada joins (~jespada@2803:9800:9842:7a62:4059:ff44:5d67:770d) |
| 12:18:33 | × | Guest2479 quits (~chris@81.96.113.213) (Ping timeout: 265 seconds) |
| 12:18:42 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 12:27:12 | → | Guest2517 joins (~Guest25@eth-west-pareq2-46-193-4-100.wb.wifirst.net) |
| 12:27:19 | × | Guest2517 quits (~Guest25@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Client Quit) |
| 12:29:15 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 12:30:44 | → | ack_inc joins (~anirudh@122.161.190.207) |
| 12:33:50 | <maerwald> | hmm, how do you highjack the way ghci shows values again? |
| 12:34:06 | <maerwald> | I wanna tweak my doctests so that they use Pretty class for showing |
| 12:38:05 | <Taneb> | I wasn't aware there was such an option! |
| 12:39:21 | <merijn> | Taneb: You can overwrite the logic to render ghci output, yes |
| 12:39:39 | <merijn> | Taneb: There's some snippets around the web for coloured output too |
| 12:39:58 | <merijn> | ghci has surprisingly many sophisticated options almost no one knows about :p |
| 12:41:02 | <merijn> | Here's a pro-tip for becoming a GHC/Haskell wizard using this "one weird trick", regardless of skill level: Make sure to skim the *entire* GHC user guide at least, like, once a year ;) |
| 12:41:38 | <merijn> | Literally every time I find some new trick, re-discover something I forgot, etc. |
| 12:42:50 | <maerwald> | doesn't work in doctests |
| 12:42:55 | <maerwald> | just times out |
| 12:44:14 | × | FragByte quits (~christian@user/fragbyte) (Ping timeout: 260 seconds) |
| 12:44:56 | → | FragByte joins (~christian@user/fragbyte) |
| 12:46:15 | <maerwald> | seems you can't redefine "show", just "putStrLn" |
| 12:46:17 | <maerwald> | not that useful |
| 12:47:32 | → | fendor_ joins (~fendor@178.115.43.157.wireless.dyn.drei.com) |
| 12:47:46 | <tomsmeding> | maerwald: the -interactive-print option looks like it should be able to do what you want? |
| 12:47:55 | <tomsmeding> | (just skimmed the manual lol) |
| 12:48:00 | <maerwald> | doesn't seem so |
| 12:48:23 | <tomsmeding> | because doctest does somethingw weird? ah |
| 12:48:31 | <tomsmeding> | oh right, s/putStrLn/print/ in your message |
| 12:48:41 | <maerwald> | I wanna redefine Show |
| 12:49:07 | <merijn> | Why? |
| 12:49:13 | <merijn> | Human readability? |
| 12:49:21 | <maerwald> | doctests as said above |
| 12:49:32 | → | qbt joins (~edun@user/edun) |
| 12:49:55 | <merijn> | You are skipping several steps of inference there if you think I understand why that should be an explanation :) |
| 12:50:02 | × | fendor quits (~fendor@178.165.207.87.wireless.dyn.drei.com) (Ping timeout: 252 seconds) |
| 12:50:12 | <maerwald> | I'm not too interested in debating the why |
| 12:50:38 | <merijn> | maerwald: Well if the answer is "for readability of humans" I have a solution |
| 12:50:52 | <merijn> | If the answer isn't that, than I dunno, RIP your sanity |
| 12:51:47 | <merijn> | but "for doctests" tells me as much as "for love" about what you need :p |
| 12:51:48 | <maerwald> | it's only partially about readability... it's making writing doctests sane |
| 12:52:03 | <merijn> | @hackage pretty-show |
| 12:52:03 | <lambdabot> | https://hackage.haskell.org/package/pretty-show |
| 12:52:08 | <merijn> | if you need the readability |
| 12:52:21 | <maerwald> | that doesn't solve the problem of me having to put that functoin everywhere |
| 12:53:08 | <merijn> | maerwald: Well it can operate on the String output of Show even if you cannot replace the show call |
| 12:53:48 | <maerwald> | that's not gonna help I think |
| 12:54:14 | <merijn> | Well, then "RIP your sanity" :p |
| 12:54:28 | <maerwald> | I don't know what that means |
| 12:55:22 | <merijn> | maerwald: It means that any solution will probably a frustrating endeavour of obscure ill-documented workarounds that'll make you mad (in both meanings of the word) :p |
| 12:55:39 | <maerwald> | I'm already mad. What are you talking about? |
| 12:56:02 | maerwald | eats part of his foot |
| 12:56:06 | <maerwald> | oh wait, that was rms |
| 12:58:47 | <maerwald> | o O ( somewhat delicious though ) |
| 12:58:58 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 12:59:20 | <maerwald> | there could be a TH hack to do this |
| 12:59:53 | <maerwald> | but then again I believe doctest can easily support this |
| 12:59:56 | × | hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 252 seconds) |
| 12:59:58 | → | sedeki joins (~textual@user/sedeki) |
| 13:04:05 | → | hyiltiz joins (~quassel@31.220.5.250) |
| 13:06:01 | × | sedeki quits (~textual@user/sedeki) (Quit: Textual IRC Client: www.textualapp.com) |
| 13:15:13 | × | hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 252 seconds) |
| 13:17:48 | → | hyiltiz joins (~quassel@31.220.5.250) |
| 13:29:05 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Ping timeout: 252 seconds) |
| 13:30:09 | → | chris joins (~chris@81.96.113.213) |
| 13:30:13 | chris | is now known as Guest8167 |
| 13:33:31 | × | jespada quits (~jespada@2803:9800:9842:7a62:4059:ff44:5d67:770d) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 13:34:35 | × | Guest8167 quits (~chris@81.96.113.213) (Ping timeout: 252 seconds) |
| 13:35:24 | → | ru0mad joins (~ru0mad@82-64-17-144.subs.proxad.net) |
| 13:35:50 | → | jumper149 joins (~jumper149@80.240.31.34) |
| 13:41:17 | → | Lycurgus joins (~juan@98.4.112.204) |
| 13:43:17 | × | asthasr quits (~asthasr@162.210.28.151) (Quit: asthasr) |
| 13:47:08 | ← | ru0mad parts (~ru0mad@82-64-17-144.subs.proxad.net) () |
| 13:48:49 | → | Guest90 joins (~Guest90@DSL217-132-180-45.bb.netvision.net.il) |
| 13:53:50 | × | TDANG_ quits (~TDANG@cpe-107-15-144-45.nc.res.rr.com) (Ping timeout: 252 seconds) |
| 13:54:04 | → | TDANG_ joins (~TDANG@cpe-107-15-144-45.nc.res.rr.com) |
| 13:57:09 | → | Vajb joins (~Vajb@2001:999:61:625c:bbee:9460:f413:8697) |
| 14:00:29 | × | sneedsfeed quits (~sneedsfee@rrcs-173-95-122-169.midsouth.biz.rr.com) (Ping timeout: 256 seconds) |
| 14:03:16 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c98f:a9cd:e1ea:d69a) |
| 14:07:46 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c98f:a9cd:e1ea:d69a) (Ping timeout: 260 seconds) |
| 14:08:49 | → | fryguybob joins (~fryguybob@cpe-74-67-169-145.rochester.res.rr.com) |
| 14:10:17 | × | Vajb quits (~Vajb@2001:999:61:625c:bbee:9460:f413:8697) (Read error: Connection reset by peer) |
| 14:10:20 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 14:13:50 | × | MQ-17J quits (~MQ-17J@8.6.144.233) (Ping timeout: 260 seconds) |
| 14:14:11 | × | cheater quits (~Username@user/cheater) (Ping timeout: 252 seconds) |
| 14:14:46 | → | cheater joins (~Username@user/cheater) |
| 14:18:20 | → | MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com) |
| 14:19:09 | × | Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt) |
| 14:20:57 | → | Hanicef joins (~gustaf@81-229-9-108-no92.tbcn.telia.com) |
| 14:22:41 | <tomsmeding> | maerwald: parental guidance is recommended when acquiring traits from rms |
| 14:24:12 | <maerwald> | lol |
| 14:28:46 | <[exa]> | but freedom!!!111 |
| 14:31:42 | → | chris joins (~chris@81.96.113.213) |
| 14:31:45 | chris | is now known as Guest6440 |
| 14:39:25 | × | acidjnk_new quits (~acidjnk@p200300d0c703cb723ce418ea93e3eeac.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 14:41:25 | × | kimjetwav quits (~user@2607:fea8:235f:9730:8d3b:ad5a:287:4c82) (Remote host closed the connection) |
| 14:45:01 | <tomsmeding> | [exa]: careful |
| 14:46:18 | [exa] | thinks "hey kids, careful with all that freedom" |
| 14:46:34 | × | Guest6440 quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 14:46:39 | <maerwald> | xD |
| 14:47:05 | maerwald | makes a personal note: refrain from making rms jokes |
| 14:51:25 | → | chris joins (~chris@81.96.113.213) |
| 14:51:29 | chris | is now known as Guest4676 |
| 14:52:48 | → | mikoto-chan joins (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) |
| 14:55:50 | × | Guest4676 quits (~chris@81.96.113.213) (Ping timeout: 260 seconds) |
| 15:00:46 | → | waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) |
| 15:00:58 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 15:00:58 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 15:00:58 | → | wroathe joins (~wroathe@user/wroathe) |
| 15:04:57 | <zzz> | I want the State Monad. what's the import? |
| 15:05:07 | <tomsmeding> | Control.Monad.State.Strict from mtl |
| 15:05:34 | <tomsmeding> | or if you don't care about monad transformer lifting, Control.Monad.Trans.State.Strict from transformers |
| 15:06:18 | <tomsmeding> | zzz: in general, the basic monad transformers are defined in 'transformers', and 'mtl' then defines those MonadState etc classes around that |
| 15:06:19 | <zzz> | thank you |
| 15:13:05 | × | terrorjack quits (~terrorjac@ec2-35-181-134-114.eu-west-3.compute.amazonaws.com) (Quit: The Lounge - https://thelounge.chat) |
| 15:15:00 | → | terrorjack joins (~terrorjac@ec2-35-181-134-114.eu-west-3.compute.amazonaws.com) |
| 15:16:21 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 15:19:29 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c98f:a9cd:e1ea:d69a) |
| 15:22:04 | × | terrorjack quits (~terrorjac@ec2-35-181-134-114.eu-west-3.compute.amazonaws.com) (Quit: The Lounge - https://thelounge.chat) |
| 15:24:38 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 15:25:01 | × | fryguybob quits (~fryguybob@cpe-74-67-169-145.rochester.res.rr.com) (Ping timeout: 252 seconds) |
| 15:25:09 | <zzz> | whoa. i have to relearn State |
| 15:25:39 | <zzz> | i was used to data State s a = State { runState :: s -> (a,s) } |
| 15:25:48 | <zzz> | what happened to that? :( |
| 15:25:50 | <shapr> | what's it doing now? |
| 15:26:34 | <zzz> | • Data constructor not in scope: |
| 15:26:44 | <zzz> | State :: ([Bool] -> (Int, [Bool])) -> State |
| 15:26:51 | <zzz> | • Perhaps you meant one of these: |
| 15:27:00 | <zzz> | ‘StateT’ (imported from Control.Monad.State.St |
| 15:27:02 | <zzz> | ... |
| 15:27:06 | → | boxscape_ joins (~boxscape_@i577BCB22.versanet.de) |
| 15:29:44 | → | hexfive joins (~eric@50.35.83.177) |
| 15:30:00 | × | hexfive quits (~eric@50.35.83.177) (Client Quit) |
| 15:30:23 | <cdsmith> | Last-minute reminder that there's a virtual Haskell CoHack happening in 30 minutes. Info, signups and zoom link at https://www.meetup.com/NY-Haskell/events/280727563/ |
| 15:30:32 | <[exa]> | zzz: use `state` |
| 15:31:12 | × | shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection) |
| 15:31:34 | <zzz> | [exa]: that's it. thanks |
| 15:31:42 | <[exa]> | zzz: using the constructor directly prevents the lower layer to actually have multiple (possibly better) implementations |
| 15:32:04 | <zzz> | ok i see |
| 15:33:01 | <[exa]> | in this case I guess you'd make it with something like `StateT \s -> Identity (a,s)` but well you see :] |
| 15:33:11 | <zzz> | yes |
| 15:33:13 | → | terrorjack joins (~terrorjac@ec2-35-181-134-114.eu-west-3.compute.amazonaws.com) |
| 15:33:20 | <zzz> | i'm not that into transformers |
| 15:33:50 | <[exa]> | it's most useful when you later realize that you actually want full RWST, no need to change code then. :D |
| 15:35:13 | → | shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 15:35:39 | <Cajun> | having recently learned RWST over IO, its very very nice to use. its basically magic (but it isnt!) how it lets you use any of the actions seamlessly |
| 15:35:59 | <zzz> | Read Write State Transformer? |
| 15:36:02 | <[exa]> | yep |
| 15:36:17 | <dsal> | That gets nasty if you need to unlift |
| 15:36:30 | <Cajun> | theres also just RWS but i havent used it |
| 15:36:44 | <Cajun> | seems very useful for a lot of stuff though |
| 15:36:55 | <[exa]> | kinda fun how the RWST IO catches the essence of so many programs |
| 15:37:02 | <Cajun> | dsal: why's that? |
| 15:37:19 | <dsal> | Because you can't generally unliftio state. |
| 15:37:31 | <dsal> | And that's the shape of most of my programs. |
| 15:37:54 | <dsal> | (lots of concurrency and io and stuff) |
| 15:38:29 | <[exa]> | dsal: that's for some stream processing I guess? |
| 15:38:47 | <dsal> | Something like that. |
| 15:39:16 | × | qbt quits (~edun@user/edun) (Quit: Leaving) |
| 15:39:47 | <dsal> | I've got a bit where I did that, but it's because the state portion wouldn't be changed during the part that would need the unlifting |
| 15:40:11 | [exa] | reads the readme |
| 15:40:15 | <[exa]> | o cool |
| 15:40:15 | → | gioyik joins (~gioyik@gateway/tor-sasl/gioyik) |
| 15:40:50 | <dsal> | Putting TVars in the reader env works for my kind of junk. |
| 15:41:47 | × | _ak_ quits (~akspecs@user/akspecs) (Ping timeout: 240 seconds) |
| 15:44:44 | <yin[m]> | can anyone explain to me the comcepts of lifting and unlifting? i keep reading that word and am not sure if it's always in the same context |
| 15:46:07 | → | zmt01 joins (~zmt00@user/zmt00) |
| 15:47:33 | × | fjmorazan quits (~quassel@user/fjmorazan) (Quit: fjmorazan) |
| 15:48:13 | → | _ak_ joins (~akspecs@136-24-181-20.cab.webpass.net) |
| 15:48:13 | × | _ak_ quits (~akspecs@136-24-181-20.cab.webpass.net) (Changing host) |
| 15:48:13 | → | _ak_ joins (~akspecs@user/akspecs) |
| 15:48:43 | × | terrorjack quits (~terrorjac@ec2-35-181-134-114.eu-west-3.compute.amazonaws.com) (Quit: The Lounge - https://thelounge.chat) |
| 15:49:50 | <cdsmith> | yin: There are actually a few different things that are meant by "lift" and "unlift" in Haskell. One is about data types, and the other is about monad transformers. Do you know which you mean? |
| 15:50:09 | ← | korvos parts (uid486420@id-486420.tinside.irccloud.com) () |
| 15:50:31 | → | hnOsmium0001 joins (uid453710@id-453710.hampstead.irccloud.com) |
| 15:50:35 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 15:50:44 | <yin[m]> | no |
| 15:50:51 | <cdsmith> | Oh, the conversation above is about the monad transformer version. |
| 15:50:56 | <[exa]> | yin[m]: lifting = converting an operation that would run somewhere deeper in the transformer stack to an operation that runs conveniently on top of that transformer stack (say you're in StateT IO, you need to lift all IO operations because they don't know how to go through StateT) |
| 15:51:26 | <yin[m]> | i see |
| 15:51:44 | <[exa]> | yin[m]: unlifting = a solution to a very subtle problem described here https://hackage.haskell.org/package/unliftio |
| 15:52:26 | <[exa]> | kinda looks like reverse lifting, you have something that works on a transformer stack that's got IO down below, but you need to squeeze that operation into something that only understands plain IO |
| 15:53:20 | <[exa]> | I might have made oversimplifications but I hope the idea makes sense |
| 15:53:29 | → | TDANG joins (~TDANG@cpe-107-15-144-45.nc.res.rr.com) |
| 15:54:17 | <[exa]> | compare with e.g. 'liftA2' which is almost the same concept (making something work in a "more complicated environment") but outside the transformer context |
| 15:54:31 | <yin[m]> | i think it does. that's a bit too advanced for me yet but i think i get the gist of it |
| 15:54:52 | → | nrl^ joins (~nrl@12.203.127.82) |
| 15:55:32 | <[exa]> | > liftA2 (,) (Just 1) (Just "phoo") -- makes the simple (,) work through Just's |
| 15:55:33 | <cdsmith> | Example of where you need unlifting: I'm running in some monad stack (m IO), and I want to fork a new thread. I want that new thread to run in the same monad transformer stack, so the code to run in that thread has type (m IO) as well. But `forkIO` expects it to have type `IO`. You can do it for *some* monad stacks, but not others |
| 15:55:34 | <lambdabot> | Just (1,"phoo") |
| 15:57:02 | × | TDANG_ quits (~TDANG@cpe-107-15-144-45.nc.res.rr.com) (Ping timeout: 252 seconds) |
| 15:58:06 | <[exa]> | > flip runStateT 3 $ do { x <- get; lift (print x); put (x+1)} |
| 15:58:08 | <lambdabot> | <IO ((),Integer)> |
| 15:59:31 | <[exa]> | yin[m]: there ^ you have a monad that combines state with IO actions, of type `StateT Integer IO`. StateT actions (`get`, `put`) are accessible directly, but you need to lift the `print x` to make it work through StateT |
| 15:59:57 | <[exa]> | (pity lambdabot didn't print much results tho.) |
| 16:00:35 | → | chris joins (~chris@81.96.113.213) |
| 16:00:39 | chris | is now known as Guest1847 |
| 16:02:03 | × | Guest90 quits (~Guest90@DSL217-132-180-45.bb.netvision.net.il) (Quit: Client closed) |
| 16:04:02 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 16:04:16 | × | hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 265 seconds) |
| 16:04:25 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 16:04:29 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 16:05:06 | × | xiongxin quits (~quassel@113.116.34.58) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 16:05:14 | × | Guest1847 quits (~chris@81.96.113.213) (Ping timeout: 265 seconds) |
| 16:05:42 | → | fjmorazan joins (~quassel@user/fjmorazan) |
| 16:08:32 | → | Partmedia joins (~kevinz@172-221-159-029.res.spectrum.com) |
| 16:13:25 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 16:21:23 | × | darxun quits (sid504814@id-504814.tinside.irccloud.com) () |
| 16:22:02 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 16:22:07 | → | hyiltiz joins (~quassel@31.220.5.250) |
| 16:22:59 | <dsal> | [exa]: yahb will |
| 16:23:12 | <dsal> | % flip runStateT 3 $ do { x <- get; lift (print x); put (x+1)} |
| 16:23:12 | <yahb> | dsal: ; <interactive>:88:35: error:; Ambiguous occurrence `lift'; It could refer to; either `Language.Haskell.TH.Syntax.lift', imported from `Language.Haskell.TH.Syntax'; or `Control.Monad.Cont.lift', imported from `Control.Monad.Cont' (and originally defined in `Control.Monad.Trans.Class') |
| 16:23:18 | <dsal> | Except for that. |
| 16:23:38 | <dsal> | % flip runStateT 3 $ do { x <- get; liftIO (print x); put (x+1)} |
| 16:23:38 | <yahb> | dsal: 3; ((),4) |
| 16:29:47 | × | _ak_ quits (~akspecs@user/akspecs) (Ping timeout: 240 seconds) |
| 16:30:02 | → | TDANG_ joins (~TDANG@cpe-107-15-144-45.nc.res.rr.com) |
| 16:30:22 | × | TDANG quits (~TDANG@cpe-107-15-144-45.nc.res.rr.com) (Ping timeout: 265 seconds) |
| 16:30:54 | → | _ak_ joins (~akspecs@136-24-181-20.cab.webpass.net) |
| 16:30:54 | × | _ak_ quits (~akspecs@136-24-181-20.cab.webpass.net) (Changing host) |
| 16:30:54 | → | _ak_ joins (~akspecs@user/akspecs) |
| 16:31:13 | <[exa]> | wow cool, there's even more lifts :] |
| 16:33:45 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 16:37:11 | × | oxide quits (~lambda@user/oxide) (Ping timeout: 252 seconds) |
| 16:39:33 | → | gustik joins (~gustik@2a01:c844:2410:9020:63ab:4bb6:83d2:e11b) |
| 16:41:09 | <dsal> | liftIO is particularly handy because IO is often at the bottom (and can only be at the bottom) and is a quite common need. |
| 16:41:11 | <dsal> | :t liftIO |
| 16:41:12 | <lambdabot> | MonadIO m => IO a -> m a |
| 16:41:56 | → | oxide joins (~lambda@user/oxide) |
| 16:42:43 | → | Vajb joins (~Vajb@2001:999:61:625c:bbee:9460:f413:8697) |
| 16:45:19 | → | chris joins (~chris@81.96.113.213) |
| 16:45:24 | chris | is now known as Guest1795 |
| 16:49:50 | × | Guest1795 quits (~chris@81.96.113.213) (Ping timeout: 252 seconds) |
| 16:50:23 | × | _ak_ quits (~akspecs@user/akspecs) (Ping timeout: 252 seconds) |
| 16:50:34 | × | boxscape_ quits (~boxscape_@i577BCB22.versanet.de) (Remote host closed the connection) |
| 16:50:42 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 16:51:23 | → | ub joins (~Thunderbi@178.115.71.159.wireless.dyn.drei.com) |
| 16:51:39 | → | fryguybob joins (~fryguybob@cpe-74-67-169-145.rochester.res.rr.com) |
| 16:54:07 | × | ubert quits (~Thunderbi@178.165.202.105.wireless.dyn.drei.com) (Ping timeout: 252 seconds) |
| 16:54:07 | ub | is now known as ubert |
| 16:54:22 | × | ubert1 quits (~Thunderbi@178.165.202.105.wireless.dyn.drei.com) (Ping timeout: 260 seconds) |
| 16:58:05 | × | mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Ping timeout: 252 seconds) |
| 17:00:53 | → | _ak_ joins (~akspecs@136-24-181-20.cab.webpass.net) |
| 17:00:53 | × | _ak_ quits (~akspecs@136-24-181-20.cab.webpass.net) (Changing host) |
| 17:00:53 | → | _ak_ joins (~akspecs@user/akspecs) |
| 17:01:19 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 17:01:29 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 17:01:36 | × | gioyik quits (~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds) |
| 17:18:06 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 17:18:07 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 17:18:07 | → | wroathe joins (~wroathe@user/wroathe) |
| 17:23:03 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds) |
| 17:26:26 | × | Hanicef quits (~gustaf@81-229-9-108-no92.tbcn.telia.com) (Quit: leaving) |
| 17:27:07 | → | mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) |
| 17:29:24 | × | MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer) |
| 17:29:37 | → | MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com) |
| 17:31:01 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 17:33:47 | → | gioyik joins (~gioyik@gateway/tor-sasl/gioyik) |
| 17:33:49 | → | boxscape_ joins (~boxscape_@i577BCB22.versanet.de) |
| 17:35:54 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 17:40:36 | × | gioyik quits (~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds) |
| 17:40:52 | × | mikoto-chan quits (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 252 seconds) |
| 17:51:04 | × | boxscape_ quits (~boxscape_@i577BCB22.versanet.de) (Quit: Connection closed) |
| 17:52:12 | → | sneedsfeed joins (~sneedsfee@rrcs-173-95-122-169.midsouth.biz.rr.com) |
| 17:52:33 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 17:53:06 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 17:54:55 | → | Guest80 joins (~Guest80@eth-west-pareq2-46-193-4-100.wb.wifirst.net) |
| 17:54:56 | × | MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer) |
| 17:55:41 | → | MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com) |
| 17:58:02 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 18:02:36 | × | Vajb quits (~Vajb@2001:999:61:625c:bbee:9460:f413:8697) (Read error: Connection reset by peer) |
| 18:02:57 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
| 18:04:19 | × | gustik quits (~gustik@2a01:c844:2410:9020:63ab:4bb6:83d2:e11b) (Quit: Leaving) |
| 18:04:37 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 265 seconds) |
| 18:04:59 | → | Pickchea joins (~private@user/pickchea) |
| 18:06:07 | × | max22- quits (~maxime@2a01cb088335980064e1e8ac26e1f95e.ipv6.abo.wanadoo.fr) (Ping timeout: 240 seconds) |
| 18:11:15 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 18:13:00 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 250 seconds) |
| 18:13:13 | → | zmt00 joins (~zmt00@user/zmt00) |
| 18:15:10 | × | zmt01 quits (~zmt00@user/zmt00) (Ping timeout: 250 seconds) |
| 18:16:07 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 18:16:44 | × | oxide quits (~lambda@user/oxide) (Ping timeout: 252 seconds) |
| 18:18:40 | → | oxide joins (~lambda@user/oxide) |
| 18:18:40 | × | MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer) |
| 18:18:54 | → | MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com) |
| 18:19:29 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 18:23:00 | × | Guest80 quits (~Guest80@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Quit: Client closed) |
| 18:29:28 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 18:30:47 | × | ack_inc quits (~anirudh@122.161.190.207) (Quit: Leaving.) |
| 18:31:13 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 18:32:12 | → | lavaman joins (~lavaman@98.38.249.169) |
| 18:33:48 | ← | Lewky parts (~Lewky@146.70.50.74) (WeeChat 2.8) |
| 18:34:40 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 18:36:20 | → | gioyik joins (~gioyik@gateway/tor-sasl/gioyik) |
| 18:37:03 | → | max22- joins (~maxime@2a01cb0883359800cacb285e285b0a86.ipv6.abo.wanadoo.fr) |
| 18:38:35 | <zzz> | what's this about? https://wiki.haskell.org/Keywords#proc |
| 18:39:00 | <monochrom> | Arrow, as it says and has links to. |
| 18:39:25 | × | cheater quits (~Username@user/cheater) (Ping timeout: 265 seconds) |
| 18:39:29 | → | Null_A joins (~null_a@2601:645:8700:2290:e8cb:df45:c587:6435) |
| 18:39:40 | × | byorgey quits (~byorgey@155.138.238.211) (Quit: leaving) |
| 18:39:44 | → | cheater joins (~Username@user/cheater) |
| 18:39:49 | → | byorgey joins (~byorgey@155.138.238.211) |
| 18:40:10 | <c_wraith> | I have never seen an explanation of why Arrow is worth learning all the special syntax for. So I never have. |
| 18:40:19 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 18:40:41 | × | byorgey quits (~byorgey@155.138.238.211) (Client Quit) |
| 18:40:49 | → | byorgey joins (~byorgey@155.138.238.211) |
| 18:41:01 | <monochrom> | If Applicative did not exist, or Lava still used Haskell, I would be able to refer to those use cases. |
| 18:41:07 | <c_wraith> | I just learned about QualifiedDo and that makes me nervous enough |
| 18:41:42 | × | gioyik quits (~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds) |
| 18:42:50 | <monochrom> | Arrow also had a chance with FRP, IIRC. |
| 18:43:10 | <c_wraith> | didn't it turn out that Applicative worked just as well there, too? |
| 18:43:31 | <monochrom> | I forgot. Wouldn't be surprised. :) |
| 18:44:51 | <sneedsfeed> | whats the best way to handle a situation where I want to add a value to a list if a condition holds but not add anything to the list if it fails? haskell doesn't seem to like this kind of thing because I always need to specify an else and it has to be the right type so it kind of forces me to stick values in the list when I don't want to. |
| 18:45:35 | <awpr> | `if cond then (thing:) else id $ restOfList` |
| 18:45:44 | <c_wraith> | $ doesn't work there |
| 18:45:54 | <awpr> | right, needs parens |
| 18:46:59 | <awpr> | or `(guard cond >> [thing]) ++ restOfList` |
| 18:47:23 | <tomsmeding> | `when cond thing ++ restOfList` |
| 18:47:38 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 18:47:42 | <awpr> | or list comprehension abuse: `[thing | cond] ++ restOfList` |
| 18:47:57 | <sneedsfeed> | my compiler is barking at me "pattern matches non exhaustive" |
| 18:48:06 | <sneedsfeed> | er IDE is barking at me |
| 18:48:11 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 18:48:19 | → | dexmad[m] joins (~dexmadmat@2001:470:69fc:105::e056) |
| 18:48:50 | <monochrom> | What pattern? |
| 18:50:33 | → | kjak joins (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) |
| 18:50:56 | <sneedsfeed> | h/o i'll show you the function i'm trying to make, hopefully it will make enough sense out of context |
| 18:51:42 | → | kayprish joins (~kayprish@46.240.130.158) |
| 18:53:22 | <sneedsfeed> | https://paste.tomsmeding.com/vficPciN |
| 18:54:21 | <sneedsfeed> | it doesnt work obviously. |
| 18:55:22 | <monochrom> | > let n | 5>6 = 1 in n |
| 18:55:23 | <lambdabot> | *Exception: <interactive>:3:5-15: Non-exhaustive patterns in function n |
| 18:55:27 | <monochrom> | Like that? |
| 18:56:57 | → | chris joins (~chris@81.96.113.213) |
| 18:57:01 | chris | is now known as Guest1560 |
| 18:57:14 | <sneedsfeed> | I mean yea. Except its worse because its actually going to evaluate the other way like half the time. |
| 18:57:23 | → | gioyik joins (~gioyik@gateway/tor-sasl/gioyik) |
| 18:57:46 | <monochrom> | So make a decision what should my n be if not(5>6). |
| 18:57:55 | <sneedsfeed> | I'm testing if a given direction is a valid way to move in the maze, if it is I want to add it to a list, if its not I want to ignore it. |
| 18:57:56 | × | brettgilio quits (~brettgili@x-node.gq) (Quit: Leaving...) |
| 18:58:06 | <monochrom> | And write down that decision as code. |
| 18:58:19 | <sneedsfeed> | Sure of course I would use Maybe I assume |
| 18:58:33 | <awpr> | the list you've written unconditionally has four elements, and some of them are just pattern-match failure errors |
| 18:58:34 | <sneedsfeed> | but that seems inefficient compared to just ignoring the case |
| 18:58:41 | <monochrom> | "ignore" ≠ "don't tell the computer what to do" |
| 18:59:17 | <monochrom> | "say nothing" ≠ "tell the computer to do nothing" |
| 18:59:21 | <sneedsfeed> | wait wait I think I know |
| 18:59:27 | → | brettgilio joins (~brettgili@x-node.gq) |
| 18:59:35 | <awpr> | you could build a list of the four candidate directions and get rid of the ones that aren't valid using `filter` |
| 18:59:49 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 19:00:17 | <sneedsfeed> | I can take the list as input, return an amended one if its valid, and just return the original list if its not |
| 19:00:18 | <monochrom> | I would pretty much use the [x1 | cond1] ++ [x2 | cond2] ++ ... idea. |
| 19:00:24 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 19:00:47 | <tomsmeding> | given the form of the conditions, awpr's idea seems nice |
| 19:00:59 | <awpr> | in this case since `cond_i` is of the form `pred x_i`, `filter` is applicable |
| 19:01:07 | × | Guest1560 quits (~chris@81.96.113.213) (Ping timeout: 240 seconds) |
| 19:02:30 | × | gioyik quits (~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds) |
| 19:03:13 | <monochrom> | As for "efficiency" "performance" I only know two meanings. |
| 19:03:38 | <monochrom> | One meaning is the big-O kind, which means this case doesn't matter. |
| 19:03:39 | <sneedsfeed> | https://paste.tomsmeding.com/AGR2dfcx yep that is pretty good |
| 19:04:16 | <monochrom> | The other meaning is real time on real computer, which means if you haven't seen what asm code GHC generates you're talking out of your *ss. |
| 19:04:33 | <tomsmeding> | monochrom: I said "nice", not "fast" ;) |
| 19:04:58 | <monochrom> | Oh, I'm just picking on "seems inefficient". |
| 19:05:32 | <sneedsfeed> | no its a valid point mono, I have no idea what sort of bytecode GHC is really producing for a given input |
| 19:05:55 | <sneedsfeed> | it may look at this filter situation and not actually assign the values to a list then remove them again |
| 19:06:09 | <sneedsfeed> | it may be smart enough to know not to assign them in the first place for all i know |
| 19:07:10 | <tomsmeding> | I suspect that in terms of actual cpu time, you're not going to get anything faster than this filter form, assuming you don't modify testMove |
| 19:07:46 | × | shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 252 seconds) |
| 19:08:59 | <sneedsfeed> | thanks everyone who took a look (y) i'm happy with this filter form |
| 19:11:32 | × | oxide quits (~lambda@user/oxide) (Quit: oxide) |
| 19:16:01 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds) |
| 19:17:47 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 19:19:51 | → | abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) |
| 19:21:31 | × | cheater quits (~Username@user/cheater) (Ping timeout: 252 seconds) |
| 19:23:33 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 19:24:20 | → | yauhsien joins (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) |
| 19:26:15 | × | Null_A quits (~null_a@2601:645:8700:2290:e8cb:df45:c587:6435) (Remote host closed the connection) |
| 19:28:17 | <cdsmith> | Is there a widely known ADT in base with two constructors and at least two fields for one of them? Need it for documentation. |
| 19:28:58 | <maerwald> | that's oddly specific |
| 19:29:01 | <awpr> | `[]` fits that, but it might not be suitable |
| 19:29:12 | × | yauhsien quits (~yauhsien@61-231-35-247.dynamic-ip.hinet.net) (Ping timeout: 265 seconds) |
| 19:29:42 | <awpr> | e.g. since you can't actually define its "nil" constructor in surface Haskell |
| 19:30:12 | → | gioyik joins (~gioyik@gateway/tor-sasl/gioyik) |
| 19:30:59 | <cdsmith> | Oh yeah. It needs to be named. Otherwise, the TH I'm documenting doesn't work, since it needs a Name |
| 19:31:54 | <tomsmeding> | cdsmith: "widely known" is debatable, but I found one: https://hackage.haskell.org/package/base-4.14.0.0/docs/System-Console-GetOpt.html#t:ArgDescr |
| 19:32:42 | <cdsmith> | Oh, yeah, that's an interesting one. I like the functions, too. Chances to show off some higher order combinators |
| 19:35:36 | → | acidjnk_new joins (~acidjnk@p200300d0c703cb723ce418ea93e3eeac.dip0.t-ipconnect.de) |
| 19:36:07 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 19:40:58 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 19:41:32 | → | chris joins (~chris@81.96.113.213) |
| 19:41:36 | chris | is now known as Guest6828 |
| 19:44:54 | → | zer0bitz joins (~zer0bitz@dsl-hkibng31-54fafc-123.dhcp.inet.fi) |
| 19:46:16 | × | Guest6828 quits (~chris@81.96.113.213) (Ping timeout: 252 seconds) |
| 19:47:58 | → | kenran joins (~kenran@200116b82bce9700bd53594d48cebdcd.dip.versatel-1u1.de) |
| 19:48:12 | → | theproffesor joins (~theproffe@2601:282:847f:8010::7704) |
| 19:48:12 | × | theproffesor quits (~theproffe@2601:282:847f:8010::7704) (Changing host) |
| 19:48:12 | → | theproffesor joins (~theproffe@user/theproffesor) |
| 19:48:47 | × | ubert quits (~Thunderbi@178.115.71.159.wireless.dyn.drei.com) (Ping timeout: 240 seconds) |
| 19:50:28 | × | nfd quits (~nfd@user/nfd) (Ping timeout: 265 seconds) |
| 19:51:36 | → | ubert joins (~Thunderbi@178.115.71.159.wireless.dyn.drei.com) |
| 19:56:52 | ← | theproffesor parts (~theproffe@user/theproffesor) (Leaving) |
| 19:57:09 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 19:59:45 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 19:59:53 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 20:00:03 | × | nrl^ quits (~nrl@12.203.127.82) (Remote host closed the connection) |
| 20:01:07 | → | Mateusz joins (~Mateusz@77-254-3-194.adsl.inetia.pl) |
| 20:01:09 | → | Sgeo_ joins (~Sgeo@user/sgeo) |
| 20:03:39 | <Mateusz> | Hi All! I'm having hard time understanding why I can't write this `foldl` with printf: https://paste.tomsmeding.com/p17krk9e |
| 20:03:59 | × | Sgeo quits (~Sgeo@user/sgeo) (Ping timeout: 252 seconds) |
| 20:05:12 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 20:05:58 | → | cheater joins (~Username@user/cheater) |
| 20:07:29 | <zzz> | Mateusz: what do you intend with it? |
| 20:08:17 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 20:08:21 | × | Sgeo_ quits (~Sgeo@user/sgeo) (Ping timeout: 265 seconds) |
| 20:08:32 | <Mateusz> | I want to pass variable number of args to printf so I cant know in advance how many I pass |
| 20:11:46 | × | _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
| 20:12:16 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 20:13:12 | → | yauhsien joins (~yauhsien@118-167-47-211.dynamic-ip.hinet.net) |
| 20:13:13 | × | MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds) |
| 20:13:31 | → | MQ-17J joins (~MQ-17J@8.6.144.233) |
| 20:16:30 | <[exa]> | Mateusz: you would need a printf with different static type for each different incoming list, which is a bit problematic |
| 20:17:44 | × | yauhsien quits (~yauhsien@118-167-47-211.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 20:20:12 | → | lavaman joins (~lavaman@98.38.249.169) |
| 20:21:06 | <Cajun> | is there any way to set default cabal build options in the .cabal or by individual .hs files? i want to put `--allow-newer` in a local library and a local executable, but i cant figure out how to in the .cabal file |
| 20:21:50 | <[exa]> | in particular, `printf "someformat"` returns `PrintfType r -> r` which is a polymorphic value that is able to match the argument list (a bit), OTOH `foldl` allows only a single type in there |
| 20:22:42 | → | boxscape_ joins (~boxscape_@i577BCB22.versanet.de) |
| 20:24:02 | <awpr> | might be able to do something with `newtype AnyPrintf = AnyPrintf (forall r. PrintfType r => r)`, instantiating it with `->` at each step and then unwrapping it to a `String` at the end |
| 20:24:51 | <[exa]> | Cajun: https://github.com/haskell/cabal/issues/2756 might be related? |
| 20:24:53 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds) |
| 20:25:14 | <monochrom> | No, you have a million statically different printfs and you are saying you are choosing one based on only-dynamically-known list length. |
| 20:26:45 | <monochrom> | Not to mention that foldl is the wrong thing if you plan to "tell it I have hit the end". |
| 20:26:50 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2) |
| 20:27:06 | <awpr> | hm, the implementation of `PrintfType` isn't exported |
| 20:27:23 | <[exa]> | Mateusz: perhaps just go with `intercalate` or something :] |
| 20:28:46 | <Cajun> | [exa]: not really, no. that seems to be talking about nix and using the command on the commandline, neither of which i want to use. i see there is this thing called `cabal.project.local` but when i put `allow-newer: True` in there it didnt set it as a flag when using `cabal build` |
| 20:29:45 | <[exa]> | ah so |
| 20:33:41 | <Cajun> | i think i got it but an explanation of how to even use project files would be nice. i did the following: `packages: [cabal file]` then `allow-newer: all` on the next line |
| 20:35:35 | <awpr> | so, disclaimer needed that this is not something one _should_ do, but it is possible: https://paste.tomsmeding.com/Tb7ASd6i |
| 20:37:11 | <[exa]> | awpr: I still vote for intercalate. :D |
| 20:37:15 | <[exa]> | or concat |
| 20:37:43 | <awpr> | yeah, I just wanted to play with types :) |
| 20:39:36 | <[exa]> | would even make sense to zip it with format strings etc |
| 20:40:04 | <[exa]> | for greater good |
| 20:40:06 | → | terrorjack joins (~terrorjac@ec2-13-37-149-154.eu-west-3.compute.amazonaws.com) |
| 20:40:14 | <[exa]> | polymorphic lists go |
| 20:45:40 | <Mateusz> | exa awpr thanks for help I will go with something simpler then |
| 20:46:20 | × | jumper149 quits (~jumper149@80.240.31.34) (Ping timeout: 252 seconds) |
| 20:46:21 | <Mateusz> | solution with RankNTypes looks interesting as mental exercise |
| 20:46:49 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 20:48:31 | → | wroathe joins (~wroathe@user/wroathe) |
| 20:52:19 | × | MQ-17J quits (~MQ-17J@8.6.144.233) (Ping timeout: 252 seconds) |
| 20:52:21 | → | econo joins (uid147250@user/econo) |
| 20:53:25 | → | MQ-17J joins (~MQ-17J@8.6.144.233) |
| 20:56:38 | <[exa]> | Mateusz: technically the haskell `printf` implementation might have been a mental exercise :D |
| 20:56:56 | <[exa]> | I'm kinda avoiding it |
| 20:57:46 | × | MQ-17J quits (~MQ-17J@8.6.144.233) (Ping timeout: 252 seconds) |
| 20:59:15 | → | MQ-17J joins (~MQ-17J@8.6.144.233) |
| 21:02:08 | <Mateusz> | yea it seems like its there but not so popular. I'm learning haskell right now so thought it might be best to stick to base because default libraries tend to be decent solution for newcomers. Problem with concat/intercalate is that I was looking for declarative string formatting so its convenient to put formats inside template, then just render |
| 21:04:20 | <[exa]> | yeah I have to say that the absence of "nice standard printing" kindof hurts |
| 21:05:55 | <[exa]> | I was recommending stuff like `putStrLn $ concat ["string", show a, show 123, "end"]`, possible with `intercalate` there, but it looks crude right. :D |
| 21:06:37 | <awpr> | easy fix, just need a type-level parser combinator library |
| 21:08:51 | [exa] | starts typing the extension pragma list |
| 21:09:19 | × | MQ-17J quits (~MQ-17J@8.6.144.233) (Ping timeout: 252 seconds) |
| 21:09:22 | <awpr> | disregard the fact that Symbol doesn't give you a way to uncons or split the string AFAIK |
| 21:09:33 | <Mateusz> | so compare to format `"string {a} {num} end"` from the template is clear what it does and what goes where. Thanks awpr seems like finally got motivation to dive into type-level parser combinators :D |
| 21:10:00 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 21:10:02 | → | MQ-17J joins (~MQ-17J@8.6.144.233) |
| 21:10:16 | <awpr> | I don't think it's actually possible to get good results with current Haskell sadly |
| 21:10:28 | × | TDANG_ quits (~TDANG@cpe-107-15-144-45.nc.res.rr.com) (Ping timeout: 252 seconds) |
| 21:10:31 | <[exa]> | there's some template haskell stuff |
| 21:11:00 | → | jumper149 joins (~jumper149@80.240.31.34) |
| 21:11:02 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds) |
| 21:11:17 | Lord_of_Life_ | is now known as Lord_of_Life |
| 21:11:21 | <[exa]> | ha, check out Data.String.Interpolate (pkg `interpolate`) |
| 21:11:59 | <awpr> | huh, that looks pretty nice |
| 21:12:24 | <c_wraith> | awpr: https://hackage.haskell.org/package/typelits-printf-0.2.0.0/docs/GHC-TypeLits-Printf.html |
| 21:12:43 | <c_wraith> | awpr: it turns out that while you can't uncons a Symbol, you can use horrible hacks involving < |
| 21:13:03 | × | fendor_ quits (~fendor@178.115.43.157.wireless.dyn.drei.com) (Remote host closed the connection) |
| 21:14:40 | <awpr> | lmao I saw the compare function and had a vague notion it could be abused to inspect the string, but I'm astonished someone actually went and did it |
| 21:17:20 | × | kayprish quits (~kayprish@46.240.130.158) (Remote host closed the connection) |
| 21:17:32 | → | lavaman joins (~lavaman@98.38.249.169) |
| 21:18:13 | × | kenran quits (~kenran@200116b82bce9700bd53594d48cebdcd.dip.versatel-1u1.de) (Quit: WeeChat info:version) |
| 21:31:55 | × | MQ-17J quits (~MQ-17J@8.6.144.233) (Ping timeout: 252 seconds) |
| 21:32:06 | × | Mateusz quits (~Mateusz@77-254-3-194.adsl.inetia.pl) (Quit: Client closed) |
| 21:35:18 | × | ubert quits (~Thunderbi@178.115.71.159.wireless.dyn.drei.com) (Ping timeout: 260 seconds) |
| 21:36:48 | × | jumper149 quits (~jumper149@80.240.31.34) (Quit: WeeChat 3.2.1) |
| 21:39:24 | → | rtjure joins (~rtjure@bras-79-132-17-74.comnet.bg) |
| 21:46:02 | × | chomwitt quits (~chomwitt@2a02:587:dc0a:5800:12c3:7bff:fe6d:d374) (Ping timeout: 260 seconds) |
| 21:46:44 | → | Null_A joins (~null_a@2601:645:8700:2290:91f2:4a69:be9c:a77e) |
| 21:47:14 | × | gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 21:53:38 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 21:55:22 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.2.1) |
| 21:56:21 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 21:57:36 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 21:58:12 | → | zebrag joins (~chris@user/zebrag) |
| 21:58:18 | → | madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net) |
| 22:01:37 | × | xff0x quits (~xff0x@2001:1a81:52a2:cc00:e316:3cc6:4da2:e9d8) (Ping timeout: 252 seconds) |
| 22:02:33 | → | xff0x joins (~xff0x@2001:1a81:52a2:cc00:a2d5:fa6a:c964:7cba) |
| 22:07:04 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 22:13:13 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 22:14:46 | → | yauhsien joins (~yauhsien@118-167-47-211.dynamic-ip.hinet.net) |
| 22:15:13 | → | ph88 joins (~ph88@2a02:8109:9e00:7e5c:7cb7:e630:89c:9583) |
| 22:17:06 | × | Null_A quits (~null_a@2601:645:8700:2290:91f2:4a69:be9c:a77e) (Remote host closed the connection) |
| 22:19:20 | × | yauhsien quits (~yauhsien@118-167-47-211.dynamic-ip.hinet.net) (Ping timeout: 265 seconds) |
| 22:21:09 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 22:23:32 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 22:23:32 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 22:23:32 | → | wroathe joins (~wroathe@user/wroathe) |
| 22:25:40 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.3) |
| 22:28:05 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 22:42:46 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 22:46:48 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 22:47:23 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
| 22:48:26 | × | madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 22:53:45 | → | MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com) |
| 22:55:49 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 22:56:23 | → | lavaman joins (~lavaman@98.38.249.169) |
| 22:57:05 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.2) |
| 23:00:58 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds) |
| 23:02:19 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 23:05:19 | → | madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net) |
| 23:05:22 | × | hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 252 seconds) |
| 23:08:53 | → | hyiltiz joins (~quassel@31.220.5.250) |
| 23:09:01 | → | CiaoSen joins (~Jura@p2e5c6ba6.dip0.t-ipconnect.de) |
| 23:09:41 | × | CiaoSen quits (~Jura@p2e5c6ba6.dip0.t-ipconnect.de) (Quit: #haskell-de) |
| 23:10:00 | → | CiaoSen joins (~Jura@p2e5c6ba6.dip0.t-ipconnect.de) |
| 23:10:45 | <sm> | how do you disable `--` being converted to em's when converting from org with pandoc ? |
| 23:12:59 | → | nrl^ joins (~nrl@68.101.50.106) |
| 23:13:50 | × | max22- quits (~maxime@2a01cb0883359800cacb285e285b0a86.ipv6.abo.wanadoo.fr) (Remote host closed the connection) |
| 23:16:58 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 23:22:39 | × | rtjure quits (~rtjure@bras-79-132-17-74.comnet.bg) (Ping timeout: 265 seconds) |
| 23:33:22 | × | CiaoSen quits (~Jura@p2e5c6ba6.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 23:40:07 | → | acidjnk_new3 joins (~acidjnk@p200300d0c703cb4660ece33f9b2036c6.dip0.t-ipconnect.de) |
| 23:42:30 | → | pavonia joins (~user@user/siracusa) |
| 23:42:53 | × | acidjnk_new quits (~acidjnk@p200300d0c703cb723ce418ea93e3eeac.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 23:46:44 | → | shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 23:47:17 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 252 seconds) |
| 23:50:34 | → | spruit11 joins (~quassel@2a02:a467:ccd6:1:1537:591d:7e85:d718) |
| 23:52:33 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 23:52:33 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 23:52:33 | → | wroathe joins (~wroathe@user/wroathe) |
| 23:53:07 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 23:53:16 | × | ph88 quits (~ph88@2a02:8109:9e00:7e5c:7cb7:e630:89c:9583) (Ping timeout: 252 seconds) |
| 23:54:13 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 23:56:37 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 23:58:43 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 252 seconds) |
All times are in UTC on 2021-09-25.