Skip to content

Could this library use normal for comprehension syntax for generators instead of something custom? #28

@myronmarston

Description

@myronmarston

The current generator syntax--e.g. for_all x in int--requires that I learn a new syntax, but it sure looks similar to Elixir's existing for comprehension syntax. Is there any reason that can't be used instead?

For example, looking over the examples in the readme:

property :square do
  for_all x in int, do: x * x >= 0
end

Could be:

property :squre do
  for x <- int, do: x * x >= 0
end

For a more involved example involving a such_that like:

for_all {x, y} in such_that({xx, yy} in {int, int} when xx < yy) do
  x < y
end

Could perhaps be:

for x <- int, y <- int, x < y do
  x < y
end

I just tried ExCheck for the first time today so I'm sure there are aspects of it's API I'm not understanding, but it would greatly reduce the learning curve if my existing knowledge of Elixir's for comprehensions could be used instead of learning a new API.

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