Logs: freenode/#haskell
| 2020-11-08 23:46:48 | <bqv> | koz_: that's just a spicy fold :D |
| 2020-11-08 23:46:51 | <Feuermagier> | interesting |
| 2020-11-08 23:46:59 | <koz_> | bqv: Spicy be good. |
| 2020-11-08 23:47:25 | <hpc> | Feuermagier: think functional :D |
| 2020-11-08 23:47:45 | × | Gurkenglas_ quits (Gurkenglas@gateway/vpn/protonvpn/gurkenglas) (Ping timeout: 240 seconds) |
| 2020-11-08 23:47:47 | → | sakirious joins (~sakirious@c-71-197-191-137.hsd1.wa.comcast.net) |
| 2020-11-08 23:48:01 | <Feuermagier> | the results of the oerations are gonna be strings, how do i build a continous one out of the results? |
| 2020-11-08 23:48:15 | <koz_> | > "foo" <> "bar" |
| 2020-11-08 23:48:17 | <lambdabot> | "foobar" |
| 2020-11-08 23:48:30 | <koz_> | Do you mean continuous in that sense? |
| 2020-11-08 23:48:32 | × | xerox_ quits (~xerox@unaffiliated/xerox) (Ping timeout: 258 seconds) |
| 2020-11-08 23:48:34 | <Feuermagier> | yes |
| 2020-11-08 23:49:26 | <koz_> | If you're gonna use a fold, then you can combine with (<>). If you're going to use foldMap, it does it for you if you project into String. |
| 2020-11-08 23:50:05 | <Feuermagier> | koz_, alright. i'll implement the zipWith for now and then see how i get on |
| 2020-11-08 23:51:34 | × | AceNovo quits (~chris@184.101.220.149) (Quit: Konversation terminated!) |
| 2020-11-08 23:52:14 | → | AceNovo joins (~chris@184.101.220.149) |
| 2020-11-08 23:53:53 | <Feuermagier> | why does this not work?: zipWith [(+ 5), (* 2), id, id, id] pad(reverse(digits n)) |
| 2020-11-08 23:54:40 | <koz_> | Feuermagier: Please be more specific. What do you mean by 'not work'? Does it not compile? Does it run, but not how you want? Something else? |
| 2020-11-08 23:55:13 | <Feuermagier> | oh, ofc. sec |
| 2020-11-08 23:56:36 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-08 23:56:55 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-11-08 23:59:41 | <jcowan> | hpc: Right, I understand that. But is that a principled restriction? |
| 2020-11-09 00:00:02 | × | rawtaz1 quits (~rawtaz@178.239.168.171) () |
| 2020-11-09 00:00:04 | <Feuermagier> | I have a function "constructDigit :: String -> Integer -> String" - I want to call it in the zipWith with a constant string and the zipped-towards integer. What's the syntax for that? |
| 2020-11-09 00:01:40 | <Axman6> | I have no idea what you're asking for |
| 2020-11-09 00:01:48 | → | christo joins (~chris@81.96.113.213) |
| 2020-11-09 00:01:49 | <Axman6> | perhaps give us some example inputs and expected outputs |
| 2020-11-09 00:02:05 | <hpc> | not anything specific, but... |
| 2020-11-09 00:02:28 | → | xerox_ joins (~xerox@unaffiliated/xerox) |
| 2020-11-09 00:02:29 | <Axman6> | Feuermagier: also zipWith [(+ 5), (* 2), id, id, id] pad(reverse(digits n)) doesn't work because you actually wrote (((zipWith [(+ 5), (* 2), id, id, id]) pad(reverse(digits n)) |
| 2020-11-09 00:02:40 | <hpc> | so, you've got code that has some identifier, "foo" - you want it to refer to the same thing everywhere you use it, and not have some extra piece of context deciding for you |
| 2020-11-09 00:02:46 | <Axman6> | (((zipWith [(+ 5), (* 2), id, id, id]) pad) (reverse(digits n))) * |
| 2020-11-09 00:02:48 | <hpc> | like what type it's supposed to be and so forth |
| 2020-11-09 00:02:59 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-09 00:03:04 | → | Tops2 joins (~Tobias@dyndsl-095-033-091-035.ewe-ip-backbone.de) |
| 2020-11-09 00:03:20 | <hekkaidekapus> | > ZipList [(+ 5), (* 2), id] <*> ZipList [100, 1000, 10000] |
| 2020-11-09 00:03:21 | <lambdabot> | ZipList {getZipList = [105,2000,10000]} |
| 2020-11-09 00:03:28 | <Axman6> | pad is being passed as an argument to zipWith |
| 2020-11-09 00:03:46 | <hpc> | and constructors are defined as part of their data definition, to produce data of that type |
| 2020-11-09 00:03:49 | <Feuermagier> | so, I want to turn [0,1] into [constructDigit "a" 0, constructDigit "b" 1] |
| 2020-11-09 00:04:05 | <hpc> | which is more obvious if you look at data definitions with GADTSyntax |
| 2020-11-09 00:04:18 | <hpc> | data Maybe where Nothing :: Maybe a; Just :: a -> Maybe a |
| 2020-11-09 00:04:25 | → | olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber) |
| 2020-11-09 00:04:26 | <hpc> | for example |
| 2020-11-09 00:04:28 | <Axman6> | so zipWith constructDigit ["a","b"] [0,1]? |
| 2020-11-09 00:04:38 | <Feuermagier> | yes |
| 2020-11-09 00:04:45 | <Feuermagier> | that works? |
| 2020-11-09 00:04:46 | <Axman6> | need more examples to see how that should be generalised |
| 2020-11-09 00:04:53 | <hpc> | and then if you define some other data type using Nothing as a constructor, you have two definitions |
| 2020-11-09 00:05:13 | <hpc> | and when definitions have overlapping names, that's an error |
| 2020-11-09 00:05:13 | <Axman6> | > zipWith f [a,b] [0,1] :: [Expr] |
| 2020-11-09 00:05:15 | <lambdabot> | [f a 0,f b 1] |
| 2020-11-09 00:05:25 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-09 00:05:59 | × | atk quits (~Arch-TK@ircpuzzles/staff/Arch-TK) (Quit: Well this is unexpected.) |
| 2020-11-09 00:06:03 | <hpc> | basically the same reason you can't define functions multiple times either |
| 2020-11-09 00:06:14 | × | comerijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 2020-11-09 00:06:24 | × | christo quits (~chris@81.96.113.213) (Ping timeout: 260 seconds) |
| 2020-11-09 00:07:25 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2020-11-09 00:07:35 | × | xerox_ quits (~xerox@unaffiliated/xerox) (Ping timeout: 256 seconds) |
| 2020-11-09 00:08:22 | → | atk joins (~Arch-TK@erebus.the-tk.com) |
| 2020-11-09 00:09:56 | × | atk quits (~Arch-TK@erebus.the-tk.com) (Changing host) |
| 2020-11-09 00:09:56 | → | atk joins (~Arch-TK@ircpuzzles/staff/Arch-TK) |
| 2020-11-09 00:12:58 | × | AceNovo quits (~chris@184.101.220.149) (Quit: Konversation terminated!) |
| 2020-11-09 00:13:05 | × | CMCDragonkai1 quits (~Thunderbi@124.19.3.250) (Ping timeout: 240 seconds) |
| 2020-11-09 00:13:15 | → | AceNovo joins (~chris@184.101.220.149) |
| 2020-11-09 00:15:48 | → | Gurkenglas_ joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2020-11-09 00:16:10 | <Feuermagier> | so, zipWith constructDigit ["a","b"] [0,1] works now. However I want the [0,1] part to be the return of a function (pad :: -> Integer) |
| 2020-11-09 00:17:40 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 258 seconds) |
| 2020-11-09 00:17:59 | <hekkaidekapus> | zipWith constructDigit ["a", "b"] (pad …) |
| 2020-11-09 00:18:20 | <Feuermagier> | ah, one more parenthesis |
| 2020-11-09 00:18:41 | <hekkaidekapus> | zipWith constructDigit ["a", "b"] xs where xs = pad … |
| 2020-11-09 00:18:52 | <bqv> | pointfree ftw |
| 2020-11-09 00:18:52 | → | todda7 joins (~torstein@athedsl-215972.home.otenet.gr) |
| 2020-11-09 00:19:29 | <hekkaidekapus> | let xs = pad … in zipWith constructDigit ["a", "b"] xs |
| 2020-11-09 00:19:30 | × | Gurkenglas__ quits (Gurkenglas@gateway/vpn/protonvpn/gurkenglas) (Ping timeout: 256 seconds) |
| 2020-11-09 00:20:05 | × | tsaka__ quits (~torstein@ppp-2-84-22-81.home.otenet.gr) (Ping timeout: 240 seconds) |
| 2020-11-09 00:21:24 | ← | jcowan parts (sid325434@gateway/web/irccloud.com/x-xccxiqbedbcrqfvq) () |
| 2020-11-09 00:24:44 | → | hekkaidekapus_ joins (~tchouri@gateway/tor-sasl/hekkaidekapus) |
| 2020-11-09 00:25:04 | × | DavidEichmann quits (~david@43.240.198.146.dyn.plus.net) (Ping timeout: 260 seconds) |
| 2020-11-09 00:26:23 | × | hekkaidekapus quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 240 seconds) |
| 2020-11-09 00:27:11 | hekkaidekapus_ | is now known as hekkaidekapus |
| 2020-11-09 00:27:58 | → | irc_user joins (uid423822@gateway/web/irccloud.com/x-sjoykohhohfeylve) |
| 2020-11-09 00:29:33 | × | HoolaBoola quits (~HoolaBool@hoolaboola.works) (Quit: WeeChat 2.8) |
| 2020-11-09 00:29:49 | × | bidabong quits (uid272474@gateway/web/irccloud.com/x-ppmzlzztyuerpxde) (Quit: Connection closed for inactivity) |
| 2020-11-09 00:33:23 | → | jmcarthur joins (~jmcarthur@2601:86:500:2a40:db56:5d66:5919:c95d) |
| 2020-11-09 00:33:27 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2020-11-09 00:33:41 | × | atk quits (~Arch-TK@ircpuzzles/staff/Arch-TK) (Quit: Well this is unexpected.) |
| 2020-11-09 00:34:58 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-09 00:35:24 | → | atk joins (~Arch-TK@ircpuzzles/staff/Arch-TK) |
| 2020-11-09 00:38:25 | × | jbox quits (~atlas@unaffiliated/jbox) (Read error: Connection reset by peer) |
| 2020-11-09 00:38:47 | → | jbox joins (~atlas@unaffiliated/jbox) |
| 2020-11-09 00:40:00 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2020-11-09 00:40:50 | → | Narinas joins (~Narinas@189.223.113.190.dsl.dyn.telnor.net) |
| 2020-11-09 00:41:44 | × | elliott_ quits (~elliott_@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 272 seconds) |
| 2020-11-09 00:43:51 | → | danso joins (~dan@69-165-210-185.cable.teksavvy.com) |
| 2020-11-09 00:47:38 | ← | jbox parts (~atlas@unaffiliated/jbox) ("WeeChat 2.9") |
| 2020-11-09 00:49:31 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2020-11-09 00:50:18 | → | tsaka__ joins (~torstein@athedsl-216011.home.otenet.gr) |
| 2020-11-09 00:51:13 | × | todda7 quits (~torstein@athedsl-215972.home.otenet.gr) (Ping timeout: 256 seconds) |
| 2020-11-09 00:51:44 | → | renzhi joins (~renzhi@2607:fa49:655f:e600::28da) |
All times are in UTC.