partial-records-0.1.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

type Opt b x = Tagged b (Tagged x (If b x ())) Source #

fillOpt :: x -> Opt True x Source #

joinOpt :: forall b1 b2 x. KnownBool b1 => Opt b1 x -> Opt b2 x -> Opt (b1 || b2) x Source #

fromOpt :: forall b x. KnownBool b => 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 #