Logo

Programming-Idioms

  • Dart
  • Haskell
1..10 |> Enum.each(fn _ -> IO.puts "Hello" end)

The pipe operator is very common in elixir and is used to chain function calls
for (var i = 0; i < 10; i++)
  print("Hello");
print("Hello\n" * 10);

This will print 'Hello' in a new line 10 times, plus an extra newline
import Control.Monad
replicateM_ 10 $ putStrLn "Hello"
with Ada.Text_IO;
use Ada.Text_IO;
for I in 1 .. 10 loop
  Put_Line ("Hello");
end loop;

New implementation...
< >
programming-idioms.org