notes

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 221e04e660dba1a628a2a1ff294b521dd340532e
parent c7f94cd2bd63a1f5201bbe1a1330396a4535be1e
Author: Andrew Laack <andrew@laack.co>
Date:   Mon, 10 Nov 2025 18:06:15 -0600

Started taking notes on Haskell, took some free software notes, some FP and some category theory

Diffstat:
Adocs/AGPL.md | 13+++++++++++++
Mdocs/C.md | 2+-
Adocs/Category.md | 9+++++++++
Adocs/CategoryTheory.md | 7+++++++
Adocs/Class.md | 3+++
Mdocs/ComputerScience.md | 4++++
Adocs/Currying.md | 21+++++++++++++++++++++
Mdocs/DeveloperTooling.md | 7+++++++
Adocs/Flip.md | 7+++++++
Adocs/FreeSoftware.md | 27+++++++++++++++++++++++++++
Adocs/FunctionApplicationOperator.md | 21+++++++++++++++++++++
Adocs/FunctionCompositionOperator.md | 21+++++++++++++++++++++
Adocs/FunctionalProgramming.md | 6++++++
Adocs/Haskell.md | 17+++++++++++++++++
Adocs/HigherOrderFunction.md | 7+++++++
Adocs/LGPL.md | 11+++++++++++
Adocs/Lists.md | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adocs/Morphism.md | 5+++++
Adocs/PartiallyApplied.md | 22++++++++++++++++++++++
Adocs/Pijul.md | 31+++++++++++++++++++++++++++++++
Adocs/REPL.md | 17+++++++++++++++++
Adocs/SoftwareLicenses.md | 11+++++++++++
Adocs/Tuples.md | 16++++++++++++++++
23 files changed, 343 insertions(+), 1 deletion(-)

diff --git a/docs/AGPL.md b/docs/AGPL.md @@ -0,0 +1,13 @@ +# GNU Affero General Public License (AGPL) + +**Definition:** The AGPL is based on the GPL, intended to be used for network based software, requiring the distribution of the source code for networked software that uses the AGPL license. + +## Projects Using the AGPL + +- MongoDB (until chaning licenses) +- Nextcloud +- ScyllaDB +- Mastodon +- PeerTube +- Grafana +- Element diff --git a/docs/C.md b/docs/C.md @@ -1,4 +1,4 @@ -/ C +# C This index tracks c related concepts. diff --git a/docs/Category.md b/docs/Category.md @@ -0,0 +1,9 @@ +# Category + +**Definition:** A category consists of a collection of objects and a collection of morphisms. + +so that: + +- Each morphism has a domain and codomain among the collection of objects +- Each object has an identity morphism +- For any composable morphisms f,g there is a composite morphism whose domain is equal to the domain of f and whose codomain is equal to the codomain of g. Additionally if f: X -> Y and g: Y -> Z then gf: X -> Z. diff --git a/docs/CategoryTheory.md b/docs/CategoryTheory.md @@ -0,0 +1,7 @@ +# Category Theory + +## Links + +- [Category](Category.md) +- [Morphism](Morphism.md) +- [Class](Class.md) diff --git a/docs/Class.md b/docs/Class.md @@ -0,0 +1,3 @@ +# Class (set theory) + +**Definition:** A class in set theory is a collection of sets (or other mathematical objects) that can be defined by a property all members share. diff --git a/docs/ComputerScience.md b/docs/ComputerScience.md @@ -19,7 +19,11 @@ This is the index for my Computer Science related notes. - [Linux Stuff](LinuxStuff.md) - [CPP](CPP.md) - [C](C.md) +- [Functional Programming](FunctionalProgramming.md) - [Developer Tooling](DeveloperTooling.md) +- [Software Licenses](SoftwareLicenses.md) +- [Haskell](Haskell.md) +- [Free Software](FreeSoftware.md) ## Forced to Take Notes on diff --git a/docs/Currying.md b/docs/Currying.md @@ -0,0 +1,21 @@ +# Currying (Haskell) + +**Source:** Effective Haskell + +**Chapter:** 1 + +**Definition:** Currying is the process of converting a function that takes multiple inputs into a function that takes one input and returns a new function with the remainder of the inputs that returns the result. + +```haskell + +makeThruple a b c = (a,b,c) +makeThruple' a b = \c -> (a,b,c) +makeThruple''= \a -> \b -> \c -> (a,b,c) + +``` + +In the above example, we see we are able to decrease the number of inputs to a given function by defining an anonymous function that takes as input the remaining parameters and returns the result. + +NOTE: The backslash character in Haskell is used to define anonymous (lambda) functions. + +In Haskell, you can't define functions with multiple inputs, instead the language under the hood is performing currying, as illustrated in the above example. diff --git a/docs/DeveloperTooling.md b/docs/DeveloperTooling.md @@ -4,4 +4,11 @@ Index for links to notes on developer tooling ## Tools +### Snapshot Based VCSs + - [Git](Git.md) + +### Patch Based VCSs + +- [Pijul](Pijul.md) +- Darcs diff --git a/docs/Flip.md b/docs/Flip.md @@ -0,0 +1,7 @@ +# Flip Function (Haskell) + +**Source:** Effective Haskell + +**Chapter:** 1 + +**Definition:** The flip function in haskell applies only the second argument of a function. Without flipping the inputs, partial application only applies to the first input. diff --git a/docs/FreeSoftware.md b/docs/FreeSoftware.md @@ -0,0 +1,27 @@ +# Free Software + +## Bad Software + +- [GIF](GIF.md) +- [TIFF](TIFF.md) +- [JPG](JPG.md) +- [LZW Compression](LZWCompression.md) + +## Good Software + +- PNG + +--- + +What the fuck are these patents: + +- https://patents.google.com/patent/US20240111498A1/en?q=(LLM)&oq=LLM +- https://patents.google.com/patent/US11900068B1/en?q=(LLM)&oq=LLM +- https://patents.google.com/patent/US12148421B2/en?q=(LLM)&oq=LLM +- https://patents.google.com/patent/US12430503B2/en?q=(LLM)&country=US&status=GRANT&language=ENGLISH&type=PATENT +- https://patents.google.com/patent/US12242826B2/en?q=(LLM)&country=US&status=GRANT&language=ENGLISH&type=PATENT&page=1 +- https://patents.google.com/patent/US11971914B1/en?q=(LLM)&country=US&status=GRANT&language=ENGLISH&type=PATENT&page=4 +- https://patents.google.com/patent/US12282411B2/en?q=(LLM)&country=US&status=GRANT&language=ENGLISH&type=PATENT&page=5 +- https://patents.google.com/patent/US11775414B2/en?q=(code+evaluation)&country=US&status=GRANT&language=ENGLISH&type=PATENT&oq=(code+evaluation)+country:US+status:GRANT+language:ENGLISH+type:PATENT&page=1 +- https://patents.google.com/patent/US11113185B2/en?q=(code+evaluation)&country=US&status=GRANT&language=ENGLISH&type=PATENT&oq=(code+evaluation)+country:US+status:GRANT+language:ENGLISH+type:PATENT&page=1 +- https://patents.google.com/patent/US10606739B2/en?q=(code+quality+evaluation)&country=US&status=GRANT&language=ENGLISH&type=PATENT&oq=(code+quality+evaluation)+country:US+status:GRANT+language:ENGLISH+type:PATENT&page=1 diff --git a/docs/FunctionApplicationOperator.md b/docs/FunctionApplicationOperator.md @@ -0,0 +1,21 @@ +# Function Application Operator + +**Source:** Effective Haskell + +**Chapter:** 1 + +**Definition:** The function application operator ($) sends the result of a function to the input of another function. + +## Example + +```haskell + +addOne num = num + 1 +timesTwo num = num * 2 + +-- These are both identical. + +addOne (timesTwo 2) +addOne $ timesTwo 2 + +``` diff --git a/docs/FunctionCompositionOperator.md b/docs/FunctionCompositionOperator.md @@ -0,0 +1,21 @@ +# Function Composition Operator + +**Source:** Effective Haskell + +**Chapter:** 1 + +**Definition:** The function composition operator (.) is a [higher-order function](HigherOrderFunction.md) used to combine two functions, yielding a new function that accepts an argument to the right-most function. + +## Example + + +```haskell + +addOne num = num + 1 +timesTwo num = num * 2 + +timesTwoPlusOne = timesTwo . addOne + +main = print $ timesTwoPlusOne 10 + +``` diff --git a/docs/FunctionalProgramming.md b/docs/FunctionalProgramming.md @@ -0,0 +1,6 @@ +# Functional Programming (FP) + +## Links + +- [Category Theory](CategoryTheory.md) +- [Haskell](Haskell.md) diff --git a/docs/Haskell.md b/docs/Haskell.md @@ -0,0 +1,17 @@ +# Haskell + +**Definition:** Haskell is a functional programming language named after Haskell Curry. + +**Moto:** Avoid success at all costs + +## Links + +- [Lists](Lists.md) +- [Tuples](Tuples.md) +- [REPL](REPL.md) +- [Currying](Currying.md) +- [Partially Applied](PartiallyApplied.md) +- [Flip](Flip.md) +- [Function Application Operator](FunctionApplicationOperator.md) +- [Function Composition Operator](FunctionCompositionOperator.md) +- [Higher Order Function](HigherOrderFunction.md) diff --git a/docs/HigherOrderFunction.md b/docs/HigherOrderFunction.md @@ -0,0 +1,7 @@ +# Higher Order Function + +**Source:** Effective Haskell + +**Chapter:** 1 + +**Definition:** A higher order function is a function that accepts at least one function as an input or returns at least one function. diff --git a/docs/LGPL.md b/docs/LGPL.md @@ -0,0 +1,11 @@ +# LGPL + +**Definition:** The LGPL is a companion to the GPL that serves as a more permissive license, allowing for linked libraries to not be licensed under the GPL (or LGPL). + +## Software Licensed Under the LGPL + +- OpenOffice +- QT +- GIMP + +Basically nothing worthwhile. diff --git a/docs/Lists.md b/docs/Lists.md @@ -0,0 +1,59 @@ +# Lists (Haskell) + +**Source:** Effective Haskell + +**Chapter:** 1 + +## Usage + +### Basics + +Definition of a list is simple: + +[1,2,3] + +[1..10] + +["one", "two", "three"] + +These are all valid list definitions. The second one works similar to the seq command as it fills in all numbers between the lower and upper bound (inclusive on both sides). + +More complex examples: + +[2,4..10] -> [2,4,6,8,10] + +[4,3..1] -> [4,3,2,1] + +[0,10..100] -> [0,10,20,30,40,50,60,70,80,90,100] + +In these examples, we see the difference between the first two numbers is used to fill in the numbers between the second number and the upper bound. + +[0,10..97] -> [0,10,20,30,40,50,60,70,80,90] + +We see our rule enumerates all numbers [lower, upper]. + +A few other examples that needn't be explained, but illustrate the point: + +[10..1] -> [] + +[10..10] -> [10] + +### Math Relation + +A nice way to think about this is from the set theoretic perspective. + +I can state the even numbers in $N_0$ up to 10 as the set $\{0, 2, ... 10\}$, or I could define them in Haskell with [0,2..10]. The main differences I notice between the two is that $\{0,-2,...10\}$ doesn't make sense as a set definition, but [0,-2..10] works in Haskell (although it evaluates to []), and that $\{0,23,...100\}$ doesn't make much sense, but in Haskell [0,23..100] is the same as [0,23,46,69,92]. + +### Arithmetic Expressions + +[10 + 2, 10 * 2, 10 - 2, 10 / 2] -> [12.0, 20.0, 8.0, 5.0] + +### Types + +Lists can't have mixed types. + +[10, "ten"] is invalid. It also has implicit type casting so [10, 10.0] is valid and evaluates to [10.0, 10.0]. + +### Lists of Tuples + +Lists can contain tuples to get around the issue of lists not being able to store multiple types of values. Despite this, each of the contained tuples must then be the same size and have the same types at each index. diff --git a/docs/Morphism.md b/docs/Morphism.md @@ -0,0 +1,5 @@ +# Morphism + +**Definition:** A morphism is a structure preserving map that has a domain and a codomain + +Morphisms relate two objects called the source and the target of the morphism. diff --git a/docs/PartiallyApplied.md b/docs/PartiallyApplied.md @@ -0,0 +1,22 @@ +# Partially Applied (Haskell) + +**Source:** Effective Haskell + +**Chapter:** 1 + +**Definition:** Partially applied functions are ones where not all input parameters have been passed. + +## Example + + +```haskell +module Main where + +greet message person = print (message <> " " <> person) + +greeting = greet "Hello" + +main = greeting "Andrew" +``` + +In this example, we call the function greet with one input and later pass the second input to fully saturate the function. diff --git a/docs/Pijul.md b/docs/Pijul.md @@ -0,0 +1,31 @@ +# Pijul + +**Source:** [https://pijul.org/](https://pijul.org/) + +**Definition:** Pijul is a distributed VCS licensed under the GPLv2 based on a theory of patches. + +## Affordances + +### Commutation + +Patches that are independent can be applied without ordering and without changing the resulting state or version identifier. + +### Conflict Resolution + +Conflicts between patches are resolved by another patch. This ensures conflicts never come back. + +## Comparison + +### Darcs + +The most obvious comparison for Pijul is Darcs since they are two of the most popular patch based VCSs. + +#### Pros + +- Faster +- Supports Branches +- Solvese Exponential Merge Problem + +#### Cons + +- No darcs replace analog diff --git a/docs/REPL.md b/docs/REPL.md @@ -0,0 +1,17 @@ +# REPL (Haskell) + +**Source:** Effective Haskell + +**Chapter:** 1 + +**Definition:** Read Evaluate Print Loop + +## Usage + +### Setup + +Run `:set prompt "Prelude> "` to set Prelude> as your prompt which gives access to common functionallity. + +### Loading Code + +You can load code with the `:load` command. This is very useful for debugging as it gives access to functions defined in the code. diff --git a/docs/SoftwareLicenses.md b/docs/SoftwareLicenses.md @@ -0,0 +1,11 @@ +# Software Licenses + +Links to notes about software licenses + +- GPL V2 +- GPL V3 +- [AGPL](AGPL.md) +- [LGPL](LGPL.md) +- MPL +- CDDL +- BSD diff --git a/docs/Tuples.md b/docs/Tuples.md @@ -0,0 +1,16 @@ +# Tuples (Haskell) + +**Source:** Effective Haskell Book + +**Chapter:** 1 + +## Basics + +Tuples in Haskell have a fixed length as opposed to the dynamic length of lists. Additionally, unlike lists, they can contain elements with different types. + +## Functions + +- fst: + - Get the first element of a tuple +- snd: + - Get the second element of a tuple