goldfirere / units

The home of the units Haskell package
94 stars 19 forks source link

Extract dimensionless quantities? #70

Open andrevidela opened 9 months ago

andrevidela commented 9 months ago

I've got some code that performs a division that removes all dimensions

a :: Mass SI n
b :: Mass SI n
c :: Qu '[] SI n
c = a |/| b

I need to extract this n for further processing by another library. Would it make sense to add

extract :: Qu '[] l n -> n
extract = coerce

?

goldfirere commented 9 months ago

Looks reasonable to me. Please do submit a PR! Thanks.