glatch
Gleam type check using pattern matching
gleam add glatchimport glatch.{IsString}
import gleam/string
pub fn main() {
case glatch.get_type("Lucy") {
IsString(_) -> "Hello, 𓇼"
unknown -> "Who are you? " <> string.inspect(unknown)
}
}Further documentation can be found at https://hexdocs.pm/glatch.
Current status
Native / Stdlib
- String
- Int
- Float
- Bool
-
List
- [x] nested type check
- [x] empty type check
-
Option
- [x] Some type check
- [x] None type check
-
Result
- [x] Ok type check
- [x] Error type check
-
Dict
- [x] key type check
- [x] value type check
- [x] empty type check
-
Tuple
- [x] Arity 0-6
Development
gleam run # Run the project
gleam test # Run the tests
gleam shell # Run an Erlang shell