Idris 接口语法

Idris interface syntax

我正在尝试在 Idris 中编译 interface 的简单示例。

interface Foo a where
     foo : a -> String

但我不断收到此类型检查错误:

error: expected: "with",
argument expression,
function right hand side,
implicit function argument,
with pattern
interface Foo a where 
                ^     

我相信它在逻辑上应该与教程中的Show接口相同:http://docs.idris-lang.org/en/latest/tutorial/interfaces.html语法是否更改?或者问题出在哪里?

我正在使用 Idris 版本 0.9.12。

在 Idris 0.9.12 中,现在称为接口的语法是 class:

class Foo a where
     foo : a -> String