partial-records-0.2.0.0: Template haskell utilities for constructing records with default values

Copyright(C) mniip 2019
LicenseBSD3
Maintainermniip@email.com
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Data.Partial.Utils

Description

Utility functions used by generated Template Haskell code.

Documentation

data Opt b x where Source #

Constructors

Has :: x -> Opt True x 
Hasn't :: Opt False x 

joinOpt :: Opt b1 x -> Opt b2 x -> Opt (b1 || b2) x Source #

fromOpt :: x -> Opt b x -> x Source #

class Require (dc :: Symbol) (fld :: Symbol) (b :: Bool) where Source #

Methods

unOpt :: p dc -> p fld -> Opt b x -> x Source #

Instances
(TypeError ((Text dc :<>: Text " does not have a required field ") :<>: Text fld) :: Constraint) => Require dc fld False Source # 
Instance details

Defined in Data.Partial.Utils

Methods

unOpt :: p dc -> p fld -> Opt False x -> x Source #

Require dc fld True Source # 
Instance details

Defined in Data.Partial.Utils

Methods

unOpt :: p dc -> p fld -> Opt True x -> x Source #