Here is a proof of the conceptual way to do this using general programming (in this case, via generics-sop ). Whether this is the right approach to solve your current problem depends on many factors that I currently cannot judge:
{-
In GHCi (this is with version 7.10.3, see below):
*Constants> test1 Constants {x00 = 1, x01 = 2, x02 = 3, x03 = 4, x04 = 5, x05 = 6, x06 = 7, x07 = 8, x08 = 9, x09 = 10, x10 = 11, x11 = 12, x12 = 13, x13 = 14, x14 = 15, x15 = 16, x16 = 17, x17 = 18, x18 = 19, x19 = 20, x20 = 21, x21 = 22, x22 = 23, x23 = 24, x24 = 25, x25 = 26, x26 = 27, x27 = 28, x28 = 29, x29 = 30, x30 = 31, x31 = 32, x32 = 33, x33 = 34, x34 = 35, x35 = 36, x36 = 37, x37 = 38, x38 = 39, x39 = 40, x40 = 41, x41 = 42, x42 = 43, x43 = 44, x44 = 45, x45 = 46, x46 = 47, x47 = 48, x48 = 49, x49 = 50, x50 = 51, x51 = 52, x52 = 53, x53 = 54, x54 = 55, x55 = 56, x56 = 57, x57 = 58, x58 = 59, x59 = 60, x60 = 61, x61 = 62, x62 = 63, x63 = 64, x64 = 65, x65 = 66, x66 = 67, x67 = 68, x68 = 69, x69 = 70, x70 = 71, x71 = 72, x72 = 73, x73 = 74, x74 = 75, x75 = 76, x76 = 77, x77 = 78, x78 = 79, x79 = 80, x80 = 81, x81 = 82, x82 = 83, x83 = 84, x84 = 85, x85 = 86, x86 = 87, x87 = 88, x88 = 89, x89 = 90, x90 = 91, x91 = 92, x92 = 93, x93 = 94, x94 = 95, x95 = 96, x96 = 97, x97 = 98, x98 = 99, x99 = 100} *Constants> test2 [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100]
Interestingly, when I tried to compile this with ghc-8.0.1 (then you should replace the -fcontext-stack -freduction-depth with -freduction-depth too), I received an unexpected GHC internal error, which I should investigate further ...