fogfish/m_http

Support ISO lens and ADT

fogfish opened this issue · 0 comments

Content parsing is implemented with individual lenses

[m_http ||
   ...
   A < lens:at(<<"a">>),
   B < lens:at(<<"b">>),
   C < lens:at(<<"c">>),
   cats:unit(#adt{a = A, b = B, c = C})
]

Usage of product lens lens:p make is efficient

[m_http ||
   ...
   P < lens:p([ lens:at(<<"a">>),  lens:at(<<"b">>),  lens:at(<<"c">>)]),
]

but then we do not have an ability apply lens:iso or build adt. Easy syntax is required.

Maybe

[m_http ||
   ...
   _ < lens:p([ lens:at(<<"a">>),  lens:at(<<"b">>),  lens:at(<<"c">>)]),
   cats:unit( ?struct(adt, _) )
]