Open apraga opened 11 months ago
This is rather opaque. Since we need a special parser for this table and its associated row type, we must make use of a definition tableTypes'
quietly provides for us, u2Parser :: ParserOptions
, that you must then pass to readTableOpt
. So, you write loadRows = inCoreAoS (readTableOpt u2Parser "ml-100k/u.user")
. What's happening is that custom separator is being used for parsing the file to generate the types at compile time, but then readTable
is using the default parser at runtime.
For this data, it may also be helpful to provide column names. I don't think these are accurate, but it's what I threw together when testing this:
tableTypes' (rowGen "test/data/ml-100k/u.user")
{ rowTypeName = "U2"
, columnNames = ["index", "age", "sex", "title", "zip"]
, separator = ";"}
Thanks for the answer, it works perfectly. Do you think the documentation could be updated to reflect that ?
Yes, definitely. I was looking at how hls can expand splices in place, and it does show the various definitions, but it’s no substitute for documentation.
Hi,
When trying the tutorial, using a custom separator does not seem to work :
With ml-100k/u.user containing
The following code outputs nothing
Replacing ";" in the data file and in the code recognize the columns. Am I doing something wrong ? Using GHC 9.2.8 and Frames 0.7.3. Thanks,