logo
  • 教程列表
  • SO官方文档
  • 常见的仿函数作为 cofree comonads 的基础
    • Cofree 空空
    • Cofree(Const c)作家 c
    • Cofree 身份流
    • Cofree 也许是非空的
    • Cofree(作家 w)WriterT w Stream
    • Cofree(E e)NonEmptyT(作家 e)
    • Cofree(读者 x)摩尔 x
  1. StackOverflow 文档
  2. Haskell Language 教程
  3. 常见的仿函数作为 cofree comonads 的基础
  4. Cofree 也许是非空的

Cofree 也许是非空的

Created: November-22, 2018

特定

data Maybe a = Just a
             | Nothing

我们有

data Cofree Maybe a
     = a :< Just (Cofree Maybe a)
     | a :< Nothing

这是同构的

data NonEmpty a
     = NECons a (NonEmpty a)
     | NESingle a
  • Cofree(作家 w)WriterT w Stream
  • Cofree 身份流

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明