Add 'Ordering' data-type to the Prelude.

Useful to have around to build comparison functions.
This commit is contained in:
KtorZ
2023-02-09 11:07:30 +01:00
parent fd14da0720
commit 62fe321ddf
2 changed files with 107 additions and 0 deletions

View File

@@ -127,6 +127,37 @@ impl Annotated<Schema> {
]))),
}),
"Ordering" => Ok(Annotated {
title: Some("Ordering".to_string()),
description: None,
annotated: Schema::Data(Some(Data::AnyOf(vec![
Annotated {
title: Some("Less".to_string()),
description: None,
annotated: Constructor {
index: 0,
fields: vec![],
},
},
Annotated {
title: Some("Equal".to_string()),
description: None,
annotated: Constructor {
index: 1,
fields: vec![],
},
},
Annotated {
title: Some("Greater".to_string()),
description: None,
annotated: Constructor {
index: 2,
fields: vec![],
},
},
]))),
}),
"Option" => {
let generic =
Annotated::from_type(modules, args.get(0).unwrap(), type_parameters)