tag:blogger.com,1999:blog-2844521419334459144.post4566443591465848336..comments2023-06-30T06:45:52.513-07:00Comments on Muad`Dib: Somewhat Pointfree Haskell Huffman TreeMuad`Dibhttp://www.blogger.com/profile/01896828471974774438noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2844521419334459144.post-2387429630287452912008-11-09T09:28:00.000-08:002008-11-09T09:28:00.000-08:00Sorry, that should have been (&&&) ins...Sorry, that should have been (&&&) instead of (***).<BR/><BR/>((+1) &&& (+2)) 3 ===> (4,5)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2844521419334459144.post-71745207884677645872008-11-09T08:46:00.000-08:002008-11-09T08:46:00.000-08:00Interesting code! Apologies if you already know al...Interesting code! Apologies if you already know all this:<BR/><BR/>The onFst and (&) functions are already available in the Control.Arrow module, where they're called first and (***) respectively. They're for general arrows, but the instances on (->) are pretty handy:<BR/><BR/>import Control.Arrow<BR/>first (+1) (1, 5) ===> (2,5)<BR/>((+1) *** (+2)) (8,4) ===> (9,6)<BR/><BR/>IMHO, it's always good to avoid having to invent your own names & documentation for utility functions like this.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2844521419334459144.post-86060044777258699872008-11-09T06:53:00.000-08:002008-11-09T06:53:00.000-08:00Nice. Just a small nit pick. It doesn't really mak...Nice. Just a small nit pick. It doesn't really make sense to talk about doing a depth first search in a Huffman tree because all data is stored in the leaves. Hence there is no data that is stored deeper or more shallow than the other. The function you call "depthFirstTraversal" would be more aptly named "leftRightTraversal".Josefhttps://www.blogger.com/profile/13272830598221833253noreply@blogger.com