diff options
author | Louis Pilfold <louis@lpil.uk> | 2020-04-14 10:20:01 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-04-14 10:20:01 +0100 |
commit | 95ad77fdd2a5f2282eee5248921973863f998427 (patch) | |
tree | 9705a03e1fbcd30222df408925685fa8d569417a /src | |
parent | 7de6de494af9e85351d416a20bab5cd82749f935 (diff) | |
download | gleam_stdlib-95ad77fdd2a5f2282eee5248921973863f998427.tar.gz gleam_stdlib-95ad77fdd2a5f2282eee5248921973863f998427.zip |
Alias core types
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/bool.gleam | 3 | ||||
-rw-r--r-- | src/gleam/float.gleam | 3 | ||||
-rw-r--r-- | src/gleam/int.gleam | 3 | ||||
-rw-r--r-- | src/gleam/list.gleam | 3 | ||||
-rw-r--r-- | src/gleam/result.gleam | 6 | ||||
-rw-r--r-- | src/gleam/string.gleam | 3 |
6 files changed, 21 insertions, 0 deletions
diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam index 76476c3..8dcc614 100644 --- a/src/gleam/bool.gleam +++ b/src/gleam/bool.gleam @@ -2,6 +2,9 @@ import gleam/order.{Order} +pub type Bool = + Bool + /// Returns the opposite Bool value /// /// ## Examples diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam index 6d6ab49..9de1549 100644 --- a/src/gleam/float.gleam +++ b/src/gleam/float.gleam @@ -4,6 +4,9 @@ import gleam/iodata import gleam/order.{Order} import gleam/result.{Option} +pub type Float = + Float + /// Attempts to parse the String as a Float if possible /// /// ## Examples diff --git a/src/gleam/int.gleam b/src/gleam/int.gleam index bd264fd..b663940 100644 --- a/src/gleam/int.gleam +++ b/src/gleam/int.gleam @@ -3,6 +3,9 @@ import gleam/order.{Order} import gleam/result.{Option} +pub type Int = + Int + /// Attempts to parse the String as an Int if possible /// /// ## Examples diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index 4b832bc..fbc3ab5 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -3,6 +3,9 @@ import gleam/pair import gleam/order.{Order} import gleam/result.{Option} +pub type List(elements) = + List(elements) + pub type LengthMismatch { LengthMismatch } diff --git a/src/gleam/result.gleam b/src/gleam/result.gleam index 5b3170d..e4ea275 100644 --- a/src/gleam/result.gleam +++ b/src/gleam/result.gleam @@ -1,6 +1,12 @@ /// Result represents the result of something that may succeed or fail. /// `Ok` means it was successful, `Error` means it failed. +pub type Result(success, error) = + Result(success, error) + +pub type Nil = + Nil + /// Returns whether the value is Ok /// pub fn is_ok(result: Result(a, e)) -> Bool { diff --git a/src/gleam/string.gleam b/src/gleam/string.gleam index 5b43dd6..46b1a25 100644 --- a/src/gleam/string.gleam +++ b/src/gleam/string.gleam @@ -6,6 +6,9 @@ import gleam/list import gleam/order import gleam/result.{Option} +pub type String = + String + /// ## Basics /// Determine if a string is empty. |