下面的代码犯规编译: class Foo f where
getInt :: f -> Int
class Bar b where
getFooFromBar :: Foo f => b -> f
someFunction :: Bar b => b -> Int
someFunction bar = getInt $ getFooFromBar bar
的错误是
我最近看到这种错误的一个很好的协议: Error:
Tactic failure: setoid rewrite failed: Unable to satisfy the following constraints:
UNDEFINED EVARS:
?X1700==[R M Re Rplus Rmult Rzero Rone Rnegate Me Mop Munit Mnegate sm
我想编译Idris中的interface的简单示例。 interface Foo a where
foo : a -> String
但我不断收到这种类型检查错误: error: expected: "with",
argument expression,
function right hand side,
implicit function argument,
with p
所以我在斯卡拉多态数据类型树定义如下 sealed trait Tree[+A]
final case class Node[A](value: A) extends Tree[A]
final case class Branch[A](value: A, left: Tree[A], right: Tree[A]) extends Tree[A]
object Tree{
i
我觉得我要有效地做这样的事情: class (forall z. ListZip z) => PlaneZip p where... --functions using z excluded
在短,但更确切地说,我想有 class A p where ... --definition excluded
class C p where
foo :: (A z) => p (z a)