Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts
Coming soon

It established an UTF-8 everywhere convention, and doing encoding/decoding to UTF-16 on windows behide the scenes. It can even correctly handle ansi escape code on window, again by doing translation for you.

How does it deal with the things not being unicode? I tried looking through the documentation and I couldn't find anything even mentioning this design decision.

I was actually very disappointed in the clarity libuv's documentation provided. I don't see them say they do anything with the encoding at all.

Original Poster1 point · 10 months ago

I wonder why it only broke recently.

see more

Your device is probably too old to support TLS 1.2, which Apple only added in iOS versions 5 and higher.

Versions of SSL/TLS have significant security problems, as such versions of TLS earlier than 1.2 are being deprecated widely. As an example, PCI DSS has not considered early versions of TLS to be strong cryptography since v3.1 (April 2015). You are likely to encounter a rapidly raising rate of issues connecting to HTTPS sites without modern TLS support on your client in the near future.

2 points · 1 year ago

Under what conditions would it make sense to use cabal by itself? The only times I can think of would be when you're using something else (Docker, Nix) to provide sandboxing instead.

see more
3 points · 1 year ago

Pretty much any? You're using cabal under stack, only now you have to go through stack to deal with cabal.

In the end you have to deal with cabal though. Why complicate things?

2 points · 1 year ago · edited 1 year ago

According to Data.Int an Int is guaranteed to be in the range of [-229 .. 229 - 1].

The implementation of genericLength is not just fromIntegral . length, but a reimplementation of length using the given Integral type for counting.

I guess this allows the functions of some containers to work with more than 229 elements by choosing something bigger than Int as index type.

see more
2 points · 1 year ago

Luckily in practice we get a 64-bit Int. Otherwise a lot of my code wouldn't work. Sadly, that just means I'm writing unsafe code, but its really hard not to given one often can't write a good 'length' one's self.

I wish it was different.

How did you make reflex work? Was it a long process? Did you have manually install dependencies?

see more
1 point · 1 year ago

I just add it to my dependency list and "cabal new-configure && cabal new-build".

It doesn't seem that simple to me, unfortunately:

$ /home/cats/.cabal/bin/cabal sandbox init                                                                                                                                                                      
Writing a default package environment file to
Creating a new sandbox at /home/cats/sandbox/reflex-stack/.cabal-sandbox
$ /home/cats/.cabal/bin/cabal new-configure                                                                                                                                                                     
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: reflex-dom-0.3 (dependency of reflex-stack-
next goal: webkitgtk3-javascriptcore (dependency of reflex-dom-0.3)
rejecting: webkitgtk3-javascriptcore-,
webkitgtk3-javascriptcore-, webkitgtk3-javascriptcore-,
webkitgtk3-javascriptcore- (conflict: reflex-dom =>
rejecting: webkitgtk3-javascriptcore-,
webkitgtk3-javascriptcore-, webkitgtk3-javascriptcore-,
webkitgtk3-javascriptcore-, webkitgtk3-javascriptcore-,
webkitgtk3-javascriptcore-, webkitgtk3-javascriptcore-,
webkitgtk3-javascriptcore-, webkitgtk3-javascriptcore-
(conflict: requires pkg-config package webkitgtk-3.0>=1.1.15, not found in the
pkg-config database)
rejecting: webkitgtk3-javascriptcore-,
webkitgtk3-javascriptcore- (conflict: reflex-dom =>
Dependency tree exhaustively searched.
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3
$ /home/cats/.cabal/bin/cabal --version                                                                                                                                                                         
cabal-install version
compiled using version of the Cabal library 

Any ideas?

see more
1 point · 1 year ago

It looks like you've depended on reflex-dom, not reflex. This pulls in a lot of system libraries. In your case, as you can see, it can't find "webkitgtk". You're missing the development headers for GTK it would seem.

On a Debian system you'd "apt-get install libwebkitgtk-dev". (You'd also need likely need cairo, pango, and gtk3 though, as it did hear it'll tell you about which ones you need explicitly)

You might prefer to specify "--ghcjs" to build the non-native version. This will of course require having ghcjs installed.

Load more comments

5 points · 1 year ago

The migration is now completed. The old server will continue to forward to the new for some time.

Please report any issue you have with the new hackage server.

7 points · 1 year ago

Nix does not strip dependency bounds unless you explicitly jailbreak the package. Nix is like Stackage in that it picks a default version for every package and if that default version falls outside your specified version range then your build fails. Then you either have to expand your version bounds or override the default version that Nix selects.

see more
1 point · 1 year ago

No, it at least very much did. I specifically said "I must have a version of directory newer then ..." and it selected a version 2 versions older which specifically had the implementation error I was avoiding.

There was a bug filed, and it was a WILLNOTFIX. They were unwilling to have multiple copies of packages even when the currently available packages were broken and they did not fail to build in that cases. It was extremely explicitly done in the Haskell modules configuration file.

Can you link that issue? It definitely does error on version bounds today.

Also, they do actually have multiple versions of packages in haskellPackages. There is generally the curated version, which is often outdated. And there is often a more verbosely named package for the most recent version on Hackage, such as purescript_0_10_5. Plus, if you need a more up to date version, and it's not available on nixpkgs, it's easy to depend on it manually.

see more
2 points · 1 year ago

I'll look for it, this was over a year ago though. The core problem seemed to be they believed because 'directory' was distributed with GHC it would satisfy for any package that would build with that GHC and there was no reason to package directory from Hackage. This was very specifically an issue with how they viewed GHC distributed packages but sadly GHC distributed packages have issues also.

Load more comments

davean commented on
r/haskellPosted byu/[deleted]
18 points · 1 year ago

All computer programs are just calculators. That is all computers do.

3 points · 1 year ago

Among other issues, a surveyor can't verify the laminate condition in below freezing weather. Perhaps a contingent agreement would be the way to go? Then you could have the survey finished in the spring, and do a sea trial.

Running stack new also gives you a package with a four-part version number unless you select a different template. Based on that and cabal init, I disagree that most packages do whatever the template set up for them. If that was true, more than 4,638 packages out of 10,642 would use four-part version numbers!

I agree that most packages probably don't follow the PVP or SemVer but instead just do whatever they want. Unfortunately there's no way for me to empirically prove that one way or the other.

see more
7 points · 1 year ago

Choosing to say something that the methodology doesn't back up because of a bias you wish to support can very easily be seen as intellectual dishonesty.

It wouldn't be hard to believe that you'd purposely left out the ambiguity with the intent of supporting your conclusion.

Is that really how you want to be seen?

There's a reason why this was in a tweet rather than a blog post. I started with the assumption that A.B.C means SemVer and A.B.C.D means PVP. I am happy that I now know those assumptions are worthless! I did not know that before.

see more
1 point · 1 year ago

Which is why one should state their methodology when making a claim. Which is a good reason never to use twitter for an actual discussion.

-2 points · 1 year ago · edited 1 year ago

This quick sort algorithm I stole from a SPJ slide

sort [] = []
sort [x] = [x]
sort (x:xs) = sorted !! 0 ++ eq ++ sorted !! 1
    eq = x : [ w | w <- xs, w == x]
    lt  = [ w | w <- xs, w < x]
    gt = [ w | w <- xs, w > x]
    sorted = [ sort ws | ws <- [lt,gt] ]

Edit: I now see you asked for Array and not list solutions.

see more
7 points · 1 year ago

What do you think the run time of that is? (hint: that's not really quicksort)

I wouldn't use that if I were you. You can find 'sort' in Data.List of 'base' if you want to sort a list. It'll serve you far better.

Och indeed, you can give up sorting the tail after you've sorted the prefix. You still have to force the whole list though.

"Absolutely crucial" and "disastrous" are over selling things though - I'd settle for calling it "a nice trick".

see more
16 points · 1 year ago

Without it, when you combine two algorithms you need to rewrite them both each time. With it you rarely do. I'd say its absolutely crucial to the re-usability Haskell actually sees in practice of its libraries which is far and away unlike any other language I've ever worked with.

Yes, he used a trivial example, but that was just probably for simplicity of explanation. It comes up everywhere.

Original Poster3 points · 1 year ago

I installed Ubuntu LTS 16.04 on VirtualBox and Raspbian on an Raspberry Pi. I did nothing out of the ordinary, both did not have a locale 'properly' configured. Google for the error messages various programs give you when locales are improperly configured, A LOT of people have this issue. It's not some obscure weird problem. It's also not obvious how to fix it, many of the suggested steps, running raspi-config and configuring it there etc. do absolutely nothing. I still have no idea what to do so my locale is fixed inside the environment that daemontools provides. Looks like /etc/defaults/locale isn't sourced there.

Thanks for your suggestion about the encoding! I gave it a shot and it seems to work. This is really what I would've expected by default. When in doubt, just use UTF8. I don't care about any 'locale', don't crash my program because I printed a non-ASCII character. At the very least I would've preferred for Haskell to simply output questions marks, spaces or just skipping unprintable characters, at least then a user looking at the output could've reasonably assumed a terminal or system configuration problem. The error message in the thread title just makes it look like a bug in the Haskell program.

see more
2 points · 1 year ago

Just testing this I see nothing like what you refer to. Do you have any idea how the locale is broken?

Do you mean perhaps setting a LANG that the system doesn't have? That's the only type of "broken" locale I can even imagine beyond a completely corrupt file which should give all sorts of issues.

I'll admit I've never even heard of a broken locale before or how one might possibly have that happen.

And the hPutStrLn form would lead to deadlock

It releases the lock between block flushes. The lines are still jumbled, but only when your line is longer than the buffer size, which is a much more exceptional case than the typical case which is you want to print a line from 2 different threads.

You're throwing the baby out with the bathwater by defending a ridiculous use case of wanting to call putStrLn on an infinite string.

see more
2 points · 1 year ago

We can't know what the underlying block size is. So if we don't support LineBuffering exactly the result remains similarly defined. Both lead to some unknown interleaving of the outputs. So you can't really rely on the result thus you shouldn't do it this way.

In the case of bytestring's hPutStrLn it's hardcoded to 1024, which I think is reasonable.

see more
9 points · 1 year ago

That won't work reliably. Even all POSIX systems or Linux systems. You're going to have to do FAR better to get a reliable definition. POSIX uses PIPE_BUF for the size that can be 'write'ed atomically.

My point, and I'm going to end here, is you really have to consider these things with care you don't seem to be taking. If you're going to write reliable multithreaded systems the edge cases aren't "ridiculous" they're the core of what you're doing.

Load more comments

Original Poster2 points · 1 year ago

Interesting. What's your source of leap-second data?

see more
1 point · 1 year ago

I have a few, the first I try is which i cache on the FS. To avoid load on them I have an internal HTTP cache of it. I collected a few backup sources too though.

It gives me a way to get onto TAI when a GPS isn't available to the system.

Original Poster1 point · 1 year ago

So you use parseTAIUTCDATFile? I was planning on removing that, since tai-utc.dat doesn't include an expiration date.

see more
1 point · 1 year ago · edited 1 year ago

You just need that file for the history.

But yes, that is the worst format for that file. Maybe you could change it to the NIST one?

Edit: Sorry, I left off a part. For the validity I cross-check with Bulletin C but it would be nice to just use the NIST file which both has validity information and a signature. Though their signature format is sadly deficient.

As I said "I currently track the partiality of the table externally." which is annoying.

Load more comments

15 points · 1 year ago · edited 1 year ago

How did you attract more engineering talent to the team? Did you find Haskellers or did you have to hire good people and give them time to learn? How long does it take people to get up to speed with Haskell, generally?

I was able to observe a situation where a Haskeller left and the replacement position was listed in two places: as a Haskell position in Haskell forums, and as a Java position. The people responding to the Haskell posting were overwhelmingly better candidates than the people responding to the Java posting. Your ability to hire Haskell programmers will be influenced by how picky you are as well as how flexible you are in terms of things like working remotely. But there's a pretty good chance you'll receive at least a dozen or so inquiries from people who are significantly above average.

Is it easy for junior devs (less than 2 years of experience) to understand and appreciate Haskell ? Or is the goodness apparent only after you've spent years programming?

It took me awhile to get proficient with Haskell, but a significant part of that was because I was learning it by myself in my spare time. I've seen junior developers without Haskell experience get up to speed pretty quickly when they have an experienced person around to help and learn from.

What about the maintenance phase of the project? Did new people come in and hate the existing Haskell code-base (like it happens in so many other languages)? Or were new devs able to grok everything and start contributing much faster?

In my experience new developers have had a MUCH easier time getting up to speed and contributing to the code base. In one particular case, I had started a project and a coworker came in after a couple months and made a large sweeping change that affected the entire project. He and I were both shocked when the change worked the first time it compiled successfully! He even expressed the shock in the commit message, writing something along the lines of "the godlike refactoring".

In another situation, I made a sweeping change that affected a large portion of a ~15,000 line code base to make things easier to understand. There was never a question in my mind of whether the change would introduce any bugs. The compiler told me everything that I needed to change, and I don't recall any bugs or excessive testing needed.

What about technical debt? Did the refactoring story of Haskell live up to its claims?

The refactoring/maintenance story is where Haskell is the biggest win. You can refactor fearlessly. And better yet, the compiler actually helps you with the refactoring. Compared to dynamic languages like Ruby, Python, and Javascript, it really is in a different universe. In this comment I describe a real world situation I encountered recently where regressions created by a Javascript refactoring would simply never have happened if we had been using Haskell.

Did the testing/QA story live up? Considerably lesser testing required? If it compiles, it runs correctly?

Yes. As evidenced by what I mentioned above, Haskell really does live up to the compiles = works correctly claims. Obviously this doesn't mean that Haskell is immune to bugs. But it is so much less prone to them that I think the claims are not misplaced.

see more
4 points · 1 year ago

The refactoring story is where Haskell is the biggest win. You can refactor fearlessly. And better yet, the compiler actually helps you with the refactoring.

Not even just refactoring but general maintance. Just this weekend I was able to add functionality to a library highly abstracted by type classes without ever needing to take the time to understand the library's core. Given the types I could show that my function must be correct and get on with more important work.

I threw in some tests too, but what could have been an all day job of educating myself became a 30 minute project of deriving code based on types.


My Keybase proof [reddit:davean = keybase:davean] (b4VWCVbbUxlnHGkvnV8ki6hLfpjpCIkCWTZsFea_v7Y)

Keybase proof

I hereby claim:

  • I am davean on reddit.
  • I am davean on keybase.
  • I have a public key whose fingerprint is BD1C 6A28 6454 457F 8776 D324 8911 6646 4680 9989

To claim this, I am signing this object:

    "body": {
        "key": {
            "eldest_kid": "0101f0bdcdcba61fdedda9b4588a6c25e2996fd700f9a22f434b3c8b0c347bf3659a0a",
            "fingerprint": "bd1c6a286454457f8776d3248911664646809989",
            "host": "",
            "key_id": "8911664646809989",
            "kid": "0101f0bdcdcba61fdedda9b4588a6c25e2996fd700f9a22f434b3c8b0c347bf3659a0a",
            "uid": "14e837cb0d08554920251cc4e323d119",
            "username": "davean"
        "service": {
            "name": "reddit",
            "username": "davean"
        "type": "web_service_binding",
        "version": 1
    "ctime": 1454986909,
    "expire_in": 157680000,
    "prev": "f474c71d0961c8f9b56f9d8103ac1140e2945dca1d88173864e921103e92d435",
    "seqno": 3,
    "tag": "signature"

with the key from above, yielding:

Version: GnuPG v2


Finally, I am proving my reddit account by posting it in /r/KeybaseProofs


Wow, this is terrific. I love the overlay you added with splits and arrow key status. Well done!

see more
2 points · 2 years ago

Yah, that is a really nice overlay. I'm afraid the timing is path Dependant or it would be need to have it as an option by default.

Clearly a few ways to do it faster though!

1 point · 3 years ago · edited 3 years ago

I'd like to point out that Reddit's "best" comment sorting was originally designed by Randall Monroe (xkcd) and is also fairly simple, albeit predictive of a comments future potential score, rather than a reflection of its actual score.

Ninja Edit: This comment from several years ago, which I found on google pretty fast, explains that xkcd didn't actually write the code for it, /u/davean did, and that davean is xkcd's forum sysadmin.

see more

"best" sort is really better for comments then posts. It doesn't play as nicely with a time component and I'd comment that time is pretty critical on the posts.

If I just want to glue together chunks and manipulate things chunkwise, then this should not require any fancy structure like a Builder

Not exactly disagreeing, but... Why not?

In both Java and Python, concatenating strings in a loop is quadratic; in the former you use a StringBuilder to avoid this, and in the latter you build up a list (or any iterable, really) and then ''.join(it). Even in Haskell, you don't want to be building lists by appending.

Why is concat not enough?

see more
6 points · 3 years ago

Because it has completely different asymptotics, thats why. Strict Text is an array without sharing. You'll get memory bloat and burning CPU cycles by using the strong structure.

Builders don't do the same thing as Lazy Text even, you simply can't write the same programs with them.

Keeping Lazy Text is pretty much an algorithmic requirement. You could advance it to be a rope or something, but you need a chunked version.

Original Poster1 point · 3 years ago

Huh. I know for sure that I used it successfully about 12 hours ago, and now it's not working. Strange.

see more
3 points · 3 years ago

Its been gone since it was delaying updating to HTTPS support. As the last thing on the list, we just disabled it so we could. Its just commented out in the HTML.

Its been a few months now. Since right before April 1st I think.

67 points · 3 years ago

We'd actually still accept new ones if you want more recent versions. See

9 points · 3 years ago

Does this include recent comics after the 3D April's Fool joke?

see more
11 points · 3 years ago

Yah, we'd take them.

1 point · 3 years ago

So colored images are saved to the server but do not get shown to other users?

see more

Who said they were even saved? Some could be. A lot of the time, the directs I've seen around won't even have the server consider them that much.

Original Poster2 points · 3 years ago

You can't legitimately draw in color, and I think there's some server side stuff that filters out colored images before showing to other people.

see more

I've not seen sufficient instructions for uploading your own images actually. The snippets I've seen floating around could working, conditionally, but if you just use them it'll definitely fail.

From what I understand of your method though, it'll actually just work.

Yeah same here. Maybe a recent overload or something

see more

Occasionally we rolled new data models. As it was a day project, there wasn't live migration. New data models required a stop-the-world conversion.

Solving it would have been easy, just taken time that wasn't in the budget. I hope to add the basic support for that to the libraries we use in the future.

2 points · 3 years ago

Are there any logs on the system indicating activity?

see more
2 points · 3 years ago

We have logs. There is very little activity.

Only a few of the users have logged in in recorded history. Most of the activity is hitting old user websites and such, though that does happen.

A very few people use it regularly.

Cake day
July 25, 2006
Moderator of these communities

19,036,348 subscribers


4 subscribers


2 subscribers

Trophy Case (7)
11-Year Club



Team Periwinkle

Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.