Last active
August 29, 2015 14:08
-
-
Save tkellogg/b881e3d81889b2440381 to your computer and use it in GitHub Desktop.
This file contains 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
module Test.Main where | |
import Debug.Trace | |
import Data.Char | |
import Data.String | |
parse [] = [] | |
-- Error: unexpected "'" | |
parse ('h':cs) = cs | |
parse (c:cs) = c:c:cs | |
main = "hello world" # toCharArray # parse # fromCharArray # trace | |
This file contains 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
module Test.Main where | |
import Debug.Trace | |
import Data.Char | |
import Data.String | |
parse [] = [] | |
parse (c:cs) = c:c:cs | |
-- is there a simpler way of writing this? | |
main = trace (fromCharArray (parse (toCharArray "hello world"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment