-- * Unsafe Type-Coercion from string

-- | Parse a 'ByteString' into an 'IP'.
unsafeIPFromString :: String -> IP
unsafeIPFromString bytes =
    case Safe.readMay bytes of
        Nothing ->
            error $ "'unsafeIPFromBS' was given a malformed value that can't\
                \ be parsed to an IP: " <> toText bytes
        Just ip ->
            ip
unsafeIPFromString :: String -> IP
unsafeIPFromString bytes =
    case Safe.readMay bytes of
        Nothing ->
            error $ "'unsafeIPFromBS' was given a malformed value that can't\
                \ be parsed to an IP: " <> toText bytes
        Just ip ->
            ip
unsafeIPFromString bytes =
    case Safe.readMay bytes of
        Nothing ->
            error $ "'unsafeIPFromBS' was given a malformed value that can't\
                \ be parsed to an IP: " <> toText bytes
        Just ip ->
            ip