From ffce843a03d5f650d5ca6750eb8498b2e07da30e Mon Sep 17 00:00:00 2001 From: Emily Martins Date: Tue, 1 Mar 2022 13:14:51 +0100 Subject: [PATCH] apply remaining suggestions --- src/Agora/AuthorityToken.hs | 4 +++- src/Agora/SafeMoney.hs | 16 +++++++++------- src/Agora/SafeMoney/QQ.hs | 4 +++- src/Agora/Stake.hs | 6 ++++-- src/Agora/Utils.hs | 4 +++- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/Agora/AuthorityToken.hs b/src/Agora/AuthorityToken.hs index d374553..64dcfc7 100644 --- a/src/Agora/AuthorityToken.hs +++ b/src/Agora/AuthorityToken.hs @@ -1,7 +1,9 @@ {- | Module : Agora.AuthorityToken Maintainer : emi@haskell.fyi -Description: Tokens acting as redeemable proofs of DAO authority +Description: Tokens acting as redeemable proofs of DAO authority. + +Tokens acting as redeemable proofs of DAO authority. -} module Agora.AuthorityToken ( authorityTokenPolicy, diff --git a/src/Agora/SafeMoney.hs b/src/Agora/SafeMoney.hs index ef09fe9..f361e22 100644 --- a/src/Agora/SafeMoney.hs +++ b/src/Agora/SafeMoney.hs @@ -1,7 +1,9 @@ {- | Module : Agora.SafeMoney Maintainer : emi@haskell.fyi -Description: Phantom-type protected types for handling money in Plutus +Description: Phantom-type protected types for handling money in Plutus. + +Phantom-type protected types for handling money in Plutus. -} module Agora.SafeMoney ( -- * Types @@ -43,7 +45,7 @@ import Agora.Utils -------------------------------------------------------------------------------- --- | Type-level unique identifier for an AssetClass +-- | Type-level unique identifier for an `AssetClass` type MoneyClass = ( -- AssetClass Symbol @@ -53,12 +55,12 @@ type MoneyClass = Nat ) --- | A PDiscrete amount of currency tagged on the type level with the MoneyClass it belong sto +-- | A `PDiscrete` amount of currency tagged on the type level with the `MoneyClass` it belong sto newtype PDiscrete (mc :: MoneyClass) (s :: S) = PDiscrete (Term s PInteger) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype (PDiscrete mc) PInteger) --- | Add two `PDiscrete` values of the same MoneyClass. +-- | Add two `PDiscrete` values of the same `MoneyClass`. paddDiscrete :: Term s (PDiscrete mc :--> PDiscrete mc :--> PDiscrete mc) paddDiscrete = phoistAcyclic $ -- In the future, this should use plutarch-numeric @@ -77,7 +79,7 @@ type ADA = '("", "", 6) -------------------------------------------------------------------------------- --- | Downcast a 'PValue' to a 'PDiscrete' unit. +-- | Downcast a `PValue` to a `PDiscrete` unit. pvalueDiscrete :: forall (moneyClass :: MoneyClass) (ac :: Symbol) (n :: Symbol) (scale :: Nat) s. ( KnownSymbol ac @@ -92,8 +94,8 @@ pvalueDiscrete = phoistAcyclic $ # pconstant (fromString $ symbolVal $ Proxy @n) # f -{- | Get a 'PValue' from a 'PDiscrete'. -NOTE: pdiscreteValue after pvaluePDiscrete is loses information +{- | Get a `PValue` from a `PDiscrete`. + __NOTE__: `pdiscreteValue` after `pvalueDiscrete` is loses information -} pdiscreteValue :: forall (moneyClass :: MoneyClass) (ac :: Symbol) (n :: Symbol) (scale :: Nat) s. diff --git a/src/Agora/SafeMoney/QQ.hs b/src/Agora/SafeMoney/QQ.hs index 51586fa..96ec4c7 100644 --- a/src/Agora/SafeMoney/QQ.hs +++ b/src/Agora/SafeMoney/QQ.hs @@ -3,7 +3,9 @@ {- | Module : Agora.SafeMoney.QQ Maintainer : emi@haskell.fyi -Description: Quasiquoter for SafeMoney types +Description: Quasiquoter for SafeMoney types. + +Quasiquoter for SafeMoney types. -} module Agora.SafeMoney.QQ (discrete) where diff --git a/src/Agora/Stake.hs b/src/Agora/Stake.hs index fcbba21..a4dcc24 100644 --- a/src/Agora/Stake.hs +++ b/src/Agora/Stake.hs @@ -2,6 +2,8 @@ Module : Agora.Stake Maintainer : emi@haskell.fyi Description: Vote-lockable stake UTXOs holding GT. + +Vote-lockable stake UTXOs holding GT. -} module Agora.Stake ( PStakeDatum (..), @@ -105,7 +107,7 @@ newtype PStakeDatum (gt :: MoneyClass) (s :: S) = PStakeDatum -} -------------------------------------------------------------------------------- --- | Policy for Stake state threads +-- | Policy for Stake state threads. stakePolicy :: forall (gt :: MoneyClass) ac n scale s. ( KnownSymbol ac @@ -186,7 +188,7 @@ stakePolicy _stake = -------------------------------------------------------------------------------- --- | Validator intended for Stake UTXOs to live in +-- | Validator intended for Stake UTXOs to live in. stakeValidator :: forall (gt :: MoneyClass) ac n scale s. ( KnownSymbol ac diff --git a/src/Agora/Utils.hs b/src/Agora/Utils.hs index c0967f0..124c57b 100644 --- a/src/Agora/Utils.hs +++ b/src/Agora/Utils.hs @@ -1,7 +1,9 @@ {- | Module : Agora.Utils Maintainer : emi@haskell.fyi -Description: Plutarch utility functions that should be upstreamed or don't belong anywhere else +Description: Plutarch utility functions that should be upstreamed or don't belong anywhere else. + +Plutarch utility functions that should be upstreamed or don't belong anywhere else. -} module Agora.Utils ( -- * Validator-level utility functions