{"action":"created","comment":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/comments/48098465","id":48098465,"diff_hunk":"@@ -0,0 +1,150 @@\n+module ClosedWellTyped (\n+    ClosedWellTyped(..)\n+    ) where\n+\n+import Control.Applicative as A ((<$>))\n+import Control.Monad.State.Lazy\n+import Data.Text.Lazy (Text, pack)\n+import Test.QuickCheck\n+\n+import Morte.Core\n+\n+\n+newtype ClosedWellTyped = ClosedWellTyped { unClosedWellTyped :: Expr X }\n+    deriving Show\n+\n+data Env a = Env {\n+      bindings :: [(Var, Expr a)]\n+    , uniques  :: [Text]\n+    }\n+\n+type GenExpr e a   = StateT (Env e) Gen a\n+type GenExprPair e = StateT (Env e) Gen (Expr e,Expr e)\n+\n+instance Arbitrary ClosedWellTyped where\n+    arbitrary = sized rndExpr\n+\n+\n+rndExpr :: Int -> Gen ClosedWellTyped\n+rndExpr n = ClosedWellTyped <$> evalStateT genExpr (initEnv n)\n+\n+initEnv :: Int -> Env a\n+initEnv n = Env [] $ map (pack . show) [1..n]\n+\n+extend :: Var -> Expr e -> GenExpr e ()\n+extend x t = modify (\\env -> env { bindings = (x,t) : bindings env })\n+\n+select :: [(Int,GenExprPair e,Env e -> Bool)] -> GenExprPair e","path":"testsuite/ClosedWellTyped.hs","position":37,"original_position":37,"commit_id":"06cb0acce6b0384bc7409845e792ed17b73d2a70","original_commit_id":"06cb0acce6b0384bc7409845e792ed17b73d2a70","user":{"login":"Gabriel439","id":1313787,"avatar_url":"https://avatars.githubusercontent.com/u/1313787?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel439","html_url":"https://github.com/Gabriel439","followers_url":"https://api.github.com/users/Gabriel439/followers","following_url":"https://api.github.com/users/Gabriel439/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel439/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel439/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel439/subscriptions","organizations_url":"https://api.github.com/users/Gabriel439/orgs","repos_url":"https://api.github.com/users/Gabriel439/repos","events_url":"https://api.github.com/users/Gabriel439/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel439/received_events","type":"User","site_admin":false},"body":"I would change the type of `select` to `[(Int, Env e -> Maybe (GenExprPair e))] -> GenExprPair e` so that you need less partial functions in the code.","created_at":"2015-12-20T01:00:08Z","updated_at":"2015-12-20T01:00:08Z","html_url":"https://github.com/Gabriel439/Haskell-Morte-Library/pull/35#discussion_r48098465","pull_request_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/comments/48098465"},"html":{"href":"https://github.com/Gabriel439/Haskell-Morte-Library/pull/35#discussion_r48098465"},"pull_request":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35","id":54048905,"html_url":"https://github.com/Gabriel439/Haskell-Morte-Library/pull/35","diff_url":"https://github.com/Gabriel439/Haskell-Morte-Library/pull/35.diff","patch_url":"https://github.com/Gabriel439/Haskell-Morte-Library/pull/35.patch","issue_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/issues/35","number":35,"state":"open","locked":false,"title":"Add basic Arbitrary instance and property tests.","user":{"login":"archblob","id":1261457,"avatar_url":"https://avatars.githubusercontent.com/u/1261457?v=3","gravatar_id":"","url":"https://api.github.com/users/archblob","html_url":"https://github.com/archblob","followers_url":"https://api.github.com/users/archblob/followers","following_url":"https://api.github.com/users/archblob/following{/other_user}","gists_url":"https://api.github.com/users/archblob/gists{/gist_id}","starred_url":"https://api.github.com/users/archblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archblob/subscriptions","organizations_url":"https://api.github.com/users/archblob/orgs","repos_url":"https://api.github.com/users/archblob/repos","events_url":"https://api.github.com/users/archblob/events{/privacy}","received_events_url":"https://api.github.com/users/archblob/received_events","type":"User","site_admin":false},"body":"The ``Arbitrary`` instance for ``Expr`` will generate closed well typed expression.\r\n``App`` terms will not be generated as the *lhs* of an ``App``. This is because although generation \r\nspeed is not a problem, or something I had to think about when implementing, it may become one when generating that kind of terms and I need to think things more.\r\n\r\nThere is not shrinking implemented either as I need to experiment with it a little bit more.","created_at":"2015-12-17T23:58:34Z","updated_at":"2015-12-20T01:00:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"718b9d4618c6e6412af6484c4d3ed6637df6b95d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35/commits","review_comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35/comments","review_comment_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/issues/35/comments","statuses_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/statuses/06cb0acce6b0384bc7409845e792ed17b73d2a70","head":{"label":"archblob:testsuite","ref":"testsuite","sha":"06cb0acce6b0384bc7409845e792ed17b73d2a70","user":{"login":"archblob","id":1261457,"avatar_url":"https://avatars.githubusercontent.com/u/1261457?v=3","gravatar_id":"","url":"https://api.github.com/users/archblob","html_url":"https://github.com/archblob","followers_url":"https://api.github.com/users/archblob/followers","following_url":"https://api.github.com/users/archblob/following{/other_user}","gists_url":"https://api.github.com/users/archblob/gists{/gist_id}","starred_url":"https://api.github.com/users/archblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archblob/subscriptions","organizations_url":"https://api.github.com/users/archblob/orgs","repos_url":"https://api.github.com/users/archblob/repos","events_url":"https://api.github.com/users/archblob/events{/privacy}","received_events_url":"https://api.github.com/users/archblob/received_events","type":"User","site_admin":false},"repo":{"id":30828231,"name":"Haskell-Morte-Library","full_name":"archblob/Haskell-Morte-Library","owner":{"login":"archblob","id":1261457,"avatar_url":"https://avatars.githubusercontent.com/u/1261457?v=3","gravatar_id":"","url":"https://api.github.com/users/archblob","html_url":"https://github.com/archblob","followers_url":"https://api.github.com/users/archblob/followers","following_url":"https://api.github.com/users/archblob/following{/other_user}","gists_url":"https://api.github.com/users/archblob/gists{/gist_id}","starred_url":"https://api.github.com/users/archblob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archblob/subscriptions","organizations_url":"https://api.github.com/users/archblob/orgs","repos_url":"https://api.github.com/users/archblob/repos","events_url":"https://api.github.com/users/archblob/events{/privacy}","received_events_url":"https://api.github.com/users/archblob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/archblob/Haskell-Morte-Library","description":"A bare-bones calculus-of-constructions","fork":true,"url":"https://api.github.com/repos/archblob/Haskell-Morte-Library","forks_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/forks","keys_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/keys{/key_id}","collaborators_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/teams","hooks_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/hooks","issue_events_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/issues/events{/number}","events_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/events","assignees_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/assignees{/user}","branches_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/branches{/branch}","tags_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/tags","blobs_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/git/refs{/sha}","trees_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/git/trees{/sha}","statuses_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/statuses/{sha}","languages_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/languages","stargazers_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/stargazers","contributors_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/contributors","subscribers_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/subscribers","subscription_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/subscription","commits_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/commits{/sha}","git_commits_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/git/commits{/sha}","comments_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/comments{/number}","issue_comment_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/issues/comments{/number}","contents_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/contents/{+path}","compare_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/compare/{base}...{head}","merges_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/merges","archive_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/downloads","issues_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/issues{/number}","pulls_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/pulls{/number}","milestones_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/milestones{/number}","notifications_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/labels{/name}","releases_url":"https://api.github.com/repos/archblob/Haskell-Morte-Library/releases{/id}","created_at":"2015-02-15T13:31:19Z","updated_at":"2015-05-08T20:04:04Z","pushed_at":"2015-12-18T14:54:12Z","git_url":"git://github.com/archblob/Haskell-Morte-Library.git","ssh_url":"git@github.com:archblob/Haskell-Morte-Library.git","clone_url":"https://github.com/archblob/Haskell-Morte-Library.git","svn_url":"https://github.com/archblob/Haskell-Morte-Library","homepage":null,"size":227,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Gabriel439:master","ref":"master","sha":"278f38ecde4f6f218cb23e6a1b3f83778b6ae35c","user":{"login":"Gabriel439","id":1313787,"avatar_url":"https://avatars.githubusercontent.com/u/1313787?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel439","html_url":"https://github.com/Gabriel439","followers_url":"https://api.github.com/users/Gabriel439/followers","following_url":"https://api.github.com/users/Gabriel439/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel439/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel439/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel439/subscriptions","organizations_url":"https://api.github.com/users/Gabriel439/orgs","repos_url":"https://api.github.com/users/Gabriel439/repos","events_url":"https://api.github.com/users/Gabriel439/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel439/received_events","type":"User","site_admin":false},"repo":{"id":23376642,"name":"Haskell-Morte-Library","full_name":"Gabriel439/Haskell-Morte-Library","owner":{"login":"Gabriel439","id":1313787,"avatar_url":"https://avatars.githubusercontent.com/u/1313787?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel439","html_url":"https://github.com/Gabriel439","followers_url":"https://api.github.com/users/Gabriel439/followers","following_url":"https://api.github.com/users/Gabriel439/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel439/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel439/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel439/subscriptions","organizations_url":"https://api.github.com/users/Gabriel439/orgs","repos_url":"https://api.github.com/users/Gabriel439/repos","events_url":"https://api.github.com/users/Gabriel439/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel439/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gabriel439/Haskell-Morte-Library","description":"A bare-bones calculus-of-constructions","fork":false,"url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library","forks_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/forks","keys_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/teams","hooks_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/hooks","issue_events_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/issues/events{/number}","events_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/events","assignees_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/assignees{/user}","branches_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/branches{/branch}","tags_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/tags","blobs_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/statuses/{sha}","languages_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/languages","stargazers_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/stargazers","contributors_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/contributors","subscribers_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/subscribers","subscription_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/subscription","commits_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/contents/{+path}","compare_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/merges","archive_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/downloads","issues_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/issues{/number}","pulls_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls{/number}","milestones_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/milestones{/number}","notifications_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/labels{/name}","releases_url":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/releases{/id}","created_at":"2014-08-27T04:23:55Z","updated_at":"2015-12-19T17:36:50Z","pushed_at":"2015-12-18T17:34:29Z","git_url":"git://github.com/Gabriel439/Haskell-Morte-Library.git","ssh_url":"git@github.com:Gabriel439/Haskell-Morte-Library.git","clone_url":"https://github.com/Gabriel439/Haskell-Morte-Library.git","svn_url":"https://github.com/Gabriel439/Haskell-Morte-Library","homepage":null,"size":231,"stargazers_count":145,"watchers_count":145,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":7,"forks":11,"open_issues":7,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35"},"html":{"href":"https://github.com/Gabriel439/Haskell-Morte-Library/pull/35"},"issue":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/issues/35"},"comments":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/Gabriel439/Haskell-Morte-Library/statuses/06cb0acce6b0384bc7409845e792ed17b73d2a70"}}}}