Search results
An Array: a data structure supporting efficient random access. In the JavaScript backend, values of this type are represented as JavaScript Arrays at runtime.
Construct values using literals:
x = [1,2,3,4,5] :: Array Int
array :: forall a. JsonCodec a -> JsonCodec (Array a)
A codec for arbitrary length Array
s where every item in the array
shares the same type.
import Data.Codec.Argonaut as CA
codecIntArray ∷ CA.JsonCodec (Array Int)
codecIntArray = CA.array CA.int
array :: forall a. Codec a -> Codec (Array a)
A codec for arbitrary length Array
s where every item in the array
shares the same type.
import Data.Codec.JSON as CJ
codecIntArray ∷ CJ.Codec (Array Int)
codecIntArray = CJ.array CJ.int
array :: forall t. Corecursive t EJsonF => Array t -> t
Array :: forall a. (Array a) -> EJsonF a
Array :: EJsonType
array :: forall a. Arbitrary a -> Arbitrary (Array a)
array :: forall a. DecodeJson a -> DecodeJson (Array a)
array :: forall a. EncodeJson a -> EncodeJson (Array a)
array :: forall r. Monoid r => Fold' r Foreign (Array Foreign)
A Fold
which reads an Array
.
array :: forall opt html fm fs msg sta a. OptArgs (CfgArray a) opt => IDHtml html => opt -> DataUI (IDSurface html) fm fs msg sta a -> DataUI (IDSurface html) fm fs (ArrayMsg (fm msg)) (ArrayState (fs sta)) (Array a)
Array :: Schema -> Schema
array :: forall props u a. { addLabel :: String, defaultValue :: u, editor :: FormBuilder { readonly :: Boolean | props } u a, label :: String } -> FormBuilder { readonly :: Boolean | props } (Array u) (Array a)
Edit an Array
of values.
This FormBuilder
displays a removable section for each array element,
along with an "Add..." button in the final row.
array :: forall m b a. Index a => Monad m => String -> ParserT (Array Foreign) m b -> ParserT Foreign m b
Array :: RowMode
array :: forall m. Monad m => FieldValueDual m (Array String)
array :: forall e m. Monad m => Validator m e (Array Json)
array :: forall m. Monad m => FieldValueValidator m (Array String)
Array :: AttributeType
array :: forall i context channel. String -> SDOM (ArrayChannel i channel) (ArrayContext context) i i -> SDOM channel context (Array i) (Array i)
Create a component which renders an array of subcomponents.
The first argument is the name of the HTML element used as the container.
The second argument is a template component for rendered subcomponents.
Note:
- The context of the template component provides access to the index of the current subcomponent.
- The event channel for the template component provides the ability to modify the input array itself.
- This component is optimized for edits at the end of the array. Small arrays should not present any issues, but large arrays might if edits typically take place away from the end of the array.
array :: forall f t. Corecursive t (SqlF EJsonF) => Foldable f => f t -> t
array :: forall r mode idx val. Expr r idx => Expr r val => Z3 r mode (Z3Array r idx val)
Create an array Z3 variable (not to be confused with an array of Z3 variables)
array_ :: forall html fm fs msg sta a. IDHtml html => DataUI (IDSurface html) fm fs msg sta a -> DataUI (IDSurface html) fm fs (ArrayMsg (fm msg)) (ArrayState (fs sta)) (Array a)
Array_ :: Array_ -> MathboxPrimitive
arrayOf :: forall a. Gen a -> Gen (Array a)
Create a random generator which generates an array of random values.
arrayOf :: forall m a. MonadRec m => GenT m a -> GenT m (Array a)
Create a random generator which generates an array of random values.
Stack-safety is guaranteed via the MonadRec
constraint
arrayOf :: forall a. Gen a -> Gen (Array a)
Generates an array of random length. The maximum length depends on the size parameter.
arrayOf :: forall o e m. Monad m => JsonDual m e o -> JsonDual m e (Array o)
arrayOf :: forall a e m. Monad m => Validator m e a -> Validator m e (Array a)
arrayOf1 :: forall a. Gen a -> Gen (NonEmptyArray a)
Create a random generator which generates a non-empty array of random values.
ArrayAgg :: forall input rest fields output. input -> Aggregate input rest fields output
arrayOf' :: forall m a. Monad m => GenT m a -> GenT m (Array a)
Create a random generator which generates an array of random values. This is only stack-safe if the underlying monad is stack-safe.
arrayOf1 :: forall m a. MonadRec m => GenT m a -> GenT m (NonEmptyArray a)
Create a random generator which generates a non-empty array of random values.
Stack-safety is guaranteed via the MonadRec
constraint
arrayOf1 :: forall a. Gen a -> Gen (NonEmpty Array a)
Generates a non-empty array of random length. The maximum length depends on the size parameter.
arrayOfN :: forall a. Int -> Gen a -> Gen (Array a)
Generates an array of the given length.
ArrayPop :: forall value. ArrayUpdate value
The unifying representation for the different typed arrays
ArrayView :: (forall r. (forall a. ArrayView a -> r) -> r) -> RequestBody
arrayView :: forall a. ArrayView a -> RequestBody
array_agg :: forall f t fields. ToArrayAgg f fields t => f -> Aggregate f E fields (Maybe (Array t))
ArrayMove :: forall value. Int -> Int -> ArrayUpdate value
arrayOf1' :: forall m a. Monad m => GenT m a -> GenT m (NonEmptyArray a)
Create a random generator which generates a non-empty array of random values. This is only stack-safe if the underlying monad is stack-safe.
arrayOfN' :: forall a. Int -> Int -> Gen a -> Gen (Array a)
Generates an array between 'n' and 'm' in length.
ArrayPush :: forall value. value -> ArrayUpdate value
arrayType :: PSType -> PSType
arrayType :: PSType -> PSType
ArrayType :: { elementType :: String, nesting :: Int } -> Type
array_ToJs :: Array_ -> JsArray_
ArrayEmpty :: forall value. ArrayUpdate value
arrayModal :: forall props componentProps a. Union componentProps (onChange :: a -> Effect Unit, value :: a) (onChange :: a -> Effect Unit, value :: a | componentProps) => Nub (onChange :: a -> Effect Unit, value :: a | componentProps) (onChange :: a -> Effect Unit, value :: a | componentProps) => { addLabel :: String, component :: { onChange :: a -> Effect Unit, value :: a | componentProps } -> JSX, componentProps :: Record componentProps, defaultValue :: a, label :: String, summary :: { readonly :: Boolean | props } -> a -> JSX } -> FormBuilder { readonly :: Boolean | props } (Array a) (Array a)
Edit an Array
of values.
Unlike array
, this FormBuilder
uses a modal popup for adding and
editing array elements.
Note
: arrayModal
does not support validation, in the sense that the
component inside the modal popup cannot reject its form state when the
use clicks the save button.
ArrayQuery :: (Array String) -> Query
ArrayShift :: forall value. ArrayUpdate value
Represents a JS ArrayBuffer object
ArrayBuffer :: forall a. (forall f. f ArrayBuffer -> f a) -> ResponseFormat a
arrayBuffer :: ResponseFormat ArrayBuffer
arrayBuffer :: ResponseType ArrayBuffer
arrayBuffer :: Response -> Aff ArrayBuffer
arrayParser :: forall a. ArrayParser a => Array HexString -> Maybe a
arrayBuffer :: Response -> Effect (Promise ArrayBuffer)
arrayBuffer :: Response -> Effect (JSPromise ArrayBuffer)
arrayBuffer :: MIME -> ArrayBuffer -> Body
arrayBuffer :: forall m. MonadAff m => Response -> m ArrayBuffer
arrayBuffer :: Response -> Aff ArrayBuffer
arrayBuffer :: Response -> Effect (Promise ArrayBuffer)
arrayBuffer :: Response -> Effect (Promise ArrayBuffer)
ArrayBuffer :: BinaryType
ArrayBuffer :: BinaryType
arrayBuffer :: Response -> Aff ArrayBuffer
ArrayHeader :: (Array String) -> Header
arrayOfLeft :: forall b a. Either a b -> Array a
This typeclass allows to convert any function that operates on Array
to a
function that operates on ArrayView
and vice versa. use
only inserts
fromArray
and toArray
in the right places, so don't expect it to
increase performance.
Note: either type annotation or partial application of some number of arguments is needed, because otherwise the type inference will not be able to guess the correct type.
import Data.Array as A
-- OK
zipWith :: forall a b c. (a -> b -> c) -> ArrayView a -> ArrayView b -> ArrayView c
zipWith = use (A.zipWith :: (a -> b -> c) -> Array a -> Array b -> Array c)
-- OK
zipWith :: forall a b c. (a -> b -> c) -> ArrayView a -> ArrayView b -> ArrayView c
zipWith f = use (A.zipWith f) -- all three type parameters are tied to `f`
-- Type error
zipWith :: forall a b c. (a -> b -> c) -> ArrayView a -> ArrayView b -> ArrayView c
zipWith = use A.zipWith
An algebra for array updates. We use this to describe the ways in which we would like to update the DOM.
An immutable Zipper for an Array.
This Zipper works well in read-heavy code but might not work well in write-heavy code
Modifications to the focused element are O(n)
due to creating
a new immutable array with the change rather than mutating the
underlying array.
Navigating to a new focus element is O(1)
regardless of how far
away from the current focus that element is. This
is in contrast to a List
-based zipper where modifications
are O(1)
and navigation is O(n)
.
[0, 1, 2, 3, 4, 5] <-- underlying array
^ ^
| -- maxIndex
-- focusIndex
Array search functions.
ARRAY_BUFFER :: BufferTarget
The event channel for an array
component.
An event is either passed to the next Parent
in the chain, or handled
Here
, by acting on the array itself.
The context of subcomponent in an array
component includes the current
context inherited from the parent, as well as the index of the current
subcomponent.
ArrayLiteral :: forall a. (Array a) -> Literal a
arrayOfMaybe :: forall a. Maybe a -> Array a
arrayOfRight :: forall b a. Either a b -> Array b
ArrayUnshift :: forall value. value -> ArrayUpdate value
ArrayDeleteAt :: forall value. Int -> ArrayUpdate value
ArrayInsertAt :: forall value. Int -> value -> ArrayUpdate value
arrayFromDigits :: Digits -> Array Char
Unwrap Array
of Char
s from Digits
container
array_aggFunctionName :: String
array_subscript_error :: String
ArrayNumberOrImageImage :: Image -> ArrayNumberOrImage
ArrayNumberOrVectorVector :: Vector -> ArrayNumberOrVector
ArrayNumberOrImageArrayNumber :: (Array Number) -> ArrayNumberOrImage
ArrayNumberOrVectorArrayNumber :: (Array Number) -> ArrayNumberOrVector
ArrayNumberOrStringOrColorColor :: Color -> ArrayNumberOrStringOrColor
ArrayNumberOrStringOrColorString :: String -> ArrayNumberOrStringOrColor
ArrayNumberOrStringOrColorArrayNumber :: (Array Number) -> ArrayNumberOrStringOrColor
No further results.