plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Data.Row.Extras

Description

Instances for Rec and Var types

Synopsis

Documentation

newtype JsonRec s Source #

Constructors

JsonRec 

Fields

Instances

Instances details
(AllUniqueLabels s, Forall s FromJSON) => FromJSON (JsonRec s) Source # 
Instance details

Defined in Data.Row.Extras

Methods

parseJSON :: Value -> Parser (JsonRec s)

parseJSONList :: Value -> Parser [JsonRec s]

Forall s ToJSON => ToJSON (JsonRec s) Source # 
Instance details

Defined in Data.Row.Extras

Methods

toJSON :: JsonRec s -> Value

toEncoding :: JsonRec s -> Encoding

toJSONList :: [JsonRec s] -> Value

toEncodingList :: [JsonRec s] -> Encoding

newtype JsonVar s Source #

Constructors

JsonVar 

Fields

Instances

Instances details
(AllUniqueLabels s, Forall s FromJSON) => FromJSON (JsonVar s) Source # 
Instance details

Defined in Data.Row.Extras

Methods

parseJSON :: Value -> Parser (JsonVar s)

parseJSONList :: Value -> Parser [JsonVar s]

Forall s ToJSON => ToJSON (JsonVar s) Source # 
Instance details

Defined in Data.Row.Extras

Methods

toJSON :: JsonVar s -> Value

toEncoding :: JsonVar s -> Encoding

toJSONList :: [JsonVar s] -> Value

toEncodingList :: [JsonVar s] -> Encoding

namedBranchFromJSON :: forall s. (AllUniqueLabels s, Forall s FromJSON) => String -> Value -> Parser (Var s) Source #

Parse a 'Var s' from JSON if the label of the branch is known.

type family (l :: Row k) .\\ (r :: Row k) :: Row k where ... infixl 6 Source #

Fast diff. The implementation in row-types is exponential in time and memory in the number of overlapping rows, due to limitations in ghc's handling of type families. This version is much faster.

Type level Row difference. That is, l .\\ r is the row remaining after removing any matching elements of r from l.

Equations

('R l) .\\ ('R r) = 'R (Diff l r)