Module

Record.ExtraSrghma

Package
purescript-record-extra-srghma
Repository
srghma/purescript-record-extra-srghma

Re-exports from Record.ExtraSrghma.AppendRecord

#AppendSubrecordImpl Source

class AppendSubrecordImpl :: forall k. k -> Row Type -> Row Type -> Constraintclass AppendSubrecordImpl rl bigger smaller  where

Members

Instances

#appendRecord Source

appendRecord :: forall rl bigger smaller. RowToList smaller rl => AppendSubrecordImpl rl bigger smaller => Record bigger -> Record smaller -> Record bigger

Re-exports from Record.ExtraSrghma.CompareRecord

#OrdRecord Source

class OrdRecord :: forall k. k -> Row Type -> Constraintclass OrdRecord rl row | rl -> row where

Type class to compare two records field by field, following a known ordering of keys (a RowList).

Members

Instances

  • (IsSymbol name, Ord ty, Cons name ty trash row, OrdRecord tail row) => OrdRecord (Cons name ty tail) row

    Compare two records by the current head field, and recurse on the tail if equal.

  • OrdRecord Nil row

    Base case: comparing empty RowList always returns EQ.

#compareRecord Source

compareRecord :: forall row rl. RowToList row rl => OrdRecord rl row => Record row -> Record row -> Ordering

Public interface for comparing two records deterministically by their keys. You must provide a type with an instance of RL.RowToList to determine key ordering.

Re-exports from Record.ExtraSrghma.FoldlValues

#FoldlValues Source

class FoldlValues :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldlValues (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#FoldlValues1 Source

class FoldlValues1 :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldlValues1 (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#foldlValues1 Source

foldlValues1 :: forall row fieldType rowList. RowToList row rowList => FoldlValues1 rowList row fieldType => (fieldType -> fieldType -> fieldType) -> Record row -> fieldType

#foldlValues Source

foldlValues :: forall accum row fieldType rowList. RowToList row rowList => FoldlValues rowList row fieldType => (accum -> fieldType -> accum) -> accum -> Record row -> accum

#foldMapValuesL1 Source

foldMapValuesL1 :: forall m row rowList fieldType row' rowList'. RowToList row rowList => RowToList row' rowList' => FoldlValues1 rowList' row' m => MapRecord rowList row fieldType m () row' => Semigroup m => (fieldType -> m) -> Record row -> m

#foldMapValuesL Source

foldMapValuesL :: forall accum row fieldType rowList. RowToList row rowList => FoldlValues rowList row fieldType => Monoid accum => (fieldType -> accum) -> Record row -> accum

Re-exports from Record.ExtraSrghma.FoldlValuesWithIndex

#FoldlValuesWithIndex Source

class FoldlValuesWithIndex :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldlValuesWithIndex (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#FoldlValuesWithIndex1 Source

class FoldlValuesWithIndex1 :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldlValuesWithIndex1 (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#foldlValuesWithIndex1 Source

foldlValuesWithIndex1 :: forall row fieldType rowList. RowToList row rowList => FoldlValuesWithIndex1 rowList row fieldType => (fieldType -> String -> fieldType -> fieldType) -> Record row -> fieldType

#foldlValuesWithIndex Source

foldlValuesWithIndex :: forall accum row fieldType rowList. RowToList row rowList => FoldlValuesWithIndex rowList row fieldType => (accum -> String -> fieldType -> accum) -> accum -> Record row -> accum

#foldMapValuesWithIndexL1 Source

foldMapValuesWithIndexL1 :: forall fieldType row rowList row' rowList' m. RowToList row rowList => RowToList row' rowList' => FoldlValuesWithIndex1 rowList' row' m => MapValuesWithIndex rowList row fieldType m () row' => Monoid m => (String -> fieldType -> m) -> Record row -> m

#foldMapValuesWithIndexL Source

foldMapValuesWithIndexL :: forall accum row fieldType rowList. RowToList row rowList => FoldlValuesWithIndex rowList row fieldType => Monoid accum => (String -> fieldType -> accum) -> Record row -> accum

Re-exports from Record.ExtraSrghma.FoldrValues

#FoldrValues Source

class FoldrValues :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldrValues (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#FoldrValues1 Source

class FoldrValues1 :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldrValues1 (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#foldrValues1 Source

foldrValues1 :: forall row fieldType rowList. RowToList row rowList => FoldrValues1 rowList row fieldType => (fieldType -> fieldType -> fieldType) -> Record row -> fieldType

Fold over the values of a record, applying the function to each field, but no initial accumulator.

#foldrValues Source

foldrValues :: forall accum row fieldType rowList. RowToList row rowList => FoldrValues rowList row fieldType => (fieldType -> accum -> accum) -> accum -> Record row -> accum

#foldMapValuesR1 Source

foldMapValuesR1 :: forall m row rowList fieldType row' rowList'. RowToList row rowList => RowToList row' rowList' => FoldrValues1 rowList' row' m => MapRecord rowList row fieldType m () row' => Semigroup m => (fieldType -> m) -> Record row -> m

#foldMapValuesR Source

foldMapValuesR :: forall accum row fieldType rowList. RowToList row rowList => FoldrValues rowList row fieldType => Monoid accum => (fieldType -> accum) -> Record row -> accum

Re-exports from Record.ExtraSrghma.FoldrValuesLazy

#FoldrValuesLazy Source

class FoldrValuesLazy :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rl fieldType) <= FoldrValuesLazy rl row fieldType | row -> fieldType where

Members

Instances

#FoldrValuesLazy1 Source

class FoldrValuesLazy1 :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldrValuesLazy1 (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#foldrValuesLazy1 Source

foldrValuesLazy1 :: forall row fieldType rowList. RowToList row rowList => Lazy fieldType => FoldrValuesLazy1 rowList row fieldType => (fieldType -> fieldType -> fieldType) -> Record row -> fieldType

Fold over the values of a record, applying the function to each field, but no initial accumulator.

#foldrValuesLazy Source

foldrValuesLazy :: forall accum row fieldType rowList. Lazy accum => RowToList row rowList => FoldrValuesLazy rowList row fieldType => (fieldType -> accum -> accum) -> accum -> Record row -> accum

#foldMapValuesLazyR1 Source

foldMapValuesLazyR1 :: forall m row rowList fieldType row' rowList'. RowToList row rowList => RowToList row' rowList' => Lazy m => FoldrValuesLazy1 rowList' row' m => MapRecord rowList row fieldType m () row' => Semigroup m => (fieldType -> m) -> Record row -> m

#foldMapValuesLazyR Source

foldMapValuesLazyR :: forall accum row fieldType rowList. Lazy accum => RowToList row rowList => FoldrValuesLazy rowList row fieldType => Monoid accum => (fieldType -> accum) -> Record row -> accum

Re-exports from Record.ExtraSrghma.FoldrValuesWithIndex

#FoldrValuesWithIndex Source

class FoldrValuesWithIndex :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldrValuesWithIndex (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#FoldrValuesWithIndex1 Source

class FoldrValuesWithIndex1 :: RowList Type -> Row Type -> Type -> Constraintclass (Homogeneous row fieldType, HomogeneousRowList rowList fieldType) <= FoldrValuesWithIndex1 (rowList :: RowList Type) (row :: Row Type) fieldType | rowList -> row fieldType where

Members

Instances

#foldrValuesWithIndex1 Source

foldrValuesWithIndex1 :: forall row fieldType rowList. RowToList row rowList => FoldrValuesWithIndex1 rowList row fieldType => (String -> fieldType -> fieldType -> fieldType) -> Record row -> fieldType

#foldrValuesWithIndex Source

foldrValuesWithIndex :: forall accum row fieldType rowList. RowToList row rowList => FoldrValuesWithIndex rowList row fieldType => (String -> fieldType -> accum -> accum) -> accum -> Record row -> accum

#foldMapValuesWithIndexR1 Source

foldMapValuesWithIndexR1 :: forall fieldType row rowList row' rowList' m. RowToList row rowList => RowToList row' rowList' => FoldrValuesWithIndex1 rowList' row' m => MapValuesWithIndex rowList row fieldType m () row' => Monoid m => (String -> fieldType -> m) -> Record row -> m

#foldMapValuesWithIndexR Source

foldMapValuesWithIndexR :: forall accum row fieldType rowList. RowToList row rowList => FoldrValuesWithIndex rowList row fieldType => Monoid accum => (String -> fieldType -> accum) -> Record row -> accum

Re-exports from Record.ExtraSrghma.Keys.Array

#RLToAK Source

class RLToAK :: RowList Type -> Constraintclass RLToAK (rowList :: RowList Type)  where

Members

Instances

#RLToANEK Source

class RLToANEK :: RowList Type -> Constraintclass RLToANEK (rowList :: RowList Type)  where

Members

Instances

#RecordToAK Source

class RecordToAK :: forall k. k -> Constraintclass RecordToAK a  where

Members

Instances

#RecordToANEK Source

class RecordToANEK :: forall k. k -> Constraintclass RecordToANEK a  where

Members

Instances

#rowToANEK Source

rowToANEK :: forall @row rowList. RowToList row rowList => RLToANEK rowList => Array NonEmptyString

#rowToAK Source

rowToAK :: forall @row rowList. RowToList row rowList => RLToAK rowList => Array String

Re-exports from Record.ExtraSrghma.Keys.List

#RLToLK Source

class RLToLK :: RowList Type -> Constraintclass RLToLK (rowList :: RowList Type)  where

Members

Instances

#RLToLNEK Source

class RLToLNEK :: RowList Type -> Constraintclass RLToLNEK (rowList :: RowList Type)  where

Members

Instances

#RecordToLK Source

class RecordToLK :: forall k. k -> Constraintclass RecordToLK a  where

Members

Instances

#RecordToLNEK Source

class RecordToLNEK :: forall k. k -> Constraintclass RecordToLNEK a  where

Members

Instances

#rowToLNEK Source

rowToLNEK :: forall @row rowList. RowToList row rowList => RLToLNEK rowList => List NonEmptyString

#rowToLK Source

rowToLK :: forall @row rowList. RowToList row rowList => RLToLK rowList => List String

Re-exports from Record.ExtraSrghma.Keys.NonEmptyArray

#RLToNEAK Source

class RLToNEAK :: RowList Type -> Constraintclass RLToNEAK (rowList :: RowList Type)  where

Members

Instances

#RLToNEANEK Source

class RLToNEANEK :: RowList Type -> Constraintclass RLToNEANEK (rowList :: RowList Type)  where

Members

Instances

#RecordToNEAK Source

class RecordToNEAK :: forall k. k -> Constraintclass RecordToNEAK a  where

Members

Instances

#RecordToNEANEK Source

class RecordToNEANEK :: forall k. k -> Constraintclass RecordToNEANEK a  where

Members

Instances

#rowToNEANEK Source

rowToNEANEK :: forall @row rowList. RowToList row rowList => RLToNEANEK rowList => NonEmptyArray NonEmptyString

#rowToNEAK Source

rowToNEAK :: forall @row rowList. RowToList row rowList => RLToNEAK rowList => NonEmptyArray String

Re-exports from Record.ExtraSrghma.Keys.NonEmptyList

#RLToNELK Source

class RLToNELK :: RowList Type -> Constraintclass RLToNELK (rowList :: RowList Type)  where

Members

Instances

#RLToNELNEK Source

class RLToNELNEK :: RowList Type -> Constraintclass RLToNELNEK (rowList :: RowList Type)  where

Members

Instances

#RecordToNELK Source

class RecordToNELK :: forall k. k -> Constraintclass RecordToNELK a  where

Members

Instances

#RecordToNELNEK Source

class RecordToNELNEK :: forall k. k -> Constraintclass RecordToNELNEK a  where

Members

Instances

#rowToNELNEK Source

rowToNELNEK :: forall @row rowList. RowToList row rowList => RLToNELNEK rowList => NonEmpty List NonEmptyString

#rowToNELK Source

rowToNELK :: forall @row rowList. RowToList row rowList => RLToNELK rowList => NonEmpty List String

Re-exports from Record.ExtraSrghma.Keys.Pick

#pickFn Source

pickFn :: forall r1 r2. Fn2 (Array String) (Record r1) (Record r2)

#pick Source

pick :: forall rowA r @rowB rowListB. Union rowB r rowA => RowToList rowB rowListB => RLToAK rowListB => Record rowA -> Record rowB

Re-exports from Record.ExtraSrghma.MapIndex

#MapIndex Source

class MapIndex :: forall k. RowList Type -> Row Type -> k -> Type -> Row Type -> Row Type -> Constraintclass MapIndex (rowList :: RowList Type) (row :: Row Type) a b (from :: Row Type) (to :: Row Type) | rowList -> row a b from to where

Members

Instances

#mapIndex Source

mapIndex :: forall row rowList a b row'. RowToList row rowList => MapIndex rowList row a b () row' => (String -> b) -> Proxy row -> Record row'

Re-exports from Record.ExtraSrghma.MapRecord

#MapRecord Source

class MapRecord :: RowList Type -> Row Type -> Type -> Type -> Row Type -> Row Type -> Constraintclass MapRecord (rowList :: RowList Type) (row :: Row Type) a b (from :: Row Type) (to :: Row Type) | rowList -> row a b from to where

Members

Instances

#mapRecord Source

mapRecord :: forall row rowList a b row'. RowToList row rowList => MapRecord rowList row a b () row' => (a -> b) -> Record row -> Record row'

Re-exports from Record.ExtraSrghma.MapValuesWithIndex

#MapValuesWithIndex Source

class MapValuesWithIndex :: RowList Type -> Row Type -> Type -> Type -> Row Type -> Row Type -> Constraintclass MapValuesWithIndex (rowList :: RowList Type) (row :: Row Type) a b (from :: Row Type) (to :: Row Type) | rowList -> row a b from to where

Type class for transforming record values based on field names and values.

Members

Instances

#mapValuesWithIndex Source

mapValuesWithIndex :: forall row rowList a b row'. RowToList row rowList => MapValuesWithIndex rowList row a b () row' => (String -> a -> b) -> Record row -> Record row'

Like mapRecord from https://github.com/justinwoo/purescript-record-extra but mapRecordWithIndex The 'mapValuesWithIndex' function allows you to transform the values of a record, with access to the index (as the field name) and the value.

Example usage:

let record = { name: "Alice", age: 25 }
let result = mapValuesWithIndex (\name value -> name ++ ": " ++ show value) record
-- result will be: { name: "name: Alice", age: "age: 25" }

Re-exports from Record.ExtraSrghma.ParSequenceRecord

#ParSequenceRecord Source

class ParSequenceRecord :: forall k. k -> Row Type -> Row Type -> Row Type -> (Type -> Type) -> (Type -> Type) -> Constraintclass (Parallel parM m) <= ParSequenceRecord rowList inputRow accRow resultRow parM m | rowList -> inputRow accRow resultRow parM m where

Class for sequencing a record of monadic values in parallel

Members

Instances

#parSequenceRecord Source

parSequenceRecord :: forall inputRow outputRow rowList parM m. RowToList inputRow rowList => ParSequenceRecord rowList inputRow () outputRow parM m => Record inputRow -> m (Record outputRow)

Sequences a record of monadic values in parallel, returning a monadic record of values. For example, turns { a: Aff Int, b: Aff String } into Aff { a: Int, b: String } by running all the monadic values in parallel.

Re-exports from Record.ExtraSrghma.SList.Array

#SListToANES Source

class SListToANES :: SList -> Constraintclass SListToANES (slist :: SList)  where

Members

Instances

#SListToAS Source

class SListToAS :: SList -> Constraintclass SListToAS (slist :: SList)  where

Members

Instances

#SListToNEANES Source

class SListToNEANES :: SList -> Constraintclass SListToNEANES (slist :: SList)  where

Members

Instances

#SListToNEAS Source

class SListToNEAS :: SList -> Constraintclass SListToNEAS (slist :: SList)  where

Members

Instances

Re-exports from Record.ExtraSrghma.SList.List

#SListToLNES Source

class SListToLNES :: SList -> Constraintclass SListToLNES (slist :: SList)  where

Members

Instances

#SListToLS Source

class SListToLS :: SList -> Constraintclass SListToLS (slist :: SList)  where

Members

Instances

#SListToNELNES Source

class SListToNELNES :: SList -> Constraintclass SListToNELNES (slist :: SList)  where

Members

Instances

#SListToNELS Source

class SListToNELS :: SList -> Constraintclass SListToNELS (slist :: SList)  where

Members

Instances

Re-exports from Record.ExtraSrghma.SList.Types

#SNil Source

data SNil :: SListdata SNil

Instances

#SList Source

data SList

A phantom type-level linked list of field names (symbols), used to express a deterministic ordering.

#SCons Source

data SCons :: Symbol -> SList -> SListdata SCons t0 t1

Instances

#SListToRowList Source

class SListToRowList :: SList -> RowList Type -> Constraintclass SListToRowList (xs :: SList) (rl :: RowList Type) | xs -> rl, rl -> xs

Convert a type-level symbol list (SList) to a RowList (RL.RowList). Example use foo :: forall @slist rowList . SListToRowList slist rowList => ...do something with rowList

Instances

#type (:::) Source

Operator alias for Record.ExtraSrghma.SList.Types.SCons (right-associative / precedence 6)

Re-exports from Record.ExtraSrghma.SequenceRecord

#SequenceRecord Source

class SequenceRecord :: forall k. k -> Row Type -> Row Type -> Row Type -> (Type -> Type) -> Constraintclass (Functor m) <= SequenceRecord rowList row from to m | rowList -> row from to m where

Members

Instances

#sequenceRecord Source

sequenceRecord :: forall row row' rowList m. RowToList row rowList => SequenceRecord rowList row () row' m => Record row -> m (Record row')

Re-exports from Record.ExtraSrghma.TraverseRecord

#TraverseRecord Source

class TraverseRecord :: forall k. k -> Row Type -> Row Type -> Row Type -> Row Type -> (Type -> Type) -> Constraintclass (Functor m) <= TraverseRecord rowList rowF rowA from to m | rowList -> rowF rowA from to m where

Members

Instances

#traverseRecord Source

traverseRecord :: forall rowF rowA rowOut rowList m. RowToList rowF rowList => TraverseRecord rowList rowF rowA () rowOut m => Record rowF -> Record rowA -> m (Record rowOut)

Re-exports from Record.ExtraSrghma.ValuesToUnfoldableLazy

#LazyTupleList Source

newtype LazyTupleList a

A lazy unfoldable wrapper for converting record values into a sequential structure.

Constructors

Instances

#valuesToUnfoldableLazy Source

valuesToUnfoldableLazy :: forall row rowList container value. RowToList row rowList => FoldrValuesLazy rowList row value => Unfoldable container => Record row -> container value

Converts a record of values into any Unfoldable container, lazily.

Re-exports from Record.ExtraSrghma.ZipRecord

#ZipRecord Source

class ZipRecord :: RowList Type -> RowList Type -> Row Type -> Row Type -> Row Type -> Row Type -> Constraintclass ZipRecord (rowListL :: RowList Type) (rowListR :: RowList Type) (rowL :: Row Type) (rowR :: Row Type) (resultRowAcc :: Row Type) (resultRow :: Row Type) | rowListL -> rowL resultRowAcc resultRow, rowListR -> rowR resultRowAcc resultRow where

Zips two records (with matching keys) into a single record of Tuple values.

Members

Instances

#zipRecord Source

zipRecord :: forall rowListL rowL rowListR rowR zippedRow. RowToList rowL rowListL => RowToList rowR rowListR => ZipRecord rowListL rowListR rowL rowR () zippedRow => Record rowL -> Record rowR -> Record zippedRow