Title: Theory / Unimportant / Math / Category / programmer
Tags: FromInstruction computer_to_instruction hasNotNewEffectReturnsMeaning some_instruction duplicateFromOtherBook duplicateToOtherBook fromMath defToAlgebra examplesSwitchExample1 mathToDef multipleBook setMultiplication toBinaryFunction toBinaryRelation type

Name: Initial element
Definition: An object \(X\) such that for any object \(C\) there is a unique morphism \(X\to C\).
Page: 56
Chapter: 5
Section: 1
Variables: \(\mathbf C\) a category,
\(X\in \mathbf C_0\).
Notation: 0
Example: empty set
Name2: coterminal object
Example2: Void
Extra: other names from wp
Awodey, ch 2. Sect. 2.2, page 33
Applied to: set
Name3: universal object
Applied to2: Haskell
Property: Unique up to iso
Name4: initial object

Name: A functor
Definition: A function sending objects to objects, arrows to arrows, identity to identity, and preserving compositions
Page: 94
Chapter: 7
Section: 1
Example: The powerset function, sending sets to their power set and functions \(f:X\to Y\) to \(A\mapsto \{f(a)\mid a\in A\}\)
Example2: Maybe is a functor from a to Maybe a

Name: The coproduct of \(A\) and \(B\)
Definition: A diagram of the form \(A\xrightarrow{q_1} Q\xleftarrow{q_2}B\), such that, for any \(Z\) and \(A\xrightarrow{z_1} Z\xleftarrow{q_2}B\) there is a unique \(u:Q\to Z\) with \(u\circ q_i=z_i\).
Page: 055
Chapter: 3
Section: 3.2
Variables: \(\mathbf C\) a category,
\(A,B\in\mathbf C_0\).
Notation: \(A+B\)
Kind: Def
Example: Disjoint union
Example2: Left of A | Right of B, (Either A B)
Applied to: set theory
Applied to2: Haskell

Name: A terminal object
Definition: An object \(X\) such that for any object \(C\) there is a unique morphism \(C\to X\).
Page: 033
Chapter: 2
Section: 2.2
Variables: \(\mathbf C\) a category
Notation: 1
Example: Singleton
Name2: A final object
Example2: trivial group
Extra: 2nd name by wp
Applied to: Set
Applied to2: Grp
Cardinal: At most one, up to iso

Name: A product diagram for the objects \(A\) and \(B\)
Definition: An object \(P\) and arrows \(A\xleftarrow{p_1} P\xrightarrow{p_2}B\) satisfying the following UMP:
Given any diagram of the form \(A\xleftarrow{x_1} X\xrightarrow{x_2}B\) there exists a unique \(u:X\to P\) such that \(x_i=p_i u\).
Page: 038
Chapter: 2
Section: 2.4
Variables: \(\mathbf C\) a category and
\(A,B\in\mathbf C_0\).
Index: 13
Kind: Def

Instruction: snd
Page: 26
Chapter: 2
Returns: The second element of a pair
Typ: (a,b)->b

Instruction: Nothing | Some a
Page: 85
Effect: A constructor for potential value
Chapter: 5
Section: 1
Typ: Maybe a

Instruction: class ClassName typeOne typeTwo ... where
functionNameOne::typeOne
functionNameTwo::typeTwo
Page: 103
Effect: Declaring a typeclass
Chapter: 7
Section: 1.4

Instruction: instance NameType NameTypeClass where
varOne = valueOne
...
Page: 152
Effect: State that NameType belongs to NameTypeClass, and that the var_i value of this class is value_i.
Chapter: 6
Extra: duplicate

Page: 4-6
Section: 1
Notation: \(g\circ f\)
Variables: \(f:A\to B\),
\(g:B\to C\)
Name: Composition of \(f\) and \(g\)
Kind: Cor
Associative: Associative,
Name2: \(g\) after \(f\)
Notation2: \(f|g\) (in unix)
Unit: Identity

Instruction: \(g\circ f\) or \(g.f\)
Page: 4
Effect: \(x\mapsto g(f(x))\)
Context: Haskell
Chapter: 1
Variables: \(f:A\to B\),
\(g:B\to C\)
Kind: Cor

Instruction: id
Page: 7
Effect: \(x\mapsto x\)
Context: Haskell
Chapter: 1

Name: A category
Definition: Objects
Page: 9
Chapter: 1
Section: 2
Definition2: Arrows between objects
Conjdef: All of
Definition3: An identity arrow by object
Definition4: Composition for pair of arrows \((f,g)\) with codomain of \(g\) equals to the domain of \(f\)
Definition5: \(f\circ id=id\circ f=f\)

Question: Geometry metaphor for programming
Answer: Code is the volume,
Surface is the information needed to manipulate data
Surface should grow slower than volume/informations grows slower than code
Page: 10
Chapter: 1
Section: 3

Typ: A class
Function: mappend:: m-> m->m assumed to be associative, and such that (mappend mempty) and (x-> mappend x mempty) are the identy functior
Page: 32
Chapter: 3
Initialization: mempty:: m
Variables: Monoid m

Page: 37
Chapter: 3
Name: the monoid obtained from \(M\)
Set: the arrows of \(M\)
Variables: \(M\) a categorical monoid
*: category's composition

Typ: Writer a
Meaning: (a, String)
Page: 37
Chapter: 4
Section: 2
Context: Haskell - Category

Page: 37
Effect: (a_1 -> Writer a_2) -> (a_2 -> Writer a_3) -> (a_1 -> Writer a_3)
Takes two morphism from a_i to Writer a_i+1. Compose them and append the strings
Context: Haskell - Category
Chapter: 4
Section: 1
Abbreviation: >=>
Name: fish

Instruction: \x -> foo
Page: 37
Context: Haskell
Chapter: 4
Section: 1
Returns: A function, taking a parameter x and returning foo, with x interpreted as the parameter's value

Objects: the types of the underlying programming language
Arrows: functions that go from A to a type derived from B using the particular embellishment
Page: 52
Chapter: 4
Section: 3
Name: A Kleisli category in l
Variables: l a programming language
Initial: Void
Terminal: ()
Coproduct: Either A B
Product: A * B
Context: Haskell

Name: Writer monad
Definition: todo once understood
Page: 52
Chapter: 4
Section: 3

Instruction: absurd
Page: 57
Effect: The only function of type Void -> a
Language: Haskell
Chapter: 5
Section: 1

Instruction: unit
Page: 57
Effect: The only function of type a -> ()
Chapter: 5
Section: 1

Question: In the definition of terminal object, why is the uniqueness of the arrow important ?
Answer: Because many objects have arrows from any other objects. E.g. any constant arrow in the category Set, where the object is not empty
Page: 57
Chapter: 5
Section: 1

Page: 57
Definition: The equivalence relation where two objects are related if they occupe the same location in memory
Chapter: 5
Section: 4
Name: Pointer equality

Name: \(q\) factorizes \(p\)
Definition: there exists \(r:C\to B\) such that \(p=r\circ q\)
Page: 65
Chapter: 5
Section: 4
Variables: \(\mathbf C\) a category
\(p:A\to B\)
\(q:A\to C\)

Definition: A function, taking as input two functions with same domain, and returning a function such that both input factorize through the output.
Page: 68
Chapter: 5
Variables: A factorizer
Example: factorizer :: (c -> a) -> (c -> b) -> (c -> (a, b))
factorizer p q = \x -> (p x, q x)

Instruction: swap
Page: 78
Chapter: 6
Section: 1
Returns: [$]\defFun{(a,b)}{(b,a)}{(x,y)}{(y,x)}[/$]

Question: (a, Unit) is
Answer: isomorphic to a
Page: 80
Chapter: 6
Section: 1

Question: Either a Void is
Answer: isomorphic to a
Page: 84
Chapter: 6
Section: 1

Question: (Either a Unit) is
Answer: isomorphic to Maybe a
Page: 84
Chapter: 6
Section: 1

Question: (a, Void) is
Answer: isomorphic to Void
Page: 84
Chapter: 6
Section: 1

Name: semiring
Page: 89
Chapter: 6
Section: 1
Abbreviation: rig

Name: Algebraic type
Definition: A type t defined using t sum and product
Page: 91
Chapter: 6
Section: 1

Page: 95
Object: \(X\mapsto c\)
Domain: \(\mathrm A\)
Arrow: \(a\mapsto 1_c\)
Section: 1
Chapter: 6
Codomain: \(\mathrm B\)
Variables: \(\mathrm{A,B}\) categories
\(c\in B\)
Name: Constant functor
Notation: \(\Delta_c\)

Name: An endofunctor on \(C\)
Definition: A functor from \(C\) to itself
Page: 96
Chapter: 7
Section: 1
Variables: \(C\) a category

Page: 96
Object: x to Just x
Domain: a
Arrow: f is sent to |Nothing->Nothing | Just x -> Just (f x)
Section: 1
Chapter: 7
Codomain: Just a
Name: maybe

Page: 96
Object: x to [x]
Domain: a
Arrow: f to (map f)
Section: 1
Chapter: 7
Codomain: List a
Name: List

Page: 96
Object: x to the constant function returning x
Domain: r -> a
Arrow: f::a -> b is sent to ((.) f)::(r->b)
Section: 1
Chapter: 7
Codomain: r -> b
Variables: r a type
Haskell
Name: Reader
Notation: ((->) r)

Question: What is the point of considering a functor as a container ?
Answer: Manipulating values, not accessing them
Page: 110
Chapter: 7
Section: 2

Page: 111
Object: x::a is sent to Const c
Domain: Const c a
Arrow: f::a->b is sent to the identity function
Section: 2
Chapter: 7
Codomain: Const c b
Variables: c a type
Name: Const c

Question: What is the effect of:
(f . g) x y
Answer: \((f(g x))y \)
Page: 111
Chapter: 7
Section: 2

Name: A bifunctor
Definition: A functor whose domain is a cartesian product of categories
Page: 117, 122
Chapter: 8
Section: 1
Definition2: A functor whose domain is a cartesian product of categories, and which satisfies the functor's arrow axiom when one of the argument is fixed
Example: Algebraic data types

Question: What means a definition such as
class Bifunctor f where
bimap :: (a -> c) -> (b -> d) -> f a b -> f c d
bimap g h = first g . second h
first :: (a -> c) -> f a b -> f c b
first g = bimap g id
second :: (b -> d) -> f a b -> f a d
second = bimap id
Answer: When an actual Bifunctor is declared, either bimap, or (first and second) must be defined. In which case the undefined one is computed using the defined function.
Otherwise, there is an infinite loop
Page: 119
Chapter: 8
Section: 1

Instruction: bimap
Page: 119
Context: Haskell bifunctor
Chapter: 8
Section: 1
Returns: A function of type
(a -> c) -> (b -> d) -> f a b -> f c d.
It applies the first function, to obtain an element of type f a c, and then the second function

Name: A monoidal category
Definition: A category \(\mathbf C\)
Page: 121
Chapter: 8
Section: 1
Definition2: A bifunctor \(\times:\mathbf C\times\mathbf C\to\mathbf C\) which is associative
Conjdef: A tuple with
Definition3: An object \(1\) of \(C\), which is an identity for the bifunctor

Page: 122
Object: to itself
Domain: a
Section: 1
Chapter: 8
Name: Identity
Full: yes