Skip to content

Instantly share code, notes, and snippets.

@mchakravarty
Created January 25, 2013 07:42
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchakravarty/4632567 to your computer and use it in GitHub Desktop.
Save mchakravarty/4632567 to your computer and use it in GitHub Desktop.
Example of how inline Objective-C in Haskell might look like.
dumpURL :: String -> IO ()
dumpURL urlString
= do
{ urlData <- $objc 'urlString [cstm| {
return [NSString stringWithContentsOfURL: [NSURL urlWithString: urlString]
encoding: NSUTF8StringEncoding
error: NULL];
} |]
; putStr urlData
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment