Logs: liberachat/#haskell
| 2021-06-13 07:21:56 | <maerwald> | is there a function to get a temporary filename (without creating it)? |
| 2021-06-13 07:22:11 | → | wonko joins (~wjc@62.115.229.50) |
| 2021-06-13 07:27:11 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-06-13 07:30:43 | × | xff0x quits (~xff0x@2001:1a81:53da:f000:a10f:4223:ab2e:3175) (Ping timeout: 272 seconds) |
| 2021-06-13 07:32:01 | → | xff0x joins (~xff0x@2001:1a81:53db:5a00:806f:9a3:56a7:aca6) |
| 2021-06-13 07:35:50 | × | beka quits (~beka@104-244-27-23.static.monkeybrains.net) (Remote host closed the connection) |
| 2021-06-13 07:36:19 | → | beka joins (~beka@104-244-27-23.static.monkeybrains.net) |
| 2021-06-13 07:41:45 | × | beka quits (~beka@104-244-27-23.static.monkeybrains.net) (Remote host closed the connection) |
| 2021-06-13 07:42:39 | → | beka joins (~beka@104-244-27-23.static.monkeybrains.net) |
| 2021-06-13 07:42:42 | × | amahl quits (~amahl@dxv5skyhc49fswhfjlcpy-3.rev.dnainternet.fi) (Remote host closed the connection) |
| 2021-06-13 07:44:25 | × | xff0x quits (~xff0x@2001:1a81:53db:5a00:806f:9a3:56a7:aca6) (Ping timeout: 244 seconds) |
| 2021-06-13 07:45:12 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-06-13 07:45:37 | × | zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving) |
| 2021-06-13 07:46:13 | → | xff0x joins (~xff0x@2001:1a81:53db:9400:2ec8:4cb:1537:c74) |
| 2021-06-13 07:46:53 | → | Peng7 joins (~Peng@188.233.111.108) |
| 2021-06-13 07:46:53 | <Peng7> | /!\ THΙЅ СΗANΝEⅬ ᎻAS МⲞVΕⅮ ТO IRϹ.LIBEᎡА.CዘAᎢ #HᎪΜᖇΑᎠIⲞ ⁄!\ |
| 2021-06-13 07:46:53 | × | Peng7 quits (~Peng@188.233.111.108) (K-Lined) |
| 2021-06-13 07:48:04 | <Rembane_> | maerwald: Do you want the name but not the file? |
| 2021-06-13 07:48:36 | <maerwald> | Rembane_: yeah |
| 2021-06-13 07:48:58 | <maerwald> | I want the juice, not the fruit |
| 2021-06-13 07:49:06 | <Rembane_> | maerwald: Do you care at all about the shape of the name? Can it be ugly? |
| 2021-06-13 07:49:21 | <maerwald> | it has to be *valid* |
| 2021-06-13 07:49:28 | <maerwald> | which isn't that easy on windows |
| 2021-06-13 07:49:41 | <maerwald> | otherwise you run it through `makeValid` |
| 2021-06-13 07:50:03 | <Rembane_> | Are dashes valid in file names on Windows? Because if they are, you could generate an UUID that's a function of time. |
| 2021-06-13 07:50:18 | <Rembane_> | And if they aren't, you could still use an UUID but remove the dashes. |
| 2021-06-13 07:50:58 | → | poljar1 joins (~poljar@93-139-36-109.adsl.net.t-com.hr) |
| 2021-06-13 07:51:01 | <Vq> | Is going beyond 8+3 filenames still an extension? Could be tricky with so short filenames. |
| 2021-06-13 07:52:22 | × | poljar quits (~poljar@93-139-68-198.adsl.net.t-com.hr) (Ping timeout: 265 seconds) |
| 2021-06-13 07:56:50 | <maerwald> | filename length is a problem on windows |
| 2021-06-13 07:57:36 | <Rembane_> | Is 8+3 still the max length? |
| 2021-06-13 07:57:54 | <maerwald> | that depends on the path length of the temporary system directory |
| 2021-06-13 07:59:32 | <Rembane_> | That's way too exciting. |
| 2021-06-13 08:02:02 | <xsperry> | Rembane_, 260 should be safe (IIRC there's a way to go beyond that, but it requires registry tweaks). https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-vds/9d39e835-514b-4308-a3f9-d4a6cbe5691b |
| 2021-06-13 08:02:19 | → | fizbin joins (~fizbin@2601:8a:4080:1280:d58e:2782:3061:3fa3) |
| 2021-06-13 08:04:39 | <xsperry> | of course that's the whole path, there's no specific length limit for filename alone AFAIK |
| 2021-06-13 08:05:04 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 2021-06-13 08:06:16 | → | jasonm joins (~bc817c21@217.29.117.252) |
| 2021-06-13 08:06:38 | × | fizbin quits (~fizbin@2601:8a:4080:1280:d58e:2782:3061:3fa3) (Ping timeout: 244 seconds) |
| 2021-06-13 08:07:03 | fendor_ | is now known as fendor |
| 2021-06-13 08:07:39 | → | hendursa1 joins (~weechat@user/hendursaga) |
| 2021-06-13 08:07:40 | → | BosonCollider joins (~olofs@90-227-86-119-no542.tbcn.telia.com) |
| 2021-06-13 08:08:00 | <jasonm> | hi. is there a scanf equivalent for haskell? that takes an actual string. there's scanf, but it works with template haskell |
| 2021-06-13 08:08:27 | <jasonm> | (I'm working with config files that, among other things, includes user supplied scanf string) |
| 2021-06-13 08:08:30 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-06-13 08:08:54 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-06-13 08:08:55 | <Rembane_> | jasonm: There's a bad one because you throw all type safety out of the window. |
| 2021-06-13 08:08:55 | → | mikoto-c1 joins (~mikoto-ch@ip-213-49-189-31.dsl.scarlet.be) |
| 2021-06-13 08:09:28 | <Rembane_> | jasonm: Nevermind, I mixed it up with printf. |
| 2021-06-13 08:09:40 | <[exa]> | jasonm: using attoparsec is usually faster and much more convenient |
| 2021-06-13 08:10:04 | <jasonm> | [exa], but I'd have to rewrite scanf basically |
| 2021-06-13 08:10:23 | <[exa]> | do you have user-specified format strings or something? |
| 2021-06-13 08:10:33 | <jasonm> | yes, I actually said that above :) |
| 2021-06-13 08:10:34 | × | hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 252 seconds) |
| 2021-06-13 08:10:41 | <[exa]> | ah sorry I just kinda arrived :D |
| 2021-06-13 08:11:38 | <[exa]> | hm, like, okay, that's hard |
| 2021-06-13 08:12:18 | <[exa]> | what would be the higher purpose? |
| 2021-06-13 08:12:21 | <jasonm> | np. can scanf package work with strings? this is an example from their page: scanf [fmt|Hello %s|] "Hello world!" :: Maybe (String :+ ()) |
| 2021-06-13 08:12:40 | <nshepperd> | you might need to write your own scanf |
| 2021-06-13 08:12:42 | <jasonm> | I am working with a config file that, among other things, includes scanf string |
| 2021-06-13 08:12:43 | <Rembane_> | How much work is it to map the scanf "commands" to some series of attoparsec combinators? |
| 2021-06-13 08:12:55 | <nshepperd> | either that or call out to C. if you need compatibility |
| 2021-06-13 08:14:12 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 2021-06-13 08:15:01 | <[exa]> | jasonm: what would happen if the user attempts buffer overflow by specifying "%d%d%d%d%d%d.........." ? |
| 2021-06-13 08:16:47 | <jasonm> | bad things.. they assume cooperation of the user. that's why it be better if there was a pure haskell version, i'd get a nice error instead of memory corruption or segfault |
| 2021-06-13 08:18:43 | <aerkenemesis> | jasonm I would use FFI for that |
| 2021-06-13 08:19:07 | <maerwald> | Can you tell stack to use a different msys2? |
| 2021-06-13 08:19:17 | → | tomsmeding joins (~tomsmedin@tomsmeding.com) |
| 2021-06-13 08:21:08 | <siers> | how do people usually represent that only As are present in a list if you have data D = A | B? |
| 2021-06-13 08:22:03 | <siers> | ah, there's even no A type like in scala, so you can't use that for a phantom type. so perhaps this is not a good question then |
| 2021-06-13 08:22:04 | → | zaquest joins (~notzaques@5.128.210.178) |
| 2021-06-13 08:22:23 | <Rembane_> | siers: What's the problem you really are trying to solve? |
| 2021-06-13 08:22:47 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 2021-06-13 08:23:08 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 2021-06-13 08:23:16 | <jasonm> | D is a type, A is one of two possible values of D |
| 2021-06-13 08:23:17 | <siers> | Rembane_, I have history with two entries and I want to filter and store only "A"s. If I use the D type, I will later have to make a function that handles the two cases though I care only about one. |
| 2021-06-13 08:23:45 | <siers> | I guess I can move all of A's data into its own data and then D will only represent the discrimination |
| 2021-06-13 08:24:02 | <jasonm> | your type is equivalent to data Bool = True | False |
| 2021-06-13 08:24:12 | <Rembane_> | siers: Something like: filter (\case; A -> True; _ -> False) [{- list of As and Bs -}] |
| 2021-06-13 08:24:55 | <siers> | I'd never seen an inline case, cool |
| 2021-06-13 08:25:18 | <tomsmeding> | if you want type-level evidence of having only A's in a list, you need to reflect the information of "being A" on the type level |
| 2021-06-13 08:25:21 | <Rembane_> | You need to activate LambdaCase, but it's worth it imo |
| 2021-06-13 08:25:40 | TheRAt | is now known as TheRAt_AWAY |
| 2021-06-13 08:25:42 | TheRAt_AWAY | is now known as TheRAt |
| 2021-06-13 08:25:57 | <tomsmeding> | e.g. data D a where A :: D 'True ; B :: D 'False -- where I'm using DataKinds so that 'a' has kind Bool |
| 2021-06-13 08:26:29 | <tomsmeding> | then a list of D 'True can contain only As, but you can't have a list of whatevers anymore |
| 2021-06-13 08:26:35 | → | fizbin joins (~fizbin@2601:8a:4080:1280:d58e:2782:3061:3fa3) |
| 2021-06-13 08:26:37 | <maerwald> | tomsmeding: yes... and in the end you'll still write your own filter function that just happens to then manipulate the types, which is one of those instances where I find type level programming pointless |
| 2021-06-13 08:26:42 | <maerwald> | because you can still mess up |
| 2021-06-13 08:26:52 | <tomsmeding> | but you can't mess up here? |
| 2021-06-13 08:26:58 | <tomsmeding> | you can't stuff a B in a list of D 'True |
| 2021-06-13 08:27:51 | <siers> | maerwald, and also you won't have to handle the cases when consuming |
| 2021-06-13 08:28:08 | <tomsmeding> | you do still have to write your own filter function, but aside from skipping items / putting them in the wrong order (which the types do not prohibit), you can't put items in the wrong list |
| 2021-06-13 08:28:18 | <maerwald> | siers: you convert to a different type then |
| 2021-06-13 08:28:44 | <siers> | tomsmeding, pretty cool, that was kind of what I was looking for |
| 2021-06-13 08:28:49 | <tomsmeding> | which is equivalent, I guess? having my GADT or instead two data types is kind of the same thing with different syntax |
| 2021-06-13 08:29:19 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 2021-06-13 08:29:26 | <siers> | maerwald, I was thinking that is the saner of options |
| 2021-06-13 08:29:30 | <tomsmeding> | siers: if you want a list of "either A or B", with my GADT you now have to do wrap them though |
| 2021-06-13 08:29:55 | <siers> | maerwald, I still want to know what's the alternative, crazier solution :) |
All times are in UTC.