From 0aa0d695f8fef33b02cbf04fbd6825bd2cbc6de1 Mon Sep 17 00:00:00 2001 From: Xu, Junfeng Date: Mon, 24 Oct 2022 12:24:50 -0700 Subject: add haskell entry --- entries/nxjfxu/fib.hs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 entries/nxjfxu/fib.hs (limited to 'entries/nxjfxu/fib.hs') 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..]] + -- cgit v1.2.3-70-g09d2