mvv/data-checked — pull request #1 by josuf107 (2014-02-07 17:56:19+00:00)
Title: Harden Checked, simplify property type, and add some combinators

Hello,

My name is Joseph. I recently wrote a library (https://github.com/josuf107/Condition) that I then realized was extremely similar to your data-checked library. My changes allow libraries to control who can create a Checked value by exporting properties and their underlying data types but not their underlying data constructors. e.g.:
```
module Evens (Even, isEven, showEven, double, timesEven) where

import Data.Checked

data Even = Even

isEven :: Integral n => Property Even n
isEven = property even

showEven :: Show n => Checked Even n -> String
showEven = show . checked

double :: Integral n => n -> Checked Even n
double n = trustThat Even (n * 2)

timesEven :: Integral n => n -> Checked Even n -> Checked Even n
timesEven a = preserving Even (*a)
```
A client importing Evens can only construct a Checked Even by using Data.Check.check or Evens.double, both of which actually guarantee evenness.

The combinators allow expressing more complex properties:
```
module SmallEvens (Small, small, showSmallEven, showSmallOrEven) where

import Evens
import Data.Checked

data Small = Small

small :: (Num n, Ord n) => Property Small n
small = property (<100)

showSmallEven :: Show n => Checked (I Small Even) n -> String
showSmallEven = show . checked

showSmallOrEven :: Show n => Checked (U Small Even) n -> String
showSmallOrEven = show . checked
```

A client importing SmallEvens can do

```
fmap showSmallOrEven (check (small ~|| isEven) 2) -- Just "2"
fmap showSmallOrEven (check (small ~|| isEven) 3) -- Just "3"
fmap showSmallOrEven (check (small ~|| isEven) 100) -- Just "100"
fmap showSmallOrEven (check (small ~|| isEven) 101) -- Nothing
```
etc.

Anyway, if I should just branch off that's okay, but it seemed like you hadn't touched the code for awhile so I thought I'd check if you'd like to merge.