mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Move Solved to roc_solve
This commit is contained in:
parent
c9914af5ab
commit
699c4d7fff
9 changed files with 27 additions and 27 deletions
|
@ -8,10 +8,28 @@ use roc_collections::VecMap;
|
|||
use roc_derive_key::GlobalDerivedSymbols;
|
||||
use roc_error_macros::internal_error;
|
||||
use roc_module::symbol::Symbol;
|
||||
use roc_types::solved_types::Solved;
|
||||
use roc_types::subs::{Content, ExposedTypesStorageSubs, FlatType, StorageSubs, Subs, Variable};
|
||||
use roc_types::types::Alias;
|
||||
|
||||
/// A marker that a given Subs has been solved.
|
||||
/// The only way to obtain a Solved<Subs> is by running the solver on it.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Solved<T>(pub T);
|
||||
|
||||
impl<T> Solved<T> {
|
||||
pub fn inner(&self) -> &'_ T {
|
||||
&self.0
|
||||
}
|
||||
|
||||
pub fn inner_mut(&mut self) -> &'_ mut T {
|
||||
&mut self.0
|
||||
}
|
||||
|
||||
pub fn into_inner(self) -> T {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SolvedModule {
|
||||
pub problems: Vec<solve::TypeError>,
|
||||
|
|
|
@ -2,6 +2,7 @@ use crate::ability::{
|
|||
resolve_ability_specialization, type_implementing_specialization, AbilityImplError,
|
||||
DeferredObligations, PendingDerivesTable, RequestedDeriveKey, Resolved, Unfulfilled,
|
||||
};
|
||||
use crate::module::Solved;
|
||||
use bumpalo::Bump;
|
||||
use roc_can::abilities::{AbilitiesStore, MemberSpecialization};
|
||||
use roc_can::constraint::Constraint::{self, *};
|
||||
|
@ -18,7 +19,6 @@ use roc_module::ident::TagName;
|
|||
use roc_module::symbol::{ModuleId, Symbol};
|
||||
use roc_problem::can::CycleEntry;
|
||||
use roc_region::all::{Loc, Region};
|
||||
use roc_types::solved_types::Solved;
|
||||
use roc_types::subs::{
|
||||
self, AliasVariables, Content, Descriptor, FlatType, GetSubsSlice, LambdaSet, Mark,
|
||||
OptVariable, Rank, RecordFields, Subs, SubsIndex, SubsSlice, UlsOfVar, UnionLabels,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue