考虑以下示例:
instance (Monad m) => MonadState s (ChronoT s e m) where
-- | Returns the present-day state.
get = ChronoT $ do
(ChronoS _ s _) <- get
return s
-- | Set the present-day state directly, erasing the past and future for
-- safety. See also 'paradox'.
put x = ChronoT $ do
(ChronoS _ _ _) <- get
put $ mkChronoS x
当通过 haddock 运行时,这些函数get
会put
显示出来,但它们使用的是 MonadState 的默认文档。如何在我的模块中包含我自己的文档?
(你可以在这里cabal haddock
运行repo来了解我的意思)