Your functions don't return anything. Try this:
Public Sub Map(Of T)(ByVal a As IEnumerable(Of T), ByVal f As Action(T))
For Each i As T In a
f(i)
Next
End Sub
Public Sub alert(ByVal a As Object)
MessageBox.Show(a)
End Sub
Above is based on the methods from the question. An actual traditional Map()
function might look more like this:
Public Iterator Function Map(Of T)(ByVal a As IEnumerable(Of T), ByVal f As Func(Of T,T)) As IEnumerable(Of T)
For Each i As T In a
Yield f(i)
Next
End Function
Or this:
Public Iterator Function Map(Of T, U)(ByVal a As IEnumerable(Of T), ByVal f As Func(Of T, U)) As IEnumerable(Of U)
For Each i As T In a
Yield f(i)
Next
End Function