MCPcopy Index your code

hub / github.com/dcreager/expression-problem-rust / types & classes

Types & classes32 in github.com/dcreager/expression-problem-rust

↓ 5 callersClassExpr
src/old.rs:123
↓ 3 callersClassExpr
src/ch02_open_sum.rs:51
↓ 3 callersClassSafeIntOrPair
src/ch07d_safer_pair_evaluation.rs:23
↓ 2 callersClassPair
Creates a new pair, whose contents are given by two subexpressions.
src/ch07a_pairs.rs:22
↓ 1 callersClassAdd
src/old.rs:30
↓ 1 callersClassIntegerLiteral
src/old.rs:22
↓ 1 callersClassMultExpr
src/ch05a_multiplication.rs:45
↓ 1 callersClassNoAddExpr
src/ch05a_multiplication.rs:64
↓ 1 callersClassPairExpr
src/ch07a_pairs.rs:61
ClassAdd
We can add two expressions together, but since we don't have an Expression type (yet), we don't know what type the left- and right-hand sides should h
src/ch02_open_sum.rs:31
EnumCoproductPair
src/old.rs:45
InterfaceEval
Each term type should implement this trait to define how it should be evaluated. If the term has any subexpressions, it should use `eval_subexpr` to
src/ch08b_open_recursion_evaluation.rs:58
InterfaceEvaluate
src/old.rs:87
InterfaceEvaluate
src/ch08b_open_recursion_evaluation.rs:190
InterfaceEvaluateAny
Well that was easy. (Not really! Don't worry, we'll run into wrinkles.)
src/ch07b_generic_evaluation.rs:24
InterfaceEvaluateInt
Each kind of term in our language should implement this trait to define how it's evaluated.
src/ch03_evaluation.rs:25
EnumExpression
We can use an enum to represent all of the different kinds of term that can appear in our toy language.
src/ch01a_before.rs:18
EnumExpression
This is the closest we can get: we create a new Expression type, containing each of the new kinds of term, and use a wrapper variant at the end to inc
src/ch01c_sad_face.rs:26
InterfaceExpression
An Expression represents the AST of one of our mini-languages. It has a `Signature` associated type, which is a `Sum` of all of the possible terms in
src/ch08a_expressions.rs:27
ClassFirst
Extract the first element of a pair.
src/ch07a_pairs.rs:28
InterfaceIncrement
I'm going to make the bold claim that most of Swierstra §6 isn't relevant in Rust — we don't typically use monads to express stateful computations, we
src/ch06_calculator_monad.rs:21
EnumIntOrPair
src/ch07c_pair_evaluation.rs:75
ClassIntegerLiteral
Instead of having a single Expression enum, with different variants for each kind of term, we create a separate type for each kind of term. We're goi
src/ch02_open_sum.rs:24
ClassMem
The simplest memory store is just a struct containing the current contents.
src/ch06_calculator_monad.rs:32
ClassMultiply
First a type for the new term
src/ch05a_multiplication.rs:22
InterfaceNotEq
src/old.rs:19
InterfaceNotEq
src/ch04_smart_constructors.rs:35
InterfaceProjectPair
We don't have a trait that we can reuse for the evaluation rules for First and Second, like we could with std::ops::Add for our Add term. So let's ma
src/ch07c_pair_evaluation.rs:37
InterfaceRecall
If you only want to read the contents of the memory, you can get away with non-mutable access to it.
src/ch06_calculator_monad.rs:27
InterfaceResult
src/old.rs:84
ClassSecond
Extract the second element of a pair.
src/ch07a_pairs.rs:33
EnumSum
This is how we'll create the different Expression types from ch01! This corresponds to the :+: "coproduct" operator from the paper.
src/ch02_open_sum.rs:38