Skip to content

Commit 235bd9a

Browse files
authored
Derive Traversable for Value (#414)
* Derive Traversable for Value * changelog, cabal
1 parent 91aa8d2 commit 235bd9a

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.5.14.0 (unreleased)
2+
========
3+
- @parsonsmatt
4+
- [#414](https://github.com/bitemyapp/esqueleto/pull/414)
5+
- Derive `Foldable` and `Traversable` for `Value`.
6+
17
3.5.13.2
28
========
39
- @blujupiter32

esqueleto.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cabal-version: 1.12
22

33
name: esqueleto
44

5-
version: 3.5.13.2
5+
version: 3.5.14.0
66
synopsis: Type-safe EDSL for SQL queries on persistent backends.
77
description: @esqueleto@ is a bare bones, type-safe EDSL for SQL queries that works with unmodified @persistent@ SQL backends. Its language closely resembles SQL, so you don't have to learn new concepts, just new syntax, and it's fairly easy to predict the generated SQL and optimize it for your backend. Most kinds of errors committed when writing SQL are caught as compile-time errors---although it is possible to write type-checked @esqueleto@ queries that fail at runtime.
88
.

src/Database/Esqueleto/Internal/Internal.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
{-# LANGUAGE ConstraintKinds #-}
88
{-# LANGUAGE DeriveDataTypeable #-}
9+
{-# LANGUAGE DeriveTraversable #-}
910
{-# LANGUAGE DerivingStrategies #-}
1011
{-# LANGUAGE EmptyDataDecls #-}
1112
{-# LANGUAGE FlexibleContexts #-}
@@ -1270,11 +1271,8 @@ else_ = id
12701271

12711272
-- | A single value (as opposed to a whole entity). You may use
12721273
-- @('^.')@ or @('?.')@ to get a 'Value' from an 'Entity'.
1273-
newtype Value a = Value { unValue :: a } deriving (Eq, Ord, Show, Typeable)
1274-
1275-
-- | @since 1.4.4
1276-
instance Functor Value where
1277-
fmap f (Value a) = Value (f a)
1274+
newtype Value a = Value { unValue :: a }
1275+
deriving (Eq, Ord, Show, Typeable, Functor, Foldable, Traversable)
12781276

12791277
instance Applicative Value where
12801278
(<*>) (Value f) (Value a) = Value (f a)

0 commit comments

Comments
 (0)