diff options
-rw-r--r-- | src/gleam/bit_string.gleam | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gleam/bit_string.gleam b/src/gleam/bit_string.gleam index d6fe14d..1176418 100644 --- a/src/gleam/bit_string.gleam +++ b/src/gleam/bit_string.gleam @@ -5,14 +5,14 @@ // TODO: determine which of these functions once we have bit string syntax pub external type BitString -/// Convert a utf8 String type into a raw Bitstring type. +/// Convert a utf8 String type into a raw BitString type. /// -pub external fn from_string(String) -> Bitstring = +pub external fn from_string(String) -> BitString = "gleam_stdlib" "identity" /// Returns an integer which is the number of bytes in the bit string. /// -pub external fn byte_size(Bitstring) -> Int = +pub external fn byte_size(BitString) -> Int = "erlang" "byte_size" /// Create a new bit string by joining two binaries. @@ -22,20 +22,20 @@ pub external fn byte_size(Bitstring) -> Int = /// > append(to: from_string("butter"), suffix: from_string("fly")) /// from_string("butterfly") /// -pub external fn append(first: Bitstring, second: Bitstring) -> Bitstring = +pub external fn append(first: BitString, second: BitString) -> BitString = "gleam_stdlib" "bit_string_append" /// Extracts part of a bit string. /// -/// Bitstring part will start at given position and continue up to specified +/// BitString part will start at given position and continue up to specified /// length. /// A negative length can be used to extract bytes at the end of a bit string. /// pub external fn part( - string: Bitstring, + string: BitString, position: Int, length: Int, -) -> Result(Bitstring, Nil) = +) -> Result(BitString, Nil) = "gleam_stdlib" "bit_string_part_" /// Convert an integer to unsigned 32 bits. @@ -43,12 +43,12 @@ pub external fn part( /// Returns an error if integer is less than zero or equal to or larger than /// 2^32. /// -pub external fn int_to_u32(Int) -> Result(Bitstring, Nil) = +pub external fn int_to_u32(Int) -> Result(BitString, Nil) = "gleam_stdlib" "bit_string_int_to_u32" /// Convert unsigned 32 bits to an integer. /// /// Returns an error if the bit string is not 32 bits in length. /// -pub external fn int_from_u32(Bitstring) -> Result(Int, Nil) = +pub external fn int_from_u32(BitString) -> Result(Int, Nil) = "gleam_stdlib" "bit_string_int_from_u32" |