Search Haskell Channel Logs

Saturday, February 18, 2017

#haskell channel featuring clmg, bollu, lalalala, jle`, lambdabot, tom7942,

jle` 2017-02-18 09:27:31
delYsid: what you have is set manager (Left settings) defaults
jle` 2017-02-18 09:29:14
if you want to set a specific field, if you have a lens availab,e you can do `set (manager . _Left . nameOfField) defaults`
clmg 2017-02-18 09:59:13
How do I use maybes with fclabels?
clmg 2017-02-18 09:59:33
For instance if I want to set (c . Just b . a) how?
lalalala 2017-02-18 10:26:03
How do I use local functions when I use IO?
lalalala 2017-02-18 10:26:16
when the function returns a IO type*
tom7942 2017-02-18 10:26:44
fmap
stevenxl 2017-02-18 10:29:49
Hi folks. I want to check if I understand right / left associativity correctly. Left associativity means that, if I fully parenthesis an expression, I would start with the parenthesis on the left. For example, functions are left associative, so add 1 2 is equivalent to (add 1) 2.
stevenxl 2017-02-18 10:31:06
Right associativity means that, if I fully parenthesis an expression, I would start with the parenthesis on the right. For example, the cons operator is right associative, so 1:2:3:[] is equivalent to (1:(2:(3:[])))
tom7942 2017-02-18 10:32:28
helps to use mathematical operators like ^ and (+ - * / )
tom7942 2017-02-18 10:35:05
is it 5^(4^(3^2)) or ((5^4)^3)^2 ?
lalalala 2017-02-18 10:35:29
someone knows how to help me with what I wrote earlier? :)
bollu 2017-02-18 10:35:36
lalalala: what was the question?
monochrom 2017-02-18 10:35:40
> [5^4^3^2, 5^(4^(3^2)), ((5^4)^3)^2]
lambdabot 2017-02-18 10:35:44
[620606987866087447074832055728467930919421926519911717317738324478446890420...
monochrom 2017-02-18 10:35:48
oops
bollu 2017-02-18 10:35:53
monochrom: modulo 12 or something
monochrom 2017-02-18 10:36:02
oh, good idea
lalalala 2017-02-18 10:36:09
bollu: How do I use local functions when the functions returns a IO type?
bollu 2017-02-18 10:36:15
> map `mod 17` [5^4^3^2, 5^(4^(3^2)), ((5^4)^3)^2]
monochrom 2017-02-18 10:36:16
> map (`mod` 12) [5^4^3^2, 5^(4^(3^2)), ((5^4)^3)^2]
lalalala 2017-02-18 10:36:17
function*
lambdabot 2017-02-18 10:36:19
:1:10: error: parse error on input '17'
lambdabot 2017-02-18 10:36:21
[1,1,1]
bollu 2017-02-18 10:36:22
fuck, I fucked p
bollu 2017-02-18 10:36:23
xD
bollu 2017-02-18 10:36:24
lol
monochrom 2017-02-18 10:36:31
12 is no good
bollu 2017-02-18 10:36:33
> map `mod` 17 [5^4^3^2, 5^(4^(3^2)), ((5^4)^3)^2]
bollu 2017-02-18 10:36:37
prime should be better
lambdabot 2017-02-18 10:36:37
error:
lambdabot 2017-02-18 10:36:37
• Could not deduce (Num t0)
lambdabot 2017-02-18 10:36:37
from the context: (Num ([t] -> (a -> b) -> [a] -> [b]),
monochrom 2017-02-18 10:36:38
> map (`mod` 17) [5^4^3^2, 5^(4^(3^2)), ((5^4)^3)^2]
lambdabot 2017-02-18 10:36:41
[1,1,16]
bollu 2017-02-18 10:36:45
argh, yes, thanks
monochrom 2017-02-18 10:37:19
@quote monochrom 17
lambdabot 2017-02-18 10:37:19
monochrom says: I am 17-ary, going on 18-ary, I can take curry of you
bollu 2017-02-18 10:37:21
lalalala: what does "local function" mean?
tom7942 2017-02-18 10:37:34
lol
lalalala 2017-02-18 10:37:35
bollu: let me show ya, a sec
tom7942 2017-02-18 10:38:38
lalalala: lift functions over structure with fmap
lalalala 2017-02-18 10:38:58
bollu: https://gist.github.com/freddedotme/caab60ab11f2964d666814f2a67a1bae
lalalala 2017-02-18 10:39:00
tom7942: what?
bollu 2017-02-18 10:39:56
lalalala: oh, IIRC, where and do do not play well. Instead, use let
monochrom 2017-02-18 10:40:32
I think this "where" should be fine. What's the problem?
bollu 2017-02-18 10:40:32
lalalala: or you can use a let inside the do
lalalala 2017-02-18 10:40:32
it isn't since return is running and it will never reach it
lalalala 2017-02-18 10:40:38
^monochrom
bollu 2017-02-18 10:40:45
monochrom: is it?
bollu 2017-02-18 10:40:48
monochrom: I'm not sure
lalalala 2017-02-18 10:40:57
it will compile and never run the where bollu
bollu 2017-02-18 10:41:05
lalalala: what do you mean?
lalalala 2017-02-18 10:41:14
bollu: the functions stops after return as it should
bollu 2017-02-18 10:41:48
lalalala: wait, what happens when you run this piece of code, exactly?
monochrom 2017-02-18 10:41:58
What is inside "..."?
lalalala 2017-02-18 10:42:09
bollu: it compiles and ends the function at return
lalalala 2017-02-18 10:42:24
monochrom: let me update it
bollu 2017-02-18 10:42:38
lalalala: that is not the way "where" works, or "return" for that matter.
lalalala 2017-02-18 10:43:16
bollu: how come it compiles then and runs?
bollu 2017-02-18 10:43:27
lalalala: because you're not doing anything syntactically wrong
bollu 2017-02-18 10:43:41
lalalala: but I think you have misunderstood return, and haskell's evaluation model
lalalala 2017-02-18 10:44:39
bollu: now it works as where should, weird, no idea what I did wrong earlier
monochrom 2017-02-18 10:44:49
OK good.
monochrom 2017-02-18 10:45:01
"did not save the file" or something
lalalala 2017-02-18 10:45:12
monochrom: :p probably... smh