units icon indicating copy to clipboard operation
units copied to clipboard

Extract dimensionless quantities?

Open andrevidela opened this issue 2 years ago • 1 comments

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

?

andrevidela avatar Sep 28 '23 14:09 andrevidela

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

goldfirere avatar Oct 03 '23 12:10 goldfirere