diff options
author | Xu, Junfeng | 2022-10-24 19:24:50 +0000 |
---|---|---|
committer | Xu, Junfeng | 2022-10-24 19:24:50 +0000 |
commit | 0aa0d695f8fef33b02cbf04fbd6825bd2cbc6de1 (patch) | |
tree | f1c0b50f169bc05a49840df9524427967e5a1c21 /entries/nxjfxu | |
parent | 0ed78b5a990776b0db8c794b4e9ca415fee86fce (diff) |
add haskell entry
Diffstat (limited to 'entries/nxjfxu')
-rw-r--r-- | entries/nxjfxu/fib.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/entries/nxjfxu/fib.hs b/entries/nxjfxu/fib.hs new file mode 100644 index 0000000..0f0d871 --- /dev/null +++ b/entries/nxjfxu/fib.hs @@ -0,0 +1,5 @@ +fib :: Int -> Int +fib = (fibs !!) + where + fibs = 0 : 1 : [fibs !! (i - 2) + fibs !! (i - 1) | i <- [2..]] + |