Function type checking

Is it possible to do type checking for functions similar to how mkOption does for modules?

1 Like

I didn’t think if the nix expression language supports type checking.
Statix may assist you there:

I’m curious about this. Could you post a snippet if you have a second?

Thanks for the info about Statix.

I am trying to emulate the mkIso and mkHost function in this person’s repo.

I like how mkOption allows for more explicit definitions of types and defaults.


I am afraid statix does not support type checking at the moment. I am not sure if it can support it in the near future either, I have looked at a couple of other attempts at doing the same, and it seems like the general consensus is that nix is not really easily “typeable”.

That doesn’t mean to say it is impossible though.