2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

口で言うより行うことがErlang習得への近道と信じています。

異なる型の比較

Erlangではどんな型の組み合わせでも大小の比較判定が可能です。

number < atom < reference < function < port < pid < tuple < map < list < bitstring

lists:min

min([term, ...]) -> term
min(リスト) -> 最小値

リストの最小値を求めます。どんなリストに対しても実行可能です。

練習してみます。

> lists:min([1, 2, 3, 4]).
1

> lists:min([1.0, 2, 3, 4]).
1.0

> lists:min(["1", {2, 3}, '4', #{x => 5}, 6]).
6

Elixirにも挑戦したい

闘魂ElixirシリーズとElixir Schoolがオススメです。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?