Module
Foreign.Index
- Package
- purescript-foreign
- Repository
- purescript/purescript-foreign
This module defines a type class for types which act like property indices.
#Index Source
class Index :: Type -> (Type -> Type) -> Constraint
class Index i m | i -> m where
This type class identifies types that act like property indices.
The canonical instances are for String
s and Int
s.
Members
index :: Foreign -> i -> ExceptT (NonEmptyList ForeignError) m Foreign
hasProperty :: i -> Foreign -> Boolean
hasOwnProperty :: i -> Foreign -> Boolean
errorAt :: i -> ForeignError -> ForeignError
Instances
#Indexable Source
class Indexable :: Type -> (Type -> Type) -> Constraint
class Indexable a m | a -> m where
Members
ix :: forall i. Index i m => a -> i -> ExceptT (NonEmptyList ForeignError) m Foreign
Instances
(Monad m) => Indexable Foreign m
(Monad m) => Indexable (ExceptT (NonEmptyList ForeignError) m Foreign) m
#readProp Source
readProp :: forall m. Monad m => String -> Foreign -> ExceptT (NonEmptyList ForeignError) m Foreign
Attempt to read a value from a foreign value property
#readIndex Source
readIndex :: forall m. Monad m => Int -> Foreign -> ExceptT (NonEmptyList ForeignError) m Foreign
Attempt to read a value from a foreign value at the specified numeric index
- Modules
- Foreign
- Foreign.
Index - Foreign.
Keys