
A primer on the cruel, tacit laws of type-level programming in Haskell - tenslisi
https://www.aymannadeem.com/haskell/2020/05/15/Kindness-for-Mean-Girls.html
======
danidiaz
Kinds in Haskell seem to be evolving in the direction of controlling the
representation of datatypes in memory. * (also called Type) is the kind of
types whose values are "lifted": they can be lazy computations which might
cause an infinite loop, throw an exception, and so on.

There are also kinds for types whose values are "unlifted", meaning they
really correspond to actual values in memory, not lazy thunks.

Right now the language for expressing unlifted datatypes is quite limited.
Hopefully it will be expanded so that we can write "strict Haskell" more
easily.

"Levity polymorphism" paper [https://www.microsoft.com/en-us/research/wp-
content/uploads/...](https://www.microsoft.com/en-us/research/wp-
content/uploads/2016/11/levity-pldi17.pdf)

"Kinds are calling conventions" paper [https://www.microsoft.com/en-
us/research/uploads/prod/2019/0...](https://www.microsoft.com/en-
us/research/uploads/prod/2019/03/eta.pdf)

The -XUnliftedNewtypes extension
[https://downloads.haskell.org/ghc/latest/docs/html/users_gui...](https://downloads.haskell.org/ghc/latest/docs/html/users_guide/glasgow_exts.html?highlight=unlifted%20newtypes#extension-
UnliftedNewtypes)

[https://stackoverflow.com/questions/35318562/what-is-
levity-...](https://stackoverflow.com/questions/35318562/what-is-levity-
polymorphism)

[https://stackoverflow.com/questions/56311510/what-does-
type-...](https://stackoverflow.com/questions/56311510/what-does-type-
signature-for-undefined-mean-in-haskell/56317845#56317845)

~~~
zozbot234
I'm not sure that "evolving" is the right phrase - unlifted types have always
been a part of low-level (generally compiler-specific) Haskell.

------
implements
There’s a “Stop trying to make Haskell happen, Gretchen - it’s not going to
happen!” joke here, somewhere.

~~~
Synaesthesia
He’s ... just not your type?

~~~
dkersten
What Kind of joke is that?

------
roenxi
There seems to be a nigh-irresistible urge for people, when explaining type
systems, to pick examples that are absolutely useless.

None of the types in the theme here make much sense. They are arbitrary. The
contribution to writing a robust program is questionable and they don't do
much to explain concepts.

May as well stick with classic "Goats are mammals; that should be enough to
get you going with OOP" examples, at least they are less distracting.

I'm not a fan of this article.

~~~
ivanbakel
That's a problem with the domain itself. Type system examples can be two of:
short, concrete, well-motivated. Short concrete examples don't have time for
motivation; concrete well-motivated examples require lots of text (or else are
unreadable); and short well-motivated examples are forced to be highly
abstract.

There's no substitute for actually encountering a real-world problem which
makes you want/need type-level programming. The article makes the sensible
choice of not trying to invent one for you. I don't think it should be
bemoaned for that.

------
tome
Holy 6MB 2,046px × 1,416px image, Batman!

~~~
throwaway_pdp09
Yep. Multiples of them totalling 35.4MB of pointless, bandwidth-sucking
stupidity.

~~~
agumonkey
a testimony on the need to train people to think about memory with lazy fp ?

~~~
throwaway_pdp09
If by that you mean lazily as in functional programming, I don't see that
would help.

~~~
throwaway_pdp09
OK, I get it finally. Bit thick today! Upvoted.

~~~
agumonkey
no worries, humorous comments are not the first expectation on HN

have a nice day

------
wscott
A discussion of the Haskell type system is not what I expected when clicking
that link.

~~~
neals
Be honest, what was your very first thought?

~~~
rogual
I thought it was going to be a piece in favour of showing kindness to people
who themselves are mean.

(I never even considered "this is HN so it's probably tech-related". Don't
know what that says about me or the site!)

~~~
js8
Yeah, me too. If it wasn't explained in the discussion, I wouldn't click on
it. (Maybe HN needs some tags.)

But I am actually glad it's about Haskell, I am a gonna read it now (and it's
refreshing to see it being written by woman).

I don't mind the movie references, I don't think it's sexist. (Quite the
opposite, I think standard mathematical writing is too dry and benefits from
having an unrelated theme to add a bit of spice.)

Current reality is hard for everyone. When men behave like men, some women
complain, when women behave like women, some men complain, it's really hard to
please everyone. Take it easy, everyone.

------
anticristi
Does anyone else think the title is sexist by today's standards?

~~~
Fr33maan
I have strictly no idea why OP is using women nor in the title or
illustrations

~~~
anticristi
It reinforces the stereotype that only women are mean. I would dislike a title
reinforcing stereotypes about me: "Detox for Alcoholic East Europeans: Haskell
type enforcement".

~~~
cdash
No such stereotype says only women are mean.

