[Haskell-beginners] Ranges and List Comprehensions in SQL

Tom Murphy amindfv at gmail.com
Thu Sep 2 15:54:12 EDT 2010


Hi Everyone,

     Is there a "From SQL"-type function that "restores" a range or list
comprehension?

Example:
Let's say I want to keep track of which episodes of a TV show I've seen. I
have an SQL table, in which is a record:
   id (INTEGER): 30
   title (VARCHAR): "The Simpsons"
   episodes_watched (Some data format): [1..4], [14], [18..21], [23..25]

Then, when I pull the record, in Haskell, the "Episodes Watched" is already
one list:
[1,2,3,4,14,18,19,21,23,24,25]

, or a series of lists that I can append together:
[1,2,3,4], [14], [18,19,20,21], [23,24,25]


Note in the example that I would like to be able to store multiple ranges
within a single record.


Thanks so much for any help!
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100902/1a043af5/attachment.html


More information about the Beginners mailing list