Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define curried data constructor via
Quark.Partial.defpartial
`defpartial/2` is called with `args_without_defaults` because `defpartial/2` is implemented using `defcurry/2` which would pass args with defaults to an anonymous function, but: ```elixir == Compilation error in file lib/algae/tree/rose.ex == ** (CompileError) lib/algae/tree/rose.ex:34: anonymous functions cannot have optional ar guments (stdlib) lists.erl:1354: :lists.mapfoldl/3 (elixir) src/elixir_fn.erl:19: :elixir_fn.expand/3 lib/algae/tree/rose.ex:34: (module) ``` On the other hand, it doesn't seem to be logical to have defaults when currying anyway: ```elixir defmodule Person do defdata do name :: string age :: integer end end Person.new_partial.("lofa") ``` I would expect the last expression to return a function instead of `%Person{name: "lofa", age: 0}`.
- Loading branch information