[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 0/4]: mllib: Add 'may' function, and refactoring.



On Tue, Nov 10, 2015 at 08:25:54PM +0000, Richard W.M. Jones wrote:
> The 'may' function is a higher-order function (HOF) that replaces:
> 
>   match x with
>   | None -> ()
>   | Some x -> f x
> 
> with:
> 
>   may f x

Another possibility is to break from lablgtk and call the
function 'maybe', as in:

  g#set_trace trace;
  g#set_verbose verbose;
  maybe g#set_identifier identifier;

?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]