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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -