Created
January 29, 2009 19:57
-
-
Save vito/54708 to your computer and use it in GitHub Desktop.
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
import Data.List (isPrefixOf) | |
(%) :: String -> [String] -> String | |
"" % _ = "" | |
s % xs | "%s" `isPrefixOf` s = next ++ (drop 2 s) % queue | |
| otherwise = (head s) : (tail s) % xs | |
where next = head xs | |
queue = tail xs | |
main = print ("Hello, %s! My name is %s!" % ["World", "Alex"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment