| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Date: Sun, 18 Jan 2026 06:01:27 GMT
Age: 0
X-Served-By: cache-dfw-kdal2120114-DFW, cache-bom-vanm7210047-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768716087.017904,VS0,VE297
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
monad-persist: An mtl-style typeclass and transformer for persistent.
monad-persist
monad-persist: An mtl-style typeclass and transformer for persistent.
Downloads
- monad-persist-0.0.3.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.0.1.0, 0.0.1.1, 0.0.1.2, 0.0.1.3, 0.0.1.4, 0.0.2.0, 0.0.3.0 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=4.8 && <5), exceptions (>=0.6), monad-control (>=1.0.0.0 && <2), monad-logger (>=0.3.10), mtl, persistent (>=2.5 && <3), text, transformers, transformers-base [details] |
| License | ISC |
| Copyright | 2017 CJ Affiliate by Conversant |
| Author | Alexis King <lexi.lambda@gmail.com> |
| Maintainer | Alexis King <lexi.lambda@gmail.com> |
| Uploaded | by lexi_lambda at 2018-09-18T20:49:43Z |
| Category | Database |
| Home page | https://github.com/cjdev/monad-persist#readme |
| Bug tracker | https://github.com/cjdev/monad-persist/issues |
| Source repo | head: git clone https://github.com/cjdev/monad-persist |
| Distributions | |
| Reverse Dependencies | 2 direct, 1 indirect [details] |
| Downloads | 5378 total (32 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2018-09-18 [all 1 reports] |
Readme for monad-persist-0.0.3.0
[back to package description]monad-persist 
This module provides an mtl-style MonadPersist typeclass for persistent, as well as a PersistT monad transformer that implements it. This makes it easier to use persistent in an arbitrary monad transformer stack, rather than one that must be ReaderT over MonadIO.
import Control.Monad.Logger (runNoLoggingT)
import Control.Monad.Persist
import Data.Text (Text)
import Database.Persist.Sqlite (withSqliteConn)
import Database.Persist.TH
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
User
name Text
email Text
UniqueEmail email
deriving Eq Show
|]
ghci> runNoLoggingT $ withSqliteConn ":memory:" $ \conn -> flip runSqlPersistT conn $ do
runMigration migrateAll
insert_ User { userName = "Alyssa", userEmail = "alyssa@example.com" }
users <- selectList [] []
return (users :: [Entity User])
Migrating: CREATE TABLE "user"("id" INTEGER PRIMARY KEY,"name" VARCHAR NOT NULL,"email" VARCHAR NOT NULL,CONSTRAINT "unique_email" UNIQUE ("email"))
[Entity {entityKey = UserKey {unUserKey = SqlBackendKey {unSqlBackendKey = 1}}, entityVal = User {userName = "Alyssa", userEmail = "alyssa@example.com"}}]