Error: Syntax error: type expected ocaml -
i'm new ocaml. following error when trying execute code.
let rec parser (edge_lst : edge list) (mininode_lst: mininode list) (previousnode : mininode) (s_lst: stmt list) = match s_lst | [] -> (*no more statements => add stop node , save graph*) (edge_lst,mininode_lst) | hd :: tl -> let currentnode = createnode(hd) in let mininode_lst_new = mininode_lst@[currentnode] , edge_lst_new = edge_lst@[createedge(previousnode,currentnode) in parser edgeplst_new mininode_lst_new currentnode tl;
error: syntax error: type expected.
please let me know going wrong here.
you using list instead of list in definition of parser, ']' missing (you have 1 open bracket without closed bracket). , createedge works on tuple ? believe not, , syntax should (with close bracket) :
edge_lst_new = edge_lst@[createedge previousnode currentnode] in
Comments
Post a Comment