ЗП
show Foo = "Foo"
show Bar = "Bar"
а если много параметров, есть какой-то быстрый способ?
Size: a a a
ЗП
NK
ЗП
NK
ЗП
NK
VY
ЗП
VY
VY
module Main where
import Prelude
import Control.Monad.Eff.Console (logShow)
import Data.Generic.Rep
import Data.Generic.Rep.Show
data Metavars
= Foo
| Bar
| Baz
derive instance repGenericMetavars ∷ Generic Metavars _
instance showMetavars :: Show Metavars where
show x = genericShow x
main = logShow $ Foo
ЗП
VY
VY
ЗП
Tree a?к
ЗП
derive instance treeGeneric :: Generic (Tree a) _?VY
ЗП
genericShowRangeError: Maximum call stack size exceeded