Skip to content

Instantly share code, notes, and snippets.

@zkessin
Created October 16, 2017 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zkessin/8d0eb3b4e96ccd2c7364152b5267e82f to your computer and use it in GitHub Desktop.
Save zkessin/8d0eb3b4e96ccd2c7364152b5267e82f to your computer and use it in GitHub Desktop.
-module(fake).
non_duplicate_random(Gen,Len) ->
?SHUFFLE(non_duplicate(Gen,Len)).
non_duplicate(Gen, Len) ->
?LET(A,
list(Len,Gen) ,
lists:usort(A)
).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment