[Haskell-cafe] generic way to construct and deconstruct a newtype

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Tue Mar 1 12:52:55 UTC 2022


If I look at the definition of an unit in dimensional
I have this

angstrom :: (Fractional a) => Unit 'NonMetric DLength a
angstrom = mkUnitQ (ucum "Ao" "Å" "Ångström") 0.1 $ nano meter

metre, meter :: Num a => Unit 'Metric DLength a
metre = mkUnitZ I.nMeter 1 siUnit -- International English.
meter = metre         -- American English.

So it seems thaht I can not differenciate angstrom and metter at the type level.


More information about the Haskell-Cafe mailing list