我知道Functor
和Applicative
应该是超Monad
,但不是由于历史的原因.但是,为什么不能声明Monad
一个实例Functor
呢?这将产生大致相同的效果,但无需修改现有代码.如果你想这样做,GHC抱怨:
instance Functor Monad where
fmap = liftM
Class `Monad' used as a type
In the instance declaration for `Functor Monad'
Run Code Online (Sandbox Code Playgroud)
这是为什么?这可能是一个很好的理由.
我有一个使用 WinForms 的跨平台 .NET 应用程序。
为了更好地与 Unity 兼容,我想设置WM_CLASS
WinForms 窗口的属性。这可能吗?