Add type_sort()

This commit is contained in:
Shunsuke Shibayama 2022-08-20 09:47:15 +09:00
parent d7be8128ad
commit 14c77e604d

View file

@ -42,6 +42,21 @@ use Visibility::*;
type Trait = Type;
/// ```
/// [Int, Str, Nat, Never, Obj, Str!, Module]
/// => [], [Int, Str, Nat, Never, Obj, Str!, Module]
/// => [[Int]], [Str, Nat, Never, Obj, Str!, Module]
/// => [[Int], [Str]], [Nat, Never, Obj, Str!, Module]
/// => ...
/// => [[Int, Nat, Never, Obj]], [Str, Obj, Str!], [Module]]
/// => [[Never, Nat, Int, Obj], [Str!, Str, Obj], [Module, Obj]]
/// => [Never, Nat, Int, Obj, Str, Obj, Module, Obj]
/// => [Never, Nat, Int, Str, Module, Obj]
/// ```
pub fn type_sort(_types: Vec<Type>) -> Vec<Type> {
todo!()
}
/// ```
/// TyParamIdx::new(Add(R, O), O) => Nth(1)
/// TyParamIdx::new(Add(R, F(O, I)), O) => Nested(Nth(1), 0)