{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module FFICXX.Generate.Type.PackageInterface where
import qualified Data.HashMap.Strict as HM
import Data.Hashable (Hashable)
import FFICXX.Runtime.CodeGen.Cxx (HeaderName (..))
newtype PackageName = PkgName String deriving (Eq PackageName
Int -> PackageName -> Int
PackageName -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: PackageName -> Int
$chash :: PackageName -> Int
hashWithSalt :: Int -> PackageName -> Int
$chashWithSalt :: Int -> PackageName -> Int
Hashable, Int -> PackageName -> ShowS
[PackageName] -> ShowS
PackageName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageName] -> ShowS
$cshowList :: [PackageName] -> ShowS
show :: PackageName -> String
$cshow :: PackageName -> String
showsPrec :: Int -> PackageName -> ShowS
$cshowsPrec :: Int -> PackageName -> ShowS
Show, PackageName -> PackageName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageName -> PackageName -> Bool
$c/= :: PackageName -> PackageName -> Bool
== :: PackageName -> PackageName -> Bool
$c== :: PackageName -> PackageName -> Bool
Eq, Eq PackageName
PackageName -> PackageName -> Bool
PackageName -> PackageName -> Ordering
PackageName -> PackageName -> PackageName
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: PackageName -> PackageName -> PackageName
$cmin :: PackageName -> PackageName -> PackageName
max :: PackageName -> PackageName -> PackageName
$cmax :: PackageName -> PackageName -> PackageName
>= :: PackageName -> PackageName -> Bool
$c>= :: PackageName -> PackageName -> Bool
> :: PackageName -> PackageName -> Bool
$c> :: PackageName -> PackageName -> Bool
<= :: PackageName -> PackageName -> Bool
$c<= :: PackageName -> PackageName -> Bool
< :: PackageName -> PackageName -> Bool
$c< :: PackageName -> PackageName -> Bool
compare :: PackageName -> PackageName -> Ordering
$ccompare :: PackageName -> PackageName -> Ordering
Ord)
newtype ClassName = ClsName String deriving (Eq ClassName
Int -> ClassName -> Int
ClassName -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ClassName -> Int
$chash :: ClassName -> Int
hashWithSalt :: Int -> ClassName -> Int
$chashWithSalt :: Int -> ClassName -> Int
Hashable, Int -> ClassName -> ShowS
[ClassName] -> ShowS
ClassName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassName] -> ShowS
$cshowList :: [ClassName] -> ShowS
show :: ClassName -> String
$cshow :: ClassName -> String
showsPrec :: Int -> ClassName -> ShowS
$cshowsPrec :: Int -> ClassName -> ShowS
Show, ClassName -> ClassName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassName -> ClassName -> Bool
$c/= :: ClassName -> ClassName -> Bool
== :: ClassName -> ClassName -> Bool
$c== :: ClassName -> ClassName -> Bool
Eq, Eq ClassName
ClassName -> ClassName -> Bool
ClassName -> ClassName -> Ordering
ClassName -> ClassName -> ClassName
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ClassName -> ClassName -> ClassName
$cmin :: ClassName -> ClassName -> ClassName
max :: ClassName -> ClassName -> ClassName
$cmax :: ClassName -> ClassName -> ClassName
>= :: ClassName -> ClassName -> Bool
$c>= :: ClassName -> ClassName -> Bool
> :: ClassName -> ClassName -> Bool
$c> :: ClassName -> ClassName -> Bool
<= :: ClassName -> ClassName -> Bool
$c<= :: ClassName -> ClassName -> Bool
< :: ClassName -> ClassName -> Bool
$c< :: ClassName -> ClassName -> Bool
compare :: ClassName -> ClassName -> Ordering
$ccompare :: ClassName -> ClassName -> Ordering
Ord)
type PackageInterface = HM.HashMap (PackageName, ClassName) HeaderName