lsts 0.6.34

Large Scale Type Systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use lsts::typ::Type;

#[test]
fn check_arrow() {
   let tany = Type::Any;
   let tc1  = Type::Named("T1".to_string(),vec![]);
   let tc2  = Type::Named("T2".to_string(),vec![]);
   let ts1  = Type::And(vec![ tc1.clone(), tc2.clone() ]);
   let ta1  = Type::Arrow( Box::new(tc1.clone()), Box::new(tc2.clone()) );
   let ta2  = Type::Arrow( Box::new(ts1.clone()), Box::new(tany.clone()) );
   let ta3  = Type::Arrow( Box::new(tc1.clone()), Box::new(tc2.clone()) );

   assert_eq!( ta3, ta2.implication_unifier(&ta1) );
}