~ubuntu-branches/ubuntu/precise/ocaml-batteries/precise

« back to all changes in this revision

Viewing changes to src/batBool.mli

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2010-03-06 16:03:38 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100306160338-spvwiv3uc4jr28hw
Tags: 1.1.0-1
* New upstream release
  - major changes, "diet" version of the library
  - fix old FTBFS error, due to major code changes (Closes: #569455)
* Revamp packaging
  - adapt to new stuff shipped by upstream
  - switch from CDBS to dh
  - adapt dependencies (generally: reduce them)
* debian/patches/
  - remove old debian/patches/{debian-specific-installation-paths,
    debian-specific-info-on-doc-availability} as obsolete
  - new patch 0001-install-fix-for-bytecode-only-build: avoid
    installing *.a files with bytecode only compilation
* debian/libbatteries-ocaml-dev.links: remove file, shortend
  /usr/bin/ocaml-batteries to the top-level no longer exists
* remove debian/README.Debian (previous content is now obsolete)
* bump Standards-Version to 3.8.4 (no changes needed)
* debian/watch: update to match new upstream version convention
* debian/libbatteries-ocaml-{dev,doc}.{docs,examples}: ship only doc
  file from the root dir, other stuff is currently out of date
  (Closes: #514265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* 
 
2
 * ExtBool - Extended booleans
 
3
 * Copyright (C) 2007 Bluestorm <bluestorm dot dylc on-the-server gmail dot com>
 
4
 *               2008 David Teller
 
5
 * 
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2.1 of the License, or (at your option) any later version,
 
10
 * with the special exception on linking described in file LICENSE.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public
 
18
 * License along with this library; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
 *)
 
21
 
 
22
(**Operations on booleans
 
23
   
 
24
   @author Gabriel Scherer
 
25
   @author David Teller
 
26
*)
 
27
 
 
28
  type t = bool
 
29
      (**The type of booleans. Formally, this is defined as [type t = true | false] *)
 
30
 
 
31
  external not : bool -> bool = "%boolnot"
 
32
      (** The boolean negation. *)
 
33
 
 
34
  external ( && ) : bool -> bool -> bool = "%sequand"
 
35
      (** The boolean ``and''. Evaluation is sequential, left-to-right:
 
36
          in [e1 && e2], [e1] is evaluated first, and if it returns [false],
 
37
          [e2] is not evaluated at all. *)
 
38
 
 
39
  external ( || ) : bool -> bool -> bool = "%sequor"
 
40
      (** The boolean ``or''. Evaluation is sequential, left-to-right:
 
41
          in [e1 || e2], [e1] is evaluated first, and if it returns [true],
 
42
          [e2] is not evaluated at all. *)
 
43
 
 
44
 
 
45
  val zero : bool
 
46
  val one : bool
 
47
  val neg : bool -> bool
 
48
  val succ : 'a -> bool
 
49
  val pred : 'a -> bool
 
50
  val abs : 'a -> 'a
 
51
  val add : bool -> bool -> bool
 
52
  val mul : bool -> bool -> bool
 
53
  val sub : 'a -> bool -> bool
 
54
  val div : 'a -> 'b -> 'c
 
55
  val modulo : 'a -> 'b -> 'c
 
56
  val pow : 'a -> 'b -> 'c
 
57
  val min_num : bool
 
58
  val max_num : bool
 
59
  val compare : 'a -> 'a -> int
 
60
  val of_int : int -> bool
 
61
  val to_int : bool -> int
 
62
  val of_string : string -> bool
 
63
    (** Convert the given string to a boolean.
 
64
        Raise [Invalid_argument "Bool.of_string"] if the string is not
 
65
        ["true"], ["false"], ["0"], ["1"], ["tt"] or ["ff"]. *)
 
66
 
 
67
  val to_string : bool -> string
 
68
  val of_float  : float -> bool
 
69
  val to_float  : bool  -> float
 
70
 
 
71
  val ( + ) : t -> t -> t
 
72
  val ( - ) : t -> t -> t
 
73
  val ( * ) : t -> t -> t
 
74
  val ( / ) : t -> t -> t
 
75
  val ( ** ) : t -> t -> t
 
76
  val ( <> ) : t -> t -> bool
 
77
  val ( >= ) : t -> t -> bool
 
78
  val ( <= ) : t -> t -> bool
 
79
  val ( > ) : t -> t -> bool
 
80
  val ( < ) : t -> t -> bool
 
81
  val ( = ) : t -> t -> bool
 
82
  val operations : t BatNumber.numeric
 
83
 
 
84
(** {6 Boilerplate code}*)
 
85
 
 
86
(** {7 Printing}*)
 
87
val print: 'a BatInnerIO.output -> t -> unit
 
88
val t_printer : t BatValue_printer.t
 
89