flatbuffers-0.1.0.0: Haskell implementation of the FlatBuffers protocol.

Safe HaskellNone
LanguageHaskell2010

FlatBuffers.Internal.Compiler.TH

Synopsis

Documentation

(~>) :: Type -> Type -> Type infixr 1 Source #

Helper method to create function types. ConT ''Int ~> ConT ''String === Int -> String

data Options Source #

Options to control how/which flatbuffers constructors/accessor should be generated.

Options can be set using record syntax on defaultOptions with the fields below.

defaultOptions { compileAllSchemas = True }

Constructors

Options 

Fields

  • includeDirectories :: [FilePath]

    Directories to search for includes (same as flatc -I option).

  • compileAllSchemas :: Bool

    Generate code not just for the root schema, but for all schemas it includes as well (same as flatc --gen-all option).

Instances
Eq Options Source # 
Instance details

Defined in FlatBuffers.Internal.Compiler.TH

Methods

(==) :: Options -> Options -> Bool #

(/=) :: Options -> Options -> Bool #

Show Options Source # 
Instance details

Defined in FlatBuffers.Internal.Compiler.TH

defaultOptions :: Options Source #

Default flatbuffers options:

Options
  { includeDirectories = []
  , compileAllSchemas = False
  }

mkFlatBuffers :: FilePath -> Options -> Q [Dec] Source #

Generates constructors and accessors for all data types declared in the given flatbuffers schema whose namespace matches the current module.

namespace Data.Game;

table Monster {}
{-# LANGUAGE TemplateHaskell #-}

module Data.Game where

import FlatBuffers

$(mkFlatBuffers "schemas/game.fbs" defaultOptions)

intLitP :: Integral i => i -> Pat Source #

intLitE :: Integral i => i -> Exp Source #

realLitE :: Real i => i -> Exp Source #

app :: [Exp] -> Exp Source #

Applies a function to multiple arguments. Assumes the list is not empty.