[Haskell-cafe] PolyKind for Fixed and HasResolution from Data.Fixed
Никита Тимофеев
ndtimofeev at gmail.com
Sun Mar 6 17:29:30 UTC 2016
Hi all!
If we define HasResolution and Fixed like that:
class HasResolution (a :: k) where
resolution :: p a -> Integer
newtype Fixed (a :: k) = Fixed Integer
We can do something like that:
instance KnownNat a => HasResolution a where
resolution = natVal
2.3 :: Fixed 1
--
Timofeev N.D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160306/2c8daebd/attachment.html>
More information about the Haskell-Cafe
mailing list