Fork me on GitHub

Oh dear…


putValue:: Eq k=> k -> v ->Store i k v->Store i k v I'm trying to understand this type signature, and the Eq k => is tripping me up a bit, can someone explain it to me?

Lennart Buit17:04:29

That says that k in the type signature is something you can compare

Lennart Buit17:04:17

So the actual type is k -> v -> Store i k v -> Store i k v in which k has an Eq instance


In clojure terms (I don't know haskell, trying to transcribe a paper to Clojure), would you say that k implements the Eq protocol?


Great, thank you!

Lennart Buit17:04:02

I was going to link the docs, but they don’t seem to be that helpful


Googling about "haskell context" isn't too useful, ended up on a dead haskell wiki page


Is there a haskell-alike (So, I guess something with monads and hindley-milner types?) that I might find somewhat practical? Haskell may be that, but I'm just curious to know if there's something else that's worth checking out? Frege maybe?


The haskell package ecosystem generally feels a little... confusing?


I hadn't thought of OCaml, derivatives of their work is going into native desktop apps right?


I guess reason is quite "hot" at the moment?


Just looking at Eta -- prompted by your question. It looks like it manages to dovetail the Haskell ecosystem (Cabal etc) into the JVM ecosystem in quite a nice way. Maybe next time I go back to "learn Haskell properly", I'll try Eta... 🙂

Lennart Buit22:04:13

Wasn’t there a new tool in town: stack?


The background for this question is that I'm trying to understand and the dependencies/Applicative stuff makes no sense to me to how it works.

Lennart Buit18:04:47

The paper is available in presentation here:

Lennart Buit18:04:53

haven’t watched, but may be helpful?

Lennart Buit18:04:19

(Also, SPJ is a functional programmer hero)

Lennart Buit18:04:17

Although, after watching it, its quite heavily dependent on knowledge of Haskell.


I've seen it, although a while ago, the authors published loads of complimentary material too

Lennart Buit20:04:46

Cool! Papers can be hard to get through, so I am glad that there is also a recorded presentation. I have seen that there is a difference in expressiveness depending on whether your data structure is ‘just’ Functor or ‘also’ Applicative or ‘also’ Monad, but I must admit that its just a slight intuition but no … full understanding.


After trying very hard to grok applicative, I've understood that it's more static than a monad, so it can be analysed


The authors combine applicative with getConst to statically find dependencies, but I couldn't figure out what getConst actually does independently, the name would imply that it's like (constantly), but it clearly isn't based on results.


It's quite tempting to design a model which matches the semantics as I understand them and cover it up with macros.

Lennart Buit21:04:27

(I am trying to help as much as I can) the applicative instance of Const appears to be closer to appending to some accumulator.


(I appreciate your help very much)


That's what I thought, but I couldn't figure out how that resulted in evaluation being interrupted, or where that was documented.


I suspect I need to spend some serious time understanding the category theory completely.

Lennart Buit21:04:28

It’s like Clojure for the Brave and True but for Haskell


I skimmed the first few chapters, but didn't see that one. I saw one with boxes that was good. I'll give that a read now thanks!


Maybe I should go over that whole book in more detail. Seems good enough too. New study project :)

Lennart Buit21:04:54

I was just rambling to a coworker how we all can learn a lot from other programming languages ^^!

Lennart Buit21:04:11

even languages as abstract as Haskell ;)


Haskell seems like a good one for reading papers, academics love it


How did you figure out how Const works? Did you use the source (Luke)?


I did try that article, but struggled to make heads of it :). Makes sense though!

Lennart Buit22:04:45

But I have been looking at this stuff on and off for years, I still don’t grasp it entirely.


That article is wonderful, thank you so much!


I think I even vaguely understand how getConst works, even though the name is absolutely terrible

Lennart Buit20:04:50

naming is not Haskells strong suite, whoever figured that “wrapping in a monadic context” should be called return… So many imperative programmers were confused that day


Documentation doesn't seem so great either, I'm guessing it's because types are truth or something