Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-13 13:35:09 <ski> iow, you're (colloquially speaking) attempting to pass three parameters to `print' : `eval',`x',`0'
2021-04-13 13:35:29 <ski> however, you actually *wanted* to call `eval' with two parameters, and pass the *result* of that to `print'
2021-04-13 13:35:29 alexm_ joins (~alexm_@161.8.254.229)
2021-04-13 13:36:11 <Komrad_Kafuka> It's a little hard to wrap your head around specially if you are used to imperative style, it's going to be hard before it make sense I guess
2021-04-13 13:36:56 × ddellacosta quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection)
2021-04-13 13:37:03 <ski> learning a different programming paradigm will be a little bit like learning to program from scratch, all over again. do you remember how long time it took, to get used to imperative programming ? to understand loops, assignment of mutable variables ?
2021-04-13 13:38:08 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-13 13:38:27 <ski> people who already know another paradigm definitely have to do some unlearning, when learning a new one. it's been suggested that it might be easter to learn FP, as a complete newbie to programming (i'm not sure how true this is, but it seems to me that there's some trace of truth in it, at least)
2021-04-13 13:38:48 × xlei quits (znc@unaffiliated/xlei) (Quit: ZNC - https://znc.in)
2021-04-13 13:39:39 <Komrad_Kafuka> yeah, it's like learning programming all over again, could you please solve this for me ? I really want to learn how to do this
2021-04-13 13:39:48 <ski> it tends to be better to suspend judgement, to not try to compare with what you already know, as you're learning a new paradigm (as opposed to learning yet another language in the same paradigm). you're in a better position to compare, when you've got more under your belt (because obviously a lot does carry over. just quite a bit less than people often tend to assume)
2021-04-13 13:41:08 <ski> anyway, imho, the gains that you get, is well worth the effort. giving you another viewpoint, another set of tools you can apply and tackle problems with. and in the end, it's just that, another toolset
2021-04-13 13:42:01 <Komrad_Kafuka> yeah heard it's awesome to write parsers with so I am learning
2021-04-13 13:42:01 Pickchea joins (~private@unaffiliated/pickchea)
2021-04-13 13:42:22 <ski> (sorry for the rantish, but i believe it helps to repeat these basic points, to FP beginners, to set expectations right)
2021-04-13 13:42:30 <ski> what's the whole list of errors that you get ?
2021-04-13 13:43:39 <ski> (and yes, it will take some amount of time. don't try to rush it too much. try to have fun, if you can. that tends to help with learning)
2021-04-13 13:43:44 × kini quits (~kini@unaffiliated/kini) (Remote host closed the connection)
2021-04-13 13:43:48 <Komrad_Kafuka> here you go https://paste.tomsmeding.com/yUg3QcE0
2021-04-13 13:44:09 × alexm_ quits (~alexm_@161.8.254.229) (Ping timeout: 265 seconds)
2021-04-13 13:44:30 mnrmnaugh joins (~mnrmnaugh@unaffiliated/mnrmnaugh)
2021-04-13 13:45:03 kini joins (~kini@unaffiliated/kini)
2021-04-13 13:45:35 <ski> (i'd rather prefer to not simply hand out solutions to exercises. you'll learn much better, by struggling a bit, perhaps banging your head against the wall a bit, and realizing the problem in your mistakes. however, of course, asking for conceptual understanding, and what went wrong, and what would be good to try instead, is quite fine)
2021-04-13 13:45:48 <ski> ok, so consider e.g.
2021-04-13 13:45:51 <ski> pow(x count)
2021-04-13 13:46:09 <ski> this means : call the function `x' with input `count', and pass the result of that call to the function `pow'
2021-04-13 13:46:10 xlei joins (znc@unaffiliated/xlei)
2021-04-13 13:46:23 <ski> .. hopefully it should be clear why that is an error here
2021-04-13 13:46:34 <ski> eval (x (count + 1))
2021-04-13 13:46:37 <ski> has the same problem
2021-04-13 13:46:38 dmytrish joins (~mitra@2a02:8084:a82:d900:f811:9873:2623:c28b)
2021-04-13 13:46:57 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection)
2021-04-13 13:47:11 × AkechiShiro quits (~AkechiShi@2a01:e0a:5f9:9681:58c8:ec73:6b59:f408) (Quit: WeeChat 2.9)
2021-04-13 13:47:15 <Komrad_Kafuka> uhuh ... yeah that's clear but we need the brackets don't we as you already demonstrated
2021-04-13 13:47:21 <ski> (also, not trying to rush you or anything, but you didn't get around to fixing the problem with your `print', yet)
2021-04-13 13:47:25 <ski> no
2021-04-13 13:47:34 <Komrad_Kafuka> because pow x count becomes (pow x) count
2021-04-13 13:47:49 <ski> yes, which is fine
2021-04-13 13:47:50 <ski> eval x count
2021-04-13 13:47:51 <ski> means
2021-04-13 13:47:55 <ski> (eval x) count
2021-04-13 13:48:06 <ski> and either is fine to write (but usually people prefer to read the former)
2021-04-13 13:48:11 <ski> however
2021-04-13 13:48:14 <ski> eval (x count)
2021-04-13 13:48:21 <ski> is something completely different
2021-04-13 13:48:42 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-13 13:48:47 <ski> (in your case, something nonsensical, since `x' is not a function)
2021-04-13 13:50:06 ksamak joins (~ksamak@185.169.233.12)
2021-04-13 13:50:26 <ski> perhaps to clarify : in your latest paste, you introduced two problems you didn't have before, while solving one earlier problem, and not solving another earlier problem
2021-04-13 13:51:30 <Komrad_Kafuka> yeah I got it , fixed all that , is this correct ? :- print eval (x 0)
2021-04-13 13:51:37 <Komrad_Kafuka> for printing
2021-04-13 13:52:17 Unhammer joins (~Unhammer@gateway/tor-sasl/unhammer)
2021-04-13 13:52:18 <ski> not exactly
2021-04-13 13:52:20 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection)
2021-04-13 13:52:21 × rj quits (~x@gateway/tor-sasl/rj) (Ping timeout: 240 seconds)
2021-04-13 13:52:35 <ski> you want to pass `x' and the initial value of the counter, to `eval', then pass the result of that to `print'
2021-04-13 13:52:49 elfets_ joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)
2021-04-13 13:53:40 <Komrad_Kafuka> so the error that I'm having https://paste.tomsmeding.com/ny9K69ti is because of this right ? so what does my experssion indicate ?
2021-04-13 13:54:11 × Lowl3v3l quits (~Lowl3v3l@dslb-002-207-103-026.002.207.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
2021-04-13 13:55:00 Lowl3v3l joins (~Lowl3v3l@2.207.103.26)
2021-04-13 13:55:40 geekosaur joins (930099da@rrcs-147-0-153-218.central.biz.rr.com)
2021-04-13 13:55:41 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 240 seconds)
2021-04-13 13:55:41 × sayola quits (~vekto@dslb-002-201-085-157.002.201.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
2021-04-13 13:56:14 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-13 13:56:18 sayola joins (~vekto@2.201.85.157)
2021-04-13 13:56:35 rj joins (~x@gateway/tor-sasl/rj)
2021-04-13 13:56:55 × drbean_ quits (~drbean@TC210-63-209-59.static.apol.com.tw) (Quit: ZNC 1.8.2+cygwin2 - https://znc.in)
2021-04-13 13:57:09 prinned joins (~vivek@103.206.114.124)
2021-04-13 13:57:13 × cafce25 quits (~cafce25@ipbcc3009d.dynamic.kabel-deutschland.de) (Ping timeout: 240 seconds)
2021-04-13 13:57:44 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-13 13:57:57 × Komrad_Kafuka quits (cbd4caba@203.212.202.186) (Quit: Connection closed)
2021-04-13 13:58:29 × whatisRT quits (~whatisRT@91.65.106.51) (Ping timeout: 246 seconds)
2021-04-13 13:59:10 ski blinks
2021-04-13 13:59:11 × Lowl3v3l quits (~Lowl3v3l@2.207.103.26) (Ping timeout: 246 seconds)
2021-04-13 14:00:24 Nicolai joins (5473e122@84-115-225-34.cable.dynamic.surfer.at)
2021-04-13 14:00:45 × tv quits (~tv@unaffiliated/tv) (Ping timeout: 260 seconds)
2021-04-13 14:00:48 Nicolai is now known as Guest42754
2021-04-13 14:00:49 × sayola quits (~vekto@2.201.85.157) (Ping timeout: 252 seconds)
2021-04-13 14:00:51 × rj quits (~x@gateway/tor-sasl/rj) (Remote host closed the connection)
2021-04-13 14:01:12 rj joins (~x@gateway/tor-sasl/rj)
2021-04-13 14:01:55 × Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 252 seconds)
2021-04-13 14:02:45 × jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
2021-04-13 14:03:30 jamm_ joins (~jamm@unaffiliated/jamm)
2021-04-13 14:03:33 <Guest42754> HI, does someone know how to install Haskell on a MacBook newest version? Whenever I download and try to run ghci, it says "zsh: command not found: ghci"
2021-04-13 14:03:53 × jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
2021-04-13 14:03:59 × mnrmnaugh quits (~mnrmnaugh@unaffiliated/mnrmnaugh) (Remote host closed the connection)
2021-04-13 14:04:27 × hiroaki_ quits (~hiroaki@2a02:8108:8c40:2bb8:c438:feb2:e809:229a) (Ping timeout: 260 seconds)
2021-04-13 14:05:15 whatisRT joins (~whatisRT@ip5b416a33.dynamic.kabel-deutschland.de)
2021-04-13 14:05:16 tv joins (~tv@unaffiliated/tv)
2021-04-13 14:05:46 × tv quits (~tv@unaffiliated/tv) (Client Quit)
2021-04-13 14:06:00 tv joins (~tv@unaffiliated/tv)
2021-04-13 14:06:05 × tv quits (~tv@unaffiliated/tv) (Client Quit)
2021-04-13 14:06:15 Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas)
2021-04-13 14:06:19 tv joins (~tv@unaffiliated/tv)
2021-04-13 14:06:28 nbloomf joins (~nbloomf@2600:1700:ad14:3020:3117:c681:fa07:7f26)
2021-04-13 14:06:35 <hypercube> hi Guest42754
2021-04-13 14:06:49 <hypercube> do you have brew setup?
2021-04-13 14:06:50 hiroaki_ joins (~hiroaki@2a02:8108:8c40:2bb8:c438:feb2:e809:229a)
2021-04-13 14:07:01 sayola joins (~vekto@dslb-002-201-085-157.002.201.pools.vodafone-ip.de)
2021-04-13 14:07:06 howdoi joins (uid224@gateway/web/irccloud.com/x-tzexppsgjjqaiofw)

All times are in UTC.