tag:blogger.com,1999:blog-7956560213437381210.post5458862632538030146..comments2022-12-01T04:12:24.788-08:00Comments on Code Miscellany: ROT13 in Haskelltautologicohttp://www.blogger.com/profile/03658701069636639534noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7956560213437381210.post-2945796599299138042008-01-22T16:40:00.000-08:002008-01-22T16:40:00.000-08:00Sorry, I know this post is a bit old, but you happ...Sorry, I know this post is a bit old, but you happen to be the first result on Google for "rot13 haskell" just now. =)<BR/><BR/>Let me suggest this replacement for rotchar above (all the other local bindings look sane enough):<BR/>rotchar c = fromMaybe c (lookup c transp)<BR/>This definition has the advantage that it doesn't change non-alpha characters into '#'. =) ("fromMaybe" is just a convenient wrapper for "maybe" that's defined in Data.Maybe.)<BR/><BR/>~dAnonymousnoreply@blogger.com