@vy @dabeaz @neutrinoceros At least the elevator cabin itself didn't crash from the top floor while the doors were open, cutting someone's stuff in progress.
(Gonna need some model checking to prevent that...)
@someodd can you use git url with a commit? This way you'd get the same clean package install without round-tripping through Hackage.
@someodd can you use git url with a commit?
@rzeta0 It's okay to skip the stack/cabal/etc if the code has no dependencies besides `base`.
Otherwise, switch to the project-based setup ASAP and save hours trying to figure out how to install stuff, where, and which versions.
Since the package they use for exercises has quite a few deps, you'd rather follow the suit and `ghcup install stack` or make yourself at least a minimal `cabal.project` (`packages: .`) and use `cabal ghci ...` instead.
Just don't try to `cabal install` - this way lies madness.
Apparently they use stack to install ghc too. That was superceded by ghcup.
@rzeta0 @jonocarroll I think this has roots in logic.
TLDR: There's a privileged element for "nothingness" and the rest are "something". So, for the types that map to some number it is natural to expect at least the 0th elements to align.
If you take numerical encoding of enums as an inductive type then there would be the "smallest" element - `Zero`, and the "next" element and you'd get the type `data N = Zero | Next N`. It can be used to encode all kinds of enums. But then, the same principle is used to encode e.g. lists: `data List a = Empty | Item a (List a)`.
So, why would the `False` go first then? Consider the function `len` that maps arbitrary lists to numbers: len Empty = Zero; len (Item next) = Next (len next).
The empty lists has no layers and so the number zero has no layers.
Recall my previous diatribe about multiple ways converging on the same outcome? Here we have another case of that. We can handwave the property being "has something". The lists have elements, the numbers have quantity, and the True is some bit being "on".
Exactly the same thing goes for the Maybe type, it's just more specific in what exactly it have got in there.
@jonocarroll @rzeta0 Collections are just example of doing things of least surprise. There is a web of concepts that are expected to behave similarly. If there are multiple ways to do the comparison, they ought to have same results since the underlying property is the same across all the implementations.
@tymwol @ammoniumperchlorate OcaML + C++
@rzeta0 Turn all the smart crap off while learning. The less bells and whistles you have the better.
You can get annoyed with it later.
@rzeta0 @jonocarroll I think it's mainly for use with collections.
Take a list of numbers, pick a number, annotate each item with the comparison to that number, sort the annotated list - the items would be in that lt/eq/gt order wrt. to pivot.
The same as subtracting the pivot, the numbers will be negative, then zeroes, then positive.
@barubary Ugh... Indeed. Cutting corners left and right
@dzwiedziu Stupid prizes or death!
@L29Ah Is there something like that, but for system design?
@reidrac personally, I just blackhole all of cn subnets by default. Nothing good ever came from there.
Toots as he pleases.