Safe Haskell | None |
---|---|
Language | Haskell2010 |
A monadic library to build dataflow graphs for OM.
This module just exports a set of chosen symbols
from Internal
.
- type Builder vector gauge anot val = State (BuilderState vector gauge anot) val
- data BuilderState vector gauge anot = BuilderState {}
- type BuilderOf r c = forall v g a. Builder v g a (Value r c)
- buildKernel :: Setup v g a -> Name -> Builder v g a () -> Kernel v g a
- bind :: (Monad m, Functor m) => m a -> m (m a)
- load :: (TRealm r, Typeable c) => Named (StaticValue r c) -> B (Value r c)
- store :: (TRealm r, Typeable c) => Named (StaticValue r c) -> Builder v g a (Value r c) -> Builder v g a ()
- reduce :: Typeable c => Operator -> Builder v g a (Value TArray c) -> Builder v g a (Value TScalar c)
- broadcast :: Typeable c => Builder v g a (Value TScalar c) -> Builder v g a (Value TArray c)
- loadIndex :: Typeable g => Axis v -> Builder v g a (Value TArray g)
- loadSize :: Typeable g => Axis v -> Builder v g a (Value TScalar g)
- shift :: Typeable c => v g -> Builder v g a (Value TArray c) -> Builder v g a (Value TArray c)
- imm :: (TRealm r, Typeable c) => c -> B (Value r c)
- cast :: (TRealm r, Typeable c1, Typeable c2) => Builder v g a (Value r c1) -> Builder v g a (Value r c2)
- castTo :: (TRealm r, Typeable c1, Typeable c2) => c2 -> Builder v g a (Value r c1) -> Builder v g a (Value r c2)
- annotate :: (TRealm r, Typeable c) => (a -> a) -> Builder v g a (Value r c) -> Builder v g a (Value r c)
- (<?>) :: (TRealm r, Typeable c) => (a -> a) -> Builder v g a (Value r c) -> Builder v g a (Value r c)
- withAnnotation :: (a -> a) -> Builder v g a ret -> Builder v g a ret
Documentation
type Builder vector gauge anot val = State (BuilderState vector gauge anot) val Source
data BuilderState vector gauge anot Source
(Show anot, Show (vector gauge)) => Show (BuilderState vector gauge anot) | |
Eq (Builder v g a ret) | |
(TRealm r, Typeable * c, C c, Fractional c) => Fractional (Builder v g a (Value r c)) | you can convert GHC floating point immediates to |
(TRealm r, Typeable * c, C c) => Num (Builder v g a (Value r c)) | you can convert GHC numeric immediates to |
Show (Builder v g a ret) | |
(TRealm r, Typeable * c) => C (Builder v g a (Value r c)) | choose the larger or the smaller of the two. |
(TRealm r, Typeable * c, C c) => C (Builder v g a (Value r c)) | |
(TRealm r, Typeable * c, C c) => C (Builder v g a (Value r c)) | |
(TRealm r, Typeable * c, C c) => C (Builder v g a (Value r c)) | |
(TRealm r, Typeable * c, C c) => C (Builder v g a (Value r c)) | |
(TRealm r, Typeable * c, C c) => C (Builder v g a (Value r c)) | Builder is Ring |
(TRealm r, Typeable * c, C c) => C (Builder v g a (Value r c)) | |
(TRealm r, Typeable * c) => C (Builder v g a (Value r c)) | |
(TRealm r, Typeable * c, C c) => C (Builder v g a (Value r c)) | |
TRealm r => Boolean (Builder v g a (Value r Bool)) |
bind :: (Monad m, Functor m) => m a -> m (m a) Source
run the given builder monad, get the result graph node,
and wrap it in a return
monad for later use.
it is like binding a value to a monad-level identifier.
:: (TRealm r, Typeable c) | |
=> Named (StaticValue r c) | the named static value to be loaded from. |
-> B (Value r c) | The loaded |
Load from a static value.
:: (TRealm r, Typeable c) | |
=> Named (StaticValue r c) | the named static value to be stored on. |
-> Builder v g a (Value r c) | The |
-> Builder v g a () | The result. |
Store to a static value.
cast :: (TRealm r, Typeable c1, Typeable c2) => Builder v g a (Value r c1) -> Builder v g a (Value r c2) Source
Perform the cast that keeps the realm while
change the content type from c1
to c2
.
castTo :: (TRealm r, Typeable c1, Typeable c2) => c2 -> Builder v g a (Value r c1) -> Builder v g a (Value r c2) Source
take a phantom object c2
, and perform the cast that keeps the realm while
change the content type from c1
to c2
.
annotate :: (TRealm r, Typeable c) => (a -> a) -> Builder v g a (Value r c) -> Builder v g a (Value r c) Source
Execute the builder, and annotate the very result with the givin function.
(<?>) :: (TRealm r, Typeable c) => (a -> a) -> Builder v g a (Value r c) -> Builder v g a (Value r c) infixr 0 Source
(?) = annotate
withAnnotation :: (a -> a) -> Builder v g a ret -> Builder v g a ret Source
Execute the builder under modifed annotation.