You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain cases, the output of structuralShowsPrec will differ from what deriving Show produces. Here is a test case which illustrates this:
{-# LANGUAGE TemplateHaskell #-}
moduleBugwhereimportData.Parameterized.TH.GADTdataT=MkRec{unRec::Int}
| Int:@@:IntderivingShow$(return[])
puShowT::T->String
puShowT t =$(structuralShowsPrec [t| T |]) 0 t ""main::IO()
main =dolet r =MkRec42
inf =42:@@:42putStrLn$"MkRec (derived):\t\t"++show r
putStrLn$"MkRec (parameterized-utils):\t"++ puShowT r
putStrLn$"(:@@:) (derived):\t\t"++show inf
putStrLn$"(:@@:) (parameterized-utils):\t"++ puShowT inf
In certain cases, the output of
structuralShowsPrec
will differ from whatderiving Show
produces. Here is a test case which illustrates this:This will output:
This shows that
structuralShowsPrec
ignores record and infix data constructors, whichderiving Show
is aware of.The text was updated successfully, but these errors were encountered: