{"action":"created","comment":{"url":"https://api.github.com/repos/ocsigen/reactiveData/pulls/comments/50557459","id":50557459,"diff_hunk":"@@ -17,66 +17,216 @@\n  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n  *)\n \n-module type DATA = sig\n-  type 'a data\n-  type 'a patch\n-  val merge : 'a patch -> 'a data -> 'a data\n-  val map_patch : ('a -> 'b) -> 'a patch -> 'b patch\n-  val map_data : ('a -> 'b) -> 'a data -> 'b data\n-  val empty : 'a data\n-  val equal : ('a -> 'a -> bool) -> 'a data -> 'a data -> bool\n-  val diff : eq:('a -> 'a -> bool) -> 'a data -> 'a data -> 'a patch\n-end\n+(** ReactiveData is a module for data-aware functional reactive\n+    programming (FRP). It adds support to incremental changes in data\n+    structures by reasoning on patches instead of absolute\n+    values. ReactiveData is based on and inter-operates with React.\n+\n+    You are most likely interested in the sub-module [RList], which\n+    implements a superset of the signature [S]. *)\n+\n+(** Signature describing a reactive data structure (['a t]).\n+\n+    Most functions in [S] are not safe to call during a React update\n+    step. *)\n module type S = sig\n+\n+  (** Reactive version of the data container *)\n+  type 'a t\n+\n+  (** Raw (non-reactive) version of the data container *)\n   type 'a data\n+\n+  (** Patch format *)\n   type 'a patch\n-  type 'a msg = Patch of 'a patch | Set of 'a data\n+\n+  (** Message format *)\n+  type 'a msg =\n+    | Patch of 'a patch (** [Patch p] triggers the application of [p]\n+                            on the current contents *)\n+    | Set of 'a data    (** With [Set d], [d] becomes the new\n+                            content *)\n+\n+  (** Handle that permits applying incremental updates *)\n   type 'a handle\n-  type 'a t\n+\n+  (** Empty data structure *)\n   val empty : 'a t\n+\n+  (** Build a container from initial contents. The handle can be used\n+      for performing reactive updates. *)\n   val make : 'a data -> 'a t * 'a handle\n+\n+  (** [make_from d e] is a container whose initial value is [d], and\n+      which gets updated for every occurrence of [e] *)\n   val make_from : 'a data -> 'a msg React.E.t -> 'a t\n+\n+  (** Convert a React signal into a ReactiveData container.\n+\n+      Whenever the signal changes from value [v] to value [v'], we\n+      detect the differences between [v] and [v'], and perform\n+      downstream computation (e.g., for [map]) only on the new and\n+      modified elements. *)\n   val make_from_s :\n     ?eq:('a -> 'a -> bool) -> 'a data React.S.t -> 'a t\n+\n+  (** Produce a constant container *)\n   val const : 'a data -> 'a t\n+\n+  (** [patch h p] applies [p] on the container corresponding to [h] *)\n   val patch : 'a handle -> 'a patch -> unit\n+\n+  (** [set h d] sets the contents of the container corresponding to\n+      [h], disregarding previous contents *)\n   val set : 'a handle -> 'a data -> unit\n+\n+  (** Transform a message *)\n   val map_msg : ('a -> 'b) -> 'a msg -> 'b msg\n+\n+  (** [map f c] applies [f] on all elements of [c], producing a new\n+      reactive container [c']. Modifying the contents of [c] leads to\n+      modifications of [c']. [f] is applied only on the new or\n+      modified elements of [c]. *)\n   val map : ('a -> 'b) -> 'a t -> 'b t\n+\n+  (** Return current contents *)\n   val value : 'a t -> 'a data\n+\n+  (** [fold f c v] accumulates the updates on [c] with [f] starting\n+      from [v].\n+\n+      The result is a signal of value [f m_n (f ... (f m_1 v))], where\n+      [m_1] ... [m_n] are the messages that have been applied since\n+      the beginning of [fold]. [m_1] is a pseudo-message [Set l],\n+      accounting for the contents [l] of [c] at the time when\n+      accumulation starts. *)\n   val fold : ('a -> 'b msg -> 'a) -> 'b t -> 'a -> 'a React.signal\n+\n+  (** Signal corresponding to contents *)\n   val value_s : 'a t -> 'a data React.S.t\n+\n+  (** Event whose occurrences correspond to container updates *)\n   val event : 'a t -> 'a msg React.E.t\n+\n+end\n+\n+(** Signature describing a raw data container (['a data]).\n+\n+    Given an implementation of [DATA], an incremental version of the\n+    container can be produced (via [Make]). *)\n+module type DATA = sig\n+\n+  (** Data container *)\n+  type 'a data\n+\n+  (** Patch format for modifying the container *)\n+  type 'a patch\n+\n+  (** Applicative merge operation: [merge p d] is a new container\n+      produced by applying [p] on [d]. [d] does not change. *)\n+  val merge : 'a patch -> 'a data -> 'a data\n+\n+  (** Transform a patch *)\n+  val map_patch : ('a -> 'b) -> 'a patch -> 'b patch\n+\n+  (** [map f d] applies [f] on all the elements of [d], producing a\n+      new container in an applicative way *)\n+  val map_data : ('a -> 'b) -> 'a data -> 'b data\n+\n+  (** Empty container *)\n+  val empty : 'a data\n+\n+  (** Lift an equality operator over atoms of type ['a] to an equality\n+      operator over ['a data] *)\n+  val equal : ('a -> 'a -> bool) -> 'a data -> 'a data -> bool\n+\n+  (** [diff ?eq d1 d2] produces a patch describing the differences\n+      between [d1] and [d2].\n+\n+      The optional [?eq] argument is used for comparing the atoms\n+      inside [d1] and [d2]. (The default value for [eq] is [(=)].) *)\n+  val diff : eq:('a -> 'a -> bool) -> 'a data -> 'a data -> 'a patch\n+\n end\n \n+(** Functor for turning a plain container into an incremental one *)\n module Make(D : DATA) : S with type 'a data = 'a D.data\n                            and type 'a patch = 'a D.patch\n+\n+(** Reactive list data structure *)\n module RList :\n sig\n+\n+  (** Patch operation on lists. All operations are of linear\n+      complexity. *)\n   type 'a p =\n-      I of int * 'a\n-    | R of int\n-    | U of int * 'a\n-    | X of int * int\n+    | I of int * 'a  (** [I i v] adds [v] at position [i] *)\n+    | R of int       (** [R i] removes [i]-th element *)\n+    | U of int * 'a  (** [U i v] substitutes [i]-th element with [v] *)\n+    | X of int * int (** [X i j] swaps the [i]-th and [j]-th elements *)","path":"src/reactiveData.mli","position":173,"original_position":173,"commit_id":"34c42f9c47c7705ad99c626044f39850dd4d7035","original_commit_id":"34c42f9c47c7705ad99c626044f39850dd4d7035","user":{"login":"Drup","id":801124,"avatar_url":"https://avatars.githubusercontent.com/u/801124?v=3","gravatar_id":"","url":"https://api.github.com/users/Drup","html_url":"https://github.com/Drup","followers_url":"https://api.github.com/users/Drup/followers","following_url":"https://api.github.com/users/Drup/following{/other_user}","gists_url":"https://api.github.com/users/Drup/gists{/gist_id}","starred_url":"https://api.github.com/users/Drup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Drup/subscriptions","organizations_url":"https://api.github.com/users/Drup/orgs","repos_url":"https://api.github.com/users/Drup/repos","events_url":"https://api.github.com/users/Drup/events{/privacy}","received_events_url":"https://api.github.com/users/Drup/received_events","type":"User","site_admin":false},"body":"`I (i,v)` and all the others.","created_at":"2016-01-22T16:30:58Z","updated_at":"2016-01-22T16:30:58Z","html_url":"https://github.com/ocsigen/reactiveData/pull/14#discussion_r50557459","pull_request_url":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/ocsigen/reactiveData/pulls/comments/50557459"},"html":{"href":"https://github.com/ocsigen/reactiveData/pull/14#discussion_r50557459"},"pull_request":{"href":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14","id":56490175,"html_url":"https://github.com/ocsigen/reactiveData/pull/14","diff_url":"https://github.com/ocsigen/reactiveData/pull/14.diff","patch_url":"https://github.com/ocsigen/reactiveData/pull/14.patch","issue_url":"https://api.github.com/repos/ocsigen/reactiveData/issues/14","number":14,"state":"open","locked":false,"title":"Add API documentation","user":{"login":"vasilisp","id":4950946,"avatar_url":"https://avatars.githubusercontent.com/u/4950946?v=3","gravatar_id":"","url":"https://api.github.com/users/vasilisp","html_url":"https://github.com/vasilisp","followers_url":"https://api.github.com/users/vasilisp/followers","following_url":"https://api.github.com/users/vasilisp/following{/other_user}","gists_url":"https://api.github.com/users/vasilisp/gists{/gist_id}","starred_url":"https://api.github.com/users/vasilisp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasilisp/subscriptions","organizations_url":"https://api.github.com/users/vasilisp/orgs","repos_url":"https://api.github.com/users/vasilisp/repos","events_url":"https://api.github.com/users/vasilisp/events{/privacy}","received_events_url":"https://api.github.com/users/vasilisp/received_events","type":"User","site_admin":false},"body":"`ReactiveData` gets API documentation. Let me know if there is anything unclear, or that needs expansion.","created_at":"2016-01-19T16:31:00Z","updated_at":"2016-01-22T16:30:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1f89e4487d7d5717be77b7e49afa7513edec8e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14/commits","review_comments_url":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14/comments","review_comment_url":"https://api.github.com/repos/ocsigen/reactiveData/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ocsigen/reactiveData/issues/14/comments","statuses_url":"https://api.github.com/repos/ocsigen/reactiveData/statuses/34c42f9c47c7705ad99c626044f39850dd4d7035","head":{"label":"ocsigen:doc","ref":"doc","sha":"34c42f9c47c7705ad99c626044f39850dd4d7035","user":{"login":"ocsigen","id":4729424,"avatar_url":"https://avatars.githubusercontent.com/u/4729424?v=3","gravatar_id":"","url":"https://api.github.com/users/ocsigen","html_url":"https://github.com/ocsigen","followers_url":"https://api.github.com/users/ocsigen/followers","following_url":"https://api.github.com/users/ocsigen/following{/other_user}","gists_url":"https://api.github.com/users/ocsigen/gists{/gist_id}","starred_url":"https://api.github.com/users/ocsigen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocsigen/subscriptions","organizations_url":"https://api.github.com/users/ocsigen/orgs","repos_url":"https://api.github.com/users/ocsigen/repos","events_url":"https://api.github.com/users/ocsigen/events{/privacy}","received_events_url":"https://api.github.com/users/ocsigen/received_events","type":"Organization","site_admin":false},"repo":{"id":19937541,"name":"reactiveData","full_name":"ocsigen/reactiveData","owner":{"login":"ocsigen","id":4729424,"avatar_url":"https://avatars.githubusercontent.com/u/4729424?v=3","gravatar_id":"","url":"https://api.github.com/users/ocsigen","html_url":"https://github.com/ocsigen","followers_url":"https://api.github.com/users/ocsigen/followers","following_url":"https://api.github.com/users/ocsigen/following{/other_user}","gists_url":"https://api.github.com/users/ocsigen/gists{/gist_id}","starred_url":"https://api.github.com/users/ocsigen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocsigen/subscriptions","organizations_url":"https://api.github.com/users/ocsigen/orgs","repos_url":"https://api.github.com/users/ocsigen/repos","events_url":"https://api.github.com/users/ocsigen/events{/privacy}","received_events_url":"https://api.github.com/users/ocsigen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ocsigen/reactiveData","description":"Functional reactive programming with incremental changes in data structures","fork":false,"url":"https://api.github.com/repos/ocsigen/reactiveData","forks_url":"https://api.github.com/repos/ocsigen/reactiveData/forks","keys_url":"https://api.github.com/repos/ocsigen/reactiveData/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ocsigen/reactiveData/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ocsigen/reactiveData/teams","hooks_url":"https://api.github.com/repos/ocsigen/reactiveData/hooks","issue_events_url":"https://api.github.com/repos/ocsigen/reactiveData/issues/events{/number}","events_url":"https://api.github.com/repos/ocsigen/reactiveData/events","assignees_url":"https://api.github.com/repos/ocsigen/reactiveData/assignees{/user}","branches_url":"https://api.github.com/repos/ocsigen/reactiveData/branches{/branch}","tags_url":"https://api.github.com/repos/ocsigen/reactiveData/tags","blobs_url":"https://api.github.com/repos/ocsigen/reactiveData/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ocsigen/reactiveData/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ocsigen/reactiveData/git/refs{/sha}","trees_url":"https://api.github.com/repos/ocsigen/reactiveData/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ocsigen/reactiveData/statuses/{sha}","languages_url":"https://api.github.com/repos/ocsigen/reactiveData/languages","stargazers_url":"https://api.github.com/repos/ocsigen/reactiveData/stargazers","contributors_url":"https://api.github.com/repos/ocsigen/reactiveData/contributors","subscribers_url":"https://api.github.com/repos/ocsigen/reactiveData/subscribers","subscription_url":"https://api.github.com/repos/ocsigen/reactiveData/subscription","commits_url":"https://api.github.com/repos/ocsigen/reactiveData/commits{/sha}","git_commits_url":"https://api.github.com/repos/ocsigen/reactiveData/git/commits{/sha}","comments_url":"https://api.github.com/repos/ocsigen/reactiveData/comments{/number}","issue_comment_url":"https://api.github.com/repos/ocsigen/reactiveData/issues/comments{/number}","contents_url":"https://api.github.com/repos/ocsigen/reactiveData/contents/{+path}","compare_url":"https://api.github.com/repos/ocsigen/reactiveData/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ocsigen/reactiveData/merges","archive_url":"https://api.github.com/repos/ocsigen/reactiveData/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ocsigen/reactiveData/downloads","issues_url":"https://api.github.com/repos/ocsigen/reactiveData/issues{/number}","pulls_url":"https://api.github.com/repos/ocsigen/reactiveData/pulls{/number}","milestones_url":"https://api.github.com/repos/ocsigen/reactiveData/milestones{/number}","notifications_url":"https://api.github.com/repos/ocsigen/reactiveData/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ocsigen/reactiveData/labels{/name}","releases_url":"https://api.github.com/repos/ocsigen/reactiveData/releases{/id}","deployments_url":"https://api.github.com/repos/ocsigen/reactiveData/deployments","created_at":"2014-05-19T10:19:41Z","updated_at":"2016-01-20T15:48:30Z","pushed_at":"2016-01-20T15:49:12Z","git_url":"git://github.com/ocsigen/reactiveData.git","ssh_url":"git@github.com:ocsigen/reactiveData.git","clone_url":"https://github.com/ocsigen/reactiveData.git","svn_url":"https://github.com/ocsigen/reactiveData","homepage":"","size":68,"stargazers_count":18,"watchers_count":18,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":18,"default_branch":"master"}},"base":{"label":"ocsigen:master","ref":"master","sha":"b3b0fec023e44eda5c71eb6e6afa9cf60c2fd97d","user":{"login":"ocsigen","id":4729424,"avatar_url":"https://avatars.githubusercontent.com/u/4729424?v=3","gravatar_id":"","url":"https://api.github.com/users/ocsigen","html_url":"https://github.com/ocsigen","followers_url":"https://api.github.com/users/ocsigen/followers","following_url":"https://api.github.com/users/ocsigen/following{/other_user}","gists_url":"https://api.github.com/users/ocsigen/gists{/gist_id}","starred_url":"https://api.github.com/users/ocsigen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocsigen/subscriptions","organizations_url":"https://api.github.com/users/ocsigen/orgs","repos_url":"https://api.github.com/users/ocsigen/repos","events_url":"https://api.github.com/users/ocsigen/events{/privacy}","received_events_url":"https://api.github.com/users/ocsigen/received_events","type":"Organization","site_admin":false},"repo":{"id":19937541,"name":"reactiveData","full_name":"ocsigen/reactiveData","owner":{"login":"ocsigen","id":4729424,"avatar_url":"https://avatars.githubusercontent.com/u/4729424?v=3","gravatar_id":"","url":"https://api.github.com/users/ocsigen","html_url":"https://github.com/ocsigen","followers_url":"https://api.github.com/users/ocsigen/followers","following_url":"https://api.github.com/users/ocsigen/following{/other_user}","gists_url":"https://api.github.com/users/ocsigen/gists{/gist_id}","starred_url":"https://api.github.com/users/ocsigen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocsigen/subscriptions","organizations_url":"https://api.github.com/users/ocsigen/orgs","repos_url":"https://api.github.com/users/ocsigen/repos","events_url":"https://api.github.com/users/ocsigen/events{/privacy}","received_events_url":"https://api.github.com/users/ocsigen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ocsigen/reactiveData","description":"Functional reactive programming with incremental changes in data structures","fork":false,"url":"https://api.github.com/repos/ocsigen/reactiveData","forks_url":"https://api.github.com/repos/ocsigen/reactiveData/forks","keys_url":"https://api.github.com/repos/ocsigen/reactiveData/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ocsigen/reactiveData/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ocsigen/reactiveData/teams","hooks_url":"https://api.github.com/repos/ocsigen/reactiveData/hooks","issue_events_url":"https://api.github.com/repos/ocsigen/reactiveData/issues/events{/number}","events_url":"https://api.github.com/repos/ocsigen/reactiveData/events","assignees_url":"https://api.github.com/repos/ocsigen/reactiveData/assignees{/user}","branches_url":"https://api.github.com/repos/ocsigen/reactiveData/branches{/branch}","tags_url":"https://api.github.com/repos/ocsigen/reactiveData/tags","blobs_url":"https://api.github.com/repos/ocsigen/reactiveData/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ocsigen/reactiveData/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ocsigen/reactiveData/git/refs{/sha}","trees_url":"https://api.github.com/repos/ocsigen/reactiveData/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ocsigen/reactiveData/statuses/{sha}","languages_url":"https://api.github.com/repos/ocsigen/reactiveData/languages","stargazers_url":"https://api.github.com/repos/ocsigen/reactiveData/stargazers","contributors_url":"https://api.github.com/repos/ocsigen/reactiveData/contributors","subscribers_url":"https://api.github.com/repos/ocsigen/reactiveData/subscribers","subscription_url":"https://api.github.com/repos/ocsigen/reactiveData/subscription","commits_url":"https://api.github.com/repos/ocsigen/reactiveData/commits{/sha}","git_commits_url":"https://api.github.com/repos/ocsigen/reactiveData/git/commits{/sha}","comments_url":"https://api.github.com/repos/ocsigen/reactiveData/comments{/number}","issue_comment_url":"https://api.github.com/repos/ocsigen/reactiveData/issues/comments{/number}","contents_url":"https://api.github.com/repos/ocsigen/reactiveData/contents/{+path}","compare_url":"https://api.github.com/repos/ocsigen/reactiveData/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ocsigen/reactiveData/merges","archive_url":"https://api.github.com/repos/ocsigen/reactiveData/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ocsigen/reactiveData/downloads","issues_url":"https://api.github.com/repos/ocsigen/reactiveData/issues{/number}","pulls_url":"https://api.github.com/repos/ocsigen/reactiveData/pulls{/number}","milestones_url":"https://api.github.com/repos/ocsigen/reactiveData/milestones{/number}","notifications_url":"https://api.github.com/repos/ocsigen/reactiveData/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ocsigen/reactiveData/labels{/name}","releases_url":"https://api.github.com/repos/ocsigen/reactiveData/releases{/id}","deployments_url":"https://api.github.com/repos/ocsigen/reactiveData/deployments","created_at":"2014-05-19T10:19:41Z","updated_at":"2016-01-20T15:48:30Z","pushed_at":"2016-01-20T15:49:12Z","git_url":"git://github.com/ocsigen/reactiveData.git","ssh_url":"git@github.com:ocsigen/reactiveData.git","clone_url":"https://github.com/ocsigen/reactiveData.git","svn_url":"https://github.com/ocsigen/reactiveData","homepage":"","size":68,"stargazers_count":18,"watchers_count":18,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14"},"html":{"href":"https://github.com/ocsigen/reactiveData/pull/14"},"issue":{"href":"https://api.github.com/repos/ocsigen/reactiveData/issues/14"},"comments":{"href":"https://api.github.com/repos/ocsigen/reactiveData/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/ocsigen/reactiveData/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ocsigen/reactiveData/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/ocsigen/reactiveData/statuses/34c42f9c47c7705ad99c626044f39850dd4d7035"}}}}