Avoid passing unnecessary dictionaries in Data.Complex
Joachim Breitner
mail at joachim-breitner.de
Sat Mar 15 18:11:12 UTC 2014
Hi,
+1
(stating the obvious)
Greetings,
Joachim
Am Samstag, den 15.03.2014, 00:16 -0400 schrieb Edward Kmett:
> We removed the data type context from Data.Complex some time ago.
>
>
> However, when we did so, we left the rest of the API in that module
> intact.
>
>
> Many of the accessors in that module (should) work with much more
> general types now!
>
>
> e.g.
>
>
> realPart :: Complex a -> a
>
>
> instead of
>
>
> realPart :: RealFloat a => Complex a -> a
>
>
> I propose we stop passing around dictionaries we don't need to methods
> that don't use them.
>
>
> Concretely, I'm proposing we simplify the signatures of the following
> functions, which in the current API all unnecessarily take a RealFloat
> constraint that they don't use.
>
>
> realPart :: Complex a -> a
> imagPart :: Complex a -> a
> conjugate :: Num a => Complex a -> Complex a
> mkPolar :: Floating a => a -> a -> Complex a
> cis :: Floating a => a -> Complex a
>
>
> Discussion Period: 2 weeks
>
>
> -Edward Kmett
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
--
Joachim “nomeata” Breitner
mail at joachim-breitner.de • http://www.joachim-breitner.de/
Jabber: nomeata at joachim-breitner.de • GPG-Key: 0x4743206C
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140315/4902fa07/attachment.sig>
More information about the Libraries
mailing list