Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Haskell lacks Type Inference

Name: Anonymous 2017-11-24 17:14

benis f = (f ['d'], f [1])
lac.hs:23:22: error:
• No instance for (Num Char) arising from the literal ‘1’
• In the expression: 1
In the first argument of ‘f’, namely ‘[1]’
In the expression: f [1]
Failed, modules loaded: none.

and car cdr = car cdr car
or car cdr = car car cdr

lac.hs:14:23: error:
• Occurs check: cannot construct the infinite type:
t ~ t2 -> t -> t1
• In the second argument of ‘car’, namely ‘car’
In the expression: car cdr car
In an equation for ‘Main.and’: Main.and car cdr = car cdr car
• Relevant bindings include
cdr :: t2 (bound at lac.hs:14:9)
car :: t2 -> t -> t1 (bound at lac.hs:14:5)
Main.and :: (t2 -> t -> t1) -> t2 -> t1 (bound at lac.hs:14:1)

lac.hs:17:18: error:
• Occurs check: cannot construct the infinite type:
t ~ t -> t2 -> t1
• In the first argument of ‘car’, namely ‘car’
In the expression: car car cdr
In an equation for ‘Main.or’: Main.or car cdr = car car cdr
• Relevant bindings include
cdr :: t2 (bound at lac.hs:17:8)
car :: t -> t2 -> t1 (bound at lac.hs:17:4)
Main.or :: (t -> t2 -> t1) -> t2 -> t1 (bound at lac.hs:17:1)

In order to make the above work you need to type it explicitly, like
LANGUAGE Rank2Types #-} --for some reason the shitty syntax highlighter bullshit in this site eats the {-#
type CBool = forall a. a -> a -> a
and :: CBool -> CBool -> CBool
or :: CBool -> CBool -> CBool
benis :: (forall a. a -> b) -> (b, b)


You can't even do benis :: (a -> b) -> (b, b) nor benis :: ([a] -> b) -> (b, b) nor anything that does not use a compiler extension. What a great language!

Name: Anonymous 2017-11-25 1:01

Not gonna lie, former Haskell fanboy here. This is fucking hilarious watching Haskell crash and burn. But in all seriousness we can't let Haskell be the new führer of programming languages.

Name: Anonymous 2017-11-25 4:31

>>2
I dropped Haskell immediately after the mess that was FTP, when it became absolutely clear that the authors are more interested in masturbation than making something useful. It doesn't help that most texts on the more complicated parts of Haskell are written by for retards in a way that confuses issues rather than simplifies them.

Name: Anonymous 2017-11-25 8:21

Name: not >>2 2017-11-25 10:35

>>5
Intent doesn't enter into it. Haskell is the idiotic hipster's pet language and this ``success'' has ruined it.

Name: Anonymous 2017-11-25 12:21

what's Haskell? I thought the language died in 2009, how the fuck is it still supported?

Name: Anonymous 2017-11-25 14:09

>>4
Whom are you quoting?

Name: Anonymous 2017-11-25 14:52

--for some reason the shitty syntax highlighter bullshit in this site eats the {-
I think that's a problem with the sexpcode parser.

Name: Anonymous 2017-11-25 14:56

Has Haskell really gotten bad over the years? I remember it being pretty good back in the old world4ch /prog/ days and Hinaichigo would talk about it or Scheme.

Name: Anonymous 2017-11-25 14:58

Terrible!

Name: Anonymous 2017-11-25 15:23

>>10
it was an alive toy language and now it's a toy lang carcass

Name: Anonymous 2017-11-25 15:24

ITS A DEAD DOG, STEPHEN

Name: Anonymous 2017-11-25 16:33

>>10
They've gone ENTERPRISE, just in a functional flavor. Everything is utterly overengineered now, with really ridiculous consequences. I don't have Haskell installed right now, but obviously idiotic things like length (1,2) now compiles (should evaluate to 1 iirc) because (,) a is a foldable.

Basically, ekmett took over.

Name: Anonymous 2017-11-25 20:57

>>10
It was always a toy language people use to jerk around with ohsoclever one liners.

Name: Anonymous 2017-11-25 20:59

>>10
Haskell has a few awesome parts, such as the monads, however these can trivially be implemented in other languages. In fact I implemented monads for Scheme recently.

Name: Anonymous 2017-11-25 22:12

>>14
That's a shame. Are there any language forks?

>>15
If by ``toy'' you mean ``academic,'' then yes. It was never suppose to become some corporate ENTERPRISE shitfest beholden to stockholders and R&D managers who don't know what the fuck they're doing.

>>16
That was always the case, but it was nice that Haskell had that and not the garbage it has now. Hopefully, Scheme doesn't become the next victim, but these days you never know.

Name: Anonymous 2017-11-25 23:57

lens my anus

Name: Anonymous 2017-11-26 23:10

>>17
Well I guess 'academic' is accurate

Don't change these.
Name: Email:
Entire Thread Thread List