3
Я пытаюсь создать список элементов из простого массива в ELM. Ожидаемый результат - это просто список элементов с 1 как первый элемент, 2 как второй и т. Д.Как вернуть список элементов в Elm
import Html exposing (..)
import Html.Attributes exposing (class, id)
import List exposing (map)
theArray = [1,2,3,4,5,6]
createListItem item =
li [] [ text (toString item)]
buildList collection =
map createListItem collection
builtList = ul [] [(buildList theArray)]
main =
builtList
Но я продолжаю получать ошибку компилятора на линии тринадцать. Я пробовал тип аннотирования элемента карты html, но я не вижу, что мне следует делать.
The 2nd argument to function `ul` is causing a mismatch.
*13| builtList = ul [] [(buildList theArray)]*
Function `ul` is expecting the 2nd argument to be:
List VirtualDom.Node
But it is:
List (List Html)