Logs: freenode/#haskell
| 2021-03-07 04:40:31 | <heck-to-the-gnom> | Sorry, just returned, so... you just use '.' in place of '$' but if you're chaining a lot together, then you better use '$' at the end at least? Am I getting this right? |
| 2021-03-07 04:41:42 | <dolio> | You don't have to use $ at the end, but you can. |
| 2021-03-07 04:41:46 | → | frozenErebus joins (~frozenEre@94.128.82.20) |
| 2021-03-07 04:42:43 | <swarmcollective> | I think of it like this: (f1 . f2) a = f1 (f2 a) |
| 2021-03-07 04:43:22 | × | bigbosskor quits (~Android@182.232.52.52) (Read error: Connection reset by peer) |
| 2021-03-07 04:43:27 | <swarmcollective> | or: (f3 . f2 . f1) a = f3 (f2 (f1 a)) = f3 $ f2 $ f1 a |
| 2021-03-07 04:43:35 | → | stree joins (~stree@68.36.8.116) |
| 2021-03-07 04:43:52 | <swarmcollective> | Three styles that accomplish the same thing "basically". |
| 2021-03-07 04:45:04 | → | ADG1089_ joins (~adg1089@122.163.167.99) |
| 2021-03-07 04:45:53 | <swarmcollective> | The first, though, decouples the function (f3 . f2 . f1) from the parameter "a" such that you could pass (f3 . f2 . f1) as a parameter where (a -> a) is expected. |
| 2021-03-07 04:46:17 | <heck-to-the-gnom> | OK, take this as an example I just tried to work with: `scon arr = last arr : ( reverse $ tail (reverse arr) )`, replacing `$` with `.` doesn't work, why's that? Is it because `.` only works with one argument, and... Well, no... If that was the case, then it'd do nothing 😳 |
| 2021-03-07 04:46:43 | × | frozenErebus quits (~frozenEre@94.128.82.20) (Ping timeout: 245 seconds) |
| 2021-03-07 04:46:45 | <swarmcollective> | Errr: (a -> ?) is expected, since this example doesn't really show the type of the result. |
| 2021-03-07 04:46:47 | <dolio> | ($) and (.) aren't the same function. |
| 2021-03-07 04:46:55 | → | myShoggoth joins (~myShoggot@75.164.81.55) |
| 2021-03-07 04:47:42 | <heck-to-the-gnom> | Of course not, but to me they seem approximately the same, and I'm just trying to understand how to use it. I just simplified a thing I was working on with `flip` and it felt so rewarding |
| 2021-03-07 04:48:02 | × | DataComputist quits (~lumeng@50.43.26.251) (Remote host closed the connection) |
| 2021-03-07 04:48:13 | <heck-to-the-gnom> | or at least, the same outcome, of course, not the same inner workings, otherwise one would've been abandoned at its inception... |
| 2021-03-07 04:48:14 | <swarmcollective> | ( (reverse . tail) (reverse arr) ) |
| 2021-03-07 04:48:18 | × | hive-mind quits (~hivemind@rrcs-67-53-148-69.west.biz.rr.com) (Ping timeout: 260 seconds) |
| 2021-03-07 04:48:19 | <dolio> | Well, if you have `reverse $ tail (reverse arr)` and you just replace `$` with `.`, they would have to be the same function, because they're getting the same arguments. |
| 2021-03-07 04:48:34 | → | bigbosskor joins (~Android@182.232.52.52) |
| 2021-03-07 04:48:37 | × | bigbosskor quits (~Android@182.232.52.52) (Read error: Connection reset by peer) |
| 2021-03-07 04:49:23 | <dolio> | The only reason you can replace a $ with a . with multiple chained $ is that it parses differently, but without multiple operataors it won't. |
| 2021-03-07 04:49:24 | <swarmcollective> | ( (reverse . tail . reverse) arr ) |
| 2021-03-07 04:49:41 | <swarmcollective> | Which is just: init arr |
| 2021-03-07 04:52:09 | × | Tario quits (~Tario@201.192.165.173) (Ping timeout: 264 seconds) |
| 2021-03-07 04:53:42 | <swarmcollective> | so, `scon arr = last arr : init arr` right? |
| 2021-03-07 04:53:48 | <heck-to-the-gnom> | yes |
| 2021-03-07 04:54:09 | <swarmcollective> | Whew, I think that means I'm learning. :) |
| 2021-03-07 04:54:13 | <heck-to-the-gnom> | So... `a . b c d . e f g` == `a (b c d) (e f g)`? Whereas `a $ b c d $ e f g` == `a ( b c d (e f g) )`? If... I'm getting this right |
| 2021-03-07 04:54:21 | <heck-to-the-gnom> | Me too ;) |
| 2021-03-07 04:55:07 | <heck-to-the-gnom> | Since `$` right-associates |
| 2021-03-07 04:55:08 | × | carlomagno quits (~cararell@148.87.23.12) (Quit: Leaving.) |
| 2021-03-07 04:55:29 | → | Tario joins (~Tario@201.192.165.173) |
| 2021-03-07 04:56:29 | → | bigbosskor joins (~Android@182.232.52.52) |
| 2021-03-07 04:56:56 | <swarmcollective> | When I first started learning Haskell, which was on-stream (Twitch), I had one or two people saying "you should use point-free" and another one or two saying "you should use parenthesis, like f (g (h a))" and someone else saying, "you should use $". Arrgghhh! I didn't even know what (f . g) a meant, let alone how to convert it to f (g a) or f $ ga. |
| 2021-03-07 04:57:17 | <swarmcollective> | (err pointful) |
| 2021-03-07 04:57:37 | × | bigbosskor quits (~Android@182.232.52.52) (Read error: Connection reset by peer) |
| 2021-03-07 04:57:37 | <d34df00d> | Can I somehow derive Data.Data for a type like this: https://bpa.st/5I4A ? |
| 2021-03-07 04:57:42 | → | frozenErebus joins (~frozenEre@94.128.82.20) |
| 2021-03-07 04:57:45 | <heck-to-the-gnom> | Parenthesis, when reasonably avioded, are dumb imo |
| 2021-03-07 04:58:10 | <justsomeguy> | That sounds frustrating, swarmcollective |
| 2021-03-07 04:58:51 | <swarmcollective> | I very much appreciate the people trying to help, but one concept at a time would have been easier. |
| 2021-03-07 04:59:03 | → | bigbosskor joins (~Android@182.232.52.52) |
| 2021-03-07 04:59:30 | <justsomeguy> | That's probably hard to coordinate on a platform like twitch. |
| 2021-03-07 04:59:35 | <MarcelineVQ> | but what if you need two concepts at once for either to work? |
| 2021-03-07 04:59:53 | <swarmcollective> | It was when I started working on Haskell in "private" that I finally got the hang of it. I hope it makes sense and you find it useful. heck-to-the-gnom |
| 2021-03-07 05:00:24 | <swarmcollective> | MarcelineVQ: Do you have an example? |
| 2021-03-07 05:00:37 | <swarmcollective> | d34df00d: I'll take a look. |
| 2021-03-07 05:00:40 | <heck-to-the-gnom> | Yeah, I'm just trying to grapple with more concepts, I've successfully made a few things work on my own now. |
| 2021-03-07 05:01:17 | <justsomeguy> | Do you find streaming while you learn stuff helpful, in general? I've never tried that, and now I'm curious. |
| 2021-03-07 05:01:58 | justsomeguy | is also a haskell noob -- about halfway through haskellbook.com with the help of someone here on irc. |
| 2021-03-07 05:02:10 | <MarcelineVQ> | swarmcollective: none that are serious |
| 2021-03-07 05:02:57 | × | frozenErebus quits (~frozenEre@94.128.82.20) (Ping timeout: 264 seconds) |
| 2021-03-07 05:03:10 | <justsomeguy> | I think maybe I'd like to try teaching the book at a meetup or through videos once I've finished it. |
| 2021-03-07 05:03:30 | <justsomeguy> | Then again, I still really suck at programming/haskell. |
| 2021-03-07 05:03:41 | <swarmcollective> | justsomeguy: It depends. I find that streaming can be helpful in that often people will try to help... and by help, I mean give you lots of things to look at (aka distractions). :D But I learn a lot of things that I would never have thought to learn otherwise. |
| 2021-03-07 05:04:00 | × | natechan quits (~natechan@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Quit: WeeChat 2.9) |
| 2021-03-07 05:05:09 | <justsomeguy> | Yes, that seems like it could be distracting, but also fun. I imagine that the enthusasim from other peoplse comments may be helpful to stay motivated. |
| 2021-03-07 05:05:10 | <swarmcollective> | No one should stream with the expectation that it will help you focus. It is nearly impossible to stream and stay focused, unless you ignore the conversation entirely. |
| 2021-03-07 05:06:17 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-03-07 05:06:17 | <swarmcollective> | However, I might not have "found" Haskell if it weren't for people on Twitch recommending I check it out. |
| 2021-03-07 05:06:48 | → | dmwit joins (~dmwit@pool-173-66-86-32.washdc.fios.verizon.net) |
| 2021-03-07 05:06:53 | <justsomeguy> | What do you think of Haskell so far? |
| 2021-03-07 05:06:54 | → | redmp joins (~redmp@172.58.38.218) |
| 2021-03-07 05:07:04 | → | DataComputist joins (~lumeng@50.43.26.251) |
| 2021-03-07 05:07:13 | × | kiweun quits (~kiweun@2607:fea8:2a62:9600:c9:290:3666:3492) (Remote host closed the connection) |
| 2021-03-07 05:07:34 | × | myShoggoth quits (~myShoggot@75.164.81.55) (Ping timeout: 245 seconds) |
| 2021-03-07 05:07:36 | <heck-to-the-gnom> | Programmers on twitch, how interesting. I've really only seen gaming, reactions, or youtube-challenge-type content on twitch before. |
| 2021-03-07 05:08:10 | <swarmcollective> | I really enjoy writing Haskell. I mean, once I understood enough syntax and could (sort of) read error messages, I started to appreciate how helpful the compiler + type system is. |
| 2021-03-07 05:08:25 | × | `slikts quits (~nelabs@wikipedia/reinis) (Ping timeout: 272 seconds) |
| 2021-03-07 05:08:28 | <heck-to-the-gnom> | +1 |
| 2021-03-07 05:09:07 | justsomeguy | 's reactions while learning have spanned a range from "why am I learning this uselsess academic language" to "haskell is super great at making things composible, imperative languages are crazy in comparison" and even "this will be a competitve advantage". |
| 2021-03-07 05:09:14 | <swarmcollective> | heck-to-the-gnom: there are quite a few programming streams on Twitch in the Science and Technology category. The problem is that Science and Technology is a broad category. |
| 2021-03-07 05:10:14 | → | hive-mind joins (~hivemind@rrcs-67-53-148-69.west.biz.rr.com) |
| 2021-03-07 05:10:24 | × | Wuzzy quits (~Wuzzy@p5b0df7c2.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 2021-03-07 05:10:45 | × | ezrakilty quits (~ezrakilty@97-113-55-149.tukw.qwest.net) (Remote host closed the connection) |
| 2021-03-07 05:11:34 | <heck-to-the-gnom> | I started learning it 'cause some Linux youtuber made a video (8 of them now, I think) on how great and customizable XMonad is. That's still the hobby project I've been working on, for ~6 months, on & off now. I think I'm getting close to finishing, I might make a cipher or encryption algorithm for my next project, just to learn. |
| 2021-03-07 05:11:39 | → | `slikts joins (~nelabs@wikipedia/reinis) |
| 2021-03-07 05:12:09 | → | Techcable joins (~Techcable@168.235.93.147) |
| 2021-03-07 05:12:11 | <swarmcollective> | Considering my background, where I started with line-number BASIC and x86 Assembly, moving to a pure-functional language like Haskell, at least at first, felt limiting. That quickly faded when I realized how the type-system was keeping me from doing something that was obviously silly, and the pure-functions kept me from mistakenly overwriting "variables", then I really began to enjoy it. |
| 2021-03-07 05:12:52 | <justsomeguy> | Cool :^). I've found ciphers are good learning projects, generally. |
| 2021-03-07 05:13:40 | <justsomeguy> | Yeah, I really like the idea of non-reassignable name bindings. It makes it easier to track what a vlue will be within a particular scope. |
| 2021-03-07 05:13:46 | <swarmcollective> | d34df00d: That code sample is beyond my knowledge. I am sorry I can't help. |
| 2021-03-07 05:14:44 | → | natechan joins (~natechan@108-233-125-227.lightspeed.sntcca.sbcglobal.net) |
| 2021-03-07 05:15:21 | → | frozenErebus joins (~frozenEre@94.128.82.20) |
| 2021-03-07 05:15:38 | <swarmcollective> | When devs ask me to explain pure functional programming, I typically say "write all `variables` as const or final and you can't use for-loops and while-loops". The typical response is "uhhh... how would that even work." LOL |
| 2021-03-07 05:15:59 | <monochrom> | I started with BASIC too. But I found BASIC the limiting one. |
| 2021-03-07 05:16:16 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 2021-03-07 05:16:24 | <heck-to-the-gnom> | Uh, I'm newer to this, I started as a soy-dev |
| 2021-03-07 05:16:30 | <heck-to-the-gnom> | JS plebian, I once was |
| 2021-03-07 05:17:38 | <swarmcollective> | True, monochrom ... but at the time it was all I had. Well, until the parent of a friend gave me "Turbo Pascal". Then I learned RPG II and OCL. Those were the days. LOL |
| 2021-03-07 05:18:09 | <monochrom> | Even in my BASIC days, I felt mutable variables overrated. They are much needed in BASIC because it lacks mechanisms that make more sense. If you can't even pass parameters when you GOSUB, of course your last resort is mutable variables, and global ones at that. |
| 2021-03-07 05:19:03 | <swarmcollective> | I did very much enjoy writing interrupt handlers in Assembly though. Well, and rewriting the boot sector. ;) |
| 2021-03-07 05:19:51 | <justsomeguy> | Heh, I wonder what that was like. It sounds so different. I only started programming two or three years ago, in Python, which I learned in CS101. Everything has been super high-level. Only now am I starting to learn how to talk to hardware and work with sockets/etc. |
| 2021-03-07 05:20:16 | <swarmcollective> | Imagine what the web would look like today if javascript had been written as a pure-functional language (I mean, as pure-functional as Haskell is). |
| 2021-03-07 05:20:59 | × | geyaeb quits (~geyaeb@gateway/tor-sasl/geyaeb) (Remote host closed the connection) |
| 2021-03-07 05:21:06 | <monochrom> | Very early on I realized that if I'm allowed recursion then I no longer need mutable variables. At least for small types like Int. |
| 2021-03-07 05:21:18 | × | ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Read error: Connection reset by peer) |
All times are in UTC.