Starfflame 2017-02-25 22:33:15
I probably should not mention specifics of what i am doing
Cale 2017-02-25 22:33:26
But I'm so much more productive in Haskell now than I *could be* with any popular imperative language. It's so nice when you realise that you can make refactors to codebases that involve hundreds of changes across dozens of files and when the compiler stops telling you what to change next, it all works.
Starfflame 2017-02-25 22:34:25
i feel there is a chance my professor could be on here and theres only a handful of people in the class so XD
ongy 2017-02-25 22:35:08
I think there's public logs of this channel, so don't slander to much
Starfflame 2017-02-25 22:35:22
i don't slander
ongy 2017-02-25 22:37:25
debugging in haskell: Run the compiler
Starfflame 2017-02-25 22:37:48
my haskell prof is actually really fucking awesome, it's just haskell i dont like, lol
tsahyt 2017-02-25 22:39:24
is there a vim syntax file that doesn't choke on OverloadedLabels?
Cale 2017-02-25 22:39:24
Where I work, for one of our clients we've been building an application which is aimed at being a competitor to Slack, with a bunch of extra features (email can be sent and received by a chat channel, there are a bunch of organisational and task management features, surveys, and various other stuff) -- it took my coworker and I just three days of pair programming to convert it to a multi-tenant architecture, since we basically changed
Cale 2017-02-25 22:39:24
the type of our authentication tokens and had the compiler tell us everywhere that we needed to adjust things.
Cale 2017-02-25 22:39:24
Usually you'd expect that kind of a refactor to take weeks -- if you were going to attempt it at all rather than just starting over :)
Starfflame 2017-02-25 22:39:31
hm
Cale 2017-02-25 22:39:56
Haskell's type system has consistently been a huge help
sbrg 2017-02-25 22:39:57
Cale: sweet :)
Starfflame 2017-02-25 22:40:22
Haskell's type system just gives me a middle finger all the time XD
ongy 2017-02-25 22:40:36
imo the type system is *the* reason to use haskell
sbrg 2017-02-25 22:40:44
It starts making sense after a while. Then it's the only thing that makes sense
Cale 2017-02-25 22:40:53
Starfflame: Right, because it knows you don't know what you're doing yet :)
Cale 2017-02-25 22:41:15
Once you *do*, it will catch all your slip ups and mistakes and you'll love it
ongy 2017-02-25 22:41:40
also ghc error messages are somewhat sane. Compared to other type errors you may get
Starfflame 2017-02-25 22:41:52
My biggest problem is converting what I want into a function
tsahyt 2017-02-25 22:42:01
ongy: sane yes, but confusing for someone not used to them
ongy 2017-02-25 22:42:17
from a syntax perspective? or what makes most problems for you?
Starfflame 2017-02-25 22:43:39
just laying it out
Cale 2017-02-25 22:44:13
Yeah, it also takes a while just to think in terms of what you have and what you want to produce
Starfflame 2017-02-25 22:44:15
i'm used to saying do this loop, change this variable etc
sm 2017-02-25 22:44:21
Starfflame, I found this helpful: set up a rapid feedback loop, I recommend ghcid for this. Start with a compiling program, then make very small changes at a time. Literally one character at a time if necessary
ongy 2017-02-25 22:45:09
that certainly. When I started out and got cpp sized errors I didn't get anything either.
sbrg 2017-02-25 22:45:30
Starfflame: yep, adjusting to the new paradigm can be difficult
sbrg 2017-02-25 22:45:30
but at some point it will just 'click'
Starfflame 2017-02-25 22:45:30
yeah it's pretty hard on me atm
ongy 2017-02-25 22:45:30
Starfflame: when I started out, every loop ever just became an explicit recursive function. That's what worked for me, then later I thought about making it pretty
Starfflame 2017-02-25 22:45:30
i would do that tooo, but
Starfflame 2017-02-25 22:45:30
my prof wants us to use folds a lot so i'm working with that atm
Cale 2017-02-25 22:45:30
Starfflame: One thing that might help starting out is that the only way that variables vary is by being bound again. So if you want variables to change, making them arguments to a function, and having that function be applied to different arguments is the fundamental way to do that.
Starfflame 2017-02-25 22:45:30
I did discover that thankfully
Cale 2017-02-25 22:45:31
(which gets you recursion and is a lot less pretty than actually understanding what you're doing enough to write something as a fold or in terms of other higher order functions, but hey, it's a start)
sbrg 2017-02-25 22:45:38
Starfflame: have you tried writing foldl/foldr on your own?
sbrg 2017-02-25 22:45:41
it helps
Starfflame 2017-02-25 22:46:04
our professor showed us foldl in terms of foldr
Cale 2017-02-25 22:46:10
Getting really good with list operations in general is helpful -- lists are like loops that are frozen in time
Starfflame 2017-02-25 22:46:25
and my brain proceeded to die
Cale 2017-02-25 22:46:55
Just as a loop either has no iterations (e.g. because its precondition isn't met), or consists of a single iteration followed by another loop
Cale 2017-02-25 22:46:55
a list is either empty, or consists of a single element followed by another list
Starfflame 2017-02-25 22:47:43
I get how both folds work but it's just a bit of a pain using them especially when I have to come up with a tuple that stores the right numbers i need to do task Y
sbrg 2017-02-25 22:48:02
Well, it doesn't have to be a tuple. it can be anything.
bollu 2017-02-25 23:21:14
Cale: oh, interesting
bollu 2017-02-25 23:21:26
Cale: I always assumed that core was "minimal subset" hence would not have newtype
bollu 2017-02-25 23:21:30
Cale: I shall go spelunk :)
athan 2017-02-25 23:21:33
Starfflame: that shouldn't be your goal :)
bollu 2017-02-25 23:21:49
Aku: I'm a little busy right now though. if you have a targetted question I can answer
athan 2017-02-25 23:21:50
bollu: Don't forget to bring sun screen!
Aku 2017-02-25 23:21:52
I am trying to figure out the type of a Parser pDefn
Starfflame 2017-02-25 23:22:04
even though my professor understands the struggle i need to get my work for haskell done otherwise it'll overlap with everything else i need to do
bollu 2017-02-25 23:22:07
Aku: lpaste?
Aku 2017-02-25 23:22:17
Are u free?
bollu 2017-02-25 23:22:20
athan: :)
Aku 2017-02-25 23:22:27
Looks like it would take some time
bollu 2017-02-25 23:22:34
Aku: I could probably just run you through it, not a detailed explanation
bollu 2017-02-25 23:22:36
even so, post the code
bollu 2017-02-25 23:22:42
and there's everyone on IRC who would help
Starfflame 2017-02-25 23:22:58
athan shouldn't be my goal but unfortunately it is
Cale 2017-02-25 23:23:02
Starfflame: btw, the fact that foldr (:) [] is the identity function is a clue to a really good way to think about what foldr is doing
bollu 2017-02-25 23:23:15
context for the others: he's implementing a parser in the style of "failure to list of successes", so he's going through parser combinators the first time :)
Aku 2017-02-25 23:23:23
okay
Cale 2017-02-25 23:23:31
foldr f z xs will replace each occurrence of (:) in the construction of the list xs with f, and the [] at the end (if any) with z
Aku 2017-02-25 23:23:31
i will put it on lpaste
Aku 2017-02-25 23:33:10
bollu I have put it!
Aku 2017-02-25 23:33:16
if time plz help!
Cale 2017-02-25 23:33:41
Starfflame: Well, usually your loop from 1 to n is going to be replaced by some sort of processing of a list [1..n]
Aku 2017-02-25 23:33:55
I have written in comments what the problem is!
Starfflame 2017-02-25 23:33:56
hm
Starfflame 2017-02-25 23:34:00
i see
Starfflame 2017-02-25 23:34:14
i miss my for loops XD
bollu 2017-02-25 23:34:31
Cale: ohh, so pi_n will have f: S^n -> T?
Cale 2017-02-25 23:34:45
bollu: Yeah
bollu 2017-02-25 23:34:51
Starfflame: you find that the haskell way of doing it is "nicer" since it carries intent better
lpaste_ 2017-02-25 23:35:10
Aku revised "figuring out type?": "figuring out type?" at http://lpaste.net/7251168297717071872
bollu 2017-02-25 23:35:15
Starfflame: when you see for (..) {..}, you don't really know what the general "shape" of the processing is
bollu 2017-02-25 23:35:42
Starfflame: but in haskell, that is conveyed by the higher order function you use: map v/s filter v/s fold v/s for v/s traverse ...
bollu 2017-02-25 23:36:06
Aku: what is pDefn supposed to do?
bollu 2017-02-25 23:36:24
Aku: oh okay, just (Var, Expr)
Aku 2017-02-25 23:36:30
It is supposed to parser Defns
Aku 2017-02-25 23:36:32
Ya
Starfflame 2017-02-25 23:36:43
hm
Starfflame 2017-02-25 23:36:48
well
Starfflame 2017-02-25 23:37:02
i'll worry about it then if i get that far
bollu 2017-02-25 23:37:20
Aku: you can use then3, since you have 3 things to "parse" as blocks: the "variable", the "=", and then the actual "expr", which you can then combine
Cale 2017-02-25 23:37:31
bollu: Well, for this it might help to take a different approach to discussing the sphere than usual. You might want to consider maps [0,1] x [0,1] -> T which send the entire outside square to the basepoint.
bollu 2017-02-25 23:37:51
Aku: and it is perfectly OK for expressions to use Alt and for Alt to use expression
bollu 2017-02-25 23:38:04
Aku: I don't think you've actually seen a formal methods class?
bollu 2017-02-25 23:38:26
Cale: how is that the same as S^2?
Aku 2017-02-25 23:38:27
The type they return are confusing
Aku 2017-02-25 23:38:36
No I haven't
bollu 2017-02-25 23:38:42
Aku: also, pExpr should be "Parser CoreExpr"
Aku 2017-02-25 23:38:46
ya
Cale 2017-02-25 23:38:54
bollu: think about what happens when you take a disc and identify all the points on its boundary
Aku 2017-02-25 23:39:03
I corrected it