summaryrefslogtreecommitdiff
path: root/docs/users_guide/exts/static_pointers.rst
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-11-21 18:50:40 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-11-23 00:57:53 +0100
commitf3a62e2acda1c4b316e0a390227c90018ff2c299 (patch)
tree45b183959e81af8a62fbcfe8801eaaba0d3c610a /docs/users_guide/exts/static_pointers.rst
parent742d8b6049c30f3b0cd1704d7a34d865bef41712 (diff)
downloadhaskell-wip/misc-fix.tar.gz
Misc cleanupwip/misc-fix
* Remove `getTag_RDR` (unused), `tidyKind` and `tidyOpenKind` (already available as `tidyType` and `tidyOpenType`) * Remove Note [Explicit Case Statement for Specificity]. Since 0a709dd9876e40 we require GHC 8.10 for bootstrapping. * Change the warning to `cmpAltCon` to a panic. This shouldn't happen. If it ever does, the code was wrong anyway: it shouldn't always return `LT`, but rather `LT` in one case and `GT` in the other case. * Rename `verifyLinearConstructors` to `verifyLinearFields` * Fix `Note [Local record selectors]` which was not referenced * Remove vestiges of `type +v` * Minor fixes to StaticPointers documentation, part of #15603
Diffstat (limited to 'docs/users_guide/exts/static_pointers.rst')
-rw-r--r--docs/users_guide/exts/static_pointers.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/users_guide/exts/static_pointers.rst b/docs/users_guide/exts/static_pointers.rst
index e142b14be2..d6f5e55a73 100644
--- a/docs/users_guide/exts/static_pointers.rst
+++ b/docs/users_guide/exts/static_pointers.rst
@@ -51,18 +51,18 @@ All of the following are permissible: ::
inc :: Int -> Int
inc x = x + 1
- ref1 = static 1
+ ref1 = static 'a'
ref2 = static inc
ref3 = static (inc 1)
ref4 = static ((\x -> x + 1) (1 :: Int))
- ref5 y = static (let x = 1 in x)
- ref6 y = let x = 1 in static x
+ ref5 = static (let x = 'a' in x)
+ ref6 = let x = 'a' in static x
While the following definitions are rejected: ::
ref7 y = let x = y in static x -- x is not closed
ref8 y = static (let x = 1 in y) -- y is not let-bound
- ref8 (y :: a) = let x = undefined :: a
+ ref9 (y :: a) = let x = undefined :: a
in static x -- x has a non-closed type
.. note::
@@ -99,7 +99,7 @@ expression is overloaded to allow lifting a ``StaticPtr`` into another
type implicitly, via the ``IsStatic`` class: ::
class IsStatic p where
- fromStaticPtr :: StaticPtr a -> p a
+ fromStaticPtr :: Typeable a => StaticPtr a -> p a
The only predefined instance is the obvious one that does nothing: ::
@@ -111,7 +111,7 @@ See :base-ref:`GHC.StaticPtr.IsStatic`.
Furthermore, type ``t`` is constrained to have a ``Typeable`` instance.
The following are therefore illegal: ::
- static show -- No Typeable instance for (Show a => a -> String)
+ static id -- No Typeable instance for (a -> a)
static Control.Monad.ST.runST -- No Typeable instance for ((forall s. ST s a) -> a)
That being said, with the appropriate use of wrapper datatypes, the