diff options
author | Braxton Hall | 2022-10-24 19:38:20 +0000 |
---|---|---|
committer | GitHub | 2022-10-24 19:38:20 +0000 |
commit | 59e81fca4d450c71f10722792d36abf1b721caff (patch) | |
tree | bbc0837d1a492e1fb946c9fa6a4e6aea66b28305 /entries | |
parent | 0aa0d695f8fef33b02cbf04fbd6825bd2cbc6de1 (diff) | |
parent | a139a04ba0a5de1c36044e3dae1c6833193d2bea (diff) |
Merge branch 'main' into main
Diffstat (limited to 'entries')
-rw-r--r-- | entries/nritschel/assets/scratch.png | bin | 0 -> 752302 bytes | |||
-rw-r--r-- | entries/nritschel/scratch/README.md | 1 | ||||
-rw-r--r-- | entries/nritschel/scratch/fib.sb3 | bin | 0 -> 43364 bytes | |||
-rw-r--r-- | entries/nritschel/xlsx/fib.xlsx | bin | 0 -> 11704 bytes | |||
-rw-r--r-- | entries/zgrannan/Fib.hs | 18 |
5 files changed, 19 insertions, 0 deletions
diff --git a/entries/nritschel/assets/scratch.png b/entries/nritschel/assets/scratch.png Binary files differnew file mode 100644 index 0000000..5883245 --- /dev/null +++ b/entries/nritschel/assets/scratch.png diff --git a/entries/nritschel/scratch/README.md b/entries/nritschel/scratch/README.md new file mode 100644 index 0000000..e059267 --- /dev/null +++ b/entries/nritschel/scratch/README.md @@ -0,0 +1 @@ +<img src="../assets/scratch.png" alt="scratch preview">
\ No newline at end of file diff --git a/entries/nritschel/scratch/fib.sb3 b/entries/nritschel/scratch/fib.sb3 Binary files differnew file mode 100644 index 0000000..a3cf2cc --- /dev/null +++ b/entries/nritschel/scratch/fib.sb3 diff --git a/entries/nritschel/xlsx/fib.xlsx b/entries/nritschel/xlsx/fib.xlsx Binary files differnew file mode 100644 index 0000000..e1b662d --- /dev/null +++ b/entries/nritschel/xlsx/fib.xlsx diff --git a/entries/zgrannan/Fib.hs b/entries/zgrannan/Fib.hs new file mode 100644 index 0000000..1918fc8 --- /dev/null +++ b/entries/zgrannan/Fib.hs @@ -0,0 +1,18 @@ +-- Point-less fibonacci +fib :: Int -> Int +fib = fix fib' + where + fib' = + ap (when 0 . (0 ==)) . + ap (when 1 . (1 ==)) . + ap (ap . ((+) .) . (. subtract 1)) (. subtract 2) + + when t c e = if c then t else e + + ap mf m = mf >>= (\f -> m >>= return . f) + + fix f = f (fix f) + + +main :: IO () +main = mapM_ (print . fib) [0 .. 10] |