7 ms·
Your question reminded me of MAYBE. I often joke about the MAYBE logical operator with friends. It's based on the concept of three valued logic [1]. It alway
by sixdimensional 8y ago
Your question reminded me of MAYBE.
I often joke about the MAYBE logical operator with friends. It's based on the concept of three valued logic [1]. It always came up for me in SQL where you have a cell in a result that can be NULL, NOT NULL or a value. I also use it to refer to spaghetti or complex code where the outcome on first glance is "maybe this or maybe that, or maybe something in the middle". Again, I use it as a joke when it is a totally real concept.
It seems like increasingly we are trying to extract approximate answers from machine learning, statistics, etc. because in so many cases it seems difficult to get to TRUE or FALSE for a given hypothesis. We want "MAYBE" with enough accuracy to believe it is mostly TRUE or 100% TRUE (but often 95% confidence - heck even 85% is still amazingly valuable when you aren't sure at all).
I believe there is a programming language that handles this (I forget which one though - anyone?). I know quantum processors potentially could handle it since they have multiple states for a qubit which could represent different states of "in-between" TRUE and FALSE.
[1] https://en.wikipedia.org/wiki/Three-valued_logic https://en.wikipedia.org/wiki/Three-valued_logic
- mitchty 8y agoThis basically exists in Haskell/Idris as the Maybe type. It is used slightly differently than what you're saying but in essence it lets you say: - The thing doesn't exist, return Nothing (unit in a way) - The inputs produced Just the thing you wanted You have to cover both "didn't work" and "here you go" but its highly useful to not have to worry about NULL versus NOT NULL. https://stackoverflow.com/questions/29456824/what-is-the-maybe-type-and-how-does-it-work https://stackoverflow.com/questions/29456824/what-is-the-may... Your function that decides if something exists or not, could be the thing determining the percentage spiel. Aka a function returning Maybe Bool could return: a Bool with true/false, or Nothing. Nothing being "its not a bool, your inputs are insane/nonsensical", but if it returns a Just Bool, you just unbox the Bool and voila. Just thought you might want to know this is a real thing and is super useful.
- sixdimensional 8y agoAh, thank you. I knew it existed in some language, but I couldn't remember where I had seen it. I need to practice Haskell a bit more.. it's not one of the languages I ever seem to get around to.
- mitchty 8y agoIts fun! Also maddening, in the "this is computation in a totally different paradigm" way. But Maybe as an example is one of those things that show you there are better ways than NULL.