Constraint
当我尝试编写一个简单的示例时,我收到了一个不在范围内的错误,
{-# LANGUAGE UndecidableInstances,
MultiParamTypeClasses,
KindSignatures,
Rank2Types,
ConstraintKinds,
FlexibleInstances,
OverlappingInstances,
TypeFamilies #-}
type family A a :: Constraint
错误是,
> ghci test.hs
[1 of 1] Compiling Main ( test.hs, interpreted )
test.hs:10:20: Not in scope: type constructor or class `Constraint'
Failed, modules loaded: none.
约束同义词似乎按预期工作,
type ShowOrd a = (Ord a, Show a)
提前致谢。