From f3635f78f30e7993ea79befb9a6cddeceea143ca Mon Sep 17 00:00:00 2001 From: martyall Date: Thu, 5 Oct 2023 22:00:01 -0700 Subject: [PATCH] fix generic impl --- src/Network/Ethereum/Web3/Solidity/Event.purs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Network/Ethereum/Web3/Solidity/Event.purs b/src/Network/Ethereum/Web3/Solidity/Event.purs index 3120cdf..8582a6c 100644 --- a/src/Network/Ethereum/Web3/Solidity/Event.purs +++ b/src/Network/Ethereum/Web3/Solidity/Event.purs @@ -54,12 +54,17 @@ else instance ABIDecode a => GArrayParser (Argument a) where res <- lmap (ParserError <<< show) <<< abiDecode $ head pure $ Tuple (Argument res) tail -else instance (ArrayParser as, ArrayParser bs) => GArrayParser (Product as bs) where +else instance (GArrayParser as, GArrayParser bs) => GArrayParser (Product as bs) where gArrayParser hxs = do - Tuple a rest <- arrayParser hxs - Tuple b rest' <- arrayParser rest + Tuple a rest <- gArrayParser hxs + Tuple b rest' <- gArrayParser rest pure $ Tuple (Product a b) rest' +else instance GArrayParser as => GArrayParser (Constructor name as) where + gArrayParser hxs = do + Tuple a rest <- gArrayParser hxs + pure $ Tuple (Constructor a) rest + else instance ArrayParser as => GArrayParser (Constructor name as) where gArrayParser hxs = do Tuple a rest <- arrayParser hxs