nikita-volkov / refined

Refinement types with static checking
http://hackage.haskell.org/package/refined
MIT License
182 stars 31 forks source link

Make predicates unary instead of nullary #12

Closed treeowl closed 5 years ago

treeowl commented 6 years ago

There's really no good reason to have undefined lurking everywhere, waiting for someone to seq the wrong thing. I think vanilla predicates should generally have a single constructor.

treeowl commented 6 years ago

Proxy passing is another option.

chessai commented 6 years ago

I've thought about both of these options, and I like the first one for being less clutter, and not unsafe.

treeowl commented 6 years ago

I guess the main questions are how it plays with the Template Haskell and with user-defined predicates. I haven't looked into that closely.

On Thu, Jun 14, 2018, 6:17 PM chessai notifications@github.com wrote:

I've thought about both of these options, and I like the first one for being less clutter, and not unsafe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nikita-volkov/refined/issues/12#issuecomment-397455277, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzi_dxCv9kUwa0fN_5bGT8UinzxuHdWks5t8uECgaJpZM4UocW5 .

treeowl commented 5 years ago

Thanks!