Skip to content

Commit

Permalink
Remove metadata from ConcPoly example
Browse files Browse the repository at this point in the history
  • Loading branch information
krame505 committed Feb 15, 2024
1 parent c7ce9ae commit 98f13da
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions doc/libraries_ref_guide/LibDoc/Prelude.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7073,24 +7073,20 @@ \subsubsection{Representation types}
struct Foo_x =
val :: a -> a

instance Generic Foo
(Meta (MetaData "Foo" "Example" () 1)
(Meta (MetaConsNamed "Foo" 0 2)
(Meta (MetaField "x" 0) (ConcPoly Foo_x),
Meta (MetaField "y" 1) (Conc (Int 8))))) where
from a =
Meta (Meta (Meta (ConcPoly (Foo_x { val = a.x; })), Meta (Conc a.y)))
to (Meta (Meta ((Meta (ConcPoly x)), (Meta (Conc y))))) =
Test.Foo { x = x.val; y = y; }
instance Generic Foo (ConcPoly Foo_x, Conc (Int 8))) where
from a = (ConcPoly (Foo_x { val = a.x; }), Conc a.y)
to (ConcPoly x, Conc y) = Foo { x = x.val; y = y; }
\end{libverbatim}

Users can omit an instance for \te{ConcPoly} to not support higher-rank data,
or define some useful default behavior.
For example, the \te{CShow} library defines an instance for ConcPoly
to return a placeholder string for higher-rank fields.

\subsubsection{Metadata types}

The following types are used to represent metadata in generic representations.
Note that these only appear as at the type level tagging a \te{Meta} type;
Note that these only appear at the type level tagging a \te{Meta} type;
values of these types are not constructed.

\begin{center}
Expand Down

0 comments on commit 98f13da

Please sign in to comment.