{"action":"created","issue":{"url":"https://api.github.com/repos/fthomas/refined/issues/82","labels_url":"https://api.github.com/repos/fthomas/refined/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/fthomas/refined/issues/82/comments","events_url":"https://api.github.com/repos/fthomas/refined/issues/82/events","html_url":"https://github.com/fthomas/refined/pull/82","id":113908026,"number":82,"title":"Add Eval predicate","user":{"login":"fthomas","id":141252,"avatar_url":"https://avatars.githubusercontent.com/u/141252?v=3","gravatar_id":"","url":"https://api.github.com/users/fthomas","html_url":"https://github.com/fthomas","followers_url":"https://api.github.com/users/fthomas/followers","following_url":"https://api.github.com/users/fthomas/following{/other_user}","gists_url":"https://api.github.com/users/fthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/fthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fthomas/subscriptions","organizations_url":"https://api.github.com/users/fthomas/orgs","repos_url":"https://api.github.com/users/fthomas/repos","events_url":"https://api.github.com/users/fthomas/events{/privacy}","received_events_url":"https://api.github.com/users/fthomas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-28T19:50:51Z","updated_at":"2015-10-28T19:54:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fthomas/refined/pulls/82","html_url":"https://github.com/fthomas/refined/pull/82","diff_url":"https://github.com/fthomas/refined/pull/82.diff","patch_url":"https://github.com/fthomas/refined/pull/82.patch"},"body":"This adds the `Eval` predicate that takes a `String` singleton type as parameter. The value of that singleton type is a definition of a predicate `T => Boolean` which is parsed and evaluated at compile-time to check if a given value satisfies it. `Eval` allows to define arbitrary predicates without writing `Validate` instances.\r\n\r\nExample usage:\r\n```scala\r\nscala> type IsEven = Eval[W.`\"(x: Int) => x % 2 == 0\"`.T]\r\ndefined type alias IsEven\r\n\r\nscala> val a: Int @@ IsEven = 4\r\na: shapeless.tag.@@[Int,IsEven] = 4\r\n\r\nscala> val b: Int @@ IsEven = 5\r\n<console>:47: error: Predicate failed: (x: Int) => x % 2 == 0.\r\n       val b: Int @@ IsEven = 5\r\n                              ^\r\n```"},"comment":{"url":"https://api.github.com/repos/fthomas/refined/issues/comments/151971459","html_url":"https://github.com/fthomas/refined/pull/82#issuecomment-151971459","issue_url":"https://api.github.com/repos/fthomas/refined/issues/82","id":151971459,"user":{"login":"fthomas","id":141252,"avatar_url":"https://avatars.githubusercontent.com/u/141252?v=3","gravatar_id":"","url":"https://api.github.com/users/fthomas","html_url":"https://github.com/fthomas","followers_url":"https://api.github.com/users/fthomas/followers","following_url":"https://api.github.com/users/fthomas/following{/other_user}","gists_url":"https://api.github.com/users/fthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/fthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fthomas/subscriptions","organizations_url":"https://api.github.com/users/fthomas/orgs","repos_url":"https://api.github.com/users/fthomas/repos","events_url":"https://api.github.com/users/fthomas/events{/privacy}","received_events_url":"https://api.github.com/users/fthomas/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T19:54:54Z","updated_at":"2015-10-28T19:54:54Z","body":"Apparently this is JVM only."}}