copilot-language-4.0: A Haskell-embedded DSL for monitoring hard real-time distributed systems.
Safe HaskellSafe
LanguageHaskell2010

Copilot.Language.Operators.Array

Description

Combinators to deal with streams carrying arrays.

Synopsis

Documentation

(.!!) :: (KnownNat n, Typed t) => Stream (Array n t) -> Stream Word32 -> Stream t Source #

Deprecated: This function is deprecated in Copilot 4. Use (!).

Create a stream that carries an element of an array in another stream.

This function implements a projection of the element of an array at a given position, over time. For example, if s is a stream of type Stream (Array '5 Word8), then s .!! 3 has type Stream Word8 and contains the 3rd element (starting from zero) of the arrays in s at any point in time.

(!) :: (KnownNat n, Typed t) => Stream (Array n t) -> Stream Word32 -> Stream t Source #

Create a stream that carries an element of an array in another stream.

This function implements a projection of the element of an array at a given position, over time. For example, if s is a stream of type Stream (Array '5 Word8), then s ! 3 has type Stream Word8 and contains the 3rd element (starting from zero) of the arrays in s at any point in time.

(!!) :: Stream (Array n t) -> Stream Word32 -> Projection (Array n t) (Stream Word32) t Source #

Pair a stream with an element accessor, without applying it to obtain the value of the element.

This function is needed to refer to an element accessor when the goal is to update the element value, not just to read it.

(=:) :: Projectable d s t => Projection d s t -> Stream t -> Stream d infixl 8 Source #

Modify the value of a sub-element of a type in a stream of elements of that type.

(=$) :: Projectable d s t => Projection d s t -> (Stream t -> Stream t) -> Stream d infixl 8 Source #

Update the value of a sub-element of a type in a stream of elements of that type, by applying a function on streams.

Orphan instances

(KnownNat n, Typed t) => Projectable (Array n t) (Stream Word32) t Source #

Update a stream of arrays.

Instance details

Associated Types

data Projection (Array n t) (Stream Word32) t Source #

Methods

(=:) :: Projection (Array n t) (Stream Word32) t -> Stream t -> Stream (Array n t) Source #

(=$) :: Projection (Array n t) (Stream Word32) t -> (Stream t -> Stream t) -> Stream (Array n t) Source #