Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - leifg/backports: Ensure backwards compatibility even if newer functions are used

Ensure backwards compatibility even if newer functions are used - leifg/backports

Visit SiteGitHub - leifg/backports: Ensure backwards compatibility even if newer functions are used

GitHub - leifg/backports: Ensure backwards compatibility even if newer functions are used

Ensure backwards compatibility even if newer functions are used - leifg/backports

Powered by 0x5a.live ๐Ÿ’—

Backports

Tooling to make it possible to run "new" code in old Elixir versions.

Currently the following functions not available before 1.3 can be backported:

  • String.trim
  • String.to_charlist
  • String.pad_leading
  • String.pad_trailing can replace trim and to_charlist functions which were not available prior to Elixir 1.3.

Installation

If available in Hex, the package can be installed by adding backports to your list of dependencies in mix.exs:

def deps do
  [{:backports, "~> 0.2.0"}]
end

Usage

Whatever module uses a function that is not available, just include Backports

This code will work in Elixir 1.1 and 1.2

defmodule Foo do
  use Backports

  def bar do
    String.trim("  amazing   ")
  end
end

Elixir Resources

are all listed below.

Resources

listed to get explored on!!

Made with โค๏ธ

to provide different kinds of informations and resources.