let all = ['a'..'z'] let letters = [(a,b,c) | a <- all, b <- all, c <- all] -- If you want to save to a text file (probably more convenient than just printing to the screen writeFile "letterCombinations.txt" (show letters)
Haskell Letter Combinations
Page 1 of 10 Replies - 1319 Views - Last Post: 13 April 2011 - 12:15 AM
#1
Haskell Letter Combinations
Posted 13 April 2011 - 12:15 AM
Description: Run this code in GHCi. This is probably not particularly useful but I wrote it a while ago and its a very cool piece of code!
Basically it gives out all combinations of 3 letters, then outputs it to a file.
Page 1 of 1