1. 7

    The main problem I’ve ran into with utilities like this is that they cannot generate sum types or otherwise handle varying representations in locations.

    This isn’t a problem in Haskell, you just define the sum type. It’s just that most people writing these utilities don’t go the last mile.

    This utility solves the problem but not in a way I prefer: the union typed :|: is unnecessary AFAICT. You can generate Haskell types that are more idiomatic using regular sum types.

    The next limitation to be aware of is that you want to be sure these utilities are doing breadth first unions of the representations, so that you have more normalized types. Cf. https://github.com/bitemyapp/bloodhound/blob/master/src/Database/V5/Bloodhound/Internal/Query.hs#L20-L51

    All that said, cool tool. I’m glad this was posted so that I could remember to give it a spin again next time this problem arises for me.

    1. 3
      • Working through tickets and editing the Haskell Book
      • Pairing to help others on Moot
      • Going to a birthday party where I will gift a book about economics, possibly mutualism.
      1. 3

        I finished the CFP milestone for Moot. I’m moving on to the blind editing workflow next.

        Day job is a data-heavy medical client, interesting stuff that I can say almost nothing about unfortunately.

        Hopefully I will have more to talk about soon.

        1. 6

          i’ve had recent experience: ubuntu 1804 feels sluggish in some parts vs. a slackware install, with more or less the same functionality:

          • xscreensaver unlocking: for some reason it takes half a second after i hit the return key until i see the desktop again on the ubuntu install.

          • there are weird lags everywhere (and no chance of debugging it with all the magick moving parts aka. “*kit”).

          • booting is slower, the initrd takes seconds until i can type in the passphrase to unlock the full disk encryption.

          maybe all the shiny new tools aren’t so great after all. if one looks at the default install size of slackware, it isn’t even lightweight with around ~8G. it just doesn’t have all the stuff handed down to us by redhat, running in the background doing things.

          1. 3

            I would kill for Michael Larabel @ Phoronix to figure out some reliable user responsiveness tests for Linux distros.

            1. 1

              Because it is very hard and takes a lot of time I’d wager. Few have the time, money or drive to do such a thing.

              Update: the responsiveness issues I was having with Ubuntu 18.04 were resolved by not using a distro install based on Gnome. I was able to replicate responsiveness improvements w/ a Debian + LXDE install and a Lubuntu (Ubuntu + LXDE) install.

              I use XMonad as my primary WM anyway so I really just want a leaner bootstrap environment that “just works” anyway.

          1. 3

            After reading that, I wonder why no one started a fork yet. Perhaps if someone does, people will quickly join.

            1. 8

              Most people who could & would implement a fork, use PureScript instead.

              1. 2

                Because it is very hard and takes a lot of time I’d wager. Few have the time, money or drive to do such a thing.

                1. 1

                  There’s not a substantial amount of money in maintaining a language like this, so it would pretty much have to be a labour of love.

                  Under those circumstances how many people would chose to fork an existing language and maintain it rather than create their own?

                  1. 1

                    Because the whole reason people use something like this is that they don’t want to develop and maintain it themselves.

                  1. 4
                    1. 2

                      Johan Huizinga’s The Autumn of the Middle Ages

                      1. 2

                        Hi Chris! Super nice article! Definitely bookmarked to share with friends or newcomers!

                        In addition, I’d set the executable as an entrypoint and add CMD in addition with default (so the image can be used as it was the executable (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#entrypoint) and do docker run -ti --rm toto -v which would pass the -v arg to the exec.

                        1. 1

                          Thank you!

                          I’ll try out your suggestion.

                        1. 2

                          I don’t recommend using this library, author doesn’t understand asynchronous and synchronous exceptions in GHC. Others tried to intervene to get it fixed and they chose to be difficult.

                          I usually use https://hackage.haskell.org/package/safe-exceptions or https://hackage.haskell.org/package/unliftio-0.2.7.0/docs/UnliftIO-Exception.html

                          You can check who uses a library by using this website: https://packdeps.haskellers.com/reverse/unexceptionalio

                          1. 2

                            Did you read the article? I thought I had been clear enough to avoid this misunderstanding by this point. This is not about the difference between synchronous and asynchronous exceptions, that was previously a misunderstanding caused by bad documentation on my part. The article (and the library) now clearly state the intent: I want to model recoverable errors. That is, things that the program can recover from and do something useful about. safe-exceptions is designed for a different purpose and does not provide this functionality.

                            Besides the fact that the library is not intended for the use case of sync vs async, additionally it is not possible to have a type that excludes all “synchronous” exceptions anyway, since they can be produced by pure code

                            return (1 `div` 0)
                            
                          1. 4

                            Why does your site ask for permission to send me notifications when I visit it?

                            1. 1

                              There’s a weird JS/chat widget.

                              1. 1

                                The “chat me” button in the bottom right has the ability to notify. I may look into a way to disable that.

                              1. 20

                                I’m sad after reading these comments.

                                I understand and respect his decision, and these comments themselves are the very evidence why he is right. How about having OpenSource simply about openness and source? Why do politics and ideologies have to always appear?

                                Maybe a new manifesto is needed, much like the Agile manifesto:

                                • Individuals and interactions over group identities and categories of people
                                • Working software over ideologies and codes of conduct
                                • Respecting each other regardless anything
                                1. 22

                                  Why do politics and ideologies have to always appear?

                                  Ideologies are always there. You only notice them when they’re different from your own.

                                  1. 22

                                    Perhaps the point is that some people would like a safe space for focusing on technical matters rather than every single open source and free software community getting politically co-opted into a culture war.

                                    Wanting a community focused on technical work and otherwise treating people equitably isn’t “apolitical”, you’re right, but that doesn’t make it invalid.

                                    I choose to focus on helping people who came from a similarly disadvantaged background as myself but that’s something I do on my own time and money. I don’t impose it on the software communities I participate in.

                                    I think we need the diversity of participants in free software represented in the communities and organizations. Were that the case, I think I would see more diversity in organizational structures, conduct standards, explicit goals, etc. What I perceive is a corporate-funded monoculture that is getting a bit creepy in the demands placed on others that don’t want to participate.

                                    I’m also starting to notice a social intelligence / neurotypical punching-down in these threads where someone who is less adept at adopting the politically convenient argot of the day gets excoriated for trying to express their discomfort in their own words. It makes me deeply uncomfortable how the members of this community conduct themselves in these threads.

                                    Some of my favorite communities are very engaged with the issues of access in ways that are in keeping with the zeitgeist (e.g. Rust) and do great work in part because of that. Some of my other favorite communities have a different emphasis or approach. I’d like them to co-exist peaceably and for people to do what they are most passionate about, whatever form that takes.

                                    1. 8

                                      You may be right. But what I wanted to express is: I have my ideologies, just like anybody else does, but I believe that open source should only have one ideology, which is about software, collaboration, and not people, or other ideologies. For my taste even the GNU project is too political in many aspects, but on the other hand they have some great pieces of software and those are often governed and built in a great atmosphere. (I can recall a single notable “scandal” that reached me, but the community was generally welcoming, as it is for most software projects.)

                                      Edit: Or to rephrase it even more: ideology is a system of thought covering most aspects of (human) life. I beleive everyone has a personal world view, that is closer to some pre-canned ideology than to others. Yet software projects should have ideologies of software lifecycle, not of human lifecycle, and those can be very well separated, as my personal life and life at my work can also be separated.

                                      The etiquette of the global human civilization should be enough to cover the human-human interaction part of the collaboration, as it is for professional interaction in my experience with colleagues from all over the world. We share our vision about software, quality, and work together, while we may disagree on plenty of things, which have no place in the discussion about a software project.

                                      1. 1

                                        Ideologies are always there. You only notice them when they’re different from your own.

                                        This is a really interesting claim that I’m seeing more and more! I’d love to find some sources that explain the justification for it.

                                      2. 6

                                        I’m genuinely sorry about that. :(

                                        Unfortunately, some topics always bring out discussion that highlights the leaky abstraction of other lobsters as purely technical beings.

                                        It’s the strongest argument against certain forms of content here.

                                        1. 3

                                          One of the goals of open source movements is bringing in new people. I don’t think that’s a particularly contentious goal.

                                          Outreachy is one organization that embodies particular ideas about how best to do that. It’s true those ideas are politically charged, but they’re in service of a goal that is agreed upon. So you can’t effectively pursue the goal of getting new people into open source without taking some kind of stance on the political questions.

                                          Some political questions (what is the optimal US tax policy) are more or less irrelevant to open source. But others are so pervasive that they can’t be ignored, except by creating a tacit consensus. Even the idea that we should respect each other creates conflicts where people have sufficiently different ideas about what respect means.

                                          1. 2

                                            These goals promote the production of “high quality programs” as well as “working cooperatively with other similarly minded people” to improve open-source technology.

                                            source: https://en.wikipedia.org/wiki/Open-source_software_movement

                                            Bringing a specific political agenda to an open source project violates the similarly minded people, or can have the effect of pushing away differently minded people. This is not what respect means in my opinion. I have worked a lot wit differently minded people, and we got along, as we were focusing on the goals. The goals were creating software, not changing society or a community. This moving goalposts is what is bad for OpenSource in my opinion.

                                            1. 10

                                              “Apolitical” open source has turned out to be overwhelmingly white and male - significantly more than even the broader software industry. Reference.

                                              I don’t think there’s any evidence that this demographic skew is deliberate. However once a group is dominated by a certain demographic then it’s easy for people to get the message that this is “not for them”, even if noone says this (and especially if some “bad apples” do).

                                              I believe that there’s nothing about being white and male that makes the best possible open source software developers, so this demographic skew is a bug not a feature. I believe that the best possible open source community is the one with the biggest group of committed (to creating open source) people involved.

                                              With this in mind, what can be done to encourage more diversity and bring more people in? There’s no evidence that the status quo (“focus on tech”, etc) will change by itself.

                                              pushing away differently minded people

                                              The only people the LLVM CoC will push out is people who repeatedly violate it (and by doing so that person is pushing out other people). Outreachy is bringing people in, it doesn’t push anyone out.

                                              Someone decided to leave because aspects of the project no longer meshed with their political world view. You see this as “pushed out”, but I don’t really see who is pushing them here (unless there are some CoC violations we don’t know about or something, but AFAIK there aren’t).

                                              1. 1

                                                Open source is an explicitly political idea to start.

                                          1. 3

                                            Hope he gets a job. I’m just puzzled at the meaning of 5.1 kids.

                                            1. 10

                                              Surround sound kids. Which honestly could just mean one and some sugar.

                                              1. 8

                                                The .1 is the woofer, likely a rescue or mutt.

                                              2. 2

                                                Wife just got pregnant, at a guess.

                                                1. 1

                                                  Looks like it. So it’s 10% done…

                                              1. 1

                                                It’s okay if the answer doesn’t mean a lot to you. It won’t map onto concrete coding intuitions very well. I don’t like this meme at all.

                                                1. 4

                                                  I recently read the chapter on the lambda calculus in Haskell Programming from First Principles, along with the papers suggested for further reading. It was a great surprise to find that a topic I assumed would be hard to access without a math background was plenty accessible when explained well. Thank you for that!

                                                  What are your thoughts on the most effective way to explain monads? I thought @hwayne’s post https://hillelwayne.com/post/monad-tutorials/ was a good elucidation of the imperfection of all familiar monad explainers. I haven’t read the chapter on monads in your book, which might be the answer to my question.

                                                  I think explanations like this SO answer are often regarded as unhelpful to beginners. But the most fruitful insights I have come from the learning I do in an attempt to understand statements like “a monad is just a monoid in the category of endofunctors”. The best intuitions I’ve in concrete applications of these topics have come from struggling to understand these concepts abstractly, in terms of algebraic law and not in terms of metaphor or patterns of use.

                                                  1. 2

                                                    What are your thoughts on the most effective way to explain monads?

                                                    You already mentioned how I think people should learn Monad: Haskell Programming from First Principles.

                                                    But more seriously, there’s no point explaining Monad to someone unless they’ve already learned enough Haskell to learn Monad in Haskell. The word-stuff and thought-stuff that Haskell equips you with gives you an automatically verified, mechanical way to work through exercises that will teach you Monad.

                                                    1. 3

                                                      I really have to agree with this. I was just reading “Real World Haskell” today (refreshing my Haskel for programming competitions), and it’s chapter on Monads was very clear, since the book had been building up to it, not by introducing the maths (that was in fact the last part of the chapter) but by showing it’s use, background (idea) and slowly sneaking up to the actual implementation.

                                                      To do this properly, blog posts will rarely find the right words. It’s a longer processes, where at the end you realize that you’ve already understood it for a while, and all that was missing was the name.

                                                1. 6

                                                  How can I tell I am getting old and out of date?

                                                  I recognize all the words in the article. But they might as well be randomly ordered.

                                                  1. 4

                                                    I think you’d need to know Haskell and the associated idioms for it to be of any use to you.

                                                    1. 1

                                                      I guess I just don’t know well enough.

                                                      1. 1

                                                        You have to make a concerted effort to learn the language, it’s evolutionarily quite apart from anything you know.

                                                  1. 3

                                                    I don’t understand what this means.

                                                    Does it mean that bitcoin’s stupid energy consumption can finally go down?

                                                    1. 5

                                                      The energy consumption is because of the number of people choosing to compete for mining (which they do because the price makes it worthwhile for them to do so) – the same volume of network could be operated with no code changes on a fraction of the energy budget.

                                                      As they say: you don’t hate X, you hate capitalism.

                                                      1. 1

                                                        I don’t think this is true. The limited block size and the difficulty of mining a new block are code features that incentivise everyone to compete for computing power so they can auction off new blocks. You want your transaction to get verified on the next block, well, there’s lots of people who will get it in but only if you pay the right price. With a larger block size, it wouldn’t be so valuable to auction off space in each block.

                                                        The network, the code creates scarcity. In the block size and difficulty of hashing. I thought LN was supposed to fix that.

                                                        1. 4

                                                          The hash difficulty automatically changes based on how much CPU power is working on mining. So if half the miners turned their computers off, the network would adjust the difficulty down and everything would keep working the same as it does now.

                                                          1. 1

                                                            Like JordiGH says, though, it’s not designed to do that. It was intentional on the part of the designer that people would do what they’re doing. There are designs for currency that require hardly any energy to operate. That’s easiest in centralized with distributed checking. People into cryptocurrencies tell me there’s decentralized models that use a lot less energy, too. So, this waste of energy is a result of its design.

                                                      2. 4

                                                        Caveats to what I am about to say:

                                                        • I find crypto mostly boring and I find discussing it with people a lot more boring than reading a paper

                                                        • I am ambivalent about proof of work vs. stake

                                                        • The only public ones I’m really interested in are zcash and cardano, privately there are some neat systems banks are making

                                                        • I am so so so so far from an expert

                                                        With all that said,

                                                        Most transactions will require only a handful of witnesses along a chain rather than requiring network quorum. It probably means more useful work will get done per watt rather than reducing the amount of mining happening unless the drop in transaction fees reduces mining (unlikely? Fixed investment)

                                                        1. 2

                                                          Lightning was about transaction speed based on prior comments. Here’s a Wikipedia article on it.

                                                        1. 3

                                                          Hey-o! This is how we do it at my company, a startup with about ten software engineers:

                                                          Provision with terraform, deploy with ansible. Ansible would do very little, just pull down our packaged software via apt-get which was python virtualenvs. Since the virtualenv was completely self contained it didn’t need to deal with dependencies at all – the idea of installing application level dependencies via pip or whatever is insane to me.

                                                          We supposedly adhered to the “devops” mantra of “devops is a shared responsibility,” but in practice no one wanted to deal with it so it usually fell on one or two people to keep things sane.

                                                          1. 1

                                                            This is pretty similar to what I’ve done in the past although I’d like to have better answers than Terraform or Ansible. Ansible especially turns into a ball-ache once you’re trying to do more than just rsync a binary.

                                                            I’ve been thinking about writing a CLI around https://github.com/frontrowed/stratosphere that uses cloudformation changesets to give me diffs like what Terraform does.

                                                            1. 1

                                                              Yeah, agreed RE: ansible – as soon as you’re doing something complicated with it, you’re doing it wrong. And it’s very tempting to do so simply because it has so much functionality built-in.

                                                              Our infrastructure was designed to be immutable once provisioned, so it really would have made sense to go the kubernetes / ECS route.

                                                          1. 5

                                                            Use what’s actually boring or gives you the least risk. For me, that’s Haskell. I understand quite well that someone who hasn’t spent the time learning Haskell that I have may not be similarly positioned and should use something else on a commercial project.

                                                            I won’t forgo those advantages I worked toward in the projects they make sense for. I’ll still use Python if I just want to sketch/graph/kick around some data. Productionization would look a lot different.

                                                            1. 4

                                                              In my experience, with anything of any significant complexity, this sort of approach ends up being more work than straight LaTeX. On top of that, the conversion tools change too much inbetween versions to guarantee longevity.

                                                              1. 3

                                                                Having worked on a 1,200 page book I am going to concur. I started out using markdown+Pandoc and it became a time loss pretty quickly.

                                                              1. 30

                                                                This is pretty wonderful. I’m happy to help you run stats like these for a quantitative post, but the moral of this story is the importance of human connections, I think you have captured here most of what there is to learn.

                                                                I still was routinely downvoted as “troll”.

                                                                This surprises me a bit. I hope the incidence was much lower, but perhaps it can be explained as reputation carrying over, people read comments in your old tone. Then perhaps we’d see them on posts a sentiment analyzer judged as ambiguous or intermediate. Hm.

                                                                1. 16

                                                                  but perhaps it can be explained as reputation carrying over, people read comments in your old tone

                                                                  I’m guilty of doing this. I thought the friendlysock name change was one big troll. It wasn’t until reading this post that I even knew it was an earnest attempt to be nicer. Sorry @friendlysock :-(

                                                                  1. 9
                                                                    I still was routinely downvoted as “troll”.
                                                                    

                                                                    This surprises me a bit. I hope the incidence was much lower, but perhaps it can be explained as reputation carrying over, people read comments in your old tone. Then perhaps we’d see them on posts a sentiment analyzer judged as ambiguous or intermediate. Hm.

                                                                    At first blush this surprised me too, but honestly I think there are some people who mis-understand what “troll” is for and are a bit too quick to pull this particular trigger.

                                                                    1. 12

                                                                      I get downvoted as troll most often in contexts where I’m replying earnestly and constructively. It doesn’t get used well and the only way to avoid it is not to disagree with anyone and avoid posting in threads where people you disagree with might be reading.

                                                                      1. 3

                                                                        I would love to see downvotes only when commenting (so you can explain downvotes). Sometimes I see totally valid comments (for my point of view) being downvoted, and as a reader I don’t know why… it’s probably frustrating for the commenter and the readers.

                                                                        1. 5

                                                                          I’m not sure that’s a good idea. If I disagree with someone or maybe I don’t understand their position, I write a comment, and don’t downvote.

                                                                          Requiring a comment for a downvote can lead to the following undesirable behaviors:

                                                                          • Trolls feed on attention, someone actually sitting down and writing a disagreement will only ensure they have been succesfull.
                                                                          • It attaches a username to a disagreement, possibly leading to harassment, retaliatory downvotes, etc.
                                                                      2. 4

                                                                        I still was routinely downvoted as “troll”.

                                                                        This surprises me a bit. I hope the incidence was much lower, but perhaps it can be explained as reputation carrying over, people read comments in your old tone.

                                                                        Could have been me. I’ve downvoted @friendlysock and other’s posts as troll before when I thought they were politely defending/promoting caustic attitudes, discrimination, or other behavior damaging to a community. I realize there are a lot of folks who prefer a written explanation, but I rarely have the bandwidth to sit down and compose a response.

                                                                        That said, I do appreciate @friendlysock’s reflection and change in communication style despite our differences in perspective on other subjects.

                                                                      1. 2

                                                                        I work too much but that’s because of my side projects like the book and OSS stuff. This is nothing my employer asks or expects of me.