Our great sponsors
-
ghc
Mirror of the Glasgow Haskell Compiler. Please submit issues and patches to GHC's Gitlab instance (https://gitlab.haskell.org/ghc/ghc). First time contributors are encouraged to get started with the newcomers info (https://gitlab.haskell.org/ghc/ghc/wikis/contributing).
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help Prelude> :{ Prelude| nth _ [] = error "nth: empty list" Prelude| nth 0 (x:_) = x Prelude| nth n (_:xs) = nth (n - 1) xs Prelude| :} Prelude> nth 3 [1,4,5,9,8] 9 Prelude> nth k l = if k == 1 then head l else nth (k - 1) (tail l) Prelude> nth 3 [1,4,5,9,8] 5