working AStar

This commit is contained in:
Folkert 2021-02-15 21:34:55 +01:00
parent 9527434be8
commit 13b2c23c01
19 changed files with 578 additions and 81 deletions

View file

@ -539,6 +539,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
top_level_function(vec![int_type(flex(TVAR1))], Box::new(str_type())),
);
// fromFloat : Float a -> Str
add_type(
Symbol::STR_FROM_FLOAT,
top_level_function(vec![float_type(flex(TVAR1))], Box::new(str_type())),
);
// List module
// get : List elem, Nat -> Result elem [ OutOfBounds ]*
@ -989,6 +995,15 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
),
);
// withDefault : Result a x, a -> a
add_type(
Symbol::RESULT_WITH_DEFAULT,
top_level_function(
vec![result_type(flex(TVAR1), flex(TVAR3)), flex(TVAR1)],
Box::new(flex(TVAR1)),
),
);
types
}