morley-1.20.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Michelson.Typed.Haskell.Doc

Description

Documentation of types appearing in contracts.

Synopsis

Documentation

type ADTRep a = [ConstructorRep a] Source #

Stands for representation of some Haskell ADT corresponding to Michelson value. Type parameter a is what you put in place of each field of the datatype, e.g. information about field type.

This representation also includes descriptions of constructors and fields.

data ConstructorRep a Source #

Representation of a constructor with an optional description.

Constructors

ConstructorRep 

data FieldRep a Source #

Representation of a field with an optional description.

Constructors

FieldRep 

frNameL :: forall a. Lens' (FieldRep a) (Maybe Text) Source #

frTypeRepL :: forall a a. Lens (FieldRep a) (FieldRep a) a a Source #

newtype WithinParens Source #

Whether given text should be rendered grouped in parentheses (if they make sense).

Constructors

WithinParens Bool 

class (Typeable a, SingI (TypeDocFieldDescriptions a), FieldDescriptionsValid (TypeDocFieldDescriptions a) a) => TypeHasDoc a where Source #

Description for a Haskell type appearing in documentation.

Generic-deriving instance produces a custom error when Generic is missing:

>>> data Foo = Foo () deriving TypeHasDoc
...
... GHC.Generics.Rep Foo
... is stuck. Likely
... Generic Foo
... instance is missing or out of scope.
...
>>> data Foo = Foo () deriving Generic
>>> instance TypeHasDoc Foo where typeDocMdDescription = "Foo"
...
... No instance for (IsoValue Foo)
...
>>> data Foo = Foo () deriving (Generic, IsoValue)
>>> instance TypeHasDoc Foo where typeDocMdDescription = "Foo"

Minimal complete definition

typeDocMdDescription

Associated Types

type TypeDocFieldDescriptions a :: FieldDescriptions Source #

Description of constructors and fields of a.

See FieldDescriptions documentation for an example of usage.

Descriptions will be checked at compile time to make sure that only existing constructors and fields are referenced.

For that check to work instance Generic a is required whenever TypeDocFieldDescriptions is not empty.

For implementation of the check see FieldDescriptionsValid type family.

Methods

typeDocName :: Proxy a -> Text Source #

Name of type as it appears in definitions section.

Each type must have its own unique name because it will be used in identifier for references.

Default definition derives name from Generics. If it does not fit, consider defining this function manually. (We tried using Data.Data for this, but it produces names including module names which is not do we want).

typeDocMdDescription :: Markdown Source #

Explanation of a type. Markdown formatting is allowed.

typeDocMdReference :: Proxy a -> WithinParens -> Markdown Source #

How reference to this type is rendered, in Markdown.

Examples:

  • [Integer](#type-integer),
  • [Maybe](#type-Maybe) [()](#type-unit).

Consider using one of the following functions as default implementation; which one to use depends on number of type arguments in your type:

If none of them fits your purposes precisely, consider using customTypeDocMdReference.

typeDocDependencies :: Proxy a -> [SomeDocDefinitionItem] Source #

All types which this type directly contains.

Used in automatic types discovery.

typeDocHaskellRep :: TypeDocHaskellRep a Source #

For complex types - their immediate Haskell representation.

For primitive types set this to Nothing.

For homomorphic types use homomorphicTypeDocHaskellRep implementation.

For polymorphic types consider using concreteTypeDocHaskellRep as implementation.

Modifier haskellRepNoFields can be used to hide names of fields, beneficial for newtypes.

Use haskellRepAdjust or haskellRepMap for more involved adjustments.

Also, consider defining an instance of TypeHasFieldNamingStrategy instead of defining this method -- the former can be used downstream, e.g. in lorentz, for better naming consistency.

typeDocMichelsonRep :: TypeDocMichelsonRep a Source #

Final michelson representation of a type.

For homomorphic types use homomorphicTypeDocMichelsonRep implementation.

For polymorphic types consider using concreteTypeDocMichelsonRep as implementation.

Instances

Instances details
TypeHasDoc ByteString Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc MText Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Operation Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc EpAddress Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Address Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc ChainId Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Mutez Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Timestamp Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc KeyHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc PublicKey Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Signature Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Chest Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc ChestKey Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Integer Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Natural Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc () Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc Bool Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

PolyCTypeHasDocC '[a] => TypeHasDoc (Set a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

PolyTypeHasDocC '[cp] => TypeHasDoc (ContractRef cp) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

PolyTypeHasDocC '[a] => TypeHasDoc (Ticket a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

PolyTypeHasDocC '[a] => TypeHasDoc (Maybe a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

PolyTypeHasDocC '[a] => TypeHasDoc [a] Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

PolyTypeHasDocC '[l, r] => TypeHasDoc (Either l r) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

(PolyCTypeHasDocC '[k], PolyTypeHasDocC '[v], Ord k) => TypeHasDoc (Map k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (Map k v) :: FieldDescriptions Source #

(PolyCTypeHasDocC '[k], PolyTypeHasDocC '[v], Ord k) => TypeHasDoc (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

PolyTypeHasDocC '[a, b] => TypeHasDoc (a, b) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (a, b) :: FieldDescriptions Source #

(TypeHasDoc (ApplyNamedFunctor f a), KnownSymbol n, KnownIsoT (ApplyNamedFunctor f Integer), Typeable f, Typeable a) => TypeHasDoc (NamedF f a n) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (NamedF f a n) :: FieldDescriptions Source #

PolyTypeHasDocC '[a, b, c] => TypeHasDoc (a, b, c) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (a, b, c) :: FieldDescriptions Source #

PolyTypeHasDocC '[a, b, c, d] => TypeHasDoc (a, b, c, d) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (a, b, c, d) :: FieldDescriptions Source #

PolyTypeHasDocC '[a, b, c, d, e] => TypeHasDoc (a, b, c, d, e) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (a, b, c, d, e) :: FieldDescriptions Source #

PolyTypeHasDocC '[a, b, c, d, e, f] => TypeHasDoc (a, b, c, d, e, f) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (a, b, c, d, e, f) :: FieldDescriptions Source #

PolyTypeHasDocC '[a, b, c, d, e, f, g] => TypeHasDoc (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions (a, b, c, d, e, f, g) :: FieldDescriptions Source #

Methods

typeDocName :: Proxy (a, b, c, d, e, f, g) -> Text Source #

typeDocMdDescription :: Markdown Source #

typeDocMdReference :: Proxy (a, b, c, d, e, f, g) -> WithinParens -> Markdown Source #

typeDocDependencies :: Proxy (a, b, c, d, e, f, g) -> [SomeDocDefinitionItem] Source #

typeDocHaskellRep :: TypeDocHaskellRep (a, b, c, d, e, f, g) Source #

typeDocMichelsonRep :: TypeDocMichelsonRep (a, b, c, d, e, f, g) Source #

class TypeHasFieldNamingStrategy a where Source #

Field naming strategy used by a type. id by default.

Some common options include: > typeFieldNamingStrategy = stripFieldPrefix > typeFieldNamingStrategy = toSnake . dropPrefix

This is used by the default implementation of typeDocHaskellRep and intended to be reused downstream.

You can also use DerivingVia together with FieldCamelCase and FieldSnakeCase to easily define instances of this class:

data MyType = ... deriving TypeHasFieldNamingStrategy via FieldCamelCase

Minimal complete definition

Nothing

data FieldCamelCase Source #

Empty datatype used as marker for DerivingVia with TypeHasFieldNamingStrategy.

Uses stripFieldPrefix strategy.

data FieldSnakeCase Source #

Empty datatype used as marker for DerivingVia with TypeHasFieldNamingStrategy.

Uses toSnake . dropPrefix strategy.

type TypeDocHaskellRep a = Proxy a -> FieldDescriptionsV -> Maybe (Maybe DocTypeRepLHS, ADTRep SomeTypeWithDoc) Source #

Signature of typeDocHaskellRep function.

A value of FieldDescriptionsV is provided by the library to make sure that instances won't replace it with an unchecked value.

When value is Just, it contains types which this type is built from.

First element of provided pair may contain name a concrete type which has the same type constructor as a (or just a for homomorphic types), and the second element of the pair - its unfolding in Haskell.

For example, for some newtype MyNewtype = MyNewtype (Integer, Natural) we would not specify the first element in the pair because MyNewtype is already a concrete type, and second element would contain (Integer, Natural). For polymorphic types like newtype MyPolyNewtype a = MyPolyNewtype (Text, a), we want to describe its representation on some example of a, because working with type variables is too non-trivial; so the first element of the pair may be e.g. "MyPolyNewType Integer", and the second one shows that it unfolds to (Text, Integer).

When rendered, values of this type look like:

  • (Integer, Natural) - for homomorphic type.
  • MyError Integer = (Text, Integer) - concrete sample for polymorphic type.

type TypeDocMichelsonRep a = Proxy a -> (Maybe DocTypeRepLHS, T) Source #

Signature of typeDocMichelsonRep function.

As in TypeDocHaskellRep, set the first element of the pair to Nothing for primitive types, otherwise it stands as some instantiation of a type, and its Michelson representation is given in the second element of the pair.

Examples of rendered representation:

  • pair int nat - for homomorphic type.
  • MyError Integer = pair string int - concrete sample for polymorphic type.

type FieldDescriptions = [(Symbol, (Maybe Symbol, [(Symbol, Symbol)]))] Source #

Description of constructors and fields of some datatype.

This type is just two nested maps represented as associative lists. It is supposed to be interpreted like this:

[(Constructor name, (Maybe constructor description, [(Field name, Field description)]))]

Example with a concrete data type:

data Foo
  = Foo
      { fFoo :: Int
      }
  | Bar
      { fBar :: Text
      }
  deriving (Generic)

type FooDescriptions =
  '[ '( "Foo", '( 'Just "foo constructor",
      , '[ '("fFoo", "some number")
         ])
      )
   , '( "Bar", '( 'Nothing,
      , '[ '("fBar", "some string")
         ])
      )
   ]

type PolyTypeHasDocC ts = Each '[TypeHasDoc] ts Source #

Constraint, required when deriving TypeHasDoc for polymorphic type with the least possible number of methods defined manually.

data SomeTypeWithDoc where Source #

Data hides some type implementing TypeHasDoc.

Constructors

SomeTypeWithDoc :: TypeHasDoc td => Proxy td -> SomeTypeWithDoc 

typeDocBuiltMichelsonRep :: TypeHasDoc a => Proxy a -> Doc Source #

Fully render Michelson representation of a type.

Since this will be used in markdown, the type is forced to a single line.

>>> data Foo = Foo () () () () () () () () () () () () deriving (Generic, IsoValue)
>>> instance TypeHasDoc Foo where typeDocMdDescription = "Foo type"
>>> typeDocBuiltMichelsonRep $ Proxy @Foo
**Final Michelson representation:** `pair (pair (pair unit unit unit) unit unit unit) (pair unit unit unit) unit unit unit`

type family HaveCommonTypeCtor a b where ... Source #

Require two types to be built from the same type constructor.

E.g. HaveCommonTypeCtor (Maybe Integer) (Maybe Natural) is defined, while HaveCommonTypeCtor (Maybe Integer) [Integer] is not.

Equations

HaveCommonTypeCtor (ac _) (bc _) = HaveCommonTypeCtor ac bc 
HaveCommonTypeCtor a a = () 

class IsHomomorphic a Source #

Require this type to be homomorphic.

Instances

Instances details
IsHomomorphic (a :: k) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

(TypeError ('Text "Type is not homomorphic: " ':<>: 'ShowType (a b)) :: Constraint) => IsHomomorphic (a b :: k2) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

genericTypeDocDependencies :: forall a. (Generic a, GTypeHasDoc (GRep a)) => Proxy a -> [SomeDocDefinitionItem] Source #

Implement typeDocDependencies via getting all immediate fields of a datatype.

Produces a custom error message for missing Generic instances:

>>> data Foo = Foo ()
>>> length $ genericTypeDocDependencies $ Proxy @Foo
...
... GHC.Generics.Rep Foo
... is stuck. Likely
... Generic Foo
... instance is missing or out of scope.
...
>>> data Foo = Foo () deriving Generic
>>> length $ genericTypeDocDependencies $ Proxy @Foo
1

Note: this will not include phantom types, I'm not sure yet how this scenario should be handled (@martoon).

customTypeDocMdReference :: (Text, DType) -> [DType] -> WithinParens -> Markdown Source #

Render a reference to a type which consists of type constructor (you have to provide name of this type constructor and documentation for the whole type) and zero or more type arguments.

customTypeDocMdReference' :: (Text, DType) -> [WithinParens -> Markdown] -> WithinParens -> Markdown Source #

More generic version of customTypeDocMdReference, it accepts arguments not as types with doc, but printers for them.

homomorphicTypeDocMdReference :: forall (t :: Type). (Typeable t, TypeHasDoc t, IsHomomorphic t) => Proxy t -> WithinParens -> Markdown Source #

Derive typeDocMdReference, for homomorphic types only.

poly1TypeDocMdReference :: forall t (r :: Type) (a :: Type). (r ~ t a, Typeable t, Each '[TypeHasDoc] [r, a], IsHomomorphic t) => Proxy r -> WithinParens -> Markdown Source #

Derive typeDocMdReference, for polymorphic type with one type argument, like Maybe Integer.

poly2TypeDocMdReference :: forall t (r :: Type) (a :: Type) (b :: Type). (r ~ t a b, Typeable t, Each '[TypeHasDoc] [r, a, b], IsHomomorphic t) => Proxy r -> WithinParens -> Markdown Source #

Derive typeDocMdReference, for polymorphic type with two type arguments, like Lambda Integer Natural.

homomorphicTypeDocHaskellRep :: forall a. (Generic a, GTypeHasDoc (GRep a)) => TypeDocHaskellRep a Source #

Implement typeDocHaskellRep for a homomorphic type.

Note that it does not require your type to be of IsHomomorphic instance, which can be useful for some polymorphic types which, for documentation purposes, we want to consider homomorphic.

Example: Operation is in fact polymorphic, but we don't want this fact to be reflected in the documentation.

Produces a custom error message for missing Generic instances:

>>> data Foo = Foo ()
>>> isJust $ homomorphicTypeDocHaskellRep (Proxy @Foo) []
...
... GHC.Generics.Rep Foo
... is stuck. Likely
... Generic Foo
... instance is missing or out of scope.
...
>>> data Foo = Foo () deriving Generic
>>> isJust $ homomorphicTypeDocHaskellRep (Proxy @Foo) []
True

concreteTypeDocHaskellRep :: forall a b. (Typeable a, GenericIsoValue a, GTypeHasDoc (GRep a), HaveCommonTypeCtor b a) => TypeDocHaskellRep b Source #

Implement typeDocHaskellRep on example of given concrete type.

This is a best effort attempt to implement typeDocHaskellRep for polymorphic types, as soon as there is no simple way to preserve type variables when automatically deriving Haskell representation of a type.

Produces a custom error message for missing Generic instances:

>>> data Foo a = Foo a
>>> isJust $ concreteTypeDocHaskellRep @(Foo Integer) @(Foo ()) Proxy []
...
... GHC.Generics.Rep (Foo Integer)
... is stuck. Likely
... Generic (Foo Integer)
... instance is missing or out of scope.
...
>>> data Foo a = Foo a deriving (Generic, IsoValue)
>>> isJust $ concreteTypeDocHaskellRep @(Foo Integer) @(Foo ()) Proxy []
True

unsafeConcreteTypeDocHaskellRep :: forall a b. (Typeable a, GenericIsoValue a, GTypeHasDoc (GRep a)) => TypeDocHaskellRep b Source #

Version of concreteTypeDocHaskellRep which does not ensure whether the type for which representation is built is any similar to the original type which you implement a TypeHasDoc instance for.

>>> data Foo = Foo ()
>>> isJust $ unsafeConcreteTypeDocHaskellRep @Foo @() Proxy []
...
... GHC.Generics.Rep Foo
... is stuck. Likely
... Generic Foo
... instance is missing or out of scope.
...
>>> data Foo = Foo () deriving (Generic, IsoValue)
>>> isJust $ unsafeConcreteTypeDocHaskellRep @Foo @() Proxy []
True

haskellAddNewtypeField :: Text -> TypeDocHaskellRep a -> TypeDocHaskellRep a Source #

Add field name for newtype.

Since newtype field is automatically erased. Use this function to add the desired field name.

haskellRepNoFields :: TypeDocHaskellRep a -> TypeDocHaskellRep a Source #

Erase fields from Haskell datatype representation.

Use this when rendering fields names is undesired.

haskellRepMap :: (Text -> Text) -> TypeDocHaskellRep a -> TypeDocHaskellRep a Source #

Like haskellRepAdjust, but can't add or remove field names.

haskellRepAdjust :: (Maybe Text -> Maybe Text) -> TypeDocHaskellRep a -> TypeDocHaskellRep a Source #

Adjust field names using a function. Can add or remove field names.

homomorphicTypeDocMichelsonRep :: forall a. KnownIsoT a => TypeDocMichelsonRep a Source #

Implement typeDocMichelsonRep for homomorphic type.

concreteTypeDocMichelsonRep :: forall a b. (Typeable a, KnownIsoT a, HaveCommonTypeCtor b a) => TypeDocMichelsonRep b Source #

Implement typeDocMichelsonRep on example of given concrete type.

This function exists for the same reason as concreteTypeDocHaskellRep.

unsafeConcreteTypeDocMichelsonRep :: forall a b. (Typeable a, KnownIsoT a) => TypeDocMichelsonRep b Source #

Version of unsafeConcreteTypeDocHaskellRep which does not ensure whether the type for which representation is built is any similar to the original type which you implement a TypeHasDoc instance for.

data DType where Source #

Doc element with description of a type.

Constructors

DType :: TypeHasDoc a => Proxy a -> DType 

Instances

Instances details
Eq DType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Methods

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

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

Ord DType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Methods

compare :: DType -> DType -> Ordering #

(<) :: DType -> DType -> Bool #

(<=) :: DType -> DType -> Bool #

(>) :: DType -> DType -> Bool #

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

max :: DType -> DType -> DType #

min :: DType -> DType -> DType #

DocItem DType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Buildable DType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Methods

build :: DType -> Doc

buildList :: [DType] -> Doc

type DocItemPlacement DType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type DocItemReferenced DType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

newtype DStorageType Source #

Doc element with description of contract storage type.

Constructors

DStorageType DType 

Instances

Instances details
Generic DStorageType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type Rep DStorageType :: Type -> Type #

Eq DStorageType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Ord DStorageType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

DocItem DStorageType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type Rep DStorageType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type Rep DStorageType = D1 ('MetaData "DStorageType" "Morley.Michelson.Typed.Haskell.Doc" "morley-1.20.0-inplace" 'True) (C1 ('MetaCons "DStorageType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DType)))
type DocItemPlacement DStorageType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type DocItemReferenced DStorageType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

dStorage :: forall store. TypeHasDoc store => DStorageType Source #

Shortcut for DStorageType.

class GTypeHasDoc (x :: Type -> Type) Source #

Generic traversal for automatic deriving of some methods in TypeHasDoc.

Minimal complete definition

gTypeDocHaskellRep

class GProductHasDoc (x :: Type -> Type) Source #

Product type traversal for TypeHasDoc.

Minimal complete definition

gProductDocHaskellRep

Instances

Instances details
GProductHasDoc (U1 :: Type -> Type) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

(GProductHasDoc x, GProductHasDoc y) => GProductHasDoc (x :*: y) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

(TypeHasDoc a, KnownSymbol field) => GProductHasDoc (S1 ('MetaSel ('Just field) _1 _2 _3) (Rec0 a)) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

TypeHasDoc a => GProductHasDoc (S1 ('MetaSel ('Nothing :: Maybe Symbol) _1 _2 _3) (Rec0 a)) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

dTypeDep :: forall (t :: Type). TypeHasDoc t => SomeDocDefinitionItem Source #

Create a DType in form suitable for putting to typeDocDependencies.

dTypeDepP :: forall (t :: Type). TypeHasDoc t => Proxy t -> SomeDocDefinitionItem Source #

Proxy version of dTypeDep.

buildADTRep :: forall a. (WithinParens -> a -> Markdown) -> ADTRep a -> Markdown Source #

Show given ADTRep in a neat way.

buildTypeWithinParens :: forall a. Typeable a => WithinParens -> Markdown Source #

Show type, wrapping into parentheses if necessary.