Skip to content

a short cut syntax for functional FFI #522

@bobzhang

Description

@bobzhang
[%%bs.ffi                                                                                                                                                                                                        
type 'a u  =                                                                                                                                                                                                     
  <                                                                                                                                                                                                              
         concat : 'self -> 'self ;                                                                                                                                                                                
         append : 'a  -> 'self  [@bs.send "concat"];                                                                                                                                                                                                                                                                                                                                 
  > as 'self                                                                                                                                                                                                                                                                                                                                                                                                                     
]      

which is equivalent to

type 'a u 
external concat : 'a u -> 'a u -> 'a u = "concat" [@@bs.send]
external append : 'a u -> 'a -> 'a u = "concat" [@@bs.send]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions