小编rob*_*cop的帖子

类型声明中的OCaml语法错误

我是OCaml的新手,我不知道为什么这会给我一个语法错误:

type ('nonterminal, 'terminal) pe =
| Empty
| T of t 
| N of n
| Seq of list
| Choose of list
| Star of e
| Not of e;;

type ('nonterminal, 'terminal) pe_tree = 
| Is_empty 
| Leaf of t 
| Node of (n,tree) 
| Sequence of list 
| Repeat of list 
| Is_not of e;;
Run Code Online (Sandbox Code Playgroud)

所有它说的是第14行字符0-1(这是哪里| Sequence of list)有一个语法错误,我无法弄清楚为什么!

ocaml

4
推荐指数
1
解决办法
933
查看次数

标签 统计

ocaml ×1