summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2013-11-01 10:07:44 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2013-11-01 10:07:44 +0100
commit506cfd8f0c0b99718ea6822d8a52703f0aad2ed6 (patch)
tree8cffb8f59da7efb8a650172991eaae758035fe68
parent9265c8896e1f4195613622edf8300b7c1758a9e4 (diff)
downloadhaskell-506cfd8f0c0b99718ea6822d8a52703f0aad2ed6.tar.gz
Add a couple of `/Since: 4.7.0.0/` annotations
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
-rw-r--r--libraries/base/Data/Typeable.hs2
-rw-r--r--libraries/base/GHC/TypeLits.hs12
-rw-r--r--libraries/base/System/Mem.hs4
3 files changed, 18 insertions, 0 deletions
diff --git a/libraries/base/Data/Typeable.hs b/libraries/base/Data/Typeable.hs
index 15aeccbca3..2f122b9e58 100644
--- a/libraries/base/Data/Typeable.hs
+++ b/libraries/base/Data/Typeable.hs
@@ -105,6 +105,8 @@ cast x = if typeRep (Proxy :: Proxy a) == typeRep (Proxy :: Proxy b)
else Nothing
-- | Extract a witness of equality of two types
+--
+-- /Since: 4.7.0.0/
eqT :: forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT = if typeRep (Proxy :: Proxy a) == typeRep (Proxy :: Proxy b)
then Just $ unsafeCoerce Refl
diff --git a/libraries/base/GHC/TypeLits.hs b/libraries/base/GHC/TypeLits.hs
index 41607c3869..f3ba70e6ef 100644
--- a/libraries/base/GHC/TypeLits.hs
+++ b/libraries/base/GHC/TypeLits.hs
@@ -53,18 +53,24 @@ data Symbol
-- | This class gives the integer associated with a type-level natural.
-- There are instances of the class for every concrete literal: 0, 1, 2, etc.
+--
+-- /Since: 4.7.0.0/
class KnownNat (n :: Nat) where
natSing :: SNat n
-- | This class gives the integer associated with a type-level symbol.
-- There are instances of the class for every concrete literal: "hello", etc.
+--
+-- /Since: 4.7.0.0/
class KnownSymbol (n :: Symbol) where
symbolSing :: SSymbol n
+-- | /Since: 4.7.0.0/
natVal :: forall n proxy. KnownNat n => proxy n -> Integer
natVal _ = case natSing :: SNat n of
SNat x -> x
+-- | /Since: 4.7.0.0/
symbolVal :: forall n proxy. KnownSymbol n => proxy n -> String
symbolVal _ = case symbolSing :: SSymbol n of
SSymbol x -> x
@@ -73,17 +79,23 @@ symbolVal _ = case symbolSing :: SSymbol n of
-- | This type represents unknown type-level natural numbers.
data SomeNat = forall n. KnownNat n => SomeNat (Proxy n)
+ -- ^ /Since: 4.7.0.0/
-- | This type represents unknown type-level symbols.
data SomeSymbol = forall n. KnownSymbol n => SomeSymbol (Proxy n)
+ -- ^ /Since: 4.7.0.0/
-- | Convert an integer into an unknown type-level natural.
+--
+-- /Since: 4.7.0.0/
someNatVal :: Integer -> Maybe SomeNat
someNatVal n
| n >= 0 = Just (withSNat SomeNat (SNat n) Proxy)
| otherwise = Nothing
-- | Convert a string into an unknown type-level symbol.
+--
+-- /Since: 4.7.0.0/
someSymbolVal :: String -> SomeSymbol
someSymbolVal n = withSSymbol SomeSymbol (SSymbol n) Proxy
diff --git a/libraries/base/System/Mem.hs b/libraries/base/System/Mem.hs
index d46e67e780..3674dcb224 100644
--- a/libraries/base/System/Mem.hs
+++ b/libraries/base/System/Mem.hs
@@ -26,7 +26,11 @@ performGC :: IO ()
performGC = performMajorGC
-- | Triggers an immediate garbage collection.
+--
+-- /Since: 4.7.0.0/
foreign import ccall "performMajorGC" performMajorGC :: IO ()
-- | Triggers an immediate minor garbage collection.
+--
+-- /Since: 4.7.0.0/
foreign import ccall "performGC" performMinorGC :: IO ()