Skip to content

Type-safe from/to helper functions #31

@ppetr

Description

@ppetr

Currently various from.../to... functions work with just [Int]. I'd suggest to:

  1. Return appropriate data types, that is Word8 for to/fromIPv4 and to/fromIPv6b, and Word16 for to/fromIPv6.
  2. Add variants for from/toIPv6 and from/toIPv4 that take/return 4-tuples and 8-tuples instead of lists. This is safer, and it's still possible to efficiently work with such tuples by wrapping them for example with NTup4 / NTup8 which provide Traversable, Applicative etc.

I'll be happy to contribute, if we agree on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions