nth element from a list

This page summarizes the projects mentioned and recommended in the original post on /r/haskellquestions

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • 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).

  • 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

  • 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.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts