Skip to content
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

Question about inspecting generator sample #58

Closed
drozzy opened this issue Apr 6, 2016 · 1 comment
Closed

Question about inspecting generator sample #58

drozzy opened this issue Apr 6, 2016 · 1 comment

Comments

@drozzy
Copy link

drozzy commented Apr 6, 2016

Hi, guys.
How can I see what kind of data my generator produces?

Let's say I have the following generator:


-module (my).
-include_lib("triq/include/triq.hrl").
-export([valid_type_gen/1]).

valid_type_gen() -> non_empty(list(any())).

I would like to examine what kind of data it generates, i.e. something like:

$ rebar3 shell
1> my:valid_type_gen().sample() %???
[1,b,"blah"]

This is an SO question:
http://stackoverflow.com/questions/36440822/how-to-get-a-sample-of-a-generator

P.S.: I created a Triq tag on SO.

@drozzy
Copy link
Author

drozzy commented Apr 6, 2016

Ok, got it:

triq_dom:pick(my:valid_type_gen(), 10).

@drozzy drozzy closed this as completed Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant