def export_to_haskell(model, module_name="Model", indent=4, function_name="score"): """ Generates a Haskell code representation of the given model. Parameters ---------- model : object The model object that should be transpiled into code. module_name : string, optional The name of the generated module. indent : int, optional The size of indents in the generated code. function_name : string, optional Name of the function in the generated code. Returns ------- code : string """ interpreter = interpreters.HaskellInterpreter( module_name=module_name, indent=indent, function_name=function_name, ) return _export(model, interpreter)
def __init__(self, model): self.model = model self.interpreter = interpreters.HaskellInterpreter() assembler_cls = assemblers.get_assembler_cls(model) self.model_ast = assembler_cls(model).assemble() self.exec_path = None