[nem-en] an operator for funciton composition?

Ivan A Eryshov ivan.eryshov at gmail.com
Mon May 28 06:46:29 CEST 2007


There is an operator '>>':
<code>
public abstract class Function ['p1, 'r]
{
  public static @>>[B] (fab : 'p1 -> B, fbc : B -> 'r) : 'p1 -> 'r
  {
    a => fbc(fab(a))
  }

  public static @>>[B] (fab : void -> B, fbc : B -> 'r) : void -> 'r
  {
    () => fbc(fab())
  }
...
</code>
But, you should add using Nemerle.Builtins.Function.

On 27/05/07, Kamil Dworakowski <kamil.dworakowski at googlemail.com> wrote:
> Is there a standard operator for function composition? By function
> composition I mean:
>
>  public static Compose['a,'b,'c](f: 'b -> 'c, g: 'a -> 'b): 'a -> 'c
>            x => f(g(x))
>
> -- Kamil Dworakowski
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>



More information about the devel-en mailing list