neko-lib-0.0.1.0: Neko VM code generation and disassembly library

Copyright(c) Petr Penzin 2015
LicenseBSD2
Maintainerpenzin.dev@gmail.com
Stabilityexperimental
Portabilitycross-platform
Safe HaskellSafe
LanguageHaskell98

Binary.Neko.Hashtbl

Description

A minimal support for Binary.Neko hashtable type needed for working with tables of fields

Synopsis

Documentation

type Hashtbl = Map Word32 String Source #

A minimal hashtable type. Binary.Neko supports hashing of all types, but we will focus on strings, since those are necessary for assembly and disassembly

hash :: String -> Word32 Source #

Binary.Neko hash_field function

empty :: Hashtbl Source #

Create an empty Hashtbl, wrapper for corresponding Map function

member :: Word32 -> Hashtbl -> Bool Source #

Check whether there is a member for a given key, wrapper for corresponding Map function

memberString :: String -> Hashtbl -> Bool Source #

Check whether there is a member for a given value

insertString :: String -> Hashtbl -> Hashtbl Source #

Insert a string to Hashtbl

lookup :: Word32 -> Hashtbl -> Maybe String Source #

Lookup a value by its key, wrapper for corresponding Map function

toList :: Hashtbl -> [(Word32, String)] Source #

Convert entire Hashtbl ot a list of key-value pairs, wrapper for corresponding Map function

fromStringList :: [String] -> Hashtbl Source #

Convert a list of strings into a Hashtbl, generating hash values for them

elems :: Hashtbl -> [String] Source #

Get a list of elements (values) in the Hashtbl, wrapper for corresponding Map function