This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # favicon.ico | |
| location = /favicon.ico { | |
| log_not_found off; | |
| access_log off; | |
| } | |
| # robots.txt | |
| location = /robots.txt { | |
| log_not_found off; | |
| access_log off; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Base formula, but this is exponential time | |
| fib :: Int -> Int | |
| fib 0 = 0 | |
| fib 1 = 1 | |
| fib x | |
| | x < 0 = error "No Negatives allowed" | |
| | otherwise = fib (x-2) + fib (x-1) | |
| -- When doing an unbounded sequence, where should we stop? | |
| fibLimit:: Int -> Int -> Int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Get the fibonacci sequence up to a limit | |
| fml :: Int -> [Int] -> [Int] | |
| fml limit seed | |
| | null seed = fml limit [1, 1] | |
| | nextNumber < limit = fml limit (seed ++ [nextNumber]) | |
| | otherwise = seed | |
| where nextNumber = ((last (init seed)) + (last seed)) | |
| -- Implementation to retrieve a specific fibonacci number | |
| fm :: Int -> [Int] -> Int |