interface Encode : (Type -> Type) -> Type -> Type -> Type
Interface for encoding values to a target monoid type.
The `Encode` interface allows converting LLVM IR data structures
to their string representations or other monoid types suitable
for serialization or pretty-printing.
@ m The monad to encode within
@ a The source type to encode
@ b The target type
Parameters: m, a, b
Constraints: Monad m
Methods:
encode : a -> m b
Convert a value to its encoded representation
Implementation: String -> VString
encode : Encode m a b => a -> m b
Convert a value to its encoded representation
Visibility: public exportinterface EncodeIn : Type -> (Type -> Type) -> Type -> Type -> Type
Interface for encoding values to a target monoid type.
The `Encode` interface allows converting LLVM IR data structures
to their string representations or other monoid types suitable
for serialization or pretty-printing.
@ m The monad to encode within
@ a The source type to encode
@ b The target type
Parameters: context, m, a, b
Constraints: Monad m
Methods:
encodeIn : context -> a -> m b
Implementation: String -> VString
encodeIn : EncodeIn context m a b => context -> a -> m b
- Visibility: public export
data VString : Type
Value string wrapper for LLVM IR string output.
A newtype wrapper around String that provides specialized
monoid operations for building LLVM IR text with proper spacing.
Totality: total
Visibility: public export
Constructor: MkVString : String -> VString
Hints:
Encode Identity String VString
Encode Identity Nat VString
Encode ATM Linkage VString
Encode ATM DLLStorage VString
Encode ATM ThreadLocality VString
Encode ATM Preemption VString
Encode ATM AddressSpace VString
Encode ATM CallingConvention VString
Encode ATM Visibility VString
Encode ATM Name VString
Encode ATM LTypeF VString
Encode ATM SymbolInfo VString
Encode ATM LType VString
Encode ATM a VString => Encode ATM (WithType a) VString
Encode ATM AddressInfo VString
Encode ATM LTag VString
Encode ATM Metadata VString
Encode ATM LExpr VString
Encode ATM GVarDef VString
Encode ATM Attribute VString
Encode ATM CaseBranch VString
Encode ATM InvokeCall VString
Encode ATM Wrapping VString
Encode ATM UnaryOpcode VString
Encode ATM BinaryOpcode VString
Encode ATM BrCall VString
Encode ATM CatchSwitch VString
Encode ATM FastMathFlag VString
Encode ATM TailCall VString
Encode ATM FnCall VString
Encode ATM Terminator VString
Encode ATM ConversionOpCode VString
Encode ATM VectorOpcode VString
Encode ATM AggregateOpcode VString
Encode ATM MiscOpcode VString
Encode ATM AtomicOrder VString
Encode ATM MemoryOpcode VString
Encode ATM CatchClause VString
Encode ATM ExceptOpcode VString
Encode ATM LOperation VString
Encode ATM LStatement VString
Encode ATM Block VString
Encode ATM FunctionArgSpec VString
Encode ATM FunctionDef VString
Encode ATM FunctionDec VString
Encode ATM Alias VString
Encode ATM IFunc VString
Encode ATM AttributeGroupDef VString
Encode ATM LClause VString
Encode ATM LModule VString
FromString VString
Monoid VString
Semigroup VString
Show VString
Walk String VString
Walk VString String
(<++>) : VString -> VString -> VString
Concatenate VString values without inserting spaces
Visibility: public export
Fixity Declaration: infixl operator, level 8intercalate : Monoid b => b -> List b -> b
Intercalate a list of monoid values with a separator.
Joins a list of monoid values with the given separator between them,
similar to the standard library's intercalate but for any monoid.
@ sep The separator to insert between elements
@ xs The list of values to join
Visibility: public exportwriteIf : Monoid b => (a -> b) -> Maybe a -> b
Conditionally apply a function based on Maybe value.
If the Maybe value is Nothing, returns the monoid neutral element.
If it's Just x, applies the function to x.
@ f The function to apply to the value
@ mx The Maybe value to check
Visibility: public exportprefixed : Monoid m => m -> m -> m
Add a prefix to a monoid value.
Returns a function that prepends the given prefix to its argument.
@ p The prefix to add
Visibility: public exportsuffixed : Monoid m => m -> m -> m
Add a suffix to a monoid value.
Returns a function that appends the given suffix to its argument.
@ s The suffix to add
Visibility: public exportseperated : Encode Identity a VString => VString -> List a -> Identity VString
Join a list of encodable values with a separator.
Encodes each value in the list and joins them with the given separator.
@ sep The separator string to use between elements
@ vs The list of values to encode and join
Visibility: public exportspaced : Encode Identity a VString => List a -> Identity VString
Join a list of encodable values with space separation
Visibility: public exportspaced' : List VString -> VString
Join a list of VString values with space separation
Visibility: public exportvshow : Show a => a -> VString
Convert Show instances to VString
Convenience function that combines show and go to create VString values
from any type with a Show instance.
Visibility: public exportencode' : Encode Identity a VString => a -> Identity VString
Type-specialized encoding function
Convenience function with explicit VString return type.
Visibility: public exporttoVString : String -> VString
Convert String to VString (redundant with go)
Visibility: public exportinterface EncodeIO : Type -> (Type -> Type) -> Type -> Type -> Type
- Parameters: e, m, a, b
Constraints: Show e, MonadIO e m, Encode m a b
Methods:
encodeIO : a -> IO (Either e b)
Implementation: String -> VString
encodeIO : EncodeIO e m a b => a -> IO (Either e b)
- Visibility: public export