
30 Dec
2008
30 Dec
'08
7:11 p.m.
Justin Goguen schrieb:
My purpose is to have operations such as ["aa".."bc"] be possible, with its result being ["aa", "ab", "ac" ..<snip>.. "ba", "bb", "bc"]
... what do you want to get, if the lengths of the start and the end string do not match? Maybe what you are after is the Ix class: Prelude> Data.Ix.range (('a','a'), ('b','c')) [('a','a'),('a','b'),('a','c'),('b','a'),('b','b'),('b','c')] Prelude> map (\(x,y) -> x:y:[]) $ Data.Ix.range (('a','a'), ('b','c')) ["aa","ab","ac","ba","bb","bc"]