From 98f13da36a89da96b4821649ca3f9c5291f35b81 Mon Sep 17 00:00:00 2001 From: Lucas Kramer Date: Wed, 14 Feb 2024 22:12:07 -0600 Subject: [PATCH] Remove metadata from ConcPoly example --- doc/libraries_ref_guide/LibDoc/Prelude.tex | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/doc/libraries_ref_guide/LibDoc/Prelude.tex b/doc/libraries_ref_guide/LibDoc/Prelude.tex index 00a395b5..4e8d344e 100644 --- a/doc/libraries_ref_guide/LibDoc/Prelude.tex +++ b/doc/libraries_ref_guide/LibDoc/Prelude.tex @@ -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}