3 ms·
When somebody tosses around phrases like how to subvert Haskell's type system to accomplish basic shit you can do in other languages, it's a big red flag that t
by statictype 16y ago
When somebody tosses around phrases like how to subvert Haskell's type system to accomplish basic shit you can do in other languages, it's a big red flag that they've never used Haskell, and possibly have never even seen Haskell code.
Well, actually, unless you've tried using Haskell you probably don't realize the it has a type system completely different from 'other languages'.
About Blub: That's a stick you can use to beat anybody who criticizes any other language.
Oh, you don't think Brainfuck has anything to offer? Hah! Go read pg's essay on blub!
- jmillikin 16y agoWell, actually, unless you've tried using Haskell you probably don't realize the it has a type system completely different from 'other languages'. Really? Before I started using it, the only things I knew about Haskell were 1) it has a weird type system 2) it uses something called 'monads' and 3) doing IO is really really hard. #3 turned out to be false, #2 was true but not as scary as the hype, and #1 was true. It's not surprising that non-users know about the "odd" type system; types are one of the few ways arbitrary languages can be compared, so I know the type systems of many languages I've never so much as written Hello World in. About Blub: That's a stick you can use to beat anybody who criticizes any other language. Not so; one can use it to criticize anybody who claims a language is bad because it is more expressive than usual. For example, there are languages with more expressive type systems than even Haskell; if a programmer used to such language called Haskell inexpressive, it wouldn't make any sense to argue against them with Blub (regardless of whether he's correct).
- eru 16y ago> completely different from 'other languages'. It's not too different from OCaml or Clean. (Though, I do miss type classes in them.)
- kwantam 16y agoAlso, Standard ML. I learned Standard ML and created a couple toy systems in it before becoming utterly frustrated with the insane state of the "standard" library[1] and fleeing to Haskell. I briefly considered OCaml, but of the MLish languages it seemed to me that OCaml had the ugliest syntax, so I chose Haskell instead. Dumb reason to choose a language, probably, but I absolutely adore Haskell. ...and I have spent an entire weekend trying to figure out how to describe within Haskell's type system something that is trivial in scheme[2] ! [1] In particular, there's a lot that's not in the SML spec that most people want in a stdlib, and every compiler's implementation is quite different. This means once you decide to use SML/NJ, if someone else has written a library you need, but for MLton, you're just up the creek. Perhaps this also happens with resp. GHC and Hugs, but I haven't found it to be nearly as much of a problem. [2] If you care: can I create a function that takes as its arguments another function and a list, and applies the elements of the list as arguments to the function? E.g., listApply (+) [1,2] should return 3. In scheme, assuming that you already have curried functions, this is trivial. In Haskell, it's exceedingly difficult. Consider: the approach in scheme, iterative partial applications, absolutely won't work in Haskell, since the types won't match: (+) has type (Num t) => t -> t -> t, but (+1) is (Num t) => t -> t. It turns out it's possible either with explicit isorecursive types (and some lifting functions) or using Template Haskell. For posterity, I posted both solutions on this old StackOverflow question I found when looking at how others had handled the same problem (viz., they hadn't, generally): http://stackoverflow.com/questions/3775446/passing-list-elements-as-parameters-to-curried-function/4241972#4241972 http://stackoverflow.com/questions/3775446/passing-list-elem...
- eru 16y agoI also love Haskell's syntax. It's very tasteful in most choices. Although my opinion of Python has gone down over the last few years, I still like its syntax, too. Especially the significant indentation, but I believe that Haskell has the slightly better mechanism, by defining indentation as a syntax sugar that you can avoid, if you want to. OCaml's standard library is also quite dismal. At the recent meeting of the OCaml consortium in Paris we suggested creating a new extended standard library. (We will reuse Core and Batteries et al, of course.) A co-worker and I are in the procss of writing a regular expression module that doesn't suck. It will be threadsafe and use poor OCaml---the module from the standard library calls C-code to run a backtracking bytecode interpreter with lots of mutable state.