Haskell Foldable Wats

Augustsson, Lennart Lennart.Augustsson at sc.com
Tue Feb 23 12:36:54 UTC 2016


I can assure you that Andreas is not delusional, and I think he makes a very good point.

I also think that the design of programming languages and APIs is as much an art as it is engineering.
You have to show good taste or you'll end up with a mess that might be logically consistent, but unpleasant to use.

-----Original Message-----
From: Libraries [mailto:libraries-bounces at haskell.org] On Behalf Of Marcin Mrotek
Sent: 23 February 2016 12:31
To: Henning Thielemann
Cc: Haskell Libraries
Subject: Re: Haskell Foldable Wats

> I think he is right.

I was objecting to the way he argues his point, not to the point itself. There isn't much room for discussion if the opposite side is "delusional" or a "case for the mental institution".

> Programming should strive for simplicity. The more you must explain, 
> the less obvious it is.

And the way type classes work right now is rather simple. You could make them take a type lambda or something like that, to point the type argument that is meant to be modified, and perhaps treating tuples like two-element containers could somehow work. But instead they work in a simplistic, but predictable way. The intuition developed for tuples is applicable to any other type in Haskell. Complicated manipulations of data types can be handled with lenses, which compensate by allowing less polymorphism, so that the overall complexity doesn't blow up. Heterogeneous containers are provided by packages like HList or Vinyl, with their own tradeoffs. Etc, etc.

> You can write programs with
> unintuitive behavior and document that intensively, but it won't fix 
> the missing intuition.

As I see it, programming is a discipline of engineering, not humanities. All things being equal, it's better to have things behave in a familiar way, but if a different behavior naturally follows from the formal system underlying the language, then too bad for these arbitrary notions of "common sense". Stripping corner cases (like Functor or Foldable instances for tuples) or making them behave differently for the sake of intuition, actually adds complexity to the language while removing functionality, in my opinion. I think it's like arguing for removal of complex numbers and matrices from mathematics because their arithmetic is confusing.

Best regards,
Marcin Mrotek
_______________________________________________
Libraries mailing list
Libraries at haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries at http://www.standardchartered.com/en/incorporation-details.html

Insofar as this communication contains any market commentary, the market commentary has been prepared by sales and/or trading desk of Standard Chartered Bank or its affiliate. It is not and does not constitute research material, independent research, recommendation or financial advice. Any market commentary is for information purpose only and shall not be relied for any other purpose, and is subject to the relevant disclaimers available at http://wholesalebanking.standardchartered.com/en/utility/Pages/d-mkt.aspx

Insofar as this e-mail contains the term sheet for a proposed transaction, by responding affirmatively to this e-mail, you agree that you have understood the terms and conditions in the attached term sheet and evaluated the merits and risks of the transaction. We may at times also request you to sign on the term sheet to acknowledge in respect of the same.

Please visit http://wholesalebanking.standardchartered.com/en/capabilities/financialmarkets/Pages/doddfrankdisclosures.aspx for important information with respect to derivative products.


More information about the Libraries mailing list