Skip to content

Commit

Permalink
fix instance chain
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall committed Sep 30, 2023
1 parent ce768fc commit 6a45690
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Network/Ethereum/Web3/Solidity/Internal.purs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ instance GRecordFieldsIso NoArguments () Nil where
gToRecordFields _ _ = {}
gFromRecordFields _ _ = NoArguments

else instance GRecordFieldsIso a r rl => GRecordFieldsIso (Constructor name a) r (Cons name rl Nil) where
gToRecordFields _ (Constructor a) = gToRecordFields (Proxy @rl) a
gFromRecordFields _ r = Constructor (gFromRecordFields (Proxy @rl) r)

else instance
( IsSymbol s
, Row.Cons s a () r
Expand Down Expand Up @@ -53,10 +57,6 @@ else instance
in
Product as bs

else instance GRecordFieldsIso a r rl => GRecordFieldsIso (Constructor name a) r (Cons name rl Nil) where
gToRecordFields _ (Constructor a) = gToRecordFields (Proxy @rl) a
gFromRecordFields _ r = Constructor (gFromRecordFields (Proxy @rl) r)

toRecord :: forall a rep fields l. Generic a rep => GRecordFieldsIso rep fields l => a -> Record fields
toRecord a = gToRecordFields (Proxy :: Proxy l) (from a)

Expand Down

0 comments on commit 6a45690

Please sign in to comment.