Re:Data structures and algorithms I actually used while work...
by eru on Saturday July 18, 2020 @04:32AM
(#23879997)
Oh, that version takes exponential time to compute. The one-liner I gave computes up to the n-th Fibonacci number in linear time.
[ Parent
| on HN ]
Re:Data structures and algorithms I actually used while work...
by exdsq on Saturday July 18, 2020 @07:00AM
(#23880520)
Your version is definitely more performant, but the three liner is just a bit nicer to read (especially for beginners) :)
Re:Data structures and algorithms I actually used while work...
by eru on Saturday July 18, 2020 @07:54AM
(#23880764)
Yes. It depends on what you want to show. Your version shows how to define functions and some simple pattern matching.
Re:Data structures and algorithms I actually used while work...
by exdsq on Tuesday July 21, 2020 @03:40AM
(#23905047)
Having worked with Haskell for a year now I still can't read much more than functions and pattern matching! :D