aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Puc <marcin.e.puc@gmail.com>2021-07-21 16:28:05 +0200
committerLouis Pilfold <louis@lpil.uk>2021-07-26 22:23:04 +0100
commit3d977c8f9c19ddb85ba9c0b59bd4aee688264dd6 (patch)
tree72d1dd591b81559d50904285b2065ae2b970c40b
parent34d7d8697123eada9fb1d4a36ee1aee2c71a8b9d (diff)
downloadgleam_stdlib-3d977c8f9c19ddb85ba9c0b59bd4aee688264dd6.tar.gz
gleam_stdlib-3d977c8f9c19ddb85ba9c0b59bd4aee688264dd6.zip
Remove redefinitions of types from the prelude
-rw-r--r--src/gleam/base.gleam2
-rw-r--r--src/gleam/bit_builder.gleam1
-rw-r--r--src/gleam/bit_string.gleam3
-rw-r--r--src/gleam/bool.gleam11
-rw-r--r--src/gleam/dynamic.gleam2
-rw-r--r--src/gleam/float.gleam3
-rw-r--r--src/gleam/int.gleam3
-rw-r--r--src/gleam/list.gleam3
-rw-r--r--src/gleam/result.gleam14
-rw-r--r--src/gleam/string.gleam7
10 files changed, 2 insertions, 47 deletions
diff --git a/src/gleam/base.gleam b/src/gleam/base.gleam
index 5ca741e..b589cb6 100644
--- a/src/gleam/base.gleam
+++ b/src/gleam/base.gleam
@@ -1,5 +1,5 @@
if erlang {
- import gleam/bit_string.{BitString}
+ import gleam/bit_string
import gleam/string
external fn erl_encode64(BitString) -> String =
diff --git a/src/gleam/bit_builder.gleam b/src/gleam/bit_builder.gleam
index f3cf026..f74f517 100644
--- a/src/gleam/bit_builder.gleam
+++ b/src/gleam/bit_builder.gleam
@@ -1,5 +1,4 @@
if erlang {
- import gleam/bit_string.{BitString}
import gleam/string_builder.{StringBuilder}
/// BitBuilder is a type used for efficiently concatenating bits to create bit
diff --git a/src/gleam/bit_string.gleam b/src/gleam/bit_string.gleam
index 835ff7c..8611c46 100644
--- a/src/gleam/bit_string.gleam
+++ b/src/gleam/bit_string.gleam
@@ -3,9 +3,6 @@
//// encoded.
if erlang {
- pub type BitString =
- BitString
-
/// Converts a UTF-8 String type into a raw BitString type.
///
pub external fn from_string(String) -> BitString =
diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam
index 684aa2f..e016168 100644
--- a/src/gleam/bool.gleam
+++ b/src/gleam/bool.gleam
@@ -1,16 +1,5 @@
import gleam/order.{Order}
-/// A type with two possible values, True and False. Used to indicate whether
-/// things are... true or false!
-///
-/// Often is it clearer and offers more type safety to define a custom type
-/// than to use Bool. For example, rather than having a `is_teacher: Bool`
-/// field consider having a `role: SchoolRole` field where SchoolRole is a custom
-/// type that can be either Student or Teacher.
-///
-pub type Bool =
- Bool
-
/// Returns the opposite bool value.
///
/// This is the same as the `!` or `not` operators in some other languages.
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam
index be2c9b7..8516b40 100644
--- a/src/gleam/dynamic.gleam
+++ b/src/gleam/dynamic.gleam
@@ -1,6 +1,6 @@
if erlang {
import gleam/atom
- import gleam/bit_string.{BitString}
+ import gleam/bit_string
import gleam/list
import gleam/map.{Map}
import gleam/option.{None, Option, Some}
diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam
index 5938be0..857b593 100644
--- a/src/gleam/float.gleam
+++ b/src/gleam/float.gleam
@@ -3,9 +3,6 @@ import gleam/order.{Order}
if erlang {
import gleam/string_builder
- pub type Float =
- Float
-
/// Attempts to parse a string as a float, returning `Error(Nil)` if it was not
/// possible.
///
diff --git a/src/gleam/int.gleam b/src/gleam/int.gleam
index f3c49c8..0df7397 100644
--- a/src/gleam/int.gleam
+++ b/src/gleam/int.gleam
@@ -1,8 +1,5 @@
import gleam/order.{Order}
-pub type Int =
- Int
-
/// Returns the absolute value of the input.
///
/// ## Examples
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam
index 682dd01..341b4a1 100644
--- a/src/gleam/list.gleam
+++ b/src/gleam/list.gleam
@@ -22,9 +22,6 @@ import gleam/int
import gleam/pair
import gleam/order.{Order}
-pub type List(elements) =
- List(elements)
-
/// An error value returned by the `strict_zip` function.
///
pub type LengthMismatch {
diff --git a/src/gleam/result.gleam b/src/gleam/result.gleam
index d0601bf..cbc2f0b 100644
--- a/src/gleam/result.gleam
+++ b/src/gleam/result.gleam
@@ -1,19 +1,5 @@
import gleam/list
-/// Result represents the result of something that may succeed or not.
-/// `Ok` means it was successful, `Error` means it was not successful.
-///
-pub type Result(success, error) =
- Result(success, error)
-
-/// Nil is a type used to represent the absence of something, similar to null
-/// or undefined in other languages.
-///
-/// Unlike some other languages values cannot be implicitly nil.
-///
-pub type Nil =
- Nil
-
/// Checks whether the result is an Ok value.
///
/// ## Examples
diff --git a/src/gleam/string.gleam b/src/gleam/string.gleam
index d9d2c63..7cf506b 100644
--- a/src/gleam/string.gleam
+++ b/src/gleam/string.gleam
@@ -11,13 +11,6 @@ if erlang {
import gleam/dynamic.{Dynamic}
}
-pub type String =
- String
-
-/// A UtfCodepoint is the integer representation of a valid UTF codepoint
-pub type UtfCodepoint =
- UtfCodepoint
-
/// Determines if a string is empty.
///
/// ## Examples