Skip to content

Instantly share code, notes, and snippets.

@tkellogg
Last active August 29, 2015 14:08
Show Gist options
  • Save tkellogg/b881e3d81889b2440381 to your computer and use it in GitHub Desktop.
Save tkellogg/b881e3d81889b2440381 to your computer and use it in GitHub Desktop.
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
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