5 Nov
2016
5 Nov
'16
7:43 p.m.
You probably want :set -XExistentialQuantification data Test = forall a . Show a => Test String a Under the hood, this works by storing the vtable for the "Show" typeclass for whatever object you're putting in the Test. You could explicitly unpack this like data TestY = forall a . Test String a (a -> String) Cheers, Will On Sat, Nov 5, 2016 at 2:09 PM, Gregory Guthrie <guthrie@mum.edu> wrote:
data (Show a) => ATest = Test (String, a)
but that also fails, although it does give the right idea; all tests have a common structure, with a second value in the Show typeclass.