Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@lukexi /NSObject+HSInit.m secret
Last active Dec 21, 2015

#import <Foundation/Foundation.h>
extern void hs_init (int *argc, char **argv[]);
extern void hs_exit (void);
@interface NSObject (HSInit)
@implementation NSObject (HSInit)
+ (void)load {
hs_init(NULL, NULL);
schell commented Dec 16, 2013

What would the matching Haskell code look like? I'm not familiar with FFI.

schell commented Dec 16, 2013

Nvm! I played with it and figured it out! Thanks for your work!

Just so others know - hs_init and hs_exit are already defined for you somewhere and they init and tear down the RTS, respectively.

This link helped me figure things out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.