home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / lib / General.sig < prev    next >
Encoding:
Text File  |  1997-07-22  |  1.9 KB  |  67 lines  |  [TEXT/R*ch]

  1. (* General and top-level *)
  2.  
  3. eqtype char
  4. type   exn
  5. eqtype int
  6. eqtype real
  7. eqtype string
  8. eqtype unit
  9.  
  10. datatype bool      = false | true
  11. datatype 'a list   = nil | op :: of 'a * 'a list
  12. datatype order     = LESS | EQUAL | GREATER
  13. datatype 'a ref    = ref of 'a 
  14.  
  15. exception Bind
  16. exception Match
  17. exception Interrupt
  18.  
  19. exception Subscript
  20. exception Size
  21. exception Fail of string
  22.  
  23. exception Overflow
  24. exception Div
  25. exception Domain
  26.  
  27. (* Below, cirs is char, int, string, or real:                   *)
  28. val <      : cirs * cirs -> bool
  29. val <=     : cirs * cirs -> bool
  30. val >      : cirs * cirs -> bool
  31. val >=     : cirs * cirs -> bool
  32. val =      : ''a * ''a -> bool
  33. val <>     : ''a * ''a -> bool
  34.  
  35. (* Below, num is int or real:                                   *)
  36. val ~      : num -> num                 (* raises Overflow      *)
  37. val +      : num * num -> num           (* raises Overflow      *)
  38. val -      : num * num -> num           (* raises Overflow      *)
  39. val *      : num * num -> num           (* raises Overflow      *)
  40. val /      : real * real -> real        (* raises Div, Overflow *)
  41. val div    : int * int -> int           (* raises Div, Overflow *)
  42. val mod    : int * int -> int           (* raises Div           *)
  43.  
  44. val real   : int -> real        (* equals Real.fromInt          *)
  45. val floor  : real -> int        (* round towards minus infinity *)
  46. val ceil   : real -> int        (* round towards plus infinity  *)
  47. val trunc  : real -> int        (* round towards zero           *)
  48. val round  : real -> int        (* round to nearest integer     *)
  49.  
  50. val o      : ('b -> 'c) * ('a -> 'b) -> ('a -> 'c)
  51. val ignore : 'a -> unit
  52. val before : 'a * unit -> 'a
  53.  
  54. val !   : 'a ref -> 'a
  55. val :=  : 'a ref * 'a -> unit
  56.  
  57. val vector  : 'a list -> 'a vector
  58.  
  59. (* Non-standard types and exceptions *)
  60.  
  61. datatype 'a frag = QUOTE of string | ANTIQUOTE of 'a
  62.  
  63. exception Io of {function : string, name : string, cause : exn }
  64. exception Graphic_failure of string
  65. exception Out_of_memory
  66.  
  67.