{-# LANGUAGE Safe #-}
module Copilot.Language.Operators.Struct
( (#)
) where
import Copilot.Core.Type
import Copilot.Core.Operators
import Copilot.Language.Stream (Stream (..))
import GHC.TypeLits (KnownSymbol)
(#) :: (KnownSymbol s, Typed t, Typed a, Struct a)
=> Stream a -> (a -> Field s t) -> Stream t
# :: forall (s :: Symbol) t a.
(KnownSymbol s, Typed t, Typed a, Struct a) =>
Stream a -> (a -> Field s t) -> Stream t
(#) Stream a
s a -> Field s t
f = forall a b. (Typed a, Typed b) => Op1 a b -> Stream a -> Stream b
Op1 (forall (s :: Symbol) a b.
KnownSymbol s =>
Type a -> Type b -> (a -> Field s b) -> Op1 a b
GetField forall a. Typed a => Type a
typeOf forall a. Typed a => Type a
typeOf a -> Field s t
f) Stream a
s