fixed bad link in culture order

This commit is contained in:
Alexander 2025-06-16 17:14:32 -04:00
parent 38d366c895
commit 18b0b14e25
4 changed files with 26 additions and 10 deletions

View file

@ -1,6 +1,6 @@
# Functors and Applicatives, Gratis[^falsehood]
It's usually possible to derive implementations of general structures from those of more specific ones, e.g. `Applicative` from `Monad` and `Functor` from `Applicative`. Here's how to do it and and why it's probably best avoided.
It's usually possible to derive implementations of general structures from those of more specific ones, e.g. `Applicative` from `Monad` and `Functor` from `Applicative`. Here's how to do it, and and why not to.
```ocaml
module type Functor = sig
@ -21,7 +21,7 @@ module type Monad = sig
end
```
Here we have the usual module signatures for functors, applicative functors, and monads respectively. The only thing of note is that I've written everything pipe-last[^pipe-last]. It's more common to see these in pipe-first style to agree with the respective infix operators, but I don't see any of those around to get offended; do you?
Here we have the usual OCaml signatures for functors, applicative functors, and monads respectively. The only thing of note is that I've written the functions in pipe-last[^pipe-last] style. It's more common to see pipe-first style, which agrees with the usual infix operators, but I don't see any of those around to get offended; do you?
```ocaml
module ApplicativeOfMonad (M : Monad) :
@ -45,7 +45,7 @@ end
Each of these accepts an instance of a less general structure and uses only the elements the module provides to implement an instance of the more general structure.
It turns out that there are multiple ways to implement the derivation functors--- also multiple ways to implement a particular monad--- and they don't all behave the same, which means it's hard to predict whether the more-general, derived implementations are the "natural" ones that you expected to get without _ad hoc_ testing, which obviously rather defeats the point of "free". On the other hand, the derivations here can be performed pretty mechanically, with little insight, by following the types in much the same way one might mechanically prove an easy proposition.
It turns out that there are multiple ways to implement the derivation functors--- also multiple ways to implement a particular monad--- and they don't all behave the same. That makes it hard to predict whether the more-general, derived implementations are the "natural" ones that you expected to get without _ad hoc_ testing, which rather defeats the point of "gratis". On the other hand, the derivations here can be performed pretty mechanically, with little insight, by following the types in much the same way one might mechanically prove an easy proposition.
***
@ -53,7 +53,7 @@ The modules above that seem to have parameters, do; these modules are called "fu
A subtlety of the OCaml module system is that if a module is defined with a particular `module type` a.k.a. signature attached, e.g. `module M : S = struct...`, all the types that are abstract in the signature `S` will _also_ be abstract in the module itself. This means that the compiler can't see or be convinced that for some `F (M)` with `type t = M.t` in `F`, `M.t` and `(F (M)).t` are equal. This is because both types are abstract, meaning the underlying type is not available. To fix this, we can explicitly expose the equality by using the `with type` construct. In the above, `Functor with type 'a t = 'a M.t`--- for example--- exposes the equality of the two types, so that functions defined as expecting arguments of `'a t` can accept `'a M.t`, and _vice versa_.
[^falsehood]: Unsurprisingly, that's a lie. Isn't it always? You have to buy a `Monad` first.
[^falsehood]: Unsurprisingly, that's a lie. But isn't it always? You have to buy a monad first.
[^1ml]: See [1ML](https://people.mpi-sws.org/~rossberg/1ml/1ml-jfp-draft.pdf) for an OCaml-like language without this stratification.

View file

@ -4,7 +4,7 @@ I've generated a reading order dependency graph for books in Iain M. Banks' unsu
![A dependency graph diagram of what Culture books must eb read before what others.](/culture.dot.png) Above is the graph, and [right here](/culture.dot.txt) is the vizgraph description file that lists my rationale for each dependency.
- _Consider Phlebas_ before _Look to Windward_--- both are about the Idiran War, and _Consider Phlebas_ is first.
- _Consider Phlebas_ before _Look to Windward_--- both are about the Idiran War. The events of _Consider Phlebas_ happen first and are important both for familiarity and for putting LtW into some emotional context.
- _Use of Weapons_ before _The State of the Art_--- these share a main character in Diziet Sma. SotA was actually released before UoW but in my opinion is more satisfying if read after it.
- _Use of Weapons_ before _Inversions_--- UoW gives the best idea of any book about what Special Circumstances is, which must be understood to fully appreciate _Inversions_ in all its subtlety.
- _Excession_ before _The Hydrogen Sonata_--- _Hydrogen Sonata_ is dual to _Excession_ in many ways that can't be explained here without abject spoilage. This one is not a hard rule, but HS is better if you know _Excession_.
@ -12,6 +12,6 @@ I've generated a reading order dependency graph for books in Iain M. Banks' unsu
- _Use of Weapons_ before _Surface Detail_--- you must know who Zakalwe is, the main character of UoW, to fully appreciate the ending of _Surface Detail_.
- _Look to Windward_ before _Surface Detail_--- These books deal with common themes and subjects. Some will disagree with me here, but LtW is more impactful _without_ certain knowledge revealed in _Surface Detail_.
Assuming one agrees with the graph, the set of ideal reading orders (that is, the set such that for all orders it contains, no order exists which is strictly better) is the set of [topological sorts](https://en.wikipedia.org/wiki/Topological_sortinghttps://en.wikipedia.org/wiki/Topological_sorting) of the graph.
Assuming one agrees with the graph, the set of ideal reading orders (that is, the set such that for all orders it contains, no order exists which is strictly better) is the set of [topological sorts](https://en.wikipedia.org/wiki/Topological_sorting) of the graph.
This gives the number of possible ideal orders as 63840. That's a lot of good ways to do it!

View file

@ -21,6 +21,22 @@ source ./pgvv/bin/activate
find acl.cool/site/ ytheleus.org/site/ -type f \( -name '*.dj' -o -name '*.html' \) -exec cat {} + >all_chars.txt
cat common_chars.txt >>all_chars.txt
for font in fonts/LiterataTT/LiterataTT-Subhead{Regular,Italic,Bold,BoldItalic}.woff2; do
woff2_decompress "$font"
ttf_font="${font%.woff2}.ttf"
subset_ttf="${ttf_font%.ttf}-Subset.ttf"
hb-subset "$ttf_font" \
--output-file="$subset_ttf" \
--text-file=all_chars.txt \
--layout-features='*' \
--passthrough-tables
woff2_compress "$subset_ttf"
rm "$subset_ttf" "$ttf_font"
done
for font in fonts/JuliaMono/*{-Light,-Regular,-SemiBold}{,Italic}.woff2; do
woff2_decompress "$font"
ttf_font="${font%.woff2}.ttf"

View file

@ -1,27 +1,27 @@
@font-face {
font-family: 'Heading';
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadRegular.woff2') format('woff2');
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadRegular-Subset.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Heading';
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadItalic.woff2') format('woff2');
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadItalic-Subset.woff2') format('woff2');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Heading';
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadBold.woff2') format('woff2');
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadBold-Subset.woff2') format('woff2');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Heading';
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadBoldItalic.woff2') format('woff2');
src: url('../assets/fonts/LiterataTT/LiterataTT-SubheadBoldItalic-Subset.woff2') format('woff2');
font-weight: bold;
font-style: italic;
}