我需要移动wireworld,我想将一个函数放在另一个函数中(“help1”)但我无法让它工作,这里有多个文件是我所拥有的
module Transitions.For_List_2D (
transition_world -- :: List_2D Cell -> List_2D Cell
) where
import Data.Cell (Cell)
import Data.Cell (Cell (Head, Tail, Conductor, Empty))
import Data.Coordinates
import Data.Coordinates (Distance,X_Coord,Y_Coord,Coord,Element_w_Coord,)
import Data.List_2D
-- Replace this function with something more meaningful:
transition_world :: List_2D Cell -> List_2D Cell
transition_world w = case w of
[] -> []
x:xs -> transition_cell x : transition_world xs
transition_cell :: Element_w_Coord Cell -> Element_w_Coord Cell
transition_cell a = case a of
(Head,(x_coord,y_coord)) -> (Tail, (x_coord,y_coord))
(Tail,(x_coord,y_coord)) -> (Conductor, (x_coord,y_coord))
(Empty,(x_coord,y_coord))-> (Empty, (x_coord, y_coord))
(Conductor,(x_coord,y_coord)) -> (i want to put working function here)
help1 :: Coord -> List_2D Cell -> List_2D Cell
help1 a = case a of
x:xs
(Conductor, (x_e, y_e))-> List_2D.local_elements(element, (x_e, y_e)): help1 xs
local_element 是另一个文件上的一个函数,如果您需要查看他的任何其他文件,我也想使用它,请问谢谢,非常感谢任何帮助