Skip to content

Commit

Permalink
pub use eval::type mods
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Nov 18, 2023
1 parent ee8f26c commit 1052517
Show file tree
Hide file tree
Showing 31 changed files with 71 additions and 67 deletions.
4 changes: 2 additions & 2 deletions src/eval/env/expr_env.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::rc::Rc;

use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;

Expand Down
4 changes: 2 additions & 2 deletions src/eval/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::rc::Rc;

use crate::eval::env::expr_env::{ExprEnv, ExprEnvEntry};
use crate::eval::env::type_env::{TypeEnv, TypeEnvEntry};
use crate::eval::r#type::expr::OptExpr;
use crate::eval::r#type::r#type::OptType;
use crate::eval::r#type::OptExpr;
use crate::eval::r#type::OptType;
use crate::infer::env::def_map_to_env_vec as def_map_to_ct_env_vec;
use crate::infer::env::def_vec_to_def_map;
use crate::infer::env::expr_env::ExprEnv as CtExprEnv;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/env/type_env.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BTreeSet;

use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
use crate::infra::option::WrapOption;

pub type TypeEnvEntry = (String, Type);
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/apply/fn/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::{false_type, namely_type, true_type};
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::infra::result::WrapResult;

mod primitive_apply;
Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/apply/fn/primitive_apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::eval::eval_expr::case::apply::{
int_expr
};
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::expr::PrimitiveOp;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::infra::option::WrapOption;
use crate::infra::result::WrapResult;

Expand Down
8 changes: 4 additions & 4 deletions src/eval/eval_expr/case/apply/fn/source_lhs_to_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use std::rc::Rc;
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::expr::PrimitiveOp;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::eval::r#type::Type;
use crate::infra::either::{Either, EitherAnyExt};
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/apply/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::case::apply::primitive_apply;
use crate::eval::eval_expr::case::apply::source_lhs_expr_to_closure;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::either::Either;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/apply/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::expr::PrimitiveOp;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/closure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::rc::Rc;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::infra::option::WrapOption;
use crate::infra::result::WrapResult;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/closure/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::{closure_type, namely_type};
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/cond/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::rc::Rc;
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;

pub fn case_cond(
type_env: &TypeEnv,
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/cond/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/discard.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Type;
use crate::infra::result::WrapResult;

pub fn case_discard(type_annot: &Type) -> EvalRet {
Expand All @@ -16,7 +16,7 @@ mod test {
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::rc::RcAnyExt;

// _: Int
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/env_ref/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::rc::Rc;
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::EvalErr;
use crate::infra::result::WrapResult;

pub fn case_env_ref(
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/env_ref/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/int.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::infra::result::WrapResult;

pub fn case_int(type_annot: &Type, int_value: &i64) -> EvalRet {
Expand All @@ -13,7 +13,7 @@ mod test {
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/let/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::rc::Rc;
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/let/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/match/fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::rc::Rc;

use crate::eval::env::expr_env::{ExprEnv, ExprEnvEntry};
use crate::eval::env::type_env::TypeEnv;
use crate::eval::r#type::expr::{Expr, StructField};
use crate::eval::r#type::{Expr, StructField};
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;

Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/match/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::case::r#match::is_expr_match_pattern_then_env;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/match/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/primitive_op/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::rc::Rc;

use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::expr::PrimitiveOp;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::eval::r#type::Type;
use crate::infra::result::WrapResult;

#[cfg(test)]
Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/case/primitive_op/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::{closure_type, namely_type};
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::expr::PrimitiveOp;
use crate::eval::r#type::Expr;
use crate::eval::r#type::PrimitiveOp;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/struct/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use std::rc::Rc;
use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::{eval_expr, EvalRet};
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::expr::{Expr, StructField};
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Type;
use crate::eval::r#type::{Expr, StructField};
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;
use crate::infra::vec::VecExt;
Expand Down
2 changes: 1 addition & 1 deletion src/eval/eval_expr/case/struct/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::eval::env::expr_env::ExprEnv;
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::{namely_type, prod_type};
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
6 changes: 3 additions & 3 deletions src/eval/eval_expr/case/unit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::eval::eval_expr::EvalRet;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Expr;
use crate::eval::r#type::Type;
use crate::infra::result::WrapResult;

pub fn case_unit(type_annot: &Type) -> EvalRet {
Expand All @@ -13,7 +13,7 @@ mod test {
use crate::eval::env::type_env::TypeEnv;
use crate::eval::eval_expr::eval_expr;
use crate::eval::r#macro::namely_type;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::Expr;
use crate::infra::rc::RcAnyExt;
use crate::infra::result::WrapResult;

Expand Down
4 changes: 2 additions & 2 deletions src/eval/eval_expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use crate::eval::eval_expr::case::case_match;
use crate::eval::eval_expr::case::case_primitive_op;
use crate::eval::eval_expr::case::case_struct;
use crate::eval::eval_expr::case::case_unit;
use crate::eval::r#type::eval_err::EvalErr;
use crate::eval::r#type::expr::Expr;
use crate::eval::r#type::EvalErr;
use crate::eval::r#type::Expr;

pub type EvalRet = Result<Expr, EvalErr>;

Expand Down
18 changes: 9 additions & 9 deletions src/eval/macro.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[allow(unused_macros)]
macro_rules! int_type {
() => {{
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
Type::NamelyType("Int".to_string())
}};
}
Expand All @@ -11,7 +11,7 @@ pub(crate) use int_type;
#[allow(unused_macros)]
macro_rules! unit_type {
() => {{
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
Type::NamelyType("Unit".to_string())
}};
}
Expand All @@ -21,7 +21,7 @@ pub(crate) use unit_type;
#[allow(unused_macros)]
macro_rules! namely_type {
($str:expr) => {{
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
Type::NamelyType($str.to_string())
}};
}
Expand All @@ -31,7 +31,7 @@ pub(crate) use namely_type;
#[allow(unused_macros)]
macro_rules! closure_type {
($lhs:expr, $rhs:expr) => {{
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
use crate::infra::rc::RcAnyExt;

Type::ClosureType($lhs.rc(), $rhs.rc())
Expand All @@ -43,7 +43,7 @@ pub(crate) use closure_type;
#[allow(unused_macros)]
macro_rules! prod_type {
($($types:expr),* $(,)?) => ({
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;

Type::ProdType(vec![
$(($types),)*
Expand All @@ -57,7 +57,7 @@ pub(crate) use prod_type;
macro_rules! sum_type {
($($types:expr),* $(,)?) => ({
use crate::{btree_set};
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;

Type::SumType(btree_set![
$(($types),)*
Expand All @@ -70,7 +70,7 @@ pub(crate) use sum_type;
#[allow(unused_macros)]
macro_rules! true_type {
() => {{
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
Type::NamelyType("True".to_string())
}};
}
Expand All @@ -80,7 +80,7 @@ pub(crate) use true_type;
#[allow(unused_macros)]
macro_rules! false_type {
() => {{
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
Type::NamelyType("False".to_string())
}};
}
Expand All @@ -90,7 +90,7 @@ pub(crate) use false_type;
#[allow(unused_macros)]
macro_rules! bool_type {
() => {{
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
Type::NamelyType("Bool".to_string())
}};
}
Expand Down
2 changes: 1 addition & 1 deletion src/eval/type/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub use primitive_op::*;

use crate::eval::env::expr_env::ExprEnv;
use crate::eval::r#type::r#type::OptType;
use crate::eval::r#type::r#type::Type;
use crate::eval::r#type::Type;
use crate::infra::option::WrapOption;
use crate::infra::rc::RcAnyExt;
use crate::infra::vec::VecExt;
Expand Down
Loading

0 comments on commit 1052517

Please sign in to comment.