comparison src/mono_util.sml @ 757:fa2019a63ea4

Basis.list
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Apr 2009 11:07:29 -0400
parents 8688e01ae469
children d8f58d488cfb
comparison
equal deleted inserted replaced
756:8ce31c052dce 757:fa2019a63ea4
49 joinL compareFields (xts1, xts2) 49 joinL compareFields (xts1, xts2)
50 end 50 end
51 | (TDatatype (n1, _), TDatatype (n2, _)) => Int.compare (n1, n2) 51 | (TDatatype (n1, _), TDatatype (n2, _)) => Int.compare (n1, n2)
52 | (TFfi (m1, x1), TFfi (m2, x2)) => join (String.compare (m1, m2), fn () => String.compare (x1, x2)) 52 | (TFfi (m1, x1), TFfi (m2, x2)) => join (String.compare (m1, m2), fn () => String.compare (x1, x2))
53 | (TOption t1, TOption t2) => compare (t1, t2) 53 | (TOption t1, TOption t2) => compare (t1, t2)
54 | (TList t1, TList t2) => compare (t1, t2)
54 | (TSource, TSource) => EQUAL 55 | (TSource, TSource) => EQUAL
55 | (TSignal t1, TSignal t2) => compare (t1, t2) 56 | (TSignal t1, TSignal t2) => compare (t1, t2)
56 57
57 | (TFun _, _) => LESS 58 | (TFun _, _) => LESS
58 | (_, TFun _) => GREATER 59 | (_, TFun _) => GREATER
66 | (TFfi _, _) => LESS 67 | (TFfi _, _) => LESS
67 | (_, TFfi _) => GREATER 68 | (_, TFfi _) => GREATER
68 69
69 | (TOption _, _) => LESS 70 | (TOption _, _) => LESS
70 | (_, TOption _) => GREATER 71 | (_, TOption _) => GREATER
72
73 | (TList _, _) => LESS
74 | (_, TList _) => GREATER
71 75
72 | (TSource, _) => LESS 76 | (TSource, _) => LESS
73 | (_, TSource) => GREATER 77 | (_, TSource) => GREATER
74 78
75 and compareFields ((x1, t1), (x2, t2)) = 79 and compareFields ((x1, t1), (x2, t2)) =
102 | TFfi _ => S.return2 cAll 106 | TFfi _ => S.return2 cAll
103 | TOption t => 107 | TOption t =>
104 S.map2 (mft t, 108 S.map2 (mft t,
105 fn t' => 109 fn t' =>
106 (TOption t, loc)) 110 (TOption t, loc))
111 | TList t =>
112 S.map2 (mft t,
113 fn t' =>
114 (TList t, loc))
107 | TSource => S.return2 cAll 115 | TSource => S.return2 cAll
108 | TSignal t => 116 | TSignal t =>
109 S.map2 (mft t, 117 S.map2 (mft t,
110 fn t' => 118 fn t' =>
111 (TSignal t, loc)) 119 (TSignal t, loc))