elm / elm-lang.org

Server and client code for the Elm website.
http://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
1.99k stars 365 forks source link

docs for radians function #713

Open Ahrengot opened 7 years ago

Ahrengot commented 7 years ago

http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#radians

I stumpled on this while trying to implement the Haversine formula for a distance calculator. Looking at the source, it looks like radians is a function that just return whatever float you give it https://github.com/elm-lang/core/blob/14c737397c76ce1ea16c15009943ad56fa9e4b6d/src/Basics.elm#L67

I think this is more of a question than a bug, but can someone elaborate on purpose of this? When would you need something like this? In any case I think it would be helpful to add another line or two in the docs that explain what this is for, because when I stumpled on the description I sure was confused :)

radians : Float -> Float Convert radians to standard Elm angles (radians).

Sorry if I'm just being obtuse here. That's really not the goal.

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

ybakos commented 7 years ago

@Ahrengot +1

downloadpizza commented 5 years ago

I would say its for better self documentation, you could also see them as type annotations, so you have type degrees and type radians angle = radians 3.14 or angle = degrees 180 is more obvious than angle = 3.14

ybakos commented 5 years ago

@Gabgab2003 Thanks. Created a PR for the documentation on this.

https://github.com/elm/core/pull/1040

downloadpizza commented 5 years ago

@ybakos Thank you, hope it gets merged. I like the explanation in the PR :)