Re: Functional operators in Nemerle
От: Don Reba Канада https://stackoverflow.com/users/49329/don-reba
Дата: 23.03.14 22:40
Оценка: 3 (1)
You don't even need a macro. |> is already a function in the standard library, defined like this:

public static @|> (a : 'p1, fac : 'p1 -> 'r) : 'r
{
    fac(a)
}
public static @|> (a : 'p1, fac : 'p1 -> void) : void
{
    fac(a)
}


There are also <<, >>, and <|. You can find them all in lib/internal-numbered.n.
Ce n'est que pour vous dire ce que je vous dis.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.