Skip to content

Commit

Permalink
remove foldr (#357)
Browse files Browse the repository at this point in the history
as requested in issue #282
  • Loading branch information
williamdemeo authored Feb 9, 2024
1 parent 5398da5 commit 625e8c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ledger/TokenAlgebra.lagda
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ record TokenAlgebra : Set₁ where
\AgdaTarget{sumᵛ}
\begin{code}
sumᵛ : List Value → Value
sumᵛ = foldr _+ᵛ_ (inject 0)
sumᵛ [] = inject 0
sumᵛ (x ∷ l) = x + sumᵛ l
\end{code}
\end{AgdaAlign}
\caption{Token algebras, used for multi-assets}
Expand Down

0 comments on commit 625e8c6

Please sign in to comment.