4

Please identify this programming language:

*Main> [ ((a,b,c),(d,e)) | 
    a <- [1..7], 
    b <- [2..8], 
    c <- [3..9], 
    d <- [1..8], 
    e <- [2..9], 
    a < b, 
    b < c, 
    d < e, 
    List.intersect [d,e] [a,b,c] == [], 
    a+b+c == 23, 
    d+e == 10 ]

output:

[((6,8,9),(3,7))]

I found the code in this blog comment.

Jared Updike
  • 7,165
  • 8
  • 46
  • 72
Handcraftsman
  • 6,863
  • 2
  • 40
  • 33

3 Answers3

8

Haskell, running in a GHCi session.

alt text

Community
  • 1
  • 1
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
3

Haskell. Definitely.

Jared Updike
  • 7,165
  • 8
  • 46
  • 72
3

Haskell, of course

Gabi Purcaru
  • 30,940
  • 9
  • 79
  • 95