https://github.com/sofakingworld/beauty_kernel
https://github.com/sofakingworld/beauty_kernel
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sofakingworld/beauty_kernel
- Owner: sofakingworld
- License: mit
- Created: 2018-11-05T11:44:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-05T12:42:42.000Z (over 7 years ago)
- Last Synced: 2026-04-20T04:49:02.505Z (2 months ago)
- Language: Elixir
- Size: 12.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BeautyKernel
[Package on Hex.pm](https://hex.pm/packages/beauty_kernel/0.1.0)
The BeautyKernel package does implement aliases for some Kernel functions.
It is usefull in pipelines, if you're tired of ugly Kernel calls, like shown below:
```elixir
defmodule Foo do
def bar() do
list_of_data
|> elvis_function()
|> Kernel.++(additional_data)
end
end
```
becomes beauty <3, just look:
```elixir
defmodule Foo do
import BeautyKernel, only: :functions
def bar() do
list_of_data
|> elvis_function()
|> list_concat(additional_data)
end
end
```
## Existing Aliases
table legend:
`?*` - awaiting for naming proposal
Kernel | BeautyKernel's alias
-------| -------------------
!/1 | `?* `
!=/2 | not_eq?
!==/2 | `?* `
&&/2 | `?* `
*/2 | multiply
++/2 | list_concat
+/1 | plus
+/2 | plus
--/2 | list_remove
-/1 | minus
-/2 | minus
../2 | `?*`
/2 | devide
2 | lt?
<=/2 | lteq?
<>/2 | concat
==/2 | eq?
===/2 | `?*`
=~/2 | match?
\>/2 | gt?
\>=/2 | gteq?
## Installation
The package can be installed
by adding `beauty_kernel` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:beauty_kernel, "~> 0.1.0"}
]
end
```