# supun1419/type-safe-arithmetic-expression-interpreter architecture

> Architecture diagram of the GitHub repository supun1419/type-safe-arithmetic-expression-interpreter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/supun1419/type-safe-arithmetic-expression-interpreter
- Repository: https://github.com/supun1419/type-safe-arithmetic-expression-interpreter

## Overview

This is a small Haskell expression-interpreter coursework project. The documented workflow is to run `Main.hs`, which presents seven repeatable checks and reports evaluation results; `Expr.hs` contains the expression type, safe evaluator, simplifier, and batch functions. The README identifies these responsibilities but does not show source-level calls between the modules, so that relationship is marked unverified. The optional Java/Haskell benchmark is excluded because it is separate from the required product.

Main entry points: [`Expr.hs`](https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs) (Expressions), [`Main.hs`](https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Main.hs) (Demonstrations)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_main["Demonstrations<br/>[Main.hs]"]
node_expr["Expressions<br/>[Expr.hs]"]
node_eval["Safe evaluator<br/>[Expr.hs]"]
node_simplify["Simplifier<br/>[Expr.hs]"]
node_batch["Batch functions<br/>[Expr.hs]"]

node_user -->|"runs"| node_main
node_main -.->|"uses"| node_expr
node_expr -.->|"evaluates"| node_eval
node_expr -.->|"simplifies"| node_simplify
node_expr -.->|"provides"| node_batch

click node_main "https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Main.hs"
click node_expr "https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs"
click node_eval "https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs"
click node_simplify "https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs"
click node_batch "https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_main,node_expr,node_eval,node_simplify,node_batch toneTeal
```

## Components

### Other components

- **User**
- [Demonstrations](https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Main.hs): `Main.hs`
- [Expressions](https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs): `Expr.hs`
- [Safe evaluator](https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs): `Expr.hs`
- [Simplifier](https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs): `Expr.hs`
- [Batch functions](https://github.com/supun1419/type-safe-arithmetic-expression-interpreter/blob/main/Expr.hs): `Expr.hs`

## Connections

- User → Demonstrations: runs (evidence: `README.md`)
- Demonstrations → Expressions: uses
- Expressions → Safe evaluator: evaluates
- Expressions → Simplifier: simplifies
- Expressions → Batch functions: provides
