{-# OPTIONS_GHC -fno-warn-orphans #-}
module StrongPath.Instances where
import Data.Hashable
import StrongPath.FilePath
import StrongPath.Types
instance Hashable (Path s b t) where
hashWithSalt :: Int -> Path s b t -> Int
hashWithSalt Int
salt = Int -> FilePath -> Int
forall a. Hashable a => Int -> a -> Int
hashWithSalt Int
salt (FilePath -> Int) -> (Path s b t -> FilePath) -> Path s b t -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Path s b t -> FilePath
forall s b t. Path s b t -> FilePath
toFilePath
instance Ord (Path s b t) where
compare :: Path s b t -> Path s b t -> Ordering
compare Path s b t
p1 Path s b t
p2 = FilePath -> FilePath -> Ordering
forall a. Ord a => a -> a -> Ordering
compare (Path s b t -> FilePath
forall s b t. Path s b t -> FilePath
toFilePath Path s b t
p1) (Path s b t -> FilePath
forall s b t. Path s b t -> FilePath
toFilePath Path s b t
p2)