Logs: freenode/#haskell
| 2021-04-20 22:00:23 | <monochrom> | without actually knowing your context or application or problem domain |
| 2021-04-20 22:02:30 | × | zva quits (~zava@141.26.31.52) (Ping timeout: 268 seconds) |
| 2021-04-20 22:02:54 | <nut> | monochrom: I'm doing a tree traversal algorithm. I get a list from both left and right subtree which I need to combime |
| 2021-04-20 22:03:38 | <nut> | monochrom: So I suppose instead of list, I can try a Seq a |
| 2021-04-20 22:04:26 | <monochrom> | "difference list" i.e. [a]->[a] |
| 2021-04-20 22:05:42 | <nut> | monochrom: wow, thanks! |
| 2021-04-20 22:05:55 | × | nicholasbulka quits (~nicholasb@2601:900:4301:da0:c46c:29eb:6d58:88ee) (Remote host closed the connection) |
| 2021-04-20 22:05:56 | → | hc_ joins (~hc@fsfe/hc) |
| 2021-04-20 22:06:01 | <monochrom> | Instead of Tree->[X], have f::Tree->[X]->[X]. f (Branch left right) = f left . f right; f (Leaf x) = \s -> x : s |
| 2021-04-20 22:06:38 | <monochrom> | For the whole tree, use "f my_whole_tree []". |
| 2021-04-20 22:06:45 | → | nicholasbulka joins (~nicholasb@2601:900:4301:da0:c46c:29eb:6d58:88ee) |
| 2021-04-20 22:06:54 | → | Guest78317 joins (~laudiacay@67.176.215.84) |
| 2021-04-20 22:07:10 | × | hc quits (~hc@fsfe/hc) (Read error: Connection reset by peer) |
| 2021-04-20 22:07:10 | × | piele quits (~piele@tbonesteak.creativeserver.net) (Quit: No Ping reply in 180 seconds.) |
| 2021-04-20 22:07:23 | → | tsaka_ joins (~torstein@athedsl-4519432.home.otenet.gr) |
| 2021-04-20 22:07:32 | <nut> | Is this Haskell specific data structure? monochrom |
| 2021-04-20 22:07:51 | <monochrom> | No, you can do this for every FP language. |
| 2021-04-20 22:07:53 | <nut> | monochrom: I can't seem to find references in other languages |
| 2021-04-20 22:07:55 | × | jesystani quits (~thorn@2404:4404:17f1:4900:819e:dd03:7c1b:1df4) (Ping timeout: 260 seconds) |
| 2021-04-20 22:08:09 | <nut> | non FP languages |
| 2021-04-20 22:08:13 | → | piele joins (~piele@tbonesteak.creativeserver.net) |
| 2021-04-20 22:08:15 | <monochrom> | But then I guess it is best used with laziness. |
| 2021-04-20 22:08:24 | <monochrom> | s/non/anti/ |
| 2021-04-20 22:08:37 | <monochrom> | Clearly, anti FP got to be anti F. |
| 2021-04-20 22:08:39 | → | jesystani joins (~thorn@2404:4404:17f1:4900:1be9:7d25:ab7d:6509) |
| 2021-04-20 22:08:51 | <nut> | haha |
| 2021-04-20 22:09:14 | <monochrom> | "Tree->[X]->[X]" fundamentally requires one to be serious about functions. |
| 2021-04-20 22:09:31 | × | elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 245 seconds) |
| 2021-04-20 22:09:40 | <monochrom> | Or at least the function composition in "f left . f right" |
| 2021-04-20 22:09:43 | × | usr25 quits (~usr25@unaffiliated/usr25) (Quit: Leaving) |
| 2021-04-20 22:10:28 | <nut> | What do you mean? |
| 2021-04-20 22:10:45 | × | rj quits (~x@gateway/tor-sasl/rj) (Ping timeout: 240 seconds) |
| 2021-04-20 22:10:55 | <monochrom> | An anti-FP language will not make it easy to use function composition. |
| 2021-04-20 22:12:46 | <nut> | monochrom: In your previous code, you've added a [X]. Is it supposed to be an accumulator? |
| 2021-04-20 22:13:12 | <monochrom> | whereas the difference list trick is built around function composition. |
| 2021-04-20 22:13:12 | × | Guest78317 quits (~laudiacay@67.176.215.84) (Ping timeout: 265 seconds) |
| 2021-04-20 22:13:13 | × | nicholasbulka quits (~nicholasb@2601:900:4301:da0:c46c:29eb:6d58:88ee) (Ping timeout: 245 seconds) |
| 2021-04-20 22:13:13 | → | ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net) |
| 2021-04-20 22:13:13 | × | __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving) |
| 2021-04-20 22:13:13 | × | tsaka__ quits (~torstein@athedsl-4519432.home.otenet.gr) (Ping timeout: 260 seconds) |
| 2021-04-20 22:13:26 | <nut> | i see |
| 2021-04-20 22:13:49 | × | fendor quits (~fendor@178.165.131.162.wireless.dyn.drei.com) (Remote host closed the connection) |
| 2021-04-20 22:13:52 | <nut> | So your code snippets demonstrates the use of function composition |
| 2021-04-20 22:14:12 | <nut> | But I don't see how that composition made things fast |
| 2021-04-20 22:14:49 | <nut> | monochrom: do you mean it turned concat into function application? |
| 2021-04-20 22:14:53 | <monochrom> | I don't know what counts as accumulator. The [X] parameter is a suffix. f does prepending. |
| 2021-04-20 22:14:54 | <monochrom> | f (Branch (Leaf x) (Leaf y)) suffix = x : y : suffix |
| 2021-04-20 22:15:03 | <monochrom> | Yes |
| 2021-04-20 22:15:27 | × | Ariakenom quits (~Ariakenom@2001:9b1:efb:fc00:795e:3018:ba62:6713) (Quit: Leaving) |
| 2021-04-20 22:15:29 | <geekosaur> | I think they meant the type signature and [X] was "list of X" |
| 2021-04-20 22:15:47 | <nut> | monochrom: it's a small aha moment for me |
| 2021-04-20 22:16:05 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 2021-04-20 22:16:09 | → | ph88 joins (~ph88@2a02:8109:9e00:7e5c:d5ef:86b3:afc4:9258) |
| 2021-04-20 22:18:24 | × | ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 252 seconds) |
| 2021-04-20 22:18:56 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-04-20 22:19:25 | → | heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-04-20 22:22:08 | → | dpl_ joins (~dpl@77-121-78-163.chn.volia.net) |
| 2021-04-20 22:22:12 | × | nut quits (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds) |
| 2021-04-20 22:22:51 | × | dpl quits (~dpl@77-121-78-163.chn.volia.net) (Ping timeout: 268 seconds) |
| 2021-04-20 22:23:43 | <infinisil> | Could also use https://hackage.haskell.org/package/dlist-1.0/docs/Data-DList.html |
| 2021-04-20 22:24:19 | × | olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Remote host closed the connection) |
| 2021-04-20 22:24:56 | × | barakkl1993 quits (~barakkley@2.55.154.74) (Ping timeout: 260 seconds) |
| 2021-04-20 22:25:41 | <infinisil> | Oh they're gone |
| 2021-04-20 22:27:44 | × | Sornaensis quits (~Sornaensi@077213200034.dynamic.telenor.dk) (Ping timeout: 246 seconds) |
| 2021-04-20 22:32:01 | × | lassulus quits (~lassulus@NixOS/user/lassulus) (Ping timeout: 245 seconds) |
| 2021-04-20 22:33:39 | → | nut joins (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 2021-04-20 22:35:08 | × | son0p quits (~ff@181.136.122.143) (Read error: Connection reset by peer) |
| 2021-04-20 22:37:02 | → | lassulus joins (~lassulus@NixOS/user/lassulus) |
| 2021-04-20 22:38:06 | × | nineonin_ quits (~nineonine@50.216.62.2) (Ping timeout: 240 seconds) |
| 2021-04-20 22:41:41 | → | hypercube joins (hypercube@gateway/vpn/protonvpn/hypercube) |
| 2021-04-20 22:41:44 | × | Sheilong quits (uid293653@gateway/web/irccloud.com/x-iszyocxwqmtvebxh) (Quit: Connection closed for inactivity) |
| 2021-04-20 22:42:30 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-20 22:42:41 | × | Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 240 seconds) |
| 2021-04-20 22:47:20 | × | Guest46085 quits (~textual@zrcout.mskcc.org) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-04-20 22:47:26 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds) |
| 2021-04-20 22:55:09 | × | rj quits (~x@gateway/tor-sasl/rj) (Ping timeout: 240 seconds) |
| 2021-04-20 22:56:21 | → | Guest78317 joins (~laudiacay@67.176.215.84) |
| 2021-04-20 22:58:41 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 2021-04-20 22:59:37 | → | nicholasbulka joins (~nicholasb@2601:900:4301:da0:c46c:29eb:6d58:88ee) |
| 2021-04-20 23:01:06 | × | Guest78317 quits (~laudiacay@67.176.215.84) (Ping timeout: 260 seconds) |
| 2021-04-20 23:02:15 | × | thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 258 seconds) |
| 2021-04-20 23:02:20 | → | sm2n_ joins (~sm2n@bras-base-hmtnon143hw-grc-13-70-54-76-62.dsl.bell.ca) |
| 2021-04-20 23:03:10 | × | heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2021-04-20 23:05:10 | × | sm2n quits (~sm2n@70.54.76.62) (Ping timeout: 252 seconds) |
| 2021-04-20 23:09:40 | → | nibot joins (45d11556@69-209-21-86.lightspeed.sntcca.sbcglobal.net) |
| 2021-04-20 23:12:15 | → | sm2n joins (~sm2n@bras-base-hmtnon143hw-grc-13-70-54-76-62.dsl.bell.ca) |
| 2021-04-20 23:12:50 | <newhoggy> | @bgamari: Any chance you could bump the upper bounds for monoidal-containers? https://github.com/bgamari/monoidal-containers/issues/78 |
| 2021-04-20 23:12:51 | <lambdabot> | Unknown command, try @list |
| 2021-04-20 23:12:54 | → | DavidEichmann joins (~david@147.136.46.217.dyn.plus.net) |
| 2021-04-20 23:13:08 | <newhoggy> | bgamari: Any chance you could bump the upper bounds for monoidal-containers? https://github.com/bgamari/monoidal-containers/issues/78 |
| 2021-04-20 23:13:42 | → | cantstanya joins (~chatting@gateway/tor-sasl/cantstanya) |
| 2021-04-20 23:13:56 | × | sm2n_ quits (~sm2n@bras-base-hmtnon143hw-grc-13-70-54-76-62.dsl.bell.ca) (Ping timeout: 246 seconds) |
| 2021-04-20 23:14:24 | → | sleblanc joins (~sleblanc@unaffiliated/sebleblanc) |
| 2021-04-20 23:15:03 | × | juri_ quits (~juri@178.63.35.222) (Ping timeout: 252 seconds) |
| 2021-04-20 23:16:45 | → | Alleria joins (~textual@2603-7000-3040-0000-e52b-abc5-9db9-302a.res6.spectrum.com) |
| 2021-04-20 23:17:08 | Alleria | is now known as Guest66770 |
| 2021-04-20 23:18:12 | × | nut quits (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds) |
| 2021-04-20 23:18:57 | → | nineonine joins (~nineonine@50.216.62.2) |
| 2021-04-20 23:20:01 | × | Narinas quits (~Narinas@187-178-93-112.dynamic.axtel.net) (Ping timeout: 252 seconds) |
| 2021-04-20 23:21:07 | × | Guest66770 quits (~textual@2603-7000-3040-0000-e52b-abc5-9db9-302a.res6.spectrum.com) (Ping timeout: 250 seconds) |
All times are in UTC.