Logs: freenode/#haskell
| 2021-04-20 10:34:22 | × | nicholasbulka quits (~nicholasb@2601:900:4301:da0:c46c:29eb:6d58:88ee) (Ping timeout: 258 seconds) |
| 2021-04-20 10:38:14 | → | ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net) |
| 2021-04-20 10:38:49 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-20 10:39:34 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 10:40:26 | × | timCF quits (~i.tkachuk@200-149-20-81.sta.estpak.ee) (Quit: leaving) |
| 2021-04-20 10:40:45 | → | brown121407 joins (~brown1214@fsf/member/brown121407) |
| 2021-04-20 10:43:47 | × | nyd quits (~nyd@unaffiliated/elysian) (Ping timeout: 265 seconds) |
| 2021-04-20 10:44:16 | × | ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 265 seconds) |
| 2021-04-20 10:44:52 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-20 10:45:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 10:47:42 | × | dansho quits (~dansho@ec2-54-168-196-255.ap-northeast-1.compute.amazonaws.com) (Quit: Leaving) |
| 2021-04-20 10:47:56 | → | oish joins (~charlie@228.25.169.217.in-addr.arpa) |
| 2021-04-20 10:49:42 | × | aVikingTrex quits (2be74510@43.231.69.16) (Ping timeout: 240 seconds) |
| 2021-04-20 10:50:55 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-20 10:51:04 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 10:51:12 | × | todda7 quits (~torstein@athedsl-4519432.home.otenet.gr) (Ping timeout: 240 seconds) |
| 2021-04-20 10:51:35 | × | quinn quits (~quinn@c-73-223-224-163.hsd1.ca.comcast.net) (Quit: ZNC 1.8.1 - https://znc.in) |
| 2021-04-20 10:54:36 | → | Alleria joins (~textual@zrcout.mskcc.org) |
| 2021-04-20 10:55:00 | Alleria | is now known as Guest46085 |
| 2021-04-20 10:56:25 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2021-04-20 10:56:37 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:01:50 | → | __monty__ joins (~toonn@unaffiliated/toonn) |
| 2021-04-20 11:02:09 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 2021-04-20 11:02:22 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:04:45 | → | geekosaur joins (930099da@rrcs-147-0-153-218.central.biz.rr.com) |
| 2021-04-20 11:07:26 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2021-04-20 11:08:05 | → | aVikingTrex joins (~aVikingTr@2001:8003:340d:d00:b2de:b98:7a93:b0ea) |
| 2021-04-20 11:08:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:13:26 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2021-04-20 11:14:04 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:16:01 | → | nyd joins (~nyd@unaffiliated/elysian) |
| 2021-04-20 11:19:06 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2021-04-20 11:19:24 | → | jumper149 joins (~jumper149@80.240.31.34) |
| 2021-04-20 11:19:42 | × | Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Remote host closed the connection) |
| 2021-04-20 11:19:49 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:20:32 | → | Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2021-04-20 11:20:47 | → | heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-04-20 11:25:11 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2021-04-20 11:25:22 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:26:21 | × | heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2021-04-20 11:30:32 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2021-04-20 11:31:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:31:31 | → | zva joins (~zava@141.26.31.52) |
| 2021-04-20 11:32:24 | × | zva quits (~zava@141.26.31.52) (Client Quit) |
| 2021-04-20 11:33:00 | → | zva joins (~zava@141.26.31.52) |
| 2021-04-20 11:34:15 | → | todda7 joins (~torstein@athedsl-4519432.home.otenet.gr) |
| 2021-04-20 11:35:07 | → | kiweun joins (~kiweun@2607:fea8:2a62:9600:7cf0:bc04:9ce:d2d0) |
| 2021-04-20 11:36:11 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2021-04-20 11:36:52 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:39:34 | × | kiweun quits (~kiweun@2607:fea8:2a62:9600:7cf0:bc04:9ce:d2d0) (Ping timeout: 245 seconds) |
| 2021-04-20 11:39:49 | → | idhugo__ joins (~idhugo@87-49-45-4-mobile.dk.customer.tdc.net) |
| 2021-04-20 11:40:02 | → | knupfer joins (~Thunderbi@200116b82b71e80075f20a34a227ec31.dip.versatel-1u1.de) |
| 2021-04-20 11:40:16 | × | yaroot quits (~yaroot@138.102.13.160.dy.iij4u.or.jp) (Quit: The Lounge - https://thelounge.chat) |
| 2021-04-20 11:40:59 | → | yaroot joins (~yaroot@138.102.13.160.dy.iij4u.or.jp) |
| 2021-04-20 11:42:04 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-20 11:42:45 | × | idhugo_ quits (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) (Ping timeout: 265 seconds) |
| 2021-04-20 11:42:49 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 11:44:26 | → | alexm_ joins (~alexm_@161.8.254.109) |
| 2021-04-20 11:45:24 | → | Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck) |
| 2021-04-20 11:45:58 | → | machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 2021-04-20 11:46:41 | → | waleee-cl joins (uid373333@gateway/web/irccloud.com/x-eecvggrkioegpbei) |
| 2021-04-20 11:47:28 | <alexm_> | hey folks, I'm doing fp-course (former NICTA course) and have been stuck on the filtering exercise for the Applicative part |
| 2021-04-20 11:47:55 | <dibblego> | how far have you got so far? |
| 2021-04-20 11:48:10 | <alexm_> | I've finally come up with this and feel like it can be made more elegant |
| 2021-04-20 11:48:12 | <alexm_> | filtering _ Nil = pure Nil |
| 2021-04-20 11:48:12 | <alexm_> | filtering p (x:.xs) = lift2 (++) (append x <$> p x) (filtering p xs) |
| 2021-04-20 11:48:12 | <alexm_> | where append x' b | b = x' :. Nil |
| 2021-04-20 11:48:14 | <alexm_> | | otherwise = Nil |
| 2021-04-20 11:48:51 | → | nut joins (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 2021-04-20 11:49:42 | <dibblego> | you can try using (:.) instead of (++) in the condition test |
| 2021-04-20 11:50:15 | <dibblego> | it is tricky, especially when doing it on your own |
| 2021-04-20 11:50:31 | <dibblego> | usually by here, people have been given _LOTS_ of hints (and tend to ignore them anyway :) |
| 2021-04-20 11:51:02 | × | LKoen quits (~LKoen@92.163.9.109.rev.sfr.net) (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”) |
| 2021-04-20 11:51:41 | <dibblego> | try this: lift2 (bool id (x:.)) _todo (filtering p xs) |
| 2021-04-20 11:51:42 | <alexm_> | when you say condition test which part do you mean exactly? |
| 2021-04-20 11:51:49 | <dibblego> | append |
| 2021-04-20 11:52:01 | → | viluon joins (uid453725@gateway/web/irccloud.com/x-glghvaevbeqxsogf) |
| 2021-04-20 11:52:24 | <alexm_> | ok, will try |
| 2021-04-20 11:52:27 | × | Barras2 quits (~Barras2@139.28.218.148) (Remote host closed the connection) |
| 2021-04-20 11:52:29 | × | knupfer quits (~Thunderbi@200116b82b71e80075f20a34a227ec31.dip.versatel-1u1.de) (Ping timeout: 245 seconds) |
| 2021-04-20 11:52:33 | <alexm_> | thanks for the hint! |
| 2021-04-20 11:54:28 | <alexm_> | that bool function is the one I was desperately searching for thinking about how can I do simple truthiness check in applicative context, sigh... |
| 2021-04-20 11:54:36 | → | drbean_ joins (~drbean@TC210-63-209-44.static.apol.com.tw) |
| 2021-04-20 11:58:04 | → | Tops2 joins (~Tobias@dyndsl-095-033-023-254.ewe-ip-backbone.de) |
| 2021-04-20 11:59:24 | → | urodna joins (~urodna@unaffiliated/urodna) |
| 2021-04-20 12:00:17 | <alexm_> | dibblego updated version is: filtering p (x:.xs) = lift2 (bool id (x:.)) (p x) (filtering p xs) |
| 2021-04-20 12:02:56 | <alexm_> | I wonder, how do you arrive to such solution? is that a common pattern of sorts? |
| 2021-04-20 12:03:23 | × | olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Remote host closed the connection) |
| 2021-04-20 12:03:24 | <merijn> | type tetris, usually |
| 2021-04-20 12:03:42 | <merijn> | "look at the pieces, make them fit" :p |
| 2021-04-20 12:04:09 | <alexm_> | easier said than done :) |
| 2021-04-20 12:04:13 | <kuribas> | the tuple trick usually works fine |
| 2021-04-20 12:04:29 | <kuribas> | I write myFun = () $ partial_implementation |
| 2021-04-20 12:04:38 | <kuribas> | then let the type system tell me what I need next. |
| 2021-04-20 12:04:41 | <merijn> | alexm_: That's where experience with possible things kicks in :) |
| 2021-04-20 12:04:52 | <merijn> | kuribas: You can do the same but better with _ |
| 2021-04-20 12:05:07 | <kuribas> | merijn: I disagree. I find that tuple gives me usually better error messages. |
| 2021-04-20 12:05:28 | <kuribas> | I only use typed holes for unimplemented functions. |
| 2021-04-20 12:06:56 | <kuribas> | Also writing straigtforward but verbose code, then using rewrite rules to make it nicer usually works very well. |
| 2021-04-20 12:07:18 | <kuribas> | And it's what I would recommend any beginner. |
All times are in UTC.