Skip to content

Show on a -> b #2

Description

@MarcWeber

Thanks to people @ #ocaml chatroom I was able to find this implementation to make deriving derive show for datatypes containing functions:

method function_ ctxt f = <:module_expr< Defaults (struct 
      type $Ast.TyDcl (loc, "a", [], atype_expr ctxt (`Function f), [])$
      let format formatter _ = Format.pp_print_string formatter "<func>"
  end) >>

However I failed at this pmap.ml:
https://github.com/HaxeFoundation/ocamllibs/blob/master/extlib/pMap.ml#L21

The preprocessor failed, and I was not able to come up with a manual instance yet (will try to ask on the chatroom tomorrow again).

I guess this would require adding new Show2 Show3 modules taking show instances for the type parameters k' v' ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions