Я следовал (старому?) руководству и обнаружил несоответствие типов. Изменилась ли библиотека List с 0.14.1 на 0.15? страница elm.
Код:
module Fibonacci where
import List exposing (..)
fibonacci : Int -> List Int
fibonacci n =
let fibonacci1 n acc =
if n <= 2
then acc
else fibonacci1 (n-1) ((head acc + (tail >> head) acc) :: acc)
in
fibonacci1 n [1,1] |> reverse
Несоответствие типов:
Type mismatch between the following types on line 11, column 40 to 69:
number
Maybe.Maybe a
It is related to the following expression:
(head acc) + ((tail >> head) acc)
Type mismatch between the following types on line 11, column 52 to 64:
Maybe.Maybe
List
It is related to the following expression:
tail >> head