Timeline for How to resolve an issue with overloading operators in haskell?
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 7, 2016 at 15:58 | vote | accept | CommunityBot | ||
| Mar 7, 2016 at 13:35 | comment | added | chi | There's no operator overloading in Haskell. You can only add new instances to typeclasses, with similar consequences. | |
| Mar 7, 2016 at 4:14 | comment | added | jamshidh | You can import Prelude hiding (+), but this is considered bad form. See below for another way. | |
| Mar 7, 2016 at 4:14 | history | edited | Chris Martin | CC BY-SA 3.0 | deleted 19 characters in body |
| Mar 7, 2016 at 4:13 | comment | added | user5960886 | @jamshidh So how can I tell the complier when adding these data types it should use the Main.+ or do I have to go MyFloat (a,b) Main.+ MyFloat (b,c) each time? | |
| Mar 7, 2016 at 4:12 | answer | added | jamshidh | timeline score: 3 | |
| Mar 7, 2016 at 4:11 | comment | added | jamshidh | The error is that you have defined your own (+) operator, which conflicts with the standard one from the prelude.... | |
| Mar 7, 2016 at 4:08 | history | asked | user5960886 | CC BY-SA 3.0 |