byteverse / haskell-ip

IP Address implementation
Other
20 stars 19 forks source link

Use wide-word Word128 for IPv6 implementation? #50

Closed dhess closed 5 years ago

dhess commented 5 years ago

wide-word's Word128 implements quite a few more canonical typeclass instances than ip's internal IPv6 implementation. It would be nice to get some of these "for free" by wrapping it in a newtype.

I've taken a first pass at this in https://github.com/hackworthltd/haskell-ip/commit/bcc16b6da4051c2e9d7a52e7938a6733937f5444. It's not ready for a PR yet as it needs to be cleaned up a bit, but it does pass all tests and has comparable, perhaps even slightly better performance than the current implementation.

Before I invest any more time in this, is it something you'd be interested in?

chessai commented 5 years ago

@dhess I'm a fan of wide-word so I'm in favour. If @andrewthad also is then I think this would have the greenlight.

andrewthad commented 5 years ago

Behold! The rare package providing 128-bit words that isn’t garbage. I just took a look at wide-word, and I think it’s a solid foundation to build on top of. I’m +1 on switching to using this library.

chessai commented 5 years ago

@andrewthad I showed you that package a few months ago. I'm glad you like it still upon rediscovery.

Anyway @dhess we welcome this.

dhess commented 5 years ago

Cool. I’ll have something later this weekend.

dhess commented 5 years ago

OK, please see #52

dhess commented 5 years ago

Closed by 0742cd48f5a49a0e8718f6eb559c70d5192ac799.