Live data from Hacker News

Haskell tutorial for C programmers

haskell.org

51–56 of 56 posts

Re: Haskell tutorial for C programmers

#51
post #35

Earlier quoted context omitted.

The advantage you mention is one of many (over OOP interfaces), I'll repeat it as (A). (A) Ability to instantiate old types with new classes (B) Conditional instantiation: "Maybe a" is an instance of "Show" iff "a" is an instance of "Show" (C) Can do return-type polymorphism, or polymorphism on any part of the signature (D) Objects do not need to pay for the interface vtable pointer. Large array of some type-class in…

(C) is covered by generics in most cases. The others, yes.

Generics aren't ad-hoc polymorphic. Type classes are.

Re: Haskell tutorial for C programmers

#54
post #50
post #35

Earlier quoted context omitted.

The advantage you mention is one of many (over OOP interfaces), I'll repeat it as (A). (A) Ability to instantiate old types with new classes (B) Conditional instantiation: "Maybe a" is an instance of "Show" iff "a" is an instance of "Show" (C) Can do return-type polymorphism, or polymorphism on any part of the signature (D) Objects do not need to pay for the interface vtable pointer. Large array of some type-class in…

E) you do get a dilemma if you add two elements in a sorted structure , lexically in two different files, where two different Ord instances arr in scope, respectively. this function-is-instance problem is dual to OO's -object-is-instance problem.

A homogenous list is guaranteed to only have one instance unless you enable incoherent instances (a known bad extension) or confuse the compiler with orphan instances (though I've never encountered this and think it should be detectable at link time anyway).

One type -> at most one instance for any class, in Haskell.

Re: Haskell tutorial for C programmers

#55

Earlier quoted context omitted.

Groundhog is pretty awesome[1]. Persistent also works, but it does some wonky stuff on SQL databases. Acid-state is really neat! Of course, there's stuff like postgresql-simple, but that's not very type safe. [1] https://www.fpcomplete.com/school/to-infinity-and-beyond/pic... Edit: Also, esqueleto has a pretty okay looking hackage page[2], but I've never used esqueleto, so I don't really know. [2] http://hackage.hask…

Do you have any experience with Database Supported Haskell (DSH) [1]? I've just recently found it and it seems very nice. I didn't have the time to test it though. [1] https://hackage.haskell.org/package/DSH

No, I don't. That seems really cool though! Thanks for pointing that out.

Re: Haskell tutorial for C programmers

#56
post #39

@kissthblade: Your comment (dead) below is very sad. You've been hell-banned for more than a year and a half. It doesn't just seem like nobody is seeing your comments, it's true. For those without showdead on: "I posted about the same comment as the parent hours ago. I don't know if anybody even sees my posts, never gotten a response, and my "karma" or something has always been 15. And posting and reading the forum i…

Is that something common at Hacker News? I find it worrisome that someone can be banned from a community and not even be aware of it. What's the point of punishing wrong behavior if the one making it isn't aware that it was wrong?

I'm trying to grasp how moderation and banning works around here, but it's difficult since neither the FAQ nor the posting guidelines have an explanation about it.

Post reply on HN