ProMode (pro_mode v0.1.17)

Brevity is bliss.

      - APLJKQ

Provides shortcuts for common Elixir functions.

Link to this section Summary

Functions

Enum.at

Enum.all?

Enum.any?

String.to_float

String.to_integer

Enum.concat

System.cmd

Decrement argument by one

Conditionally apply a statement to a value. x is being injected as the value.

Enum.drop

String.duplicate

Enum.each

elem

Enum.filter

Enum.reject

Enum.find

Enum.find_index

Enum.flat_map

IO.ANSI.format

Shorter if

Increment argument by one

Enum.into

Enum.join

Map.keys

Keyword.get

Keyword.put

length

List.first

List.last

Enum.map

Enum.max

Map.delete

Map.get

Enum.min

Map.put

Map.take

Map with previous element

IO.puts

Enum.reduce

Enum.reduce

Enum.reverse

String.length

String.split

Enum.sort_by

Enum.sort_by

String.slice

then

Matrix transpose

String.trim

Enum.uniq

Enum.unzip

Map.values

Enum.with_index

Enum.zip

Link to this section Functions

Enum.at

Enum.all?

Enum.any?

String.to_float

String.to_integer

Enum.concat

System.cmd

Decrement argument by one

examples

Examples

iex> ProMode.dec(1) 0

Link to this macro

do?(a, b, c)

(macro)

Conditionally apply a statement to a value. x is being injected as the value.

iex> ProMode.do?([1], true, [2 | x]) [2, 1]

iex> ProMode.do?([1], false, [2 | x]) [1]

iex> t = true; %{a: 1} |> ProMode.do?(t, Map.put(x, :b, 2)) |> ProMode.do?(false, Map.put(x, :c, 3)) |> ProMode.do?(true, Map.delete(x, :a)) %{b: 2}

iex> t = true; %{a: 1} |> ProMode.do?(t, do: (Map.put(x, :b, 2))) %{a: 1, b: 2}

iex> t = false; %{a: 1} |> ProMode.do?(t, do: (Map.put(x, :b, 2))) %{a: 1}

iex> v = 5; ProMode.do?([], v, ProMode.kwp(x, :count, v)) [count: 5]

iex> v = nil; ProMode.do?([], v, ProMode.kwp(x, :count, v)) []

Enum.drop

String.duplicate

Enum.each

elem

Enum.filter

Enum.reject

Enum.find

Enum.find_index

Enum.flat_map

IO.ANSI.format

Link to this macro

i?(c, d, e \\ nil)

(macro)

Shorter if

examples

Examples

iex> ProMode.i?(true, "then", "else") "then"

iex> ProMode.i?(false, "then", "else") "else"

iex> ProMode.i?(true, "yes") "yes"

iex> ProMode.i?(false, "yes") nil

Increment argument by one

examples

Examples

iex> ProMode.inc(1) 2

Enum.into

Enum.join

Map.keys

Keyword.get

Keyword.put

length

List.first

List.last

Enum.map

Enum.max

Map.delete

Map.get

Enum.min

Map.put

Map.take

Map with previous element

examples

Examples

Calculates deltas

iex> ProMode.mwp([1, 3, 10, 22], &-/2) [-2, -7, -12]

IO.puts

Enum.reduce

Enum.reduce

Enum.reverse

String.length

String.split

Enum.sort_by

Enum.sort_by

String.slice

Link to this function

sslice(a, b, c)

then

Matrix transpose

examples

Examples

iex> ProMode.tpose([[1, 2], [3, 4]]) [[1, 3], [2, 4]]

String.trim

Enum.uniq

Enum.unzip

Map.values

Enum.with_index

Enum.zip