Copyright | (C) 2012-2016 University of Twente 2017 Myrtle Software Ltd 2018 Google Inc. |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Utility functions to generate Primitives
Synopsis
- generatePrimMap :: HasCallStack => [UnresolvedPrimitive] -> [(Text, PrimitiveGuard ())] -> [FilePath] -> IO ResolvedPrimMap
- hashCompiledPrimMap :: CompiledPrimMap -> Int
- constantArgs :: Text -> CompiledPrimitive -> Set Int
- decodeOrErr :: (HasCallStack, FromJSON a) => FilePath -> ByteString -> a
Documentation
:: HasCallStack | |
=> [UnresolvedPrimitive] | unresolved primitives found in annotations (in LoadModules and LoadInterfaceFiles) |
-> [(Text, PrimitiveGuard ())] | |
-> [FilePath] | Directories to search for primitive definitions |
-> IO ResolvedPrimMap |
Generate a set of primitives that are found in the primitive definition files in the given directories.
hashCompiledPrimMap :: CompiledPrimMap -> Int Source #
Hash a compiled primitive map. It needs a separate function (as opposed to
just hash
) as it might contain (obviously unhashable) Haskell functions. This
function takes the hash value stored with the function instead.
constantArgs :: Text -> CompiledPrimitive -> Set Int Source #
Determine what argument should be constant / literal
:: (HasCallStack, FromJSON a) | |
=> FilePath | Path read from (for error message) |
-> ByteString | Bytestring to parse |
-> a |
Parse a ByteString according to the given JSON template. Throws exception if it fails.