Skip to content

Instantly share code, notes, and snippets.

@amirmc
Created August 13, 2014 20:53
Show Gist options
  • Save amirmc/48e493194d6452ab8c4e to your computer and use it in GitHub Desktop.
Save amirmc/48e493194d6452ab8c4e to your computer and use it in GitHub Desktop.
Merging atom feeds - Line 15 does not type-check
open Http_client.Convenience
open Syndic
let feed_urls =
["http://amirchaudhry.com/atom.xml";
"http://nymote.org/atom.xml"]
let all_feeds feed_urls =
let parse_one_feed feed =
let raw_feed = http_get feed in
let input = Xmlm.make_input (`String (0, raw_feed)) in
Atom.parse input in
List.map parse_one_feed feed_urls
let merged_feed = Atom.aggregate all_feeds
let () =
let fh = open_out "combined_feed.txt" in
Atom.output merged_feed (`Channel fh);
close_out fh
@amirmc
Copy link
Author

amirmc commented Aug 13, 2014

$ make
ocamlfind ocamlopt -annot -o "merge.native" -package syndic,netclient -linkpkg merge.ml
File "merge.ml", line 15, characters 33-42:
Error: This expression has type string list -> Syndic.Atom.feed list
       but an expression was expected of type
         (Uri.t option * Syndic.Atom.feed) list
make: *** [merge.native] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment