Re:What I Wish I Knew When Learning Haskell
by CyberDildonics on Saturday April 11, 2020 @10:22AM
(#22841820)
Won't this have to iterate through linked lists and create multiple new heap allocations on each recursive step? Doesn't that imply n log n heap allocations just to sort a list?
[ Parent
| on HN ]
Re:What I Wish I Knew When Learning Haskell
by remcob on Saturday April 11, 2020 @11:29AM
(#22842165)
Yes, but due to lazy-evaluation that won't happen until you do something with the sorted list. Your performance may just blow up in some seemingly unrelated place.
My biggest problem with Haskell is how GC and lazy-evaluation makes it very difficult to reason about what the hardware is actually doing at a given point. I know there ways to inspect and control it, but I've found myself preferring languages that have simpler mental models.
Re:What I Wish I Knew When Learning Haskell
by CyberDildonics on Monday April 13, 2020 @10:46PM
(#22862281)
Right, by the time you have to control it, you are washing away all the advantages for using it.