comparison lib/ur/basis.urs @ 821:395a5d450cc0

Chars and more string operations
author Adam Chlipala <adamc@hcoop.net>
date Tue, 26 May 2009 12:25:06 -0400
parents 4585f744574a
children 14a6c0971d89
comparison
equal deleted inserted replaced
820:91f465ded07e 821:395a5d450cc0
1 type int 1 type int
2 type float 2 type float
3 type string 3 type string
4 type char
4 type time 5 type time
5 type blob 6 type blob
6 7
7 type unit = {} 8 type unit = {}
8 9
19 val eq : t ::: Type -> eq t -> t -> t -> bool 20 val eq : t ::: Type -> eq t -> t -> t -> bool
20 val ne : t ::: Type -> eq t -> t -> t -> bool 21 val ne : t ::: Type -> eq t -> t -> t -> bool
21 val eq_int : eq int 22 val eq_int : eq int
22 val eq_float : eq float 23 val eq_float : eq float
23 val eq_string : eq string 24 val eq_string : eq string
25 val eq_char : eq char
24 val eq_bool : eq bool 26 val eq_bool : eq bool
25 val eq_time : eq time 27 val eq_time : eq time
26 val mkEq : t ::: Type -> (t -> t -> bool) -> eq t 28 val mkEq : t ::: Type -> (t -> t -> bool) -> eq t
27 29
28 class num 30 class num
42 val gt : t ::: Type -> ord t -> t -> t -> bool 44 val gt : t ::: Type -> ord t -> t -> t -> bool
43 val ge : t ::: Type -> ord t -> t -> t -> bool 45 val ge : t ::: Type -> ord t -> t -> t -> bool
44 val ord_int : ord int 46 val ord_int : ord int
45 val ord_float : ord float 47 val ord_float : ord float
46 val ord_string : ord string 48 val ord_string : ord string
49 val ord_char : ord char
47 val ord_bool : ord bool 50 val ord_bool : ord bool
48 val ord_time : ord time 51 val ord_time : ord time
49 52
50 53
51 (** String operations *) 54 (** String operations *)
52 55
53 val strcat : string -> string -> string 56 val strcat : string -> string -> string
57 val strsub : string -> int -> char
58 val strsuffix : string -> int -> string
54 59
55 class show 60 class show
56 val show : t ::: Type -> show t -> t -> string 61 val show : t ::: Type -> show t -> t -> string
57 val show_int : show int 62 val show_int : show int
58 val show_float : show float 63 val show_float : show float
59 val show_string : show string 64 val show_string : show string
65 val show_char : show char
60 val show_bool : show bool 66 val show_bool : show bool
61 val show_time : show time 67 val show_time : show time
62 val mkShow : t ::: Type -> (t -> string) -> show t 68 val mkShow : t ::: Type -> (t -> string) -> show t
63 69
64 class read 70 class read
66 val readError : t ::: Type -> read t -> string -> t 72 val readError : t ::: Type -> read t -> string -> t
67 (* [readError] calls [error] if the input is malformed. *) 73 (* [readError] calls [error] if the input is malformed. *)
68 val read_int : read int 74 val read_int : read int
69 val read_float : read float 75 val read_float : read float
70 val read_string : read string 76 val read_string : read string
77 val read_char : read char
71 val read_bool : read bool 78 val read_bool : read bool
72 val read_time : read time 79 val read_time : read time
73 val mkRead : t ::: Type -> (string -> t) -> (string -> option t) -> read t 80 val mkRead : t ::: Type -> (string -> t) -> (string -> option t) -> read t
74 81
75 82