nickcowle / HCollections

Type-safe heterogeneous collections for F#
MIT License
6 stars 4 forks source link

Adding HList.split and HListT.split #10

Open JackMatusiewicz opened 4 years ago

JackMatusiewicz commented 4 years ago

Needed these for something. Whilst it can be achieved using the TypeList.split and then doing it manually I thought it might be nice to add them to the API to reduce the amount of clutter you need to write yourself.

I've opted to make another crate for the Cons case, as opposed to using the crate that is already part of the implementation. For HListT this makes sense, as we want the crate to hold different things. For the HList I decided to create a separate crate to keep the implementation separate from the function, meaning a change to how we store HLists won't involve a major version number change.

Names are probably awful, better suggestions are welcome! I've also added some basic tests but happy to add more if you think there is a case missing