我有一个由字符串列表组成的列表,声明为
type alias Model =
{board : List (List String)
}
init : Model
init =
{board =
[ ["","",""]
,["","",""]
,["","",""]
]
}
在我的更新功能中,我试图通过]访问列表的内部元素>
(getAt col (getAt row model.board))
尽管尝试编译它时收到以下错误。如何从Maybe List转换为Just List或简单地List?
The 2nd argument to `getAt` is not what I expect:
65| (getAt col (getAt row model.board))
^^^^^^^^^^^^^^^^^^^^^
This `getAt` call produces:
Maybe (List String.String)
But `getAt` needs the 2nd argument to be:
List a
我有一个由字符串列表组成的列表,声明为类型别名Model = {board:List(列表字符串)} init:Model init = {board = [[“”,“”,“”], [“”,“”,...
首先回答您的问题:使用case .. of
或case .. of
。