Erlang Central

Difference between revisions of "List Generators"

From ErlangCentral Wiki

(Created)
 
Line 2: Line 2:
  
 
== Authors ==
 
== Authors ==
 +
 +
(This is a living page, please add your own list based generators here!)
 +
 
[[Adam]] Lindberg
 
[[Adam]] Lindberg
  

Revision as of 12:47, 9 September 2008


Authors

(This is a living page, please add your own list based generators here!)

Adam Lindberg

Non-empty list

If you want to generate lists which can never be empty, it's fairly simple to wrap the standard list() generator in QuickCheck:

nelist(G) ->
    ?LET({E, L}, {G, list(G)},
         [E|L]).