Cofree(E e)NonEmptyT(作家 e)

特定

data Either e a = Left e
                | Right a

我們有

data Cofree (Either e) a
     = a :< Left e
     | a :< Right (Cofree (Either e) a)

這是同構的

data Hospitable e a
     = Sorry_AllIHaveIsThis_Here'sWhy a e
     | EatThis a (Hospitable e a)

或者,如果你承諾僅在完成結果後評估日誌,則 NonEmptyT (Writer e) a 使用

data NonEmptyT (Writer e) a = NonEmptyT (e,a,[a])