foundation icon indicating copy to clipboard operation
foundation copied to clipboard

Number things are a bit wonky

Open ndmitchell opened this issue 9 years ago • 6 comments

subtract is not flip (-).

^^ seems a little redundant normally to me, and especially in this new world.

ndmitchell avatar May 09 '16 20:05 ndmitchell

I'm not sure about subtract overall; probably make sense not to export, I have never use it before..

for the power functions, it currently is a bit tricky. I don't think it's possible to get away from exposing the different ones.

vincenthz avatar May 14 '16 17:05 vincenthz

Subtract is useful to get around -1 which is both the subtraction section and an Int literal. It's worth having and should match -.

For power, I rarely use any and the Haskell ones confuse me. But I don't really have and strong opinion.

ndmitchell avatar May 14 '16 17:05 ndmitchell

Just removed subtract, never used, and seems completely trivial to write where needed

I agree about power, need to refine the type and make it less confusing.

vincenthz avatar Jul 21 '16 15:07 vincenthz

I hope we can use this issue for a general discussion on Number. (Starting another issue seems wrong.)

In Foundation things are generally named as they are in Prelude: String, Eq, Array, etc. Yet Number is not Num. What's the reason for this? I find it a bit odd.

I know Number is not exactly Num, but Foundation.String is not exactly Prelude.String either.

snowleopard avatar Aug 17 '16 12:08 snowleopard

I'm open to suggestion and discussion on everything, but one of the reason why it's not Num is sadly Prelude.Num has to leak through foundation because a numeric literal is typed as a Prelude.Num a. This is why there's now Number so that Num can be present too.

vincenthz avatar Aug 17 '16 20:08 vincenthz

@vincenthz Ah, I see, this is sad indeed :-(

snowleopard avatar Aug 17 '16 20:08 snowleopard