1
使用Esqueleto处理列表类型
我将数据类型定义为: data ComitteeView = CommitteeView { committeeId :: CommitteeId , committeeMembers :: [Person] } data CommitteesView = CommitteesView { committeeView :: [CommitteeView] } 现在,就目前而言,我有一个持久模型定义为: Person name Text Committee name Text CommitteePerson personId PersonId committeeId CommitteeId 我可以很容易地使用Esqueleto创建一个查询来填充CommitteeView。它会像这样: getCommitteeView cid = CommitteeView <$> runDB $ select $ from (person `InnerJoin` pxc `InnerJoin` …