Safe Haskell | None |
---|---|
Language | Haskell2010 |
Convert Haskell values to STG values.
- class ToStg value where
Documentation
class ToStg value where Source #
Convert a Haskell value to an STG binding.
Instances of this class should have a corresponding FromStg
instance to
retrieve a value fom the program, with the two being inverse to each other
(up to forcing the generated thunks).
This class contains a helper function, toStgWithGlobals
, this is hidden
from the outside. If you want to write your own instance, have a look at the
source for documentation.
toStg :: Var -> value -> Program Source #
toStgWithGlobals :: Var -> value -> Writer Program Program Source #
ToStg Bool Source # |
|
ToStg Int Source # | Same as the |
ToStg Integer Source # |
|
ToStg () Source # |
|
ToStg a => ToStg [a] Source # |
|
ToStg a => ToStg (Maybe a) Source # |
|
(ToStg a, ToStg b) => ToStg (Either a b) Source # |
|
(ToStg a, ToStg b) => ToStg (a, b) Source # |
|
(ToStg a, ToStg b, ToStg c) => ToStg (a, b, c) Source # |
|
(ToStg a, ToStg b, ToStg c, ToStg d) => ToStg (a, b, c, d) Source # |
|
(ToStg a, ToStg b, ToStg c, ToStg d, ToStg e) => ToStg (a, b, c, d, e) Source # |
|