{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Language.Dickinson.Unique ( Unique (..)
, UniqueCtx
, dummyUnique
) where
import Control.DeepSeq (NFData)
import Data.Binary (Binary (..))
import Data.Data (Data)
import Prettyprinter (Pretty)
newtype Unique = Unique { Unique -> Int
unUnique :: Int }
deriving (Unique -> Unique -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Unique -> Unique -> Bool
$c/= :: Unique -> Unique -> Bool
== :: Unique -> Unique -> Bool
$c== :: Unique -> Unique -> Bool
Eq, Eq Unique
Unique -> Unique -> Bool
Unique -> Unique -> Ordering
Unique -> Unique -> Unique
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 :: Unique -> Unique -> Unique
$cmin :: Unique -> Unique -> Unique
max :: Unique -> Unique -> Unique
$cmax :: Unique -> Unique -> Unique
>= :: Unique -> Unique -> Bool
$c>= :: Unique -> Unique -> Bool
> :: Unique -> Unique -> Bool
$c> :: Unique -> Unique -> Bool
<= :: Unique -> Unique -> Bool
$c<= :: Unique -> Unique -> Bool
< :: Unique -> Unique -> Bool
$c< :: Unique -> Unique -> Bool
compare :: Unique -> Unique -> Ordering
$ccompare :: Unique -> Unique -> Ordering
Ord, forall ann. [Unique] -> Doc ann
forall ann. Unique -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [Unique] -> Doc ann
$cprettyList :: forall ann. [Unique] -> Doc ann
pretty :: forall ann. Unique -> Doc ann
$cpretty :: forall ann. Unique -> Doc ann
Pretty, Unique -> ()
forall a. (a -> ()) -> NFData a
rnf :: Unique -> ()
$crnf :: Unique -> ()
NFData, Get Unique
[Unique] -> Put
Unique -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
putList :: [Unique] -> Put
$cputList :: [Unique] -> Put
get :: Get Unique
$cget :: Get Unique
put :: Unique -> Put
$cput :: Unique -> Put
Binary, Int -> Unique -> ShowS
[Unique] -> ShowS
Unique -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Unique] -> ShowS
$cshowList :: [Unique] -> ShowS
show :: Unique -> String
$cshow :: Unique -> String
showsPrec :: Int -> Unique -> ShowS
$cshowsPrec :: Int -> Unique -> ShowS
Show, Typeable Unique
Unique -> DataType
Unique -> Constr
(forall b. Data b => b -> b) -> Unique -> Unique
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Unique -> u
forall u. (forall d. Data d => d -> u) -> Unique -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Unique
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unique -> c Unique
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Unique)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Unique)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Unique -> m Unique
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Unique -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Unique -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> Unique -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Unique -> [u]
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unique -> r
gmapT :: (forall b. Data b => b -> b) -> Unique -> Unique
$cgmapT :: (forall b. Data b => b -> b) -> Unique -> Unique
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Unique)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Unique)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Unique)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Unique)
dataTypeOf :: Unique -> DataType
$cdataTypeOf :: Unique -> DataType
toConstr :: Unique -> Constr
$ctoConstr :: Unique -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Unique
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Unique
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unique -> c Unique
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Unique -> c Unique
Data)
dummyUnique :: Unique
dummyUnique :: Unique
dummyUnique = Int -> Unique
Unique Int
0
type UniqueCtx = Int