ONC-RPC-0.2: ONC RPC (aka Sun RPC) and XDR library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.ONCRPC.XDR.Generate

Description

Generate Haskell code from XDR descriptions as per RFC4506 and RPC extensions from RFC5531

Synopsis

Documentation

generate :: MonadFail m => GenerateOptions -> String -> ByteString -> m String Source #

Parse an XDR specification and generate pretty-printed Haskell source string, or fail on error. The String argument provides a description of the input to use in parse errors.

generateModule :: MonadFail m => GenerateOptions -> String -> ByteString -> m (Module ()) Source #

Parse an XDR specification and generate a Haskell module, or fail on error. The String argument provides a description of the input to use in parse errors.

data ReidentOptions Source #

How to generate Haskell identifiers from XDR in order to confirm to Haskell's lexical rules and ensure uniqueness.

Constructors

ReidentOptions 

Fields

  • reidentUpperPrefix, reidentLowerPrefix :: String

    Prefix to use to make an identifier a different case if necessary, e.g. "_" for lower-case, or "XDR_" for upper case (default empty: just changes the first character, possibly resulting in names like "nFS_NULL")

  • reidentJoinField, reidentJoinProcedure :: Maybe String

    Prefix fields with their type name (or program, version name) and this string (necessary for most XDR files), or Nothing to use only the field name (or procedure name), which assumes uniqueness across the file (e.g., if you wrote the file yourself, though often safe for procedures only) (default Just "'")

data GenerateOptions Source #

Options for generating Haskell code

Constructors

GenerateOptions 

Fields