| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
ZM.Types
- module Data.Model.Types
- type AbsTypeModel = TypeModel Identifier Identifier (ADTRef AbsRef) AbsRef
- type AbsType = Type AbsRef
- data AbsRef = AbsRef (SHAKE128_48 AbsADT)
- absRef :: Flat r => r -> AbsRef
- type AbsADT = ADT Identifier Identifier (ADTRef AbsRef)
- type AbsEnv = TypeEnv Identifier Identifier (ADTRef AbsRef) AbsRef
- data ADTRef r
- getADTRef :: ADTRef a -> Maybe a
- asIdentifier :: String -> Validation Errors Identifier
- data Identifier
- data UnicodeLetter = UnicodeLetter Char
- data UnicodeLetterOrNumberOrLine = UnicodeLetterOrNumberOrLine Char
- data UnicodeSymbol = UnicodeSymbol Char
- data SHA3_256_6 a = SHA3_256_6 Word8 Word8 Word8 Word8 Word8 Word8
- data SHAKE128_48 a = SHAKE128_48 Word8 Word8 Word8 Word8 Word8 Word8
- data NonEmptyList a
- = Elem a
- | Cons a (NonEmptyList a)
- nonEmptyList :: [a] -> NonEmptyList a
- data Word7
- data FlatEncoding = FlatEncoding
- data UTF8Encoding = UTF8Encoding
- data UTF16LEEncoding = UTF16LEEncoding
- data NoEncoding = NoEncoding
- type TypedDecoded a = Either TypedDecodeException a
- data TypedDecodeException
- class NFData a
- class Flat a
- data ZigZag a = ZigZag a
- data LeastSignificantFirst a = LeastSignificantFirst a
- data MostSignificantFirst a = MostSignificantFirst a
- data Value = Value {}
- data Label a label = Label a (Maybe label)
- label :: (Functor f, Ord k) => Map k a -> (a -> l) -> f k -> f (Label k l)
Model
module Data.Model.Types
type AbsTypeModel = TypeModel Identifier Identifier (ADTRef AbsRef) AbsRef Source #
An absolute type model, an absolute type and its associated environment
type AbsType = Type AbsRef Source #
An absolute type, a type identifier that depends only on the definition of the type
A reference to an absolute data type definition, in the form of a hash of the data type definition itself data AbsRef = AbsRef (SHA3_256_6 AbsADT) deriving (Eq, Ord, Show, NFData, Generic, Flat)
Constructors
| AbsRef (SHAKE128_48 AbsADT) |
type AbsADT = ADT Identifier Identifier (ADTRef AbsRef) Source #
An absolute data type definition, a definition that refers only to other absolute definitions
type AbsEnv = TypeEnv Identifier Identifier (ADTRef AbsRef) AbsRef Source #
An environments of absolute types
A reference inside an ADT to another ADT
Constructors
| Var Word8 | Variable, standing for a type |
| Rec | Recursive reference to the ADT itself |
| Ext r | Reference to another ADT |
Instances
| Functor ADTRef Source # | |
| Foldable ADTRef Source # | |
| Traversable ADTRef Source # | |
| Eq r => Eq (ADTRef r) Source # | |
| Ord r => Ord (ADTRef r) Source # | |
| Show r => Show (ADTRef r) Source # | |
| Generic (ADTRef r) Source # | |
| NFData r => NFData (ADTRef r) Source # | |
| Flat r => Flat (ADTRef r) Source # | |
| Model a => Model (ADTRef a) Source # | |
| type Rep (ADTRef r) Source # | |
asIdentifier :: String -> Validation Errors Identifier Source #
Validate a string as an Identifier
>>>asIdentifier ""Failure ["identifier cannot be empty"]
>>>asIdentifier "Id_1"Success (Name (UnicodeLetter 'I') [UnicodeLetterOrNumberOrLine 'd',UnicodeLetterOrNumberOrLine '_',UnicodeLetterOrNumberOrLine '1'])
>>>asIdentifier "a*^"Failure ["In a*^: '*' is not an Unicode Letter or Number or a _","In a*^: '^' is not an Unicode Letter or Number or a _"]
>>>asIdentifier "<>"Success (Symbol (Cons (UnicodeSymbol '<') (Elem (UnicodeSymbol '>'))))
data Identifier Source #
An Identifier, the name of an ADT
Constructors
| Name UnicodeLetter [UnicodeLetterOrNumberOrLine] | |
| Symbol (NonEmptyList UnicodeSymbol) |
data UnicodeLetter Source #
A character that is included in one of the following Unicode classes: UppercaseLetter LowercaseLetter TitlecaseLetter ModifierLetter OtherLetter
Constructors
| UnicodeLetter Char |
data UnicodeLetterOrNumberOrLine Source #
A character that is either a UnicodeLetter, a UnicodeNumber or the special character '_'
Constructors
| UnicodeLetterOrNumberOrLine Char |
Instances
data UnicodeSymbol Source #
A character that is included in one of the following Unicode classes: MathSymbol CurrencySymbol ModifierSymbol OtherSymbol
Constructors
| UnicodeSymbol Char |
data SHA3_256_6 a Source #
A hash of a value, the first 6 bytes of the value's SHA3-256 hash
Instances
| Eq (SHA3_256_6 a) Source # | |
| Ord (SHA3_256_6 a) Source # | |
| Show (SHA3_256_6 a) Source # | |
| Generic (SHA3_256_6 a) Source # | |
| NFData (SHA3_256_6 a) Source # | |
| Flat (SHA3_256_6 a) Source # | |
| Model a => Model (SHA3_256_6 a) Source # | |
| type Rep (SHA3_256_6 a) Source # | |
data SHAKE128_48 a Source #
A hash of a value, the first 48 bits (6 bytes) of the value's SHAKE128 hash
Instances
| Eq (SHAKE128_48 a) Source # | |
| Ord (SHAKE128_48 a) Source # | |
| Show (SHAKE128_48 a) Source # | |
| Generic (SHAKE128_48 a) Source # | |
| NFData (SHAKE128_48 a) Source # | |
| Flat (SHAKE128_48 a) Source # | |
| Model a => Model (SHAKE128_48 a) Source # | |
| type Rep (SHAKE128_48 a) Source # | |
data NonEmptyList a Source #
A list that contains at least one element
Constructors
| Elem a | |
| Cons a (NonEmptyList a) |
Instances
| Functor NonEmptyList Source # | |
| Foldable NonEmptyList Source # | |
| Traversable NonEmptyList Source # | |
| Eq a => Eq (NonEmptyList a) Source # | |
| Ord a => Ord (NonEmptyList a) Source # | |
| Show a => Show (NonEmptyList a) Source # | |
| Generic (NonEmptyList a) Source # | |
| NFData a => NFData (NonEmptyList a) Source # | |
| Flat a => Flat (NonEmptyList a) Source # | |
| Model a => Model (NonEmptyList a) Source # | |
| type Rep (NonEmptyList a) Source # | |
nonEmptyList :: [a] -> NonEmptyList a Source #
Convert a list to a NonEmptyList, returns an error if the list is empty
A 7 bits unsigned integer data Word7 = V0 .. V127
Encodings
Exceptions
type TypedDecoded a = Either TypedDecodeException a Source #
data TypedDecodeException Source #
An exception thrown if the decoding of a type value fails
Constructors
| UnknownMetaModel AbsType | |
| WrongType | |
Fields
| |
| DecodeError DecodeException | |
Other Re-exports
A class of types that can be fully evaluated.
Since: 1.1.0.0
Instances
| NFData Bool | |
| NFData Char | |
| NFData Double | |
| NFData Float | |
| NFData Int | |
| NFData Int8 | |
| NFData Int16 | |
| NFData Int32 | |
| NFData Int64 | |
| NFData Integer | |
| NFData Word | |
| NFData Word8 | |
| NFData Word16 | |
| NFData Word32 | |
| NFData Word64 | |
| NFData CallStack | Since: 1.4.2.0 |
| NFData TypeRep | NOTE: Only defined for Since: 1.4.0.0 |
| NFData () | |
| NFData TyCon | NOTE: Only defined for Since: 1.4.0.0 |
| NFData Natural | Since: 1.4.0.0 |
| NFData Void | Since: 1.4.0.0 |
| NFData Version | Since: 1.3.0.0 |
| NFData Unique | Since: 1.4.0.0 |
| NFData ThreadId | Since: 1.4.0.0 |
| NFData ExitCode | Since: 1.4.2.0 |
| NFData CChar | Since: 1.4.0.0 |
| NFData CSChar | Since: 1.4.0.0 |
| NFData CUChar | Since: 1.4.0.0 |
| NFData CShort | Since: 1.4.0.0 |
| NFData CUShort | Since: 1.4.0.0 |
| NFData CInt | Since: 1.4.0.0 |
| NFData CUInt | Since: 1.4.0.0 |
| NFData CLong | Since: 1.4.0.0 |
| NFData CULong | Since: 1.4.0.0 |
| NFData CLLong | Since: 1.4.0.0 |
| NFData CULLong | Since: 1.4.0.0 |
| NFData CFloat | Since: 1.4.0.0 |
| NFData CDouble | Since: 1.4.0.0 |
| NFData CPtrdiff | Since: 1.4.0.0 |
| NFData CSize | Since: 1.4.0.0 |
| NFData CWchar | Since: 1.4.0.0 |
| NFData CSigAtomic | Since: 1.4.0.0 |
| NFData CClock | Since: 1.4.0.0 |
| NFData CTime | Since: 1.4.0.0 |
| NFData CUSeconds | Since: 1.4.0.0 |
| NFData CSUSeconds | Since: 1.4.0.0 |
| NFData CFile | Since: 1.4.0.0 |
| NFData CFpos | Since: 1.4.0.0 |
| NFData CJmpBuf | Since: 1.4.0.0 |
| NFData CIntPtr | Since: 1.4.0.0 |
| NFData CUIntPtr | Since: 1.4.0.0 |
| NFData CIntMax | Since: 1.4.0.0 |
| NFData CUIntMax | Since: 1.4.0.0 |
| NFData All | Since: 1.4.0.0 |
| NFData Any | Since: 1.4.0.0 |
| NFData Fingerprint | Since: 1.4.0.0 |
| NFData SrcLoc | Since: 1.4.2.0 |
| NFData ShortByteString | |
| NFData ByteString | |
| NFData ByteString | |
| NFData IntSet | |
| NFData Filler | |
| NFData QualName | |
| NFData Name | |
| NFData Doc | |
| NFData TextDetails | |
| NFData LocalTime | |
| NFData ZonedTime | |
| NFData UTCTime | |
| NFData NominalDiffTime | |
| NFData Day | |
| NFData UniversalTime | |
| NFData DiffTime | |
| NFData NoEncoding # | |
| NFData FlatEncoding # | |
| NFData UTF16LEEncoding # | |
| NFData UTF8Encoding # | |
| NFData Value # | |
| NFData UnicodeSymbol # | |
| NFData UnicodeLetter # | |
| NFData UnicodeLetterOrNumberOrLine # | |
| NFData Identifier # | |
| NFData AbsRef # | |
| NFData TypedBLOB # | |
| NFData a => NFData [a] | |
| NFData a => NFData (Maybe a) | |
| NFData a => NFData (Ratio a) | |
| NFData (Ptr a) | Since: 1.4.2.0 |
| NFData (FunPtr a) | Since: 1.4.2.0 |
| NFData a => NFData (Identity a) | Since: 1.4.0.0 |
| NFData a => NFData (Min a) | Since: 1.4.2.0 |
| NFData a => NFData (Max a) | Since: 1.4.2.0 |
| NFData a => NFData (First a) | Since: 1.4.2.0 |
| NFData a => NFData (Last a) | Since: 1.4.2.0 |
| NFData m => NFData (WrappedMonoid m) | Since: 1.4.2.0 |
| NFData a => NFData (Option a) | Since: 1.4.2.0 |
| NFData a => NFData (NonEmpty a) | Since: 1.4.2.0 |
| NFData (Fixed a) | Since: 1.3.0.0 |
| NFData a => NFData (Complex a) | |
| NFData (StableName a) | Since: 1.4.0.0 |
| NFData a => NFData (ZipList a) | Since: 1.4.0.0 |
| NFData a => NFData (Dual a) | Since: 1.4.0.0 |
| NFData a => NFData (Sum a) | Since: 1.4.0.0 |
| NFData a => NFData (Product a) | Since: 1.4.0.0 |
| NFData a => NFData (First a) | Since: 1.4.0.0 |
| NFData a => NFData (Last a) | Since: 1.4.0.0 |
| NFData (IORef a) | NOTE: Only strict in the reference and not the referenced value. Since: 1.4.2.0 |
| NFData a => NFData (Down a) | Since: 1.4.0.0 |
| NFData (MVar a) | NOTE: Only strict in the reference and not the referenced value. Since: 1.4.2.0 |
| NFData a => NFData (Digit a) | |
| NFData a => NFData (Node a) | |
| NFData a => NFData (Elem a) | |
| NFData a => NFData (FingerTree a) | |
| NFData a => NFData (IntMap a) | |
| NFData a => NFData (Tree a) | |
| NFData a => NFData (Seq a) | |
| NFData a => NFData (Set a) | |
| NFData (Context a) | |
| NFData (Digest a) | |
| NFData a => NFData (DList a) | |
| NFData a => NFData (PostAligned a) | |
| NFData a => NFData (PreAligned a) | |
| NFData (Get a) | |
| NFData a => NFData (Hashed a) | |
| NFData ref => NFData (Type ref) | |
| NFData r => NFData (TypeN r) | |
| NFData name => NFData (TypeRef name) | |
| NFData a => NFData (Doc a) | |
| NFData a => NFData (AnnotDetails a) | |
| NFData a => NFData (HashSet a) | |
| NFData a => NFData (Vector a) | |
| NFData (Vector a) | |
| NFData (Vector a) | |
| NFData (Vector a) | |
| NFData a => NFData (NonEmptyList a) # | |
| NFData a => NFData (List a) # | |
| NFData r => NFData (ADTRef r) # | |
| NFData (SHAKE128_48 a) # | |
| NFData (SHA3_256_6 a) # | |
| NFData a => NFData (TypedValue a) # | |
| NFData encoding => NFData (BLOB encoding) # | |
| NFData (a -> b) | This instance is for convenience and consistency with Since: 1.3.0.0 |
| (NFData a, NFData b) => NFData (Either a b) | |
| (NFData a, NFData b) => NFData (a, b) | |
| (NFData a, NFData b) => NFData (Array a b) | |
| (NFData a, NFData b) => NFData (Arg a b) | Since: 1.4.2.0 |
| NFData (Proxy k a) | Since: 1.4.0.0 |
| NFData (STRef s a) | NOTE: Only strict in the reference and not the referenced value. Since: 1.4.2.0 |
| (NFData k, NFData a) => NFData (Map k a) | |
| (NFData ref, NFData name) => NFData (ConTree name ref) | |
| (NFData k, NFData v) => NFData (HashMap k v) | |
| (NFData k, NFData v) => NFData (Leaf k v) | |
| NFData (MVector s a) | |
| NFData (MVector s a) | |
| NFData (MVector s a) | |
| (NFData label, NFData a) => NFData (Label a label) # | |
| (NFData a, NFData b, NFData c) => NFData (a, b, c) | |
| NFData a => NFData (Const k a b) | Since: 1.4.0.0 |
| (NFData consName, NFData ref, NFData name) => NFData (ADT name consName ref) | |
| NFData b => NFData (Tagged k s b) | |
| (NFData a, NFData b, NFData c, NFData d) => NFData (a, b, c, d) | |
| (NFData adtName, NFData inRef, NFData consName, NFData exRef) => NFData (TypeModel adtName consName inRef exRef) | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData (a1, a2, a3, a4, a5) | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData (a1, a2, a3, a4, a5, a6) | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData (a1, a2, a3, a4, a5, a6, a7) | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8) => NFData (a1, a2, a3, a4, a5, a6, a7, a8) | |
| (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8, NFData a9) => NFData (a1, a2, a3, a4, a5, a6, a7, a8, a9) | |
Class of types that can be encoded/decoded
Instances
| Flat Filler | Use a special encoding for the filler |
| Flat Sign # | |
| Flat Bit # | |
| Flat Bits11 # | |
| Flat Bits23 # | |
| Flat Bits52 # | |
| Flat Bits8 # | |
| Flat NoEncoding # | |
| Flat FlatEncoding # | |
| Flat UTF16LEEncoding # | |
| Flat UTF8Encoding # | |
| Flat Value # | |
| Flat UnicodeSymbol # | |
| Flat UnicodeLetter # | |
| Flat UnicodeLetterOrNumberOrLine # | |
| Flat Identifier # | |
| Flat AbsRef # | |
| Flat TypedBLOB # | |
| Flat [UnicodeLetterOrNumberOrLine] # | |
| Flat a => Flat (PostAligned a) | |
| Flat a => Flat (PreAligned a) | |
| Flat a => Flat (NonEmptyList a) # | |
| Flat a => Flat (List a) # | |
| Flat a => Flat (MostSignificantFirst a) # | |
| Flat a => Flat (LeastSignificantFirst a) # | |
| Flat a => Flat (ZigZag a) # | |
| Flat r => Flat (ADTRef r) # | |
| Flat (SHAKE128_48 a) # | |
| Flat (SHA3_256_6 a) # | |
| Flat a => Flat (TypedValue a) # | |
| Flat encoding => Flat (BLOB encoding) # | |
| (Flat label, Flat a) => Flat (Label a label) # | |
ZigZag encoding, map signed integers to unsigned integers Positive integers are mapped to even unsigned values, negative integers to odd values: 0 -> 0, -1 -> 1, 1 -> 2, -2 -> 3, 2 -> 4 ...
Constructors
| ZigZag a |
data LeastSignificantFirst a Source #
Constructors
| LeastSignificantFirst a |
Instances
| Eq a => Eq (LeastSignificantFirst a) Source # | |
| Ord a => Ord (LeastSignificantFirst a) Source # | |
| Show a => Show (LeastSignificantFirst a) Source # | |
| Generic (LeastSignificantFirst a) Source # | |
| Flat a => Flat (LeastSignificantFirst a) Source # | |
| Model a => Model (LeastSignificantFirst a) Source # | |
| type Rep (LeastSignificantFirst a) Source # | |
data MostSignificantFirst a Source #
Constructors
| MostSignificantFirst a |
Instances
| Eq a => Eq (MostSignificantFirst a) Source # | |
| Ord a => Ord (MostSignificantFirst a) Source # | |
| Show a => Show (MostSignificantFirst a) Source # | |
| Generic (MostSignificantFirst a) Source # | |
| Flat a => Flat (MostSignificantFirst a) Source # | |
| Model a => Model (MostSignificantFirst a) Source # | |
| type Rep (MostSignificantFirst a) Source # | |
A generic value (used for dynamic decoding)
Constructors
| Value | |
An optionally labeled value
Instances
| (Eq label, Eq a) => Eq (Label a label) Source # | |
| (Ord label, Ord a) => Ord (Label a label) Source # | |
| (Show label, Show a) => Show (Label a label) Source # | |
| Generic (Label a label) Source # | |
| (NFData label, NFData a) => NFData (Label a label) Source # | |
| (Flat label, Flat a) => Flat (Label a label) Source # | |
| type Rep (Label a label) Source # | |
Orphan instances
| (Flat a, Flat b) => Flat [(a, Type b)] Source # | |
| Flat a => Flat [Type a] Source # | |
| Flat a => Flat (Type a) Source # | |
| Flat a => Flat (TypeRef a) Source # | |
| Model a => Model (PostAligned a) Source # | |
| Model a => Model (Type a) Source # | |
| Model a => Model (TypeRef a) Source # | |
| (Flat a, Flat b) => Flat (ConTree a b) Source # | |
| (Model a, Model b) => Model (ConTree a b) Source # | |
| (Flat a, Flat b, Flat c) => Flat (ADT a b c) Source # | |
| (Model a, Model b, Model c) => Model (ADT a b c) Source # | |
| (Flat adtName, Flat consName, Flat inRef, Flat exRef, Ord exRef) => Flat (TypeModel adtName consName inRef exRef) Source # | |
| (Model adtName, Model consName, Model inRef, Model exRef) => Model (TypeModel adtName consName inRef exRef) Source # | |