{-# OPTIONS_GHC -Wno-orphans     #-}
module Test.Ouroboros.Network.Orphans () where


import Data.Hashable (Hashable (hashWithSalt), hashUsing)
import Data.IP qualified as IP
import Data.Word (Word16)

import Network.Socket (PortNumber)


instance Hashable IP.IPv4
instance Hashable IP.IPv6
instance Hashable IP.IP

instance Hashable PortNumber where
  hashWithSalt :: Int -> PortNumber -> Int
hashWithSalt Int
salt PortNumber
pn =
    (PortNumber -> Word16) -> Int -> PortNumber -> Int
forall b a. Hashable b => (a -> b) -> Int -> a -> Int
hashUsing (PortNumber -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral :: PortNumber -> Word16) Int
salt PortNumber
pn