Please, help me to write correctly function on Erlang. Function should remove packages (which successfully sent) from the queue. I think it should be like that, but it does not work. Erlang says: illegal pattern on line 3 :(
delete_pkts(AcksList, State) ->
NewSendingList = lists:filter(fun(X) ->
lists:any(fun(E) -> case E of X#internal_packet.message_number -> false; _ -> true end end, AcksList)
end, State#state.pkt_send),
State#state{ pkt_send = NewSendingList }.