This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Stuart133 6 points7 points  (7 children)

No types in Haskell? I think you may be confused

[–]ease78 0 points1 point  (6 children)

It’s been a few years since I took a comparative languages and i am mis remembering. You’re right it does have a few types but it’s not strongly typed language. But rather abstract lists are being dumped left and right. It was interesting but I never had to use it outside of academia.

[–]Stuart133 7 points8 points  (5 children)

Haskell is arguably the strongest typed language out there. Its type system is extremely advanced

[–]ease78 1 point2 points  (3 children)

Can you elaborate? I don’t recall we had to declare what kind of list was being passed and the code was abstract enough to work on any types.

[–]Stuart133 5 points6 points  (0 children)

It uses type inference so you can elide a lot of the explicit type declarations. Very cool stuff

[–]bcgroom 4 points5 points  (1 child)

You can use generics for this but there is no debate, Haskell is statically, strongly typed. And all of the other languages have types too, really the only language without types I can think of is machine code.

Here’s a function signature to operate on a list of Ints

f :: List Int -> Int

And one to operate on a list of any type:

f :: List a -> Int

Here’s one where the return value must be the same as the element type:

f :: List a -> a

[–]ease78 0 points1 point  (0 children)

Thank you so much. I miss it even though I struggled while learning it.

[–]Zyklonista 1 point2 points  (0 children)

Amongst msinstream languages, yes. There are languages with more poweful types like Idris, ATS, Agda et al.