-module(hd).
-record(c,{c}).
-export([hd/2,y/1]).
hd(_,_) ->
    [[X+hd()+?MODULE:hd()||X<-hd()]||_<-[]].

hd() ->
    case c of
        c -> X = c;
        _ -> X = [fun hd/0,y(c)]
    end,
    fun(Y)->Y+1 end.

%% @doc `y' returns a lambda
y(X) ->
    fun(Y)->X=(#c{c=c})#c.c end.

