Hacker Newsnew | past | comments | ask | show | jobs | submit | edef's commentslogin

> I get to take for granted that a boolean is true or false (and not some brilliant third value!)

  [True, False, undefined] :: [Bool]


The traditional third value is actually FileNotFound: https://thedailywtf.com/articles/what_is_truth_0x3f_

but in Haskell, yes, it's undefined. Which isn't a real value! For example, infinite loops are undefined. Theorists like to call it a value of every type, but in practical terms, it's more like a computation that never produces a value. The builtin "undefined" can be written as an infinite loop ("undefined = undefined") and many other pure infinite loops can also act as undefined values. The runtime is able to catch some and crash instead of hanging, but not others.


Nah.

  check :: Bool -> a
  check  True = undefined
  check False = undefined
  check     _ = undefined


  7:1: warning: [GHC-53633] [-Woverlapping-patterns]
      Pattern match is redundant
      In an equation for ‘check’: check _ = ...
    |
  7 | check     _ = undefined
    | ^^^^^^^^^^^^^^^^^^^^^^^


See, you can even do quantum computing very naturally in Haskell.


The qemu TCG parts that it presumably links to are GPLv2, so the combined project is GPLv2 by necessity[1]. I think that's all they're trying to get across.

[1]: apart from viral licenses being pretty much meaningless under EU copyright law


Exactly. We wanted MIT, but we were infected by the GPLv2 due to the QEMU dependency. So we licensed each file under MIT, but GPLv2 as a whole.

QEMU does something similar:

    https://github.com/qemu/qemu/blob/master/LICENSE


Aha!

I think you could phrase that better. Maybe something like “This projects builds on GPLv2-licensed code, so the project is GPLv2-licensed. If you want to use our additions in isolation, you can choose to use them as either GPLv2 or MIT licensed”?


You can do this from the app switcher: long-press the "title bar", and there'll be a round "I" button that takes you to the app's settings.


> This is such an old programming language flame war trope that it was probably first written in Aramaic.

I love the quip, but

> people literally said it about assembly language. If for no other reason than to preserve your own dignity, please don't imply that people program in a particular language because they're not good enough to program in other languages.

This is an inversion of the sentiment being expressed: the suggestion is to use languages that allow you to shift more cognitive overhead to the compiler and tooling. If anything, I program in Rust when I fear that the keeping track of all the little bits Go doesn't help me with will take up too much of my puny human brain.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: