HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleopaleye-0.10.8.0Haskell2010

Opaleye.Distinct

Contents
  1. Explicit versions
  2. Adaptors
  3. Deprecated
Synopsis
  • Packageopaleye-0.10.8.0
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceDistinct.hs
valuedistinct
  1. :: (Default Distinctspec fields fields, Default Unpackspec fields fields)
  2. => Select fields
  3. -> Select fields

Remove duplicate rows from the Select.

Example type specialization:

distinct :: Select (Field a, Field b) -> Select (Field a, Field b)

Assuming the makeAdaptorAndInstanceInferrable splice has been run for the product type Foo:

distinct :: Select (Foo (Field a) (Field b) (Field c)) -> Select (Foo (Field a) (Field b) (Field c))

If you want to run distinct on Select.SelectArrs you should apply Opaleye.Lateral.laterally to it:

Opaleye.Lateral.laterally distinct :: Data.Profunctor.Product.Default Distinctspec fields fields => SelectArr i fields -> SelectArr i fields
valuedistinctOnBy
  1. :: Default Unpackspec b b
  2. => a -> b
  3. -> Order a
  4. -> Select a
  5. -> Select a

Keep the row from each set where the given function returns the same result. The row is chosen according to which comes first by the supplied ordering. However, no output ordering is guaranteed. Multiple fields may be distinguished by projecting out tuples of Field_s.

Explicit versions

Adaptors

newtypenewtype Distinctspec a b
#
Instances7Profunctor, ProductProfunctor, SumProfunctor, Default, Functor, Applicative, …

Deprecated