bsl / oeis

Haskell interface to the Online Encyclopedia of Integer Sequences
Other
6 stars 6 forks source link

add support for multiple results #14

Closed int-e closed 4 years ago

int-e commented 4 years ago

The OEIS text-based interface can return up to 10 results. With this patch, the data is split into chunks at the %I fields, and each chunk is parsed separately.

The existing functions only return the first result (previously, the sequence data of all results would be concatenated...).

This patch adds new functions that can return multiple results:

Math.OEIS.searchSequences_IO Math.OEIS.lookupSequences_IO

int-e commented 4 years ago

Note that the current behavior (without this patch) is surprising: For example, looking up 0,1,2,4 returns a result whose sequenceData starts with 0,1,2,4,8,10,23,83,220,1313,2951,20015,51053,0,0,1,2,4,6,9,12,16,20..., which is actually a concatenation of several sequences.

niteria commented 4 years ago

Thanks!