Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 83 84 85 86 87 88 89 90 91 92 93 .. 5022
502,152 events total
2020-09-20 04:25:17 <ski> so .. `compute' is a function that computes/returns an action
2020-09-20 04:25:41 <sepi> I know I would want (y:ys) to be where y gets thrown out, next in ys becomes y. Now I'm trying to figure out how to translate that over
2020-09-20 04:25:50 <ski> the line in which you currently need `IO Blah', while you actually only have something of type `Blah' in
2020-09-20 04:26:12 <ski> sepi : perhaps try throwing out `y', then
2020-09-20 04:26:13 <lechner> so it goes before, which makes it kind of ling
2020-09-20 04:26:19 <lechner> long
2020-09-20 04:26:51 <ski> you mean the line of code ?
2020-09-20 04:27:16 <lechner> i am sticking in before the last line of compute
2020-09-20 04:28:05 <lechner> something is wrong
2020-09-20 04:29:07 × Orbstheorem quits (~roosember@hellendaal.orbstheorem.ch) (Ping timeout: 240 seconds)
2020-09-20 04:29:13 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-09-20 04:29:54 <ski> sepi : btw, you didn't say what `memb' is supposed to compute
2020-09-20 04:31:30 ski idly wonders what lechner is trying
2020-09-20 04:31:35 × ambiso quits (~ambiso@209.182.239.205) (Quit: Ping timeout (120 seconds))
2020-09-20 04:31:54 ambiso joins (~ambiso@209.182.239.205)
2020-09-20 04:32:15 <sepi> its supposed to compute true or false, saying true"abc" is in there, or false it isn't in there
2020-09-20 04:32:15 × irc_user quits (uid423822@gateway/web/irccloud.com/x-yamugsoddzfdaipx) (Quit: Connection closed for inactivity)
2020-09-20 04:32:20 <lechner> i feel so dumb. i can't put this line in the right place: return :: Char8.ByteString -> IO Char8.ByteString
2020-09-20 04:32:22 <sepi> I think I got it though
2020-09-20 04:33:00 <sepi> Thanks I was here for a few hours to get to this point, appreciate your push in the right direction
2020-09-20 04:33:03 <ski> sepi : what is `memb x ys' supposed to compute, for an arbitrary `x' and list `ys' ?
2020-09-20 04:34:09 <ski> lechner : oh, i should clarify that i only intended you to use `return'. the `:: Char8.ByteString -> IO Char8.ByteString' was only a clarification, to tell you what type it would have, in your case
2020-09-20 04:34:24 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds)
2020-09-20 04:34:28 <ski> sepi : show the code ?
2020-09-20 04:35:37 <ski> (if you really want to, you could type in `return :: Char8.ByteString -> IO Char8.ByteString' .. but you'd have to bracket it like `(return :: Char8.ByteString -> IO Char8.ByteString)')
2020-09-20 04:37:33 <lechner> i was just missing some parentheses (or perhaps a dollar sign). return is a function!
2020-09-20 04:37:39 <ski> yes, of course
2020-09-20 04:37:44 <ski> it has a `->' in its type
2020-09-20 04:38:08 <ski> all values whose types are of the general shape `... -> ...' are functions
2020-09-20 04:38:09 <lechner> doesn't everything in Haskell? :)
2020-09-20 04:38:14 <ski> (and only those are functions)
2020-09-20 04:38:18 <lechner> just kidding
2020-09-20 04:38:37 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:7d39:b02b:8868:9bea) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-09-20 04:38:46 <ski> yea .. "Everything is a function" does not hold in the Functional Programming paradigm
2020-09-20 04:38:58 <lechner> it was a bad joke
2020-09-20 04:39:00 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-09-20 04:39:55 <ski> see <http://conal.net/blog/posts/everything-is-a-function-in-haskell> :)
2020-09-20 04:41:00 <ski> lechner : so .. how does your `compute' look, now ?
2020-09-20 04:41:15 <sepi> memb x [] = Falsememb x (y:ys) | x `elem` y:ys = True | otherwise = mMemb where mMemb = memb x (ys)
2020-09-20 04:41:56 <ski> that's better
2020-09-20 04:42:17 <lechner> ski: it's working. https://dpaste.com/CBE8R6EU2
2020-09-20 04:42:20 <ski> sepi : although that code not had redundant functionality
2020-09-20 04:42:22 <ski> er
2020-09-20 04:42:25 <ski> sepi : although that code now had redundant functionality
2020-09-20 04:42:32 <lechner> ski: I am just getting the hang of it. thanks so much for your help.
2020-09-20 04:43:08 <lechner> ski: i'll be back. my first day with haskell is ending, and it's time to call it a night.
2020-09-20 04:43:09 <sepi> the extra where part?
2020-09-20 04:43:10 <ski> lechner : yea. btw, i would probably write that last line as `return (hashMethod (Char8.pack contents))'
2020-09-20 04:43:27 <lechner> that's what I had. why is that superior, please?
2020-09-20 04:43:33 <ski> sepi : no, not that
2020-09-20 04:43:48 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds)
2020-09-20 04:44:12 <ski> sepi : can you tell me, in words, what `memb x ys' is supposed to compute/check ?
2020-09-20 04:44:25 <ski> lechner : it uses less `$'s :)
2020-09-20 04:44:43 Orbstheorem joins (~roosember@hellendaal.orbstheorem.ch)
2020-09-20 04:44:47 <ski> `$' rarely improve code, imho
2020-09-20 04:44:58 <sepi> the x = y:ys ?
2020-09-20 04:45:11 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:118d:2a8:7881:1f11)
2020-09-20 04:45:19 __Joker joins (~Joker@180.151.105.65)
2020-09-20 04:45:26 <ski> sepi : that question was not about your code, but about what behaviour your code is supposed to have
2020-09-20 04:46:03 <lechner> thanks again for all your help! unfortunately, i have to go but thanks to you my experience in this channel was super
2020-09-20 04:46:06 <sepi> Its supposed to check if what's given in x is in the ys list
2020-09-20 04:46:07 brandly joins (~brandly@c-73-68-15-46.hsd1.ma.comcast.net)
2020-09-20 04:46:35 <ski> lechner : in general, it's probably better to replace `f $ g $ h $ x' with `f . g . h $ x' or (i prefer) `(f . g . h) x' .. or just `f (g (h x))' (brackets are nothing to be afraid of)
2020-09-20 04:46:54 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:118d:2a8:7881:1f11) (Client Quit)
2020-09-20 04:47:22 <ski> lechner : the `f . g . h' "chain"/"pipeline" is better, since you can break out and factor away any part of it, giving it a new name. not so with the repeated `$'s
2020-09-20 04:47:58 <ski> lechner : have fun, and good luck with your continued learning
2020-09-20 04:48:08 <ski> sepi : yes, thank you
2020-09-20 04:48:39 <ski> sepi : now, what is x `elem` ys supposed to compute/check ?
2020-09-20 04:52:01 × perrier-jouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 2.9)
2020-09-20 04:52:12 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:118d:2a8:7881:1f11)
2020-09-20 04:53:27 hackage tagstew 0 - Black magic tagsoup https://hackage.haskell.org/package/tagstew-0 (FumiakiKinoshita)
2020-09-20 04:54:14 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2020-09-20 04:55:57 × Orbstheorem quits (~roosember@hellendaal.orbstheorem.ch) (Ping timeout: 260 seconds)
2020-09-20 04:57:42 <sepi> I see that is my redundant part 😅
2020-09-20 04:59:09 <sepi> I'm not sure without my = true, my | becomes a parse error input
2020-09-20 04:59:40 <ski> how do you mean ?
2020-09-20 05:01:54 mmohammadi981261 joins (~mmohammad@5.238.182.51)
2020-09-20 05:02:15 <sepi> does it need a true or false claim before using otherwise?
2020-09-20 05:02:30 × urodna quits (~urodna@unaffiliated/urodna) (Quit: urodna)
2020-09-20 05:02:32 <ski> a guard, introduced by the
2020-09-20 05:02:56 <ski> `|' symbol, expects an expresion evaluating to `True' or `False', after it, yes
2020-09-20 05:04:40 × shad0w_ quits (~shad0w_@160.202.36.27) (Remote host closed the connection)
2020-09-20 05:05:58 <sepi> memb x (y:ys) | x == y = True | otherwise = mMemb
2020-09-20 05:06:21 <sepi> that gets rid of redundancy correct
2020-09-20 05:06:22 <ski> yay :)
2020-09-20 05:06:28 <ski> yes
2020-09-20 05:07:11 <sepi> 💀💀 thank you
2020-09-20 05:07:16 <ski> now, do you know how to express this using, say, `if'-`then'-`else', instead of guards ?
2020-09-20 05:07:24 <ski> (or any other way ?)
2020-09-20 05:07:28 hackage typesafe-precure 0.7.9.1 - Type-safe transformations and purifications of PreCures (Japanese Battle Heroine) https://hackage.haskell.org/package/typesafe-precure-0.7.9.1 (igrep)
2020-09-20 05:08:20 × mmohammadi981261 quits (~mmohammad@5.238.182.51) (Quit: I quit (╯°□°)╯︵ ┻━┻)
2020-09-20 05:08:25 × Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-157-9.dhcp-dynamic.fibreop.nb.bellaliant.net) (Remote host closed the connection)
2020-09-20 05:08:32 × ericsagnes quits (~ericsagne@2405:6580:0:5100:64a7:3952:c5b0:2946) (Ping timeout: 260 seconds)
2020-09-20 05:09:49 Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-157-9.dhcp-dynamic.fibreop.nb.bellaliant.net)
2020-09-20 05:11:41 × HarveyPwca quits (~HarveyPwc@c-98-220-98-201.hsd1.il.comcast.net) (Quit: Leaving)
2020-09-20 05:13:24 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-09-20 05:13:26 Lord_of_Life_ joins (~Lord@unaffiliated/lord-of-life/x-0885362)
2020-09-20 05:14:12 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 272 seconds)
2020-09-20 05:14:48 Lord_of_Life_ is now known as Lord_of_Life
2020-09-20 05:16:31 <sepi> I know how I'd want to do it conceptually but I'm not too sure on the syntax
←Prev  Next→
Page 1 .. 83 84 85 86 87 88 89 90 91 92 93 .. 5022

All times are in UTC.