Skip to main content

morphir_core/
ir.rs

1//! Morphir IR module.
2//!
3//! V4 is the primary/canonical format. Classic (V1-V3) is a submodule for legacy support.
4//!
5//! # Type Aliases
6//!
7//! For V4 (preferred), use `Type`, `Value`, `Pattern` directly with `TypeAttributes`
8//! and `ValueAttributes`. Or use the convenience aliases `TypeExpr` and `ValueExpr`.
9//!
10//! For Classic (V1-V3 compatibility), use the `classic` submodule directly:
11//! - `ir::classic::Type<A>`, `ir::classic::Value<TA, VA>`, etc.
12
13// Legacy support
14pub mod classic;
15
16// A genuine decimal, shared by the v4 model and (task 5) the classic model
17pub mod decimal;
18pub use decimal::{DecimalLiteral, InvalidDecimalLexeme};
19
20// Diagnostics shared by every IR codec
21pub mod diagnostic;
22pub use diagnostic::{Diagnostic, DiagnosticCode, DiagnosticError, DiagnosticStage, Warning};
23
24// V4 is the primary format
25pub mod v4;
26
27// Document-tree layout: the storage profile, path grammar and file stems.
28pub mod layout;
29
30// The JSON storage profile's canonical writer
31pub mod json;
32
33// The native YAML storage profile
34pub mod yaml;
35
36// Re-export serde_tagged from v4 for backward compatibility
37pub use v4::serde_tagged;
38
39// Re-exports for V4 types (primary)
40pub use v4::{
41    // Access control
42    Access,
43    AccessControlled,
44    // Distribution types
45    ApplicationContent,
46    // Type definition types
47    ConstructorArg,
48    ConstructorArgSpec,
49    ConstructorDefinition,
50    ConstructorSpecification,
51    DefinitionDependencies,
52    Dependencies,
53    Distribution,
54    // The four files a document tree is made of
55    DistributionKind,
56    DistributionManifestFile,
57    EntryPoint,
58    EntryPointKind,
59    EntryPoints,
60    ExpectedEntries,
61    FILE_STEM_PATTERN,
62    // Core expression types
63    Field,
64    // Top-level types
65    FormatVersion,
66    // Value definition types
67    HoleReason,
68    IRFile,
69    Incompleteness,
70    // Value expression types (from value module)
71    InputType,
72    LetBinding,
73    LibraryContent,
74    Literal,
75    MIN_PATH_BUDGET,
76    // Module types
77    ModuleDefinition,
78    ModuleEntries,
79    ModuleManifestFile,
80    ModuleSpecification,
81    NativeHint,
82    NativeInfo,
83    NodeFileBody,
84    // Package types
85    PackageDefinition,
86    PackageSpecification,
87    Pattern,
88    PatternCase,
89    RecordFieldEntry,
90    SourceLocation,
91    SpecsContent,
92    Type,
93    TypeAttributes,
94    TypeDefinition,
95    TypeDefinitionFile,
96    TypeExpr,
97    TypeSpecification,
98    Value,
99    ValueAttributes,
100    ValueBody as ValueDefBody,
101    ValueDefinition,
102    ValueDefinitionFile,
103    ValueExpr,
104    ValueExprBody as ValueBody,
105    ValueExprDefinition,
106    ValueHoleReason,
107    ValueNativeHint,
108    ValueSpecification,
109};