{-# LANGUAGE Safe #-}
{-# LANGUAGE TypeFamilies #-}
module Copilot.Language.Operators.Array
( (.!!)
) where
import Copilot.Core ( Typed
, Op2 (Index)
, typeOf
, Array
)
import Copilot.Language.Stream (Stream (..))
import Data.Word (Word32)
import GHC.TypeLits (KnownNat)
(.!!) :: ( KnownNat n
, Typed t
) => Stream (Array n t) -> Stream Word32 -> Stream t
Stream (Array n t)
arr .!! :: forall (n :: Nat) t.
(KnownNat n, Typed t) =>
Stream (Array n t) -> Stream Word32 -> Stream t
.!! Stream Word32
n = Op2 (Array n t) Word32 t
-> Stream (Array n t) -> Stream Word32 -> Stream t
forall a1 b a.
(Typed a1, Typed b, Typed a) =>
Op2 a1 b a -> Stream a1 -> Stream b -> Stream a
Op2 (Type (Array n t) -> Op2 (Array n t) Word32 t
forall (n :: Nat) c. Type (Array n c) -> Op2 (Array n c) Word32 c
Index Type (Array n t)
forall a. Typed a => Type a
typeOf) Stream (Array n t)
arr Stream Word32
n