Logs: freenode/#haskell
| 2021-04-16 04:04:54 | × | vicfred__ quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving) |
| 2021-04-16 04:07:04 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 252 seconds) |
| 2021-04-16 04:11:46 | × | __minoru__shirae quits (~shiraeesh@109.166.58.206) (Ping timeout: 240 seconds) |
| 2021-04-16 04:14:11 | → | JanBessa1 joins (~JanB@85-22-17-38.ip.dokom21.de) |
| 2021-04-16 04:16:55 | → | howdoi joins (uid224@gateway/web/irccloud.com/x-jxdeabbswteucrim) |
| 2021-04-16 04:16:58 | × | falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 252 seconds) |
| 2021-04-16 04:17:11 | × | JanBessai quits (~JanB@85-22-21-116.ip.dokom21.de) (Ping timeout: 240 seconds) |
| 2021-04-16 04:19:38 | → | sgibber2018 joins (d055ed90@208.85.237.144) |
| 2021-04-16 04:24:46 | → | Stanley|00 joins (~stanley00@unaffiliated/stanley00) |
| 2021-04-16 04:25:29 | × | aerona quits (~aerona@2600:6c54:4600:f300:9051:460a:b720:8d59) (Quit: Leaving) |
| 2021-04-16 04:26:49 | → | falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) |
| 2021-04-16 04:26:53 | × | Stanley00 quits (~stanley00@unaffiliated/stanley00) (Ping timeout: 240 seconds) |
| 2021-04-16 04:27:13 | × | ericsagnes quits (~ericsagne@2405:6580:0:5100:fcb5:fe0b:76b4:5550) (Ping timeout: 250 seconds) |
| 2021-04-16 04:27:46 | → | ace89320 joins (~ace89320@cpe-76-88-177-21.hawaii.res.rr.com) |
| 2021-04-16 04:30:20 | × | kayvan quits (~user@52-119-115-185.PUBLIC.monkeybrains.net) (Remote host closed the connection) |
| 2021-04-16 04:31:43 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:a582:5ae0:47b5:20e5) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-04-16 04:34:50 | → | nbloomf joins (~nbloomf@2600:1700:ad14:3020:a582:5ae0:47b5:20e5) |
| 2021-04-16 04:38:24 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-04-16 04:38:37 | → | hexable joins (~cmo@S010610561191f5d6.lb.shawcable.net) |
| 2021-04-16 04:39:27 | → | ericsagnes joins (~ericsagne@2405:6580:0:5100:eb42:97e1:2138:8966) |
| 2021-04-16 04:39:54 | × | hexable quits (~cmo@S010610561191f5d6.lb.shawcable.net) (Client Quit) |
| 2021-04-16 04:40:20 | → | hexable joins (~cmo@S010610561191f5d6.lb.shawcable.net) |
| 2021-04-16 04:40:27 | × | hexable quits (~cmo@S010610561191f5d6.lb.shawcable.net) (Remote host closed the connection) |
| 2021-04-16 04:41:32 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-16 04:42:34 | × | sgibber2018 quits (d055ed90@208.85.237.144) (Quit: Connection closed) |
| 2021-04-16 04:42:44 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 246 seconds) |
| 2021-04-16 04:44:23 | → | ericsagn1 joins (~ericsagne@2405:6580:0:5100:cac:8636:1ade:e81c) |
| 2021-04-16 04:44:59 | × | ericsagnes quits (~ericsagne@2405:6580:0:5100:eb42:97e1:2138:8966) (Ping timeout: 258 seconds) |
| 2021-04-16 04:46:09 | × | zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving) |
| 2021-04-16 04:48:41 | × | horatiohb quits (~horatiohb@165.227.120.74) (Ping timeout: 268 seconds) |
| 2021-04-16 04:49:13 | → | imes joins (~imes@120.89.104.111) |
| 2021-04-16 04:52:32 | → | zaquest joins (~notzaques@5.128.210.178) |
| 2021-04-16 04:54:14 | × | jijimofo quits (~cmo@S010610561191f5d6.lb.shawcable.net) (Ping timeout: 268 seconds) |
| 2021-04-16 04:55:41 | × | myShoggoth quits (~myShoggot@97-120-72-12.ptld.qwest.net) (Ping timeout: 260 seconds) |
| 2021-04-16 04:58:01 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2021-04-16 04:58:33 | → | Tario joins (~Tario@201.192.165.173) |
| 2021-04-16 05:01:55 | × | waleee-cl quits (uid373333@gateway/web/irccloud.com/x-mduldyizmjdpywto) (Quit: Connection closed for inactivity) |
| 2021-04-16 05:02:37 | → | bobajett joins (~user@2001:470:0:301::1e) |
| 2021-04-16 05:03:34 | × | imes quits (~imes@120.89.104.111) (Quit: Leaving) |
| 2021-04-16 05:04:10 | → | tionos- joins (~tionos@2a0b:b7c4:1:731::1) |
| 2021-04-16 05:04:11 | × | tionos quits (~tionos@we.like.to.party.intercop.de) (Ping timeout: 240 seconds) |
| 2021-04-16 05:11:20 | × | ace89320 quits (~ace89320@cpe-76-88-177-21.hawaii.res.rr.com) (Quit: leaving) |
| 2021-04-16 05:13:43 | <bobajett> | hello, how can I write this function? foo ['a','b','c'] => [['A','b','c'], ['a','B','c], ['a','b','C']] |
| 2021-04-16 05:14:36 | <bobajett> | in other words I want to map over the list, but return the mapped item along with the whole list |
| 2021-04-16 05:15:38 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds) |
| 2021-04-16 05:18:22 | → | ddellacosta joins (~ddellacos@86.106.143.183) |
| 2021-04-16 05:19:46 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds) |
| 2021-04-16 05:20:07 | × | nineonine quits (~nineonine@50.216.62.2) (Remote host closed the connection) |
| 2021-04-16 05:21:03 | × | desmond373 quits (~desmond37@180.150.112.239) (Remote host closed the connection) |
| 2021-04-16 05:21:11 | × | Lowl3v3l quits (~Lowl3v3l@dslb-002-207-103-026.002.207.pools.vodafone-ip.de) (Read error: No route to host) |
| 2021-04-16 05:22:58 | × | ddellacosta quits (~ddellacos@86.106.143.183) (Ping timeout: 252 seconds) |
| 2021-04-16 05:24:56 | × | Blkt quits (~Blkt@2a01:4f8:200:2425::adda) (Remote host closed the connection) |
| 2021-04-16 05:25:12 | → | Blkt joins (~Blkt@2a01:4f8:200:2425::adda) |
| 2021-04-16 05:26:17 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-04-16 05:28:26 | → | Lowl3v3l joins (~Lowl3v3l@dslb-002-207-103-026.002.207.pools.vodafone-ip.de) |
| 2021-04-16 05:29:17 | × | Tario quits (~Tario@201.192.165.173) (Ping timeout: 246 seconds) |
| 2021-04-16 05:31:11 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds) |
| 2021-04-16 05:31:44 | × | grumble quits (~Thunderbi@freenode/staff/grumble) (Ping timeout: 608 seconds) |
| 2021-04-16 05:31:53 | × | drbean_ quits (~drbean@TC210-63-209-186.static.apol.com.tw) (Ping timeout: 240 seconds) |
| 2021-04-16 05:34:49 | → | Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2021-04-16 05:37:35 | × | seveg quits (~gabriel@2a02-ab04-0249-8d00-dea6-32ff-fe17-0993.dynamic.v6.chello.sk) (Ping timeout: 260 seconds) |
| 2021-04-16 05:39:58 | → | seveg joins (~gabriel@188-167-252-202.dynamic.chello.sk) |
| 2021-04-16 05:40:08 | × | falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 246 seconds) |
| 2021-04-16 05:42:26 | → | drbean_ joins (~drbean@TC210-63-209-87.static.apol.com.tw) |
| 2021-04-16 05:44:13 | × | pfurla_ quits (~pfurla@216.151.180.220) (Ping timeout: 240 seconds) |
| 2021-04-16 05:45:18 | → | pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net) |
| 2021-04-16 05:46:19 | <gnumonic> | bobajett i think this does what you want (although i don't think it's very efficient) https://gist.github.com/gnumonik/1ae4bb58f2535ebbe1deff0129fbb1fc |
| 2021-04-16 05:47:27 | → | idhugo joins (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) |
| 2021-04-16 05:49:18 | → | wonko7 joins (~wonko7@62.115.229.50) |
| 2021-04-16 05:54:53 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:a582:5ae0:47b5:20e5) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-04-16 05:55:41 | × | jao quits (~jao@pdpc/supporter/professional/jao) (Ping timeout: 240 seconds) |
| 2021-04-16 05:55:48 | × | monochrom quits (trebla@216.138.220.146) (Quit: NO CARRIER) |
| 2021-04-16 05:55:50 | <bobajett> | @gnumonic thanks! This looks a little complicated to newbie me. I was wondering if there was some idiomatic solution to such problems. |
| 2021-04-16 05:55:50 | <lambdabot> | Unknown command, try @list |
| 2021-04-16 05:55:52 | → | v01d4lph4 joins (~v01d4lph4@122.160.65.250) |
| 2021-04-16 05:55:59 | <bobajett> | I came up with: |
| 2021-04-16 05:56:25 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-04-16 05:56:31 | <bobajett> | someFunc xs = map (\(i, x) -> replace xs i (toUpper x)) $ zip [1..] xs |
| 2021-04-16 05:56:53 | <bobajett> | replace xs i y = take (i-1) xs ++ [y] ++ drop i xs |
| 2021-04-16 05:59:14 | × | Sonderblade quits (~helloman@2a02:aa1:100d:fe6f:6a75:3fbc:c81a:1def) (Quit: Konversation terminated!) |
| 2021-04-16 05:59:36 | × | idhugo quits (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) (Ping timeout: 268 seconds) |
| 2021-04-16 06:00:38 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds) |
| 2021-04-16 06:03:29 | <dmwit> | > [pre ++ toUpper mid ++ post | pre <- inits "abc" | mid:post <- tails "abc"] |
| 2021-04-16 06:03:31 | <lambdabot> | error: |
| 2021-04-16 06:03:31 | <lambdabot> | • Couldn't match expected type ‘[Char]’ with actual type ‘Char’ |
| 2021-04-16 06:03:31 | <lambdabot> | • In the first argument of ‘(++)’, namely ‘toUpper mid’ |
| 2021-04-16 06:03:40 | <dmwit> | > [pre ++ [toUpper mid] ++ post | pre <- inits "abc" | mid:post <- tails "abc"] |
| 2021-04-16 06:03:42 | <lambdabot> | ["Abc","aBc","abC"] |
| 2021-04-16 06:03:44 | <gnumonic> | well that's shorter than what I did :P My intuition is that it's probably not a function where you'd reach for map. I mean the part that makes the uppercase chars is map-ey (there's probably a mapwithindex function somewhere that'd be good for that) |
| 2021-04-16 06:03:47 | <dmwit> | bobajett: ^ |
| 2021-04-16 06:05:07 | <dmwit> | Usually indexing is a sign you're Doing It Wrong. |
| 2021-04-16 06:05:34 | <gnumonic> | actually yeah that list comprehension solution is probably the best. i need to use those more. i know how they work and all but a comprehension is almost never the first thing that occurs to me |
| 2021-04-16 06:09:37 | <bobajett> | dmwit: Nice! thanks! |
| 2021-04-16 06:12:58 | → | monochrom joins (trebla@216.138.220.146) |
| 2021-04-16 06:13:59 | × | bobajett quits (~user@2001:470:0:301::1e) (Quit: ERC Version 5.3 (IRC client for Emacs)) |
| 2021-04-16 06:13:59 | → | qwerty2o joins (~qwerty2o@93-172-139-92.bb.netvision.net.il) |
| 2021-04-16 06:14:04 | → | nicholasbulka joins (~nicholasb@2601:900:4301:da0:34df:482b:a0b7:2d77) |
| 2021-04-16 06:15:14 | → | _ht joins (~quassel@82-169-194-8.biz.kpn.net) |
| 2021-04-16 06:15:53 | × | cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 240 seconds) |
| 2021-04-16 06:16:46 | × | notzmv quits (~zmv@unaffiliated/zmv) (Ping timeout: 260 seconds) |
All times are in UTC.