logoalt Hacker News

orf11/08/20241 replyview on HN

Write the full transform in Haskell?


Replies

itishappy11/08/2024

    {-# LANGUAGE OverloadedStrings #-}

    import Prelude hiding (putStrLn)
    import Data.Text (Text, replace)
    import Data.Text.IO (putStrLn)

    transform :: Text -> Text
    transform = replace "k" "sk" . replace "ke" "-ki" 

    main :: IO ()
    main = putStrLn $ transform "Haskell"
show 2 replies