Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
class Marshal a where Source #
A typeclass for providing a uniform API to marshal/unmarshal values between Haskell and Souffle datalog.
The marshalling is done via a stack-based approach, where elements are pushed/popped one by one. You need to make sure that the marshalling of values happens in the correct order or unexpected things might happen (including crashes). Pushing and popping of fields should happen in the same order (from left to right, as defined in Datalog).
Generic implementations for push
and pop
that perform the previously
described behavior are available. This makes it possible to
write very succinct code:
data Edge = Edge String String deriving Generic instance Marshal Edge
Nothing
push :: a -> MarshalM PushF () Source #
Marshals a value to the datalog side.
default push :: (Generic a, SimpleProduct a (Rep a), GMarshal (Rep a)) => a -> MarshalM PushF () Source #
pop :: MarshalM PopF a Source #
Unmarshals a value from the datalog side.
A data type used for serializing a Marshal
-able value
from Haskell to Souffle, only used internally.
A data type used for deserializing a Marshal
-able value
from Souffle to Haskell, only used internally.
The monad used for serializing and deserializing of values that
implement the Marshal
typeclass.