Function wireworld haskell需要帮助

Function wireworld haskell需要帮助,function,haskell,cellular-automata,Function,Haskell,Cellular Automata,我需要进行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

我需要进行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_元素是我要使用的另一个文件上的函数 此外,如果您需要查看任何其他文件,请询问
非常感谢您的任何帮助

您的
help1
函数需要两个参数,但您只提供一个参数

试试像这样的东西

help1 coord world = case world of

尝试在列表上进行递归实验,停止在堆栈溢出上发布赋值问题,尤其是使用您的真实姓名。

我想您可能刚刚得到了
案例。。。函数语法混乱,我们看不到您所有的定义(例如,我认为
Conductor,…
将是
元素\u w_协调单元
,但您正试图使用它(?)代替将失败的
列表\u 2D单元
)-无论如何,请尝试
帮助(x:xs)(Conductor…)=…
而不是
help1 a=x:xs的案例a…
要开始在任何情况下,请告诉我们报告给您的错误,并指向显示错误的行请保持友好,也许你应该扩大你的答案一点-现在它实际上不超过一个评论我的回答可能不是最礼貌的,但老实说,我只是想在学生因剽窃而面临失败(或更糟)的风险之前停止。这不是一个可以用给出的答案合理回答的问题,或者学生问为什么他们的“帮助1”功能不起作用(在这种情况下,我已经回答了他们的问题),或者他们要求解决他们的作业,这是有问题的。我理解,我的评论并不意味着冒犯-是的,OP很可能已经失去了所有的兴趣,因为他无法在几秒钟内解决他的问题。但是“家庭作业”问题经常出现(见),我的理解是家庭作业问题是可以的,我们只需要注意并给出比完整答案更多的提示(第一)——我们不是这里的老师或家长,如果他们作弊,我们不负责任-我们是来帮助的呃,我只是想在函数中得到一些帮助(帮助1),我把我的名字放在这里,这样我的代码就知道是我的,不能被使用,如果有帮助的话,我计划举出曾经帮助过我的人,因为我想避免瘟疫抱歉,如果我造成了任何冲突,我没有回应,因为我这周考试很忙