Skip to content

Commit

Permalink
uncomment primitive type bindings; fix typo in Blob doc
Browse files Browse the repository at this point in the history
  • Loading branch information
crusso committed May 24, 2021
1 parent 3f5e274 commit 1b0b253
Show file tree
Hide file tree
Showing 18 changed files with 2 additions and 37 deletions.
4 changes: 1 addition & 3 deletions src/Blob.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
import Prim "mo:⛔";
module {

/*
/// An immutable, possibly empty sequence of bytes.
/// Given `b : Blob`:
///
/// * `b.size() : Nat` returns the number of bytes in the blob;
/// * `b.bytes() : Iter.Iter<Nat8>` returns an iterator to enumerate the bytes of the blob.
/// (Direct indexing of Blobs is not unsupported yet.)
/// (Direct indexing of Blobs is not yet supported.)
public type Blob = Prim.Types.Blob;
*/

/// Returns a (non-cryptographic) hash of 'b'
public let hash : (b : Blob) -> Nat32 = Prim.hashBlob;
Expand Down
2 changes: 0 additions & 2 deletions src/Bool.mo
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
import Prim "mo:⛔";
module {

/*
/// Booleans with constants `true` and `false`.
public type Bool = Prim.Types.Bool;
*/

/// Conversion.
public func toText(x : Bool) : Text {
Expand Down
2 changes: 0 additions & 2 deletions src/Char.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
import Prim "mo:⛔";
module {

/*
/// Characters represented as Unicode code points.
public type Char = Prim.Types.Char;
*/

/// Convert character `c` to a word containing its Unicode scalar value.
public let toNat32 : (c : Char) -> Nat32 = Prim.charToNat32;
Expand Down
2 changes: 0 additions & 2 deletions src/Error.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import Prim "mo:⛔";

module {

/*
/// Error values resulting from `async` computations
public type Error = Prim.Types.Error;
*/

/// Error codes (user and system), where module `Prim` defines:
/// ```motoko
Expand Down
2 changes: 0 additions & 2 deletions src/Float.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import Int "Int";

module {

/*
/// 64-bit floating point numbers.
public type Float = Prim.Types.Float;
*/

/// Ratio of the circumference of a circle to its diameter.
public let pi : Float = 3.14159265358979323846; // taken from musl math.h
Expand Down
2 changes: 0 additions & 2 deletions src/Int.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import Hash "Hash";

module {

/*
/// Infinite precision signed integers.
public type Int = Prim.Types.Int;
*/

/// Returns the absolute value of the number
public let abs : Int -> Nat = Prim.abs;
Expand Down
2 changes: 0 additions & 2 deletions src/Int16.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 16-bit signed integers
public type Int16 = Prim.Types.Int16;
*/

/// Conversion.
public let toInt : Int16 -> Int = Prim.int16ToInt;
Expand Down
2 changes: 0 additions & 2 deletions src/Int32.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 32-bit signed integers.
public type Int32 = Prim.Types.Int32;
*/

/// Conversion.
public let toInt : Int32 -> Int = Prim.int32ToInt;
Expand Down
2 changes: 0 additions & 2 deletions src/Int64.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 64-bit signed integers.
public type Int64 = Prim.Types.Int64;
*/

/// Conversion.
public let toInt : Int64 -> Int = Prim.int64ToInt;
Expand Down
2 changes: 0 additions & 2 deletions src/Int8.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 8-bit signed integers.
public type Int8 = Prim.Types.Int8;
*/

/// Conversion.
public let toInt : Int8 -> Int = Prim.int8ToInt;
Expand Down
3 changes: 1 addition & 2 deletions src/Nat.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import Prim "mo:⛔";

module {

/*

/// Infinite precision natural numbers.
public type Nat = Prim.Types.Nat;
*/

/// Conversion.
public let toText : Nat -> Text = Int.toText;
Expand Down
2 changes: 0 additions & 2 deletions src/Nat16.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 16-bit natural numbers.
public type Nat16 = Prim.Types.Nat16;
*/

/// Conversion.
public let toNat : Nat16 -> Nat = Prim.nat16ToNat;
Expand Down
2 changes: 0 additions & 2 deletions src/Nat32.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 32-bit natural numbers.
public type Nat32 = Prim.Types.Nat32;
*/

/// Conversion.
public let toNat : Nat32 -> Nat = Prim.nat32ToNat;
Expand Down
2 changes: 0 additions & 2 deletions src/Nat64.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 64-bit natural numbers.
public type Nat64 = Prim.Types.Nat64;
*/

/// Conversion.
public let toNat : Nat64 -> Nat = Prim.nat64ToNat;
Expand Down
2 changes: 0 additions & 2 deletions src/Nat8.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import Prim "mo:⛔";

module {

/*
/// 8-bit natural numbers.
public type Nat8 = Prim.Types.Nat8;
*/

/// Conversion.
public let toNat : Nat8 -> Nat = Prim.nat8ToNat;
Expand Down
2 changes: 0 additions & 2 deletions src/None.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import Prim "mo:⛔";

module {

/*
/// The empty type. A subtype of all types.
public type None = Prim.Types.None;
*/

/// Turns an absurd value into an arbitrary type.
public let impossible : <A> None -> A = func<A>(x : None) : A {
Expand Down
2 changes: 0 additions & 2 deletions src/Principal.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import Blob "Blob";
import Hash "Hash";
module {

/*
/// Internet Computer principal identifiers.
/// Convert to `Blob` for access to bytes.
public type Principal = Prim.Types.Principal;
*/

/// Conversion.
public let fromActor : (a : actor {}) -> Principal = Prim.principalOfActor;
Expand Down
2 changes: 0 additions & 2 deletions src/Text.mo
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ import Prim "mo:⛔";

module {

/*
/// Text values.
public type Text = Prim.Types.Text;
*/

/// Conversion.
/// Returns the text value of size 1 containing the single character `c`.
Expand Down

0 comments on commit 1b0b253

Please sign in to comment.