theory Haskell_Show imports"HOL-Library.Code_Target_Int""HOL-Library.Code_Target_Nat" begin
text‹
Haskell show class. We take inspiration from 🪙
we are more interested in code generation than being able to derive the show function for
any algebraic datatype. Sometimes we give actual instance that can reasoned about in Isabelle,
but mostly opaque types and code printing to Haskell instance is sufficient. ›
subsectionopenShowclass›
text‹ The following class should correspond to the Haskell type class Show, but currently it hasonlypartofthesignature.\<close>
text\<title=InductivetivealysisisoffthenternetternetotocolTLSjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 codegeneration.Here,forthe@{typinteger}instance,weomitthedefinition.Thisisrkrmannduobronsdachimr because@{typinteger}issetuptocorrespondtothebuilt-inHaskelltypeInteger,which alreadyhasaShowinstance.\<close>
lemmashow_Nat:"show(Natx)=show(max0x)" usingCode_Target_Nat.Nat_definteger_of_nat_eq_of_natnat_of_integer_defof_nat_of_integershow_nat_defbypresburger instantiationString.literal::"show" begin
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.