|
lol if you cant program by flipping a series of switches on a computer from memory, then you just cant program at all
|
# ? Nov 19, 2014 23:24 |
|
|
# ? May 25, 2024 23:46 |
|
bobbilljim posted:lol if you cant program by flipping a series of switches on a computer from memory, then you just cant program at all If you aren't toggling the os into the supercomputer you built by hand from memory you ain't poo poo. We are all scrubs in comparison
|
# ? Nov 19, 2014 23:37 |
|
CPColin posted:In interviews I've been in on, I've always been prepared to count an answer as correct if the person says, "I don't know, but I'd look here to find out." this is a relief because annoyingly the only sorting algorithms I can remember are the joke ones (bogosort, quantum bogosort, sleepsort, fonzsort)
|
# ? Nov 20, 2014 00:05 |
|
qntm posted:this is a relief because annoyingly the only sorting algorithms I can remember are the joke ones (bogosort, quantum bogosort, sleepsort, fonzsort) remind me what quantum bogosort is
|
# ? Nov 20, 2014 00:10 |
|
an O(n) implementation of bogosort on a quantum computer
|
# ? Nov 20, 2014 00:15 |
|
I must be missing something really obvious here, it's making GBS threads the bed because its expecting an Expr. but the function signature says to except a VarTable, which is defined as H.map String Expr - which is apparetnyl what the function is trying to return, if I am reading that rightcode:
code:
ok I am 99% sure that I am actually somehow ending up trying to return code:
Valeyard fucked around with this message at 00:33 on Nov 20, 2014 |
# ? Nov 20, 2014 00:26 |
|
pseudorandom name posted:an O(n) implementation of bogosort on a quantum computer hahahaha
|
# ? Nov 20, 2014 00:27 |
|
this is a classic mistake and a good reason why 'return' should be called something different. to directly answer your question, you shouldn't use do-notation here, instead structure it like (you could also use "= let ... in ..." if you prefer) code:
*: the 'a' inside of 'Parser a' for example, you never deconstruct Parsers but can only pass them around. you're free to gently caress around with the values of type 'a' as much as you want though. gonadic io fucked around with this message at 00:41 on Nov 20, 2014 |
# ? Nov 20, 2014 00:34 |
|
as for why you get that message, which Map are you using? it looks like it might have a monad instance, so the compiler is assuming that you're using do-notation correctly and inferring the type from that
|
# ? Nov 20, 2014 00:39 |
|
qntm posted:this is a relief because annoyingly the only sorting algorithms I can remember are the joke ones (bogosort, quantum bogosort, sleepsort, fonzsort) Hahaha what the hell is fonzsort? Does it involve jukebox punching?
|
# ? Nov 20, 2014 00:42 |
|
AlsoD posted:this is a classic mistake and a good reason why 'return' should be called something different. to directly answer your question, you shouldn't use do-notation here, instead structure it like (you could also use "_lines = let ... in ma :: VarTable" if you prefer) arghh, I was tricked! the dummy skeleton code for this function had a dummy return statement, so I just assumed it would work that way without thinking about it it is a Data.Map, which also came predefined. if i had used the do notation correctly, would it have involved making the types explicit when doing "let"s?
|
# ? Nov 20, 2014 00:43 |
|
imo those list comprehensions are weird dude.
|
# ? Nov 20, 2014 00:47 |
|
VLADIMIR GLUTEN posted:Hahaha what the hell is fonzsort? Does it involve jukebox punching? tongue punching in teh jukebox
|
# ? Nov 20, 2014 00:48 |
|
i couldn't help myself, i did a little refactoring. you can replace zipk with a list comprehension and then inline kplus and knames to give:code:
|
# ? Nov 20, 2014 00:59 |
|
Valeyard posted:if i had used the do notation correctly, would it have involved making the types explicit when doing "let"s? replace "shouldn't" with "can't" in my previous statement. there is no correct way to use do-notation in this case. do-notation is sugar that makes it easier to work with monads, you're not working inside a monad here so you can't use do-notation. (but no, when using let statements inside do-notation you aren't forced to state all your types explicitly except in edge cases) gonadic io fucked around with this message at 01:14 on Nov 20, 2014 |
# ? Nov 20, 2014 01:00 |
|
AlsoD posted:there is no correct way to use do-notation in this case. do-notation is sugar that makes it easier to work with monads, you're not working inside a monad here so you can't use do-notation. (but no, when using let statements inside do-notation you aren't forced to state all your types explicitly except in edge cases) i went back and looked at the monad section of learnyouahaskell and i see what you are saying there about monads (although most of that chapter is still daunting) AlsoD posted:i couldn't help myself, i did a little refactoring. you can replace zipk with a list comprehension and then inline kplus and knames to give: the question about this is; is it any more efficient? space wise, sure
|
# ? Nov 20, 2014 01:14 |
|
Valeyard posted:the question about this is; is it any more efficient? space wise, sure probably not any faster (or less space) depending on how aggressively the compiler inlines/fuses. anybody else want to weigh in?
|
# ? Nov 20, 2014 01:15 |
|
actually is there a fusion rule for 'zip'? it probably would end up faster then. either way, it won't be an appreciable difference and the refactoring would be for the person reading the code, whether it's future you or a marker
|
# ? Nov 20, 2014 01:20 |
|
Seaside Loafer posted:Good examples: I understand needing to keep the software, but couldn't the hardware be virtualized?
|
# ? Nov 20, 2014 01:20 |
|
hey guys lets talk about monads
|
# ? Nov 20, 2014 01:29 |
|
DimpledChad posted:hey guys lets talk about gonads
|
# ? Nov 20, 2014 01:32 |
|
that's a monads implementation in golang right
|
# ? Nov 20, 2014 01:33 |
|
DimpledChad posted:hey guys lets talk about monads "please work..."
|
# ? Nov 20, 2014 01:35 |
|
as far as anybody who is programming haskell need be concerned, monad means 'can use do-notation on this thing'
|
# ? Nov 20, 2014 02:04 |
|
b-b-but higher-kinded types functor transformation monad laws type theory burritos!
|
# ? Nov 20, 2014 02:07 |
|
Stringent posted:I understand needing to keep the software, but couldn't the hardware be virtualized? Seaside Loafer fucked around with this message at 03:16 on Nov 20, 2014 |
# ? Nov 20, 2014 03:02 |
|
e: quote is not edit
|
# ? Nov 20, 2014 03:15 |
|
as an aside that job told me to redo the exercise and "go crazy" with it so I've made some horrific monstrosity in swing (which actually isn't that bad now that I've sit down with it for a few hours) that I'm getting happier with ui programming is really a pain though.
|
# ? Nov 20, 2014 03:58 |
|
"a picture is worth 1000 words" means that it takes 1k loving works to create a picture
|
# ? Nov 20, 2014 04:02 |
|
uncurable mlady posted:as an aside that job told me to redo the exercise and "go crazy" with it so I've made some horrific monstrosity in swing (which actually isn't that bad now that I've sit down with it for a few hours) that I'm getting happier with That is because you are not using c# and wpf
|
# ? Nov 20, 2014 04:05 |
|
Bloody posted:That is because you are not using c# and wpf or more specifically, its because he is using swing
|
# ? Nov 20, 2014 04:09 |
|
bobbilljim posted:tongue punching in teh jukebox text me
|
# ? Nov 20, 2014 04:09 |
|
Seaside Loafer posted:Pick something you know a shitload about so you dont have to do any systems analysis and just try and write a program to do it. Every time I need to learn a new language I try to write this really complicated board game I played when I was a little kid, I never finish it but by the time im a quarter of the way through ive learnt enough of the language to be ok at it. i think he's referring to the difficulty of jumping from one ecosystem to another like, professionally. learning the new ecosystem isn't the issue, it's doing something worthwhile that you can point to and say 'yes i am a professional user of this thing'
|
# ? Nov 20, 2014 04:12 |
|
there's a heroku issue where a dyno could down and there's no notification so all requests going to that dyno just get stuck until the heroku timeout. apparently this doesn't happen if you pay for the uber-dyno that costs like 10x as much. wtf
|
# ? Nov 20, 2014 04:23 |
|
MeruFM posted:there's a heroku issue where a dyno could down and there's no notification so all requests going to that dyno just get stuck until the heroku timeout. didnt that happen like 2 years ago
|
# ? Nov 20, 2014 04:37 |
|
here is a more general haskell question, for which i am assuming the answer is no based on what ive read, but is there any kind of equivalent functionality of specifying a specific field in a datatype to be what is returned by show? I am trying to test something involving a really nasty data structure, and its reallllly hard to read whats happening, so i just want to get rid of most of the junk its showing me attempting to install one of the pretty print libraries just now Valeyard fucked around with this message at 05:08 on Nov 20, 2014 |
# ? Nov 20, 2014 04:54 |
|
Bloody posted:That is because you are not using c# and wpf im not familiar with c# as well as I am with Java, and the only PC I have access to is really bad and doesn't run VS so hot. Java it is~
|
# ? Nov 20, 2014 05:07 |
|
uncurable mlady posted:im not familiar with c# as well as I am with Java, and the only PC I have access to is really bad and doesn't run VS so hot. Java it is~ You've chosen poorly
|
# ? Nov 20, 2014 05:10 |
|
Bloody posted:You've chosen poorly Mac OS X is the worlds best operation system
|
# ? Nov 20, 2014 05:15 |
|
|
# ? May 25, 2024 23:46 |
|
Valeyard posted:here is a more general haskell question, for which i am assuming the answer is no based on what ive read, but is there any kind of equivalent functionality of specifying a specific field in a datatype to be what is returned by show? I am trying to test something involving a really nasty data structure, and its reallllly hard to read whats happening, so i just want to get rid of most of the junk its showing me are you defining the datatype? you can use record syntax to give your fields names.
|
# ? Nov 20, 2014 05:18 |