Changes between Version 7 and Version 8 of ObjectiveC/ForeignDeclarations


Ignore:
Timestamp:
Apr 23, 2012 5:37:29 AM (3 years ago)
Author:
amarqueslee
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ObjectiveC/ForeignDeclarations

    v7 v8  
    3030 * Export a set of Haskell functions (pertaining to a certain datatype) as a class: 
    3131{{{ 
    32 foreign export constructor objc tycon "<superclass>" <list of initializer> <list of method> 
     32foreign export constructor objc tycon "<superclass> <class>" constructor :: ... -> IO tycon 
    3333}}} 
    34  The Haskell-defined `tycon` would be type-constrained to have certain properties (yet to be specified). `initializer`s are used to provide constructors of the form 
    35 {{{ 
    36 ... -> IO tycon 
    37 }}} 
     34 The Haskell-defined `tycon` would be type-constrained to have certain properties (yet to be specified). 
     35 
    3836 * Export of a method implementation: 
    3937{{{ 
    40 foreign export method objc "<optional header> +/-[<class> <selector>]" varid :: <type> 
     38foreign export method objc "<optional header> +/-[<class> <selector>]" methodid :: <type> 
    4139}}} 
    4240  where 
    4341{{{ 
    44 varid :: ObjCPtr super -> tycon -> ... -> IO (tycon, b) 
     42methodid :: ObjCPtr super -> tycon -> ... -> IO (tycon, b) 
    4543}}} 
    46  This approach would pull in `superclass` as a side-effect, and client code could work with it, for now pretending it's some unrelated class. This should give method implementations an Objective-C feel. 
     44 This approach would provide opaque access to the object's Objective-C representation as an opaque supertype, giving Haskell method implementations an Objective-C feel. 
    4745 
    4846In both of these cases, the underlying structure of the class' datatype - if possible - should be derived from the provided type constructor.