Created
February 8, 2018 12:34
-
-
Save saevarb/fe58208db594ed1c98900554f6dcd79a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i) => ToJSON2 ((,,,,,,,,,,) a b c d e f g h i) where | |
liftToJSON2 toJ _ toK _ (a, b, c, d, e, f, g, h, i, j, k) = Array $ V.create $ do | |
mv <- VM.unsafeNew 11 | |
VM.unsafeWrite mv 0 (toJSON a) | |
VM.unsafeWrite mv 1 (toJSON b) | |
VM.unsafeWrite mv 2 (toJSON c) | |
VM.unsafeWrite mv 3 (toJSON d) | |
VM.unsafeWrite mv 4 (toJSON e) | |
VM.unsafeWrite mv 5 (toJSON f) | |
VM.unsafeWrite mv 6 (toJSON g) | |
VM.unsafeWrite mv 7 (toJSON h) | |
VM.unsafeWrite mv 8 (toJSON i) | |
VM.unsafeWrite mv 9 (toJ j) | |
VM.unsafeWrite mv 10 (toK k) | |
return mv | |
{-# INLINE liftToJSON2 #-} | |
liftToEncoding2 toJ _ toK _ (a, b, c, d, e, f, g, h, i, j, k) = E.list id | |
[ toEncoding a | |
, toEncoding b | |
, toEncoding c | |
, toEncoding d | |
, toEncoding e | |
, toEncoding f | |
, toEncoding g | |
, toEncoding h | |
, toEncoding i | |
, toJ j | |
, toK k | |
] | |
{-# INLINE liftToEncoding2 #-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment