You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The labels in Salsa are handled like the following:
-- Type level label
data WriteLine_
-- Term level label
_WriteLine = undefined :: WriteLine_
-- Functions for invoking methods with '#'
_writeLine args target = invoke target _WriteLine args
_writeLine_ target = invoke target _WriteLine ()
This could ideally be simplified. Upper case labels (the most common convention in .net) can be supported on both the type level and term level by simply:
data WriteLine = WriteLine
Lower case (allowed in .Net as far as I know) can supported on the term level easily enough using the undefined notation though not on the type level. This is probably ok to give it some arbitrary prefix since these are very uncommon by convention:
data X_foo
foo = undefined :: X_foo
As for the invoke wrappers, these could potentially be dropped if the use of '#' as in infix operator in it's current form is not continued. The problem is that we would end up having:
Console # WriteLine "hello"
which really means:
Console # (WriteLine "hello")
Since we can't bind higher than function application, and end up trying to come up with a quick solution:
Console # WriteLine $ "hello"
Though this might not be the ideal solution. Maybe a tuple should be used, but at which end is this to be? From an oop straight from .Net perspective, the object method arg syntax does have merit. On the other hand, it feels some what more natural in a functional setting to to treat the function/method as more first class, i.e.
WriteLine # (Console, "hello")
Finally, without the invoke wrappers and changing the meaning of '#' to be more than reverse application, means that we may need 2 or more operators for both static and instance invocation (though cannot confirm). Any thoughts on syntax are greatly appreciated..
The text was updated successfully, but these errors were encountered:
The labels in Salsa are handled like the following:
This could ideally be simplified. Upper case labels (the most common convention in .net) can be supported on both the type level and term level by simply:
Lower case (allowed in .Net as far as I know) can supported on the term level easily enough using the undefined notation though not on the type level. This is probably ok to give it some arbitrary prefix since these are very uncommon by convention:
As for the invoke wrappers, these could potentially be dropped if the use of '#' as in infix operator in it's current form is not continued. The problem is that we would end up having:
which really means:
Since we can't bind higher than function application, and end up trying to come up with a quick solution:
Though this might not be the ideal solution. Maybe a tuple should be used, but at which end is this to be? From an oop straight from .Net perspective, the object method arg syntax does have merit. On the other hand, it feels some what more natural in a functional setting to to treat the function/method as more first class, i.e.
Finally, without the invoke wrappers and changing the meaning of '#' to be more than reverse application, means that we may need 2 or more operators for both static and instance invocation (though cannot confirm). Any thoughts on syntax are greatly appreciated..
The text was updated successfully, but these errors were encountered: