A couple minor possible simplifications
ianmackenzie opened this issue · comments
Hey Erkal, it was great to see this project - one of the largest/most complex apps I've seen using elm-geometry
! Looks like you've used quite a bit of different functionality from a range of modules too, which is cool too see.
A couple very minor things I noticed when browsing through the code:
- In
Main.elm
, I thinkfromEdgeMidpointToLabelMidpoint
can be simplified slightly - you should be able to replaceDirection2d.toVector |> Vector2d.scaleBy labelDistance
with justVector2d.withLength labelDistance
. (Direction2d.toVector
is there as an escape hatch but there are usually nicer approaches.) - In
edgeIdsIntersectiongLineSegment
inGraphFile.elm
, it should be possible to replace thecase
expression inside theintersects
function with justLineSegment2d.intersectionPoint l1 l2 /= Nothing
.
Would love to hear about things that you found difficult or awkward when using the package, or any annoying functionality gaps - either here or as new feature requests on the elm-geometry
repo. Let me know!
Hi Ian, thank you for the beautiful comments!
I did the two changes that you said, thanks.
I find elm-geometry
really great. It made my life better.
The API is great. It makes my code much more readable.
I've also learned a lot from your Elm Europe talk.
I don't have anything else to say about the library other than "Thank you". :)