【发布时间】:2018-05-10 22:44:15
【问题描述】:
在另一个问题 (How to write a simple list-based quicksort in Idris?) 中,我试图理解为什么 Prelude.Applicative.guard 需要 Ord 类型类。
Guard 定义为like this:
guard : Alternative f => Bool -> f ()
guard a = if a then pure () else empty
查看Alternative 接口docs(我还没有真正理解它在代码中是如何定义的,但我在学习 Idris 方面还不是很远),我不明白它需要什么Ord 要么。
【问题讨论】:
标签: idris