Safe Haskell | None |
---|
- data Function
- functionType :: Type
- new :: Code -> Dictionary -> IO Function
- getCode :: Function -> IO Code
- getGlobals :: Function -> IO Dictionary
- getModule :: Function -> IO SomeObject
- getDefaults :: Function -> IO (Maybe Tuple)
- setDefaults :: Function -> Maybe Tuple -> IO ()
- getClosure :: Function -> IO (Maybe Tuple)
- setClosure :: Function -> Maybe Tuple -> IO ()
- getAnnotations :: Function -> IO (Maybe Dictionary)
- setAnnotations :: Function -> Maybe Dictionary -> IO ()
Documentation
new :: Code -> Dictionary -> IO FunctionSource
Return a new function associated with the given code object. The second parameter will be used as the globals accessible to the function.
The function's docstring, name, and __module__
are retrieved from the
code object. The parameter defaults and closure are set to Nothing
.
getGlobals :: Function -> IO DictionarySource
Return the globals dictionary associated with a function.
getModule :: Function -> IO SomeObjectSource
Return the __module__
attribute of a function. This is normally
a Unicode
containing the module name, but can be set to any other
object by Python code.
getDefaults :: Function -> IO (Maybe Tuple)Source
Return the default parameter values for a function. This can be a tuple
or Nothing
.
getClosure :: Function -> IO (Maybe Tuple)Source
Return the closure associated with a function. This can be Nothing
,
or a tuple of Cell
s.
setClosure :: Function -> Maybe Tuple -> IO ()Source
Set the closure associated with a function. The tuple should contain
Cell
s.
getAnnotations :: Function -> IO (Maybe Dictionary)Source
Return the annotations for a function. This can be a mutable dictionary,
or Nothing
.
setAnnotations :: Function -> Maybe Dictionary -> IO ()Source
Set the annotations for a function object.