Fork me on GitHub
#off-topic
<
2019-04-21
>
agigao10:04:54

Oh dear…

dominicm16:04:12

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

dominicm17:04:15

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

dominicm17:04:56

Great, thank you!

Lennart Buit17:04:02

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

dominicm16:04:32

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

dominicm20:04:08

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?

dominicm20:04:27

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

dominicm20:04:21

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

dominicm20:04:23

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

seancorfield21:04:23

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?

dominicm22:04:11

The background for this question is that I'm trying to understand https://dl.acm.org/citation.cfm?id=3236774 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: https://www.youtube.com/watch?v=BQVT6wiwCxM

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.

dominicm20:04:38

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.

dominicm21:04:20

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

dominicm21:04:13

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.

dominicm21:04:29

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.

dominicm21:04:56

(I appreciate your help very much)

dominicm21:04:00

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

dominicm21:04:36

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

dominicm21:04:18

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!

dominicm21:04:43

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 ;)

dominicm21:04:05

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

dominicm22:04:32

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

dominicm22:04:48

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.

dominicm20:04:18

That article is wonderful, thank you so much!

dominicm20:04:14

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

dominicm20:04:10

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