fork(1) download
  1. import Data.Char
  2.  
  3. main = print $ rot13 "How can you tell an extrovert from an"
  4.  
  5. rot13 ""=""
  6. rot13 (c:str)=crot13 c: rot13 str
  7.  
  8. crot13 c
  9. | 'a'>=c && 'z'<=c =chr (aBaseRot+(ord 'a'))
  10. where
  11. aBase=(ord c)-(ord 'a')
  12. aBaseRot= (aBase+13) `mod` 26
  13. | 'A'>=c && 'Z'<c =chr (aBaseRot+(ord 'A'))
  14. where
  15. aBase=(ord c)-(ord 'A')
  16. aBaseRot= (aBase+13) `mod` 26
  17. | otherwise =c
Compilation error #stdin compilation error #stdout 0s 4516KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:13:2: error: parse error on input ‘|’
stdout
Standard output is empty