In Elixir/Erlang one can do this kind of pattern matching / deconstruction over binaries and bitstrings:
def func1(my_data) do
<<
1,
44,
a::little-32,
b::little-64,
c,
d::64-little,
e::32-little-float,
rest::binary
>> = my_data
# using a, b, c, d, e, rest
end
I've not found a way to do that in Haskell. Is there any out of the box capacity of Haskell? Or will utilizing some third-party library be required?