Created
          March 18, 2010 11:20 
        
      - 
      
 - 
        
Save astanin/336267 to your computer and use it in GitHub Desktop.  
    Upside down
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env runhaskell | |
| > import Data.Char (toLower) | |
| Once @malfet wrote: uʍop ǝpısdn ǝʇıɹʍ oʇ pǝsn ǝq uɐɔ sloqɯʎs sɔıʇǝuoɥd. | |
| Indeed, there are upside-down pairs for most of the lower-case letters. | |
| Only 'j' is a problem. | |
| > abc = [ ('a', 'ɐ'), ('b', 'q'), ('c', 'ɔ'), ('d', 'p'), ('e', 'ə') | |
| > , ('f', 'ɟ'), ('g', 'ɓ'), ('h', 'ɥ'), ('i', 'ᴉ'), ('j', 'f') | |
| > , ('k', 'ʞ'), ('l', 'ʅ'), ('m', 'ɯ'), ('n', 'u'), ('o', 'o') | |
| > , ('p', 'd'), ('q', 'b'), ('r', 'ɹ'), ('s', 's'), ('t', 'ʇ') | |
| > , ('u', 'n'), ('v', 'ʌ'), ('w', 'ʍ'), ('x', 'x'), ('y', 'ʎ') | |
| > , ('z', 'z') ] | |
| So let's make a unix filter out of this alphabet: | |
| > main = interact $ unlines . | |
| > map (map ((\c -> maybe c id (lookup c abc)) . toLower) . reverse) . | |
| > reverse . lines | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment