这是我的代码:
newcell :: [Cell] -> [Cell]
newcell [Cell {cellPosition = cp, cellState = cs}]
= [Cell {cellPosition = cp, cellState = (nextCellState cs)}]
Run Code Online (Sandbox Code Playgroud)
nextCellState 只是一个功能,但它说不能匹配模式.
src/StudentSources/LangtonsAnt.hs:141:1: Warning:
Pattern match(es) are non-exhaustive
In an equation for ‘newcell’:
Patterns not matched:
[]
(Cell _ _) : (_ : _)
Run Code Online (Sandbox Code Playgroud) haskell ×1