Skip to main content
Fix link rot
Source Link
Matt Thomas
  • 5.9k
  • 4
  • 33
  • 65
Fix syntax highlighting
Source Link
Dada
  • 6.8k
  • 7
  • 28
  • 48
let iter_combs n k f =
  let rec iter v s j =
    if j = k then f v
    else for i = s to n - 1 do iter (i::v) (i+1) (j+1) done in
  iter [] 0 0
let iter_combs n k f =
  let rec iter v s j =
    if j = k then f v
    else for i = s to n - 1 do iter (i::v) (i+1) (j+1) done in
  iter [] 0 0
let fold_combs n k f x =
  let rec loop i s c x =
    if i < n then
      loop (i+1) s c @@
      let c = i::c and s = s + 1 and i = i + 1 in
      if s < k then loop i s c x else f c x
    else x in
  loop 0 0 [] x
let fold_combs n k f x =
  let rec loop i s c x =
    if i < n then
      loop (i+1) s c @@
      let c = i::c and s = s + 1 and i = i + 1 in
      if s < k then loop i s c x else f c x
    else x in
  loop 0 0 [] x
let iter_combs n k f =
  let rec iter v s j =
    if j = k then f v
    else for i = s to n - 1 do iter (i::v) (i+1) (j+1) done in
  iter [] 0 0
let fold_combs n k f x =
  let rec loop i s c x =
    if i < n then
      loop (i+1) s c @@
      let c = i::c and s = s + 1 and i = i + 1 in
      if s < k then loop i s c x else f c x
    else x in
  loop 0 0 [] x
let iter_combs n k f =
  let rec iter v s j =
    if j = k then f v
    else for i = s to n - 1 do iter (i::v) (i+1) (j+1) done in
  iter [] 0 0
let fold_combs n k f x =
  let rec loop i s c x =
    if i < n then
      loop (i+1) s c @@
      let c = i::c and s = s + 1 and i = i + 1 in
      if s < k then loop i s c x else f c x
    else x in
  loop 0 0 [] x
Bounty Awarded with 500 reputation awarded by Naman
refine grammerly
Source Link
OmG
  • 19k
  • 13
  • 69
  • 96
Loading
a small fix
Source Link
ivg
  • 35.4k
  • 2
  • 43
  • 73
Loading
adds a simple implementations, that are ready to use.
Source Link
ivg
  • 35.4k
  • 2
  • 43
  • 73
Loading
Fixed broken link
Source Link
feetwet
  • 3.5k
  • 8
  • 57
  • 96
Loading
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot
Loading
Fixed grammar
Source Link
APC
  • 146.9k
  • 20
  • 180
  • 289
Loading
Attempt to fix latex by replacing with images
Source Link
Isaac Turner
  • 3k
  • 1
  • 27
  • 25
Loading
Added Ocaml (F#) syntax highlighting tag
Source Link
Engineero
  • 13k
  • 5
  • 56
  • 79
Loading
grammar
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading
Changed the ! to . because ! might be read ambiguously by some to mean factorial.
Source Link
CashCow
  • 31.6k
  • 5
  • 65
  • 97
Loading
edit
Source Link
Rahul Gautam
  • 4.9k
  • 2
  • 24
  • 30
Loading
Post Made Community Wiki by sss123next
I followed the link for McCaffery's method and implemented it. I see there are no duplicates produced but the comments section says that duplicates WILL be part of the output. My edit is "... Buckles. Fortunately, it does not produce duplicate combinations: ..."
Source Link
Loading
Fixed a typo, from better then to better than.
Source Link
billygoat
  • 22.1k
  • 5
  • 44
  • 50
Loading
testing if ---- are issue in post not being revealed properly.
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading
gray, not grey. opps. link to some c of chase's
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading
added 364 characters in body
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading
added 1201 characters in body
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading
added 867 characters in body
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading
added 1137 characters in body
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading
Source Link
nlucaroni
  • 48k
  • 6
  • 68
  • 87
Loading