orville-postgresql-1.0.0.0: A Haskell library for PostgreSQL
CopyrightFlipstone Technology Partners 2023
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

Orville.PostgreSQL.Plan.Syntax

Description

This module exports the bind function as >>= so that it can be used in conjuction with the QualifiedDo language extension to write plans using do syntax like so:

{-# LANGUAGE QualifiedDo #-}
module MyModule where

import qualified Orville.PostgreSQL.Plan.Syntax as PlanSyntax

data FooFamily =
  FooFamily
    { foo :: Foo
    , children :: [FooChildren]
    , pets :: [FooPets]
    }

findFooFamily = PlanSyntax.do $
  fooHeader <- Plan.findOne fooTable fooIdField
  fooChildren <- Plan.findAll fooChildTable fooIdField
  fooPets <- Plan.findAll fooPetTable fooIdField

  FooFamily
    <$> Plan.use fooHeader
    <*> Plan.use fooChildren
    <*> Plan.use fooPets

Since: 1.0.0.0

Synopsis

Documentation

(>>=) :: Plan scope param a -> (Planned scope param a -> Plan scope param result) -> Plan scope param result Source #

An operator alias of bind so that it can be used with QualifiedDo.

Since: 1.0.0.0