Îõ³h*$Š"ÁÖ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU1.0.0.0© Hécate Moonlight, 2021MIThecate@glitchbra.instable Safe-Inferred"156ÀÁÂÃÄÍÒÚÛÝðò~* text-display2This wrapper allows you to rely on a pre-existing V instance in order to derive   from it.Example Îdata AutomaticallyDerived = AD -- We derive 'Show' deriving stock Show -- We take advantage of the 'Show' instance to derive 'Display' from it deriving Display via (ShowInstance AutomaticallyDerived) text-display…This wrapper allows you to create an opaque instance for your type, useful for redacting sensitive content like tokens or passwords.Example àdata UserToken = UserToken UUID deriving Display via (OpaqueInstance "[REDACTED]" UserToken) Çdisplay $ UserToken "7a01d2ce-31ff-11ec-8c10-5405db82c3cd" "[REDACTED]"  text-display  text-display#A typeclass for user-facing output.  text-display?Implement this method to describe how to convert your value to W.  text-display The method  õ is provided to allow for a specialised way to render lists of a certain value. This is used to render the list of Xô as a string of characters enclosed in double quotes, rather than between square brackets and separated by commas.Example ãimport qualified Data.Text.Lazy.Builder as TB instance Display Char where displayBuilder c = Builder.fromText $ Text.pack $ Text.singleton c displayList cs = Builder.fromText $ Text.pack $ Text.pack cs instance (Display a) => Display [a] where -- In this instance, 'displayBuilder' is defined in terms of 'displayList', which for most types -- is defined as the default written in the class declaration. -- But when a ~ Char, there is an explicit implementation that is selected instead, which -- provides the rendering of the character string between double quotes. displayBuilder = displayList How implementations are selected ØdisplayBuilder ([1,2,3] :: [Int]) ’C displayBuilder @[Int] = displayBuilderList @Int ’C Default `displayList` displayBuilder ("abc" :: [Char]) ’C displayBuilder @[Char] = displayBuilderList @Char ’C Custom `displayList`  text-display The method    allows you to write instances that require nesting. The precedence parameter can be thought of as a suggestion coming from the surrounding context for how tightly to bind. If the precedence parameter is higher than the precedence of the operator (or constructor, function, etc.) being displayed, then that suggests that the output will need to be surrounded in parentheses in order to bind tightly enough (see ).þFor example, if an operator constructor is being displayed, then the precedence requirement for its arguments will be the precedence of the operator. Meaning, if the argument binds looser than the surrounding operator, then it will require parentheses.ÍNote that function/constructor application has an effective precedence of 10.Examples Ôinstance (Display a) => Display (Maybe a) where -- In this instance, we define 'displayPrec' rather than 'displayBuilder' as we need to decide -- whether or not to surround ourselves in parentheses based on the surrounding context. -- If the precedence parameter is higher than 10 (the precedence of constructor application) -- then we indeed need to surround ourselves in parentheses to avoid malformed outputs -- such as @Just Just 5@. -- We then set the precedence parameter of the inner 'displayPrec' to 11, as even -- constructor application is not strong enough to avoid parentheses. displayPrec _ Nothing = "Nothing" displayPrec prec (Just a) = displayParen (prec > 10) $ "Just " <> displayPrec 11 a èdata Pair a b = a :*: b infix 5 :*: -- arbitrary choice of precedence instance (Display a, Display b) => Display (Pair a b) where displayPrec prec (a :*: b) = displayParen (prec > 5) $ displayPrec 6 a <> " :*: " <> displayPrec 6 b text-displayConvert a value to a readable Y.Examples display 3"3" display True"True" text-display,A utility function that surrounds the given Wó with parentheses when the Bool parameter is True. Useful for writing instances that may require nesting. See the  % documentation for more information. text-display text-display text-display text-display text-display text-display text-displayStrict Y text-displayLazy Z text-display ! is overloaded, so that when the  Display [a] instance calls  Ì, we end up with a nice string instead of a list of chars between brackets.display [1, 2, 3] "[1,2,3]"!display ['h', 'e', 'l', 'l', 'o']"hello" text-display*«í You should not try to display functions! ¡é Write a  'newtype'ã wrapper that represents your domain more accurately. If you are not consciously trying to use Í on a function, make sure that you are not missing an argument somewhere. text-display1«í You should not try to display lazy ByteStrings!,¡é Always provide an explicit encoding. Use  or  to convert from UTF-8 text-display3«í You should not try to display strict ByteStrings!,¡é Always provide an explicit encoding. Use  or  to convert from UTF-8 text-display…This wrapper allows you to create an opaque instance for your type, useful for redacting sensitive content like tokens or passwords. text-display2This wrapper allows you to rely on a pre-existing V instance in order to derive   from it.. text-display/ text-display0 text-display1 text-display2 text-display3 text-display4 text-display5 text-display6 text-display7 text-display8 text-display9 text-display: text-display; text-display< text-display= text-display> text-display? text-display@ text-display  text-display9The precedence level passed in by the surrounding context   © Jonathan Lorimer, 2023MITjonathanlorimer@pm.mestableNone"/1ÀÁÂÃÄÅÆÍÚÛÝë"1A text-display Constraint to prevent misuse of D deriving via mechanism.Example Ýdata MySum = A | B | C deriving stock (Generic) deriving (Display) via (RecordInstance MySum) Ô ¢@ «í Cannot derive Display instance for MySum via RecordInstance due to sum type ¡é Sum types should use a manual instance or derive one via ShowInstance. ¢@ When deriving the instance for (Display MySum)C text-displayÝThis type family is lifted from generic-data. We use it to prevent the user from deriving a D for sum typesD text-display%This wrapper allows you to create an  Á instance for a record, so long as all the record fields have a   instance as well.Example Ødata Password = Password deriving Display via (OpaqueInstance "[REDACTED]" Password) Údata MyRecord = MyRecord { fieldA :: String , fieldB :: Maybe String , fieldC :: Int , pword :: Password } deriving stock (Generic) deriving (Display) via (RecordInstance MyRecord) ÓputStrLn . Data.Text.unpack . display $ MyRecord "hello" (Just "world") 22 Password ÞMyRecord { fieldA = hello , fieldB = Just world , fieldC = 22 , pword = [REDACTED] }G text-displayáGeneric typeclass machinery for inducting on the structure of the type, such that we can thread  Ù instances through the structure of the type. The primary use case is for implementing D”, which does this "threading" for record fields. This machinery does, crucially, depend on child types (i.e. the type of a record field) having a   instance.O text-displayéThis is the most important instance, it can be considered as the "base case". It requires a non-generic  Ó instance. All this generic machinery can be conceptualized as distributing these   calls across a product type.U text-displayWe leverage the  AssertNoSum„ type family to prevent consumers from deriving instances for sum types. Sum types should use a manual instance or derive one via . ABCDFEGHI GHIDFECBA© Hécate Moonlight, 2021MIThecate@glitchbra.instable Safe-Inferred"£  DEF  DEFÛ        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIIJKLMNOPQRSTUVWXYZ[\]^_`abcdecfeç+text-display-1.0.0.0-DKq3xgpMz006QEKXjMto1TData.Text.Display.CoreData.Text.Display.Generic text-displayData.Text.Encoding decodeUtf8'decodeUtf8WithData.Text.DisplayDisplayRealFloatDisplayDecimal ShowInstanceOpaqueInstanceOpaqueCannotDisplayByteStringsCannotDisplayBareFunctionsDisplaydisplayBuilder displayList displayPrecdisplay displayParen$fDisplay(,,,) $fDisplay(,,) $fDisplay(,)$fDisplayMaybe$fDisplayNonEmpty $fDisplayList $fDisplayText$fDisplayText0 $fDisplayChar $fDisplayFUN$fDisplayByteString$fDisplayByteString0$fDisplayOpaqueInstance$fDisplayShowInstance$fDisplayDisplayDecimal$fDisplayDisplayRealFloat$fRealFloatDisplayRealFloat$fRealFracDisplayRealFloat$fRealDisplayRealFloat$fOrdDisplayRealFloat$fEqDisplayRealFloat$fNumDisplayRealFloat$fFractionalDisplayRealFloat$fFloatingDisplayRealFloat$fIntegralDisplayDecimal$fRealDisplayDecimal$fEnumDisplayDecimal$fOrdDisplayDecimal$fNumDisplayDecimal$fEqDisplayDecimal$fShowShowInstance$fDisplaySomeException$fDisplayIOException$fDisplayWord64$fDisplayWord32$fDisplayWord16$fDisplayWord8 $fDisplayWord$fDisplayInteger$fDisplayInt64$fDisplayInt32$fDisplayInt16 $fDisplayInt8 $fDisplayInt$fDisplayFloat$fDisplayDouble $fDisplayBool $fDisplayVoid $fDisplay()AssertNoSumRecordInstanceAssertHasSumRecordInstanceunDisplayProduct GDisplay1gdisplayBuilder1gdisplayBuilderDefault$fGDisplay1:+:$fGDisplay1:*: $fGDisplay1M1$fGDisplay1M10$fGDisplay1M11 $fGDisplay1K1 $fGDisplay1U1 $fGDisplay1V1$fGenericRecordInstance$fAssertFalsemsg$fAssertTruemsg$fDisplayRecordInstancebaseGHC.ShowShow0text-builder-linear-0.1.3-6Vz0wYtvhjFIq9YVk4ONpRData.Text.Builder.LinearBuilderghc-prim GHC.TypesChar text-2.0.2Data.Text.InternalTextData.Text.Internal.Lazy