-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Nix through haskell #129
Comments
What do you think about moving more of the logic to Haskell directly in addition to this? For example |
One of the goals of snack is to allow the user to run |
Ah, I see! The build process should not even depend on |
FWIW there's an existing https://github.com/regnat/ptyx project that attempts to add a type system to Nix. |
Last time I talked to @regnat he mentioned it wasn't looking really good. However @jwiegley mentioned there's a rudimentary type system in https://github.com/haskell-nix/hnix, so that could work. |
Most of snack's flakiness comes from the fact that the logic is written in Nix - which is untyped and doesn't really have test frameworks.
An idea I played with a while ago was to wrap Nix with haskell types: https://github.com/nmattia/nix-reloaded
It provides a nice way to write Nix by lifting all expressions to typed haskell values, e.g.
https://github.com/nmattia/nix-reloaded/blob/82489bd9d58e21cc4611b2c00c757a859f5fe70a/Test.hs#L16-L21
an expression like
builtins.map
would be lifted to a haskell value of type(Var a -> Var b) -> Var [a] -> Var [b]
which can then be used and applied like any other haskell function.The text was updated successfully, but these errors were encountered: