Skip to content

Commit

Permalink
Fix issue #5922
Browse files Browse the repository at this point in the history
  • Loading branch information
Unisay committed Apr 24, 2024
1 parent b97e8be commit d93201e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plutus-core/plutus-ir/src/PlutusIR/Contexts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ data SplitMatchContext tyname name uni fun a = SplitMatchContext
}

extractTyArgs :: AppContext tyname name uni fun a -> Maybe [Type tyname uni a]
extractTyArgs = go []
where go acc (TypeAppContext ty _ ctx) = go (ty:acc) ctx
go _ (TermAppContext{}) = Nothing
go acc AppContextEnd = Just acc
extractTyArgs = go id
where
go acc = \case
TypeAppContext ty _ ctx -> go (acc . (ty :)) ctx
TermAppContext{} -> Nothing
AppContextEnd -> Just (acc [])

-- | Split a normal datatype 'match'.
splitNormalDatatypeMatch
Expand Down

0 comments on commit d93201e

Please sign in to comment.