Dependently typed languages like DML, Epigram, ATS, Coq, Agda or Idris supports these kind of types. Unfortunately it quickly becomes difficult to work with this kind of typing when you introduce more complex properties.
Using the Template Haskell bits have all the disadvantages of Template Haskell - mostly a slower compile. Other than that, I don't see many downsides. As mentioned in the discussion on r/haskell, things get a little tricky when your arguments interact, but if you're okay with uncurrying you can still verify that you've got a sane combination: http://www.reddit.com/r/haskell/comments/3425pk/refinement_t...
It also may require some explicit conversions in places they shouldn't strictly be necessary.
Other than that, I don't see any downsides. There do seem to be a couple similar libraries, but feel free to start using it everywhere :)
11 comments
[ 2.4 ms ] story [ 37.1 ms ] thread(Also, what's up with that &? It doesn't seem to be a Prelude operator.)
If it's from lens, then it's "the flipped version of ($)".
[0] http://qerub.se/ampersand
An example from that paper:
The ATS programming language (http://www.ats-lang.org) is more ML-like than Haskell-like but can have ranged integer types. Something like:It's now in [Data.Function of "base"](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Fu...) and hence in ["base-prelude"](http://hackage.haskell.org/package/base-prelude).
1. there are any disadvantages to using this library
2. there are any comparable libraries that I should/could be using instead (obviously with reasons as to why it's better/worse).
because this sounds great and I now want to start using it everywhere!
It also may require some explicit conversions in places they shouldn't strictly be necessary.
Other than that, I don't see any downsides. There do seem to be a couple similar libraries, but feel free to start using it everywhere :)