clash-lang / ghc-typelits-knownnat

Derive KnownNat constraints from other KnownNat constraints
Other
14 stars 10 forks source link

Implement support for unary arithmetic functions #11

Closed nshepperd closed 7 years ago

nshepperd commented 7 years ago

I wanted a type level logarithm for some experiments, so I've implemented support for unary functions here. Previously, one could make a two-argument function that just didn't make use of its argument, but it looks messier than directly implementing one-argument function.

Also, I added a proptest for it (using QuickCheck) since that seemed easiest, and then some other proptests while I was trying to debug... Whether you want to keep the tests that way is up to you.

nshepperd commented 7 years ago

Wait, do you want the version bumped too? Or I can just add an entry at the top under version HEAD or something, so you can bump the version later.

christiaanb commented 7 years ago

This is fine. Thanks for the PR