Printer.hs 215 Bytes
Newer Older
1
2
3
4
module Printer
    (validateId)
where

5
6
import Data.Char

7
validateId :: String -> String
Philipp Meyer's avatar
Philipp Meyer committed
8
validateId "" = ""
9
10
validateId (x:xs) = (if isAlpha x then x else '_') :
        map (\c -> if isAlphaNum c then c else '_') xs