https://github.com/jaeyson/getypex
Library for checking types. Similar from IEx's i command
https://github.com/jaeyson/getypex
elixir type-checking
Last synced: 4 months ago
JSON representation
Library for checking types. Similar from IEx's i command
- Host: GitHub
- URL: https://github.com/jaeyson/getypex
- Owner: jaeyson
- License: mit
- Created: 2021-08-14T22:40:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-16T13:35:00.000Z (almost 4 years ago)
- Last Synced: 2025-03-24T01:46:43.579Z (about 1 year ago)
- Topics: elixir, type-checking
- Language: Elixir
- Homepage: https://hex.pm/packages/getypex
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Getypex
[//]: # "Badges"
[![Dependabot][dependabot badge]][dependabot]
[![Actions Status][actions badge]][actions]
[![Super Linter][linter badge]][linter]
[//]: # "Links"
[dependabot]: https://github.com/jaeyson/getypex
[actions]: https://github.com/jaeyson/getypex/actions/workflows/ci.yml
[linter]: https://github.com/jaeyson/getypex/actions/workflows/linter.yml
[//]: # "Image sources"
[dependabot badge]: https://badgen.net/github/dependabot/jaeyson/getypex
[actions badge]: https://github.com/jaeyson/getypex/actions/workflows/ci.yml/badge.svg
[linter badge]: https://github.com/jaeyson/getypex/actions/workflows/linter.yml/badge.svg
Library for checking types. Similar from `PHP`'s `gettype` or `JavaScript`'s `typeof`. Created this package to better understand how [`Protocol`](https://elixir-lang.org/getting-started/protocols.html) works.
**Note**: try `IEx.Info.info("hello world")`, [Elixir's implementation](https://github.com/elixir-lang/elixir/blob/master/lib/iex/lib/iex/info.ex) via shell or visit Elixir's [Protocol guide](https://elixir-lang.org/getting-started/protocols.html) instead of this package, since it's based from that module.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `getypex` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:getypex, "~> 0.1.1"}
]
end
```
Docs can be found at [https://hexdocs.pm/getypex](https://hexdocs.pm/getypex).
## Usage
```elixir
iex(1)> Getypex.check("hello Getypex")
"String (UTF-8)"
iex(2)> Getypex.check({:ok, "message"})
"Tuple"
```