Copyright | (c) Sergey Vinokurov 2018 |
---|---|
License | Apache-2.0 (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data SymbolName
- mkSymbolName :: Text -> SymbolName
- mkSymbolNameString :: String -> SymbolName
- mkSymbolNameShortByteString :: ShortByteString -> SymbolName
- mkSymbolNameUnsafe :: Addr# -> SymbolName
- reifySymbol :: WithCallStack => Env -> SymbolName -> (RawValue 'Regular -> a) -> (RawValue 'Pinned -> a) -> IO a
Documentation
data SymbolName Source #
Instances
IsString SymbolName Source # | |
Defined in Data.Emacs.Module.SymbolName.Internal fromString :: String -> SymbolName # | |
Show SymbolName Source # | |
Defined in Data.Emacs.Module.SymbolName.Internal showsPrec :: Int -> SymbolName -> ShowS # show :: SymbolName -> String # showList :: [SymbolName] -> ShowS # | |
Eq SymbolName Source # | |
Defined in Data.Emacs.Module.SymbolName.Internal (==) :: SymbolName -> SymbolName -> Bool # (/=) :: SymbolName -> SymbolName -> Bool # | |
Pretty SymbolName Source # | |
Defined in Data.Emacs.Module.SymbolName.Internal pretty :: SymbolName -> Doc ann # prettyList :: [SymbolName] -> Doc ann # |
mkSymbolName :: Text -> SymbolName Source #
mkSymbolNameUnsafe :: Addr# -> SymbolName Source #
Should be applied to unboxed string literals like this
mkSymbolNameUnsafe "foo"#
Can be safely applied to non-literals (e.g. arbitrary pointers) if it's guaranteed that address points to a null-terminated strings. Otherwise behaviour is undefined.
The string literal must only contain ASCII symbols. This condition is required by the Emacs API and results in undefined behaviour if violated.
reifySymbol :: WithCallStack => Env -> SymbolName -> (RawValue 'Regular -> a) -> (RawValue 'Pinned -> a) -> IO a Source #