typ*_*ris 3 haskell deriving derivingvia
从我读过的一篇博客文章
-- | Newtype for disabling logging
newtype NoLoggingT m a
= NoLoggingT { runNoLoggingT :: m a }
deriving newtype (Functor, Applicative, Monad)
deriving (MonadTrans) via IdentityT
instance Monad m => MonadLog (NoLoggingT m) where logLn _ _ = pure ()
Run Code Online (Sandbox Code Playgroud)
那是什么deriving newtype
语法?它是哪个扩展名,它有什么作用?请在 anwser 中提供指向其文档的链接。
归档时间: |
|
查看次数: |
81 次 |
最近记录: |