Search Haskell Channel Logs

Thursday, February 9, 2017

#haskell channel featuring kadoban, sternmull, glguy, bollu, MarcelineVQ, qmm, and 10 others.

sternmull 2017-02-09 10:45:22
dmwit: I tried both
mniip 2017-02-09 10:45:27
bollu, I have
sternmull 2017-02-09 10:45:33
glguy: thank you, will look up what that means
bollu 2017-02-09 10:45:36
mniip: and thoughts on it?
mniip 2017-02-09 10:45:40
but last time I read this I probably didn't have enough expertise to understand
glguy 2017-02-09 10:45:51
sternmull: You can turn it back on with: :set -XMonomorphismRestriction
glguy 2017-02-09 10:45:57
and it'll be good to read about what it is
bollu 2017-02-09 10:45:59
mniip: I see. do you think it is worth implementing?
bollu 2017-02-09 10:46:29
also, I wish H1B is reversed. It basically fucks all my chances for higher education in the USA :(
mniip 2017-02-09 10:46:57
hmm?
merijn 2017-02-09 10:47:03
bollu: You don't need H1B for studying
monochrom 2017-02-09 10:47:12
bollu: Darth Vader says: Come to Canada!
merijn 2017-02-09 10:47:13
bollu: Those are for jobs
bollu 2017-02-09 10:47:21
merijn: oh, I see
monochrom 2017-02-09 10:47:26
darn
merijn 2017-02-09 10:47:28
bollu: You need a J visum for studying/internships
mniip 2017-02-09 10:47:29
I'm fairly sure you need one for studying
mniip 2017-02-09 10:47:32
though a different one
glguy 2017-02-09 10:47:46
Visa varieties and immigration policies are beyond the topic
sternmull 2017-02-09 10:47:55
glguy: Thank you. As you said turning it on made ghci happy.
bollu 2017-02-09 10:47:57
glguy: sorry :)
kadoban 2017-02-09 10:48:16
You need a visa usually, but H1B is a special type of visa that's typically more restricted.
bollu 2017-02-09 10:48:21
mniip: in the paper, they propose a type system, but no inference algorithm. Is that the norm?
mniip 2017-02-09 10:48:42
I don't know
bollu 2017-02-09 10:48:48
#haskll-overflow <- take the conversation here?
mniip 2017-02-09 10:48:59
I probably know less type theory than you do
bollu 2017-02-09 10:49:04
#haskell-overflow *
dmwit 2017-02-09 10:49:10
sternmull: Another solution, in case you don't want to turn on the dreaded MR, is `rs g = case random g of (val, g') -> val : rs g'`
merijn 2017-02-09 10:49:18
bollu: Pretty sure the type theory is fine here, just the US immigration discussion that is not :p
bollu 2017-02-09 10:49:25
merijn: xD
jle` 2017-02-09 10:49:29
sternmull: turning on the monomorphism restriction in ghci is usually a bad idea. the error here is kind of weird though
dmwit 2017-02-09 10:49:32
sternmull: This forces this particular binding to be monomorphic without forcing all other affected bindings to be monomorphic.
bollu 2017-02-09 10:49:53
why is TaPL not free?
bollu 2017-02-09 10:49:57
(SF is)
merijn 2017-02-09 10:50:04
bollu: Because academic publishers are scum
dmwit 2017-02-09 10:50:05
jle`: I guess this is because of the new pattern-binding desugaring rule that turns this into `let val = fst (random g); g' = snd (random g)` and decouples the types of the two things.
jle` 2017-02-09 10:50:34
wait, what
monochrom 2017-02-09 10:50:42
What is SF?
jle` 2017-02-09 10:50:43
never realized that was a thing now
bollu 2017-02-09 10:50:49
monochrom: software foundations
sternmull 2017-02-09 10:50:52
ok... let me read about the monomorphism stuff. All your good advises are a little bit too much for my tired brain right now :)
merijn 2017-02-09 10:50:52
monochrom: Software Foundations, also by Pierce
jle` 2017-02-09 10:51:45
sternmull: monomorphism restriction is usually the behavior you want when writing source files, but usually the behavior you don't want when using ghci
dmwit 2017-02-09 10:52:00
sternmull: Well, the behavior here surprised me, too, and I think I'm a relatively experienced Haskeller. So don't feel too bad.
jle` 2017-02-09 10:52:50
yeah, heh, i didn't believe there would be an error until i tried it out myself
jle` 2017-02-09 10:53:17
that desugaring rule is a bit odd dmwit. any particular reason it was added?
monochrom 2017-02-09 10:54:12
Oh! Irretuable patterns have a decoupling effect.
bollu 2017-02-09 10:54:24
where is HoTT research being done right now?
dmwit 2017-02-09 10:56:31
jle`: Turns out all possible rules are a bit odd. This was ruled the least odd of all.
dmwit 2017-02-09 10:56:41
jle`: I don't cherish trying to find the mailing list thread discussing this...
jle` 2017-02-09 10:56:51
kind of breaks ghci potentially
jle` 2017-02-09 10:56:53
oh well
merijn 2017-02-09 11:07:02
Christ, Haskell makes me a terrible contributor...
merijn 2017-02-09 11:07:55
I keep submitting PRs without actually bothering to compile things because changes seem so trivial and compiling a shitload of dependencies is annoying >.>
monochrom 2017-02-09 11:09:36
Are you changing code all over the dependencies?
dmwit 2017-02-09 11:10:03
monochrom: I was wondering the same thing. Then I noticed he said "compiling" and not "recompiling".
merijn 2017-02-09 11:10:18
monochrom: No, just small one-of patches
kubbe 2017-02-09 11:11:09
If I were supposed to count each character that occurs in a string, and it is supposed to show up in a table..
monochrom 2017-02-09 11:11:13
I guess it is none of my business. But is it necessary to compile the dependencies for even the second time?
kubbe 2017-02-09 11:11:28
Can I create it without any help-functions? I have a working set of code but it is just way to ugly to submit
merijn 2017-02-09 11:11:48
monochrom: No, I'm saying that Haskell makes the changes look so simple I didn't even compile it the first time >.>
merijn 2017-02-09 11:12:07
monochrom: Hence, why it's making me make terrible PRs >.>
dmwit 2017-02-09 11:13:00
kubbe: We're happy to help you beautify your code. But inventing fresh code for somebody's assignment is questionably ethical.
dmwit 2017-02-09 11:13:09
?paste what you've got
lambdabot 2017-02-09 11:13:09
Haskell pastebin: http://lpaste.net/
merijn 2017-02-09 11:13:18
Speaking of beautifying code...
lpaste_ 2017-02-09 11:13:51
merijn pasted "Ugly..." at http://lpaste.net/8199856595501318144
kubbe 2017-02-09 11:14:03
I absolutely do not want you to give me any answer, I just ask for guidance so I can get to that set of code and understand it myself. I always try to create a working set of code and then "beautify" it and at the same time get it faster! dmwit
monochrom 2017-02-09 11:14:11
Help functions are good ideas.
merijn 2017-02-09 11:14:14
Any suggestions how to make that code less ugly?
kubbe 2017-02-09 11:14:46
Alright, let me enter the code and we'll see if there is something that you could tell me. Promise not to laugh
dmwit 2017-02-09 11:15:13
No promises. But all laughter will come with suggestions. =)
Akii 2017-02-09 11:15:18
kubbe: lpaste though
kubbe 2017-02-09 11:15:29
http://pastebin.com/P8B0eQSX
kubbe 2017-02-09 11:15:41
I dont think I need to import anything else in that for it to work!
monochrom 2017-02-09 11:15:44
I can't promise, but history shows that I don't usually laugh, I usually frown.
merijn 2017-02-09 11:15:56
monochrom: Or sigh :)
dmwit 2017-02-09 11:16:19
kubbe: You might like `partition`.
dmwit 2017-02-09 11:16:20
:t partition
kubbe 2017-02-09 11:16:20
haha monochrom
lambdabot 2017-02-09 11:16:22
(a -> Bool) -> [a] -> ([a], [a])
dmwit 2017-02-09 11:16:59
kubbe: Why build up a `[(Char, Int)]` in `characterCounstAux` instead of building up a `Table Char Int`?
merijn 2017-02-09 11:17:07
oh... actually, I guess I could just move the when block into a let bound value and use it in the different cases...
kubbe 2017-02-09 11:17:49
Since I struggled for hours to get it to work that way, but I only got it to work for the first character in the string.. And then I decided I'll go with some help-functions to make it go through the entire string and then end up in the "table char int"
merijn 2017-02-09 11:20:03
No ideas on my code?
dmwit 2017-02-09 11:21:13
kubbe: Sorry for phrasing that as a question. What I really meant was: you should try building up a `Table Char Int` directly instead of building up a `[(Char, Int)]` only to tear it down and make a `Table Char Int` out of it.
kubbe 2017-02-09 11:21:57
Yes! Okey, let me give it a shot.. I am going to show you what I were able to create before. I need some assistance to get it be recursive and go through the list
dmwit 2017-02-09 11:22:40
We'll be happy to help with that. =)
kubbe 2017-02-09 11:23:17
http://pastebin.com/bz7Mirab
monochrom 2017-02-09 11:23:32
kubbe: Basically you can get rid of characterCountsAuxAux, and change characterCountsAux to update Tabe directly (String -> Table Char Int -> Table Char Int)
kubbe 2017-02-09 11:23:56
I can see two faults with this: 1. It just counts the first letter. 2. it will say the length on the array, not acutally count it so the result is -1.
dmwit 2017-02-09 11:24:11
kubbe: I recommend you start from the code in your previous paste.
dmwit 2017-02-09 11:24:22
kubbe: Beautify something that's working, not something that doesn't work. =)
monochrom 2017-02-09 11:24:46
Well, that actually depends
kubbe 2017-02-09 11:25:05
Hmm, okey! Interesting. But it just way to ugly, I want to delete half before even trying
MarcelineVQ 2017-02-09 11:25:13
merijn: your = should be -> in Just a's case expression
MarcelineVQ 2017-02-09 11:26:20
*Just a's guards
monochrom 2017-02-09 11:26:51
As it turns out, the broken version can be fixed and will become the simplest.
merijn 2017-02-09 11:27:17
MarcelineVQ: Eh, right. but that doesn't make it substantially less sucky :p
dmwit 2017-02-09 11:28:02
Okay. Two guides is too many; I defer to monochrom. monochrom, please ping me if you need to leave and I will pick up wherever you left off.
MarcelineVQ 2017-02-09 11:29:01
merijn: no, I am having trouble parsing it to see what can be done though :> for instance lf on line 9 doesn't seem to come from anywhere
merijn 2017-02-09 11:29:30
MarcelineVQ: Yeah, lemme fix it. That's what I get for copying mid refactoring
kubbe 2017-02-09 11:30:40
monochrom, yes this is what I think aswell.. Less is more for all haskellers, I have been told!
kubbe 2017-02-09 11:34:22
Okey.. So monochrome, is it to much to ask you if it the solution has to do with the use of guards, or recursive on the same line?
monochrom 2017-02-09 11:34:40
No guards.
monochrom 2017-02-09 11:35:04
You have always been doing recursive on the same line.
qmm 2017-02-09 11:35:56
i think hvr is too busy to answer, could someone help me this question: https://github.com/hvr/cassava/issues/130
kubbe 2017-02-09 11:36:05
Yeah, but with a bunch of piece of shit Aux :D
monochrom 2017-02-09 11:36:32
You can work on the working version first. It brings you understanding.
kubbe 2017-02-09 11:37:06
Yes, i am going to try!
monochrom 2017-02-09 11:37:34
That understanding will help you see what you're missing in the broken version, if you have time later. (And it will be obvious in retrospect.)
monochrom 2017-02-09 11:39:07
qmm: You can just use [ByteString] for each row. (Therefore [[ByteString]] for the whole table. Or Vector something.)
monochrom 2017-02-09 11:40:22
Vector [ByteString] and [Vector ByteString] are also possible.
kubbe 2017-02-09 11:41:43
Nah, I will have to continue this another night.. Need to sleep! Well thank you for now. Cya!
tibbe 2017-02-09 11:44:24
qmm, you want to parse into e.g. the Vector or HashMap generic representations
lpaste_ 2017-02-09 11:44:32
samcal pasted "GADT AST Lambdas" at http://lpaste.net/352288
tibbe 2017-02-09 11:44:36
qmm, e.g. parse ... :: HashMap ByteString ByteString
tibbe 2017-02-09 11:44:55
qmm, you might need to the manually parse the bytestrings in the first column before manipulating them