Go to file
2024-05-24 19:44:55 +02:00
.direnv fuck base lmao 2024-05-24 17:02:29 +01:00
src/Data fuck base lmao 2024-05-24 17:02:29 +01:00
.envrc fuck base lmao 2024-05-24 17:02:29 +01:00
.gitignore fuck base lmao 2024-05-24 17:02:29 +01:00
CHANGELOG.md fuck base lmao 2024-05-24 17:02:29 +01:00
flake.lock fuck base lmao 2024-05-24 17:02:29 +01:00
flake.nix fuck base lmao 2024-05-24 17:02:29 +01:00
lattice.cabal fuck base lmao 2024-05-24 17:02:29 +01:00
LICENSE fuck base lmao 2024-05-24 17:02:29 +01:00
README.md oops forgor how markdown 2024-05-24 19:44:55 +02:00

What?

this adds a class of types you can perform boolean operations on

the simplest example is Bool itself:

False || False = False
_ || _ = True

Why?

very frequently i need to redefine the basic boolean operations exported by Prelude

a one simple example of this is the involvement of predicates

takeWhile (isAlphaNum || (== '_') || (== '-'))
takeWhile (\x -> isAlphaNum x || x == '_' || x == '-')

this doesnt look like too sizeable of a difference, but once you give the variable an even slightly more descriptive name, and start stacking up other predicates, you'll be very happy to skip it entirely

so this library exists to allow me to Not redefine the boolean operations exported by Prelude over and over and over and over and over again

additionally, the library adds other useful combinators. the least interesting of these are the implication -* and exclusion </, which exist more for readability than anything

the two more interesting combinators are the (in)equality operators, =*= and =/=, which respectively produce the corresponding truth values when comparing two of the same or two different elements

How?

recommended usage is to import Prelude hiding the (||), (&&), and any additional boolean functions, and add Data.Lattice to your list of imports

if youre making an alternative prelude (or you work on base, god help you), feel free to include this library or copy-paste this code

i literally do not care lmao the license only exists cause cabal wouldnt let me not choose one, the fuckers