Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions persistent-test/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased changes

## 2.13.1.4

* Support `persistent-2.17`

## 2.13.1.3

* Support persistent-2.14 with `SafeToInsert` class
Expand Down
4 changes: 2 additions & 2 deletions persistent-test/persistent-test.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: persistent-test
version: 2.13.1.3
version: 2.13.1.4
license: MIT
license-file: LICENSE
author: Michael Snoyman <[email protected]>
Expand Down Expand Up @@ -77,7 +77,7 @@ library
, monad-logger >=0.3.25
, mtl
, path-pieces >=0.2
, persistent >=2.14 && <2.17
, persistent >=2.14 && <2.18
, QuickCheck >=2.9
, quickcheck-instances >=0.3
, random >=1.1
Expand Down
8 changes: 8 additions & 0 deletions persistent/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog for persistent

# 2.17.0.0

* [#1595](https://github.com/yesodweb/persistent/pull/1595)
* Add `tabulateEntityApply` to `PersistEntity` class similar to
`tabulateEntityA` but that works on `Apply` type instead of `Applicative`.
This allows you to use `foldMap1` and other non-empty structures with
tabulating and manipulating records.

# 2.16.0.0

* [#1584](https://github.com/yesodweb/persistent/pull/1584)
Expand Down
11 changes: 11 additions & 0 deletions persistent/Database/Persist/Class/PersistEntity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module Database.Persist.Class.PersistEntity
) where

import Data.Functor.Constant
import Data.Functor.Apply (Apply)

import Data.Aeson
( FromJSON(..)
Expand Down Expand Up @@ -160,6 +161,16 @@ class ( PersistField (Key record), ToJSON (Key record), FromJSON (Key record)
-- 'Applicative' context.
-> f (Entity record)

-- | Like 'tabulateEntityA', but works with any 'Apply' f. This works
-- because all entities have at least one field, and so we can tabulate
-- things into semigroup-like shapes instead.
--
-- @since 2.17.0.0
tabulateEntityApply
:: (Apply f)
=> (forall a. EntityField record a -> f a)
-> f (Entity record)

-- | Unique keys besides the 'Key'.
data Unique record
-- | A meta operation to retrieve all the 'Unique' keys.
Expand Down
Loading
Loading