File: example.lua

package info (click to toggle)
haskell-hslua 2.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 148 kB
  • sloc: haskell: 288; makefile: 6
file content (8 lines) | stat: -rw-r--r-- 140 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
--- Compute the n-th fibonacci number.
function fib(n)
  local a, b = 0, 1
  for i = 0, (n - 1) do
    a, b = b, b + a
  end
  return a
end