<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I'm new to mercury and I'm trying to process CSV data using the package<br>  <a href="https://github.com/juliensf/mercury-csv">https://github.com/juliensf/mercury-csv</a><br><br></div>The next paragraph is my test code and mmc is giving me this error.<br>    test_raw_csv.m:034:   type error: unsatisfied typeclass constraint:<br>    test_raw_csv.m:034:     `stream.reader(csv.raw_reader(io.input_stream), csv.record, io.state, Error)'<br></div>May I know how I should fix my code? Thanks.<br><br>%-----------------------------------------------------------------------------%<br>% Program: test_raw_csv.m<br>% Purpose: Read CSV content from stdin and print as raw records to stdout.<br><br>:- module test_raw_csv.<br>:- interface.<br>:- import_module io.<br>:- pred main(io::di, io::uo) is det.<br><br>:- implementation.<br><br>:- import_module csv.<br>:- import_module stream.<br><br>%-----------------------------------------------------------------------------%<br><br>main(!IO) :-<br>    io.stdin_stream(Input, !IO),<br>    process_csv(Input, !IO).<br><br>:- pred process_csv(io.text_input_stream::in, io::di, io::uo) is det.<br>process_csv(Input, !IO) :-<br>    csv.init_raw_reader(Input, Reader, !IO),<br>    stream.input_stream_fold_state(Reader, writer, _Result, !IO).<br><br>:- pred writer(record::in, io::di, io::uo) is det.<br>writer(Record, !IO) :-<br>    print(Record, !IO).<br>%-----------------------------------------------------------------------------%<br><br></div>Regards,<br></div>WK<br></div>