2

I've written a Haskell library I would like to include in an iPhone app. It makes heavy use of Haskell's functional abilities, currying, etc. and rewriting in Objective-C would be tough.

Is it possible to automatically translate Haskell to C? or dig out an intermediate C representation from one of the compilers?

Apple's developer agreement forbids statically linking one of the lightweight Haskell interpreters, not that I'm keen on that solution.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
hosiers
  • 39
  • 3
  • 4
    "Apple's developer agreement forbids statically linking one of the lightweight Haskell interpreters" -- Not anymore, I think. The only thing it forbids is running *downloaded* code. However, as long as the code comes from *inside* your app (i.e. it is part of your submission to the App Store), they don't care *how* you execute it. That stupid "only C, C++, Objective-C and ECMAScript" restriction was removed. – Jörg W Mittag Jan 02 '11 at 01:12

3 Answers3

4

http://repetae.net/computer/jhc/ compiles to fairly standard C. It might be possible to use it.

wnoise
  • 9,764
  • 37
  • 47
4

I haven't used it but there is http://projects.haskell.org/ghc-iphone/

Logan Capaldo
  • 39,555
  • 5
  • 63
  • 78
0

Have a look at the ghc-ios project:

http://www.reddit.com/r/haskell/comments/1lboh4/announcing_ghc_ios/

ErikR
  • 51,541
  • 9
  • 73
  • 124