apply remaining suggestions

This commit is contained in:
Emily Martins 2022-03-01 13:14:51 +01:00
parent 8bf96802b7
commit ffce843a03
5 changed files with 22 additions and 12 deletions

View file

@ -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,

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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