Logs: freenode/#haskell
| 2021-05-18 14:01:30 | × | emergence quits (~emergence@vm0.max-p.me) (Read error: Connection reset by peer) |
| 2021-05-18 14:01:30 | × | Jesin quits (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) (Ping timeout: 240 seconds) |
| 2021-05-18 14:01:30 | × | quinn quits (~quinn@c-73-223-224-163.hsd1.ca.comcast.net) (Quit: ZNC 1.8.1 - https://znc.in) |
| 2021-05-18 14:01:30 | × | vent quits (~vent@185.62.190.213) (Quit: ZNC - http://znc.in) |
| 2021-05-18 14:01:30 | × | jrm quits (~jrm@freebsd/developer/jrm) (Quit: ciao) |
| 2021-05-18 14:01:30 | × | Inoperable quits (~PLAYER_1@fancydata.science) (Quit: All your buffer are belong to us!) |
| 2021-05-18 14:01:30 | × | atk quits (~Arch-TK@ircpuzzles/staff/Arch-TK) (Remote host closed the connection) |
| 2021-05-18 14:01:30 | × | Anthaas quits (~Anthaas@unaffiliated/anthaas) (Quit: ZNC 1.7.1 - https://znc.in) |
| 2021-05-18 14:01:30 | × | remedan quits (~remedan@balak.me) (Quit: Bye!) |
| 2021-05-18 14:01:30 | × | ekleog quits (~ii@prologin/ekleog) (Remote host closed the connection) |
| 2021-05-18 14:01:31 | ddella___ | is now known as 895AAIPMI |
| 2021-05-18 14:01:31 | → | vent joins (~vent@185.62.190.213) |
| 2021-05-18 14:01:31 | → | ddella___ joins (~ddellacos@ool-44c73afa.dyn.optonline.net) |
| 2021-05-18 14:01:31 | → | quinn joins (~quinn@c-73-223-224-163.hsd1.ca.comcast.net) |
| 2021-05-18 14:01:31 | haya5 | is now known as haya |
| 2021-05-18 14:01:33 | → | jrm2 joins (~jrm@freebsd/developer/jrm) |
| 2021-05-18 14:01:37 | → | ekleog_ joins (~ii@prologin/ekleog) |
| 2021-05-18 14:01:37 | Katarushisu1 | is now known as Katarushisu |
| 2021-05-18 14:01:41 | × | Vq quits (~vq@90-227-195-41-no77.tbcn.telia.com) (Ping timeout: 240 seconds) |
| 2021-05-18 14:01:43 | × | Alleria__ quits (~textual@mskresolve-a.mskcc.org) (Ping timeout: 252 seconds) |
| 2021-05-18 14:01:44 | → | dan64 joins (~dan64@107.170.238.198) |
| 2021-05-18 14:02:00 | <boxscape> | not bad :) |
| 2021-05-18 14:02:04 | jrm2 | is now known as jrm |
| 2021-05-18 14:02:04 | → | Vq joins (~vq@90.227.195.41) |
| 2021-05-18 14:02:08 | → | hyiltiz joins (~quassel@31.220.5.250) |
| 2021-05-18 14:02:09 | × | hyiltiz quits (~quassel@31.220.5.250) (Changing host) |
| 2021-05-18 14:02:09 | → | hyiltiz joins (~quassel@unaffiliated/hyiltiz) |
| 2021-05-18 14:02:11 | × | obiiwahn quits (~obiwahn@pdpc/supporter/student/obiwahn) (Ping timeout: 240 seconds) |
| 2021-05-18 14:02:14 | → | nek0 joins (~nek0@mail.nek0.eu) |
| 2021-05-18 14:02:27 | → | seliopou joins (seliopou@entropy.tmok.com) |
| 2021-05-18 14:02:51 | → | Anthaas joins (~Anthaas@unaffiliated/anthaas) |
| 2021-05-18 14:02:52 | × | frozenErebus quits (~frozenEre@94.129.65.28) (Ping timeout: 268 seconds) |
| 2021-05-18 14:03:02 | × | 895AAIPMI quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 246 seconds) |
| 2021-05-18 14:03:16 | <mniip> | why fix something that works |
| 2021-05-18 14:03:19 | × | aVikingTrex quits (~aVikingTr@2001:8003:340d:d00:b2de:b98:7a93:b0ea) (Ping timeout: 245 seconds) |
| 2021-05-18 14:03:42 | → | Alleria joins (~textual@zrcout.mskcc.org) |
| 2021-05-18 14:04:03 | → | bob_twinkles joins (~quassel@ec2-52-37-66-13.us-west-2.compute.amazonaws.com) |
| 2021-05-18 14:04:05 | Alleria | is now known as Guest69204 |
| 2021-05-18 14:04:11 | → | In0perable joins (~PLAYER_1@fancydata.science) |
| 2021-05-18 14:04:12 | × | APic quits (apic@apic.name) (Ping timeout: 240 seconds) |
| 2021-05-18 14:04:12 | <dminuoso> | [Russian accent]: Sometimes you have to fix error |
| 2021-05-18 14:04:31 | → | cdsmith joins (~cdsmithus@c-73-184-127-183.hsd1.ga.comcast.net) |
| 2021-05-18 14:04:41 | <merijn> | > fix error |
| 2021-05-18 14:04:43 | <lambdabot> | "*Exception: *Exception: *Exception: *Exception: *Exception: *Exception: *Ex... |
| 2021-05-18 14:05:02 | Arch-TK | is now known as atk |
| 2021-05-18 14:06:24 | → | rix_ joins (~rix@117.222.67.232) |
| 2021-05-18 14:06:34 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 268 seconds) |
| 2021-05-18 14:06:40 | × | sm2n quits (~sm2n@74.12.28.63) (Ping timeout: 252 seconds) |
| 2021-05-18 14:07:15 | × | ericsagn1 quits (~ericsagne@2405:6580:0:5100:a66b:b5fe:8945:845c) (Ping timeout: 260 seconds) |
| 2021-05-18 14:08:13 | × | nut quits (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds) |
| 2021-05-18 14:08:22 | → | mastarija__ joins (~mastarija@78-3-221-47.adsl.net.t-com.hr) |
| 2021-05-18 14:08:29 | → | alx741 joins (~alx741@186.178.108.105) |
| 2021-05-18 14:09:51 | × | kristijonas_ quits (~kristijon@78-56-32-39.static.zebra.lt) (Remote host closed the connection) |
| 2021-05-18 14:10:07 | × | geekosaur quits (45870322@069-135-003-034.biz.spectrum.com) (Quit: Connection closed) |
| 2021-05-18 14:10:17 | → | kristijonas_ joins (~kristijon@78-56-32-39.static.zebra.lt) |
| 2021-05-18 14:10:26 | → | geekosaur joins (45870322@069-135-003-034.biz.spectrum.com) |
| 2021-05-18 14:12:21 | → | sm2n joins (~sm2n@bras-base-hmtnon143hw-grc-16-74-12-28-150.dsl.bell.ca) |
| 2021-05-18 14:12:45 | → | Sgeo joins (~Sgeo@ool-18b9875e.dyn.optonline.net) |
| 2021-05-18 14:13:47 | × | Qwerky quits (~qwerky@178.197.228.14) (Remote host closed the connection) |
| 2021-05-18 14:14:25 | → | NieDzejkob joins (~quassel@195.149.98.3) |
| 2021-05-18 14:16:39 | → | safinaskar joins (~user@109.252.90.136) |
| 2021-05-18 14:17:30 | <safinaskar> | how to check that given list doesn't contain duplicates? i can think of this: (all (\x -> length x == 1) $ group $ sort a). is there some more ideomatic way? |
| 2021-05-18 14:18:25 | <merijn> | :t all (==1) . M.fromListWith (+) . map (,1) |
| 2021-05-18 14:18:25 | <dminuoso> | Yes |
| 2021-05-18 14:18:26 | <lambdabot> | Ord k => [k] -> Bool |
| 2021-05-18 14:18:40 | <mniip> | isJust . foldr (liftA2 (.) (fmap . S.insert) (mfilter . S.notMember)) (Just S.empty) |
| 2021-05-18 14:18:46 | → | berberman_ joins (~berberman@unaffiliated/berberman) |
| 2021-05-18 14:18:57 | <mniip> | (sorry I just had that lying around) |
| 2021-05-18 14:19:00 | <dminuoso> | % isUnique [] = True; isUnique (x:xs) = x `notElem` xs && isUnique xs |
| 2021-05-18 14:19:00 | <merijn> | mniip: That's mine, but worse :p |
| 2021-05-18 14:19:02 | <yahb> | dminuoso: |
| 2021-05-18 14:19:07 | <dminuoso> | ^- this is probably the idiomatic way. |
| 2021-05-18 14:19:08 | <mniip> | it's better actually |
| 2021-05-18 14:19:09 | <merijn> | Although I guess it short circuits |
| 2021-05-18 14:19:12 | <mniip> | exactly |
| 2021-05-18 14:19:20 | <merijn> | mniip: Whether that's better depends :p |
| 2021-05-18 14:19:23 | × | berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 250 seconds) |
| 2021-05-18 14:19:25 | → | ericsagn1 joins (~ericsagne@2405:6580:0:5100:dcc7:3c52:3009:4cfd) |
| 2021-05-18 14:19:40 | <dminuoso> | What merijn and mniip wrote are just cute tricks, whether you want them in your production code.. dunno. :) |
| 2021-05-18 14:19:43 | <merijn> | dminuoso: That's the worst of all worlds :p |
| 2021-05-18 14:19:47 | <merijn> | dminuoso: wut? |
| 2021-05-18 14:19:59 | <merijn> | I'd give some intermediate names in real code, probably |
| 2021-05-18 14:20:01 | <dminuoso> | jeez |
| 2021-05-18 14:20:03 | <dminuoso> | sorry |
| 2021-05-18 14:20:05 | <dminuoso> | wait |
| 2021-05-18 14:20:18 | <kuribas> | dminuoso: https://www.youtube.com/watch?v=8HZ4DnVfWYQ |
| 2021-05-18 14:20:22 | <merijn> | I guess yours short-circuits, so that helps |
| 2021-05-18 14:20:29 | <dminuoso> | My brain is on autopilot. :P |
| 2021-05-18 14:20:51 | <merijn> | But "fold sequence into a map and evaluate predicate against counts" is something I find myself doing *a lot* |
| 2021-05-18 14:21:03 | <merijn> | It's why I hate the stupid Monoid on Map |
| 2021-05-18 14:21:33 | <merijn> | Otherwise I could just do "foldMap (\x -> M.singleton x (Sum 1))" |
| 2021-05-18 14:22:31 | <merijn> | safinaskar: So there you go, that's roughly 3 different versions ;) |
| 2021-05-18 14:22:45 | <dminuoso> | isUnique xs = go Set.empty where go _ [] = False; go buf (x:xs) = x `Set.elem` seen || go (Set.insert x s) xs |
| 2021-05-18 14:23:04 | <dminuoso> | Here. |
| 2021-05-18 14:23:26 | <merijn> | Although mine has the bonus of making it easy to report which values violate the constraint :p |
| 2021-05-18 14:23:41 | × | argento quits (~argent0@168.227.96.26) (Ping timeout: 240 seconds) |
| 2021-05-18 14:23:50 | <dminuoso> | well you can adapt my isUnique trivially too |
| 2021-05-18 14:24:27 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 2021-05-18 14:24:29 | <dminuoso> | % isUnique xs = go Set.empty where go _ [] = False; go buf (x:xs) = x `Set.elem` s || go (Set.insert x s) xs |
| 2021-05-18 14:24:29 | <yahb> | dminuoso: ; <interactive>:2:18: error:; Not in scope: `Set.empty'; Perhaps you meant one of these: `Seq.empty' (imported from Data.Sequence), data constructor `Seq.Empty' (imported from Data.Sequence), `S.empty' (imported from Data.Set); No module named `Set' is imported.; <interactive>:2:69: error:; Not in scope: `Set.elem'; No module named `Set' is imported.; <interactive>:2:89: error:; N |
All times are in UTC.