Besonderhede van voorbeeld: -7676364924980526877

Metadata

Author: WikiMatrix

Data

English[en]
For example, in the Haskell programming language, the list of all Fibonacci numbers can be written as: fibs = 0 : 1 : zipWith (+) fibs (tail fibs) In Haskell syntax, ":" prepends an element to a list, tail returns a list without its first element, and zipWith uses a specified function (in this case addition) to combine corresponding elements of two lists to produce a third.
Korean[ko]
예를 들어 하스켈에서는 모든 피보나치 수의 목록을 다음과 같이 쓸 수 있다. fibs = 1 : 1 : zipWith (+) fibs (tail fibs) 하스켈의 구문 ":"는 목록에 원소를 첨가하는 것이고 tail은 첫 번째 원소를 빼고 리스트를 돌려주며, zipWith는 특정한 (여기서는 (+)) 함수를 사용하여 두 목록의 각 원소를 결합하여 세 번째 항목을 생성하도록 한다.

History

Your action: