Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
Signed-off-by: Ana Pantilie <ana.pantilie95@gmail.com>
  • Loading branch information
ana-pantilie committed Apr 29, 2024
1 parent a730d6b commit 0d75e65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 2 additions & 6 deletions plutus-tx-plugin/test/AssocList/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ module AssocList.Spec where

import Test.Tasty.Extras

import Control.Monad (when)
import Data.List (nubBy, sort)
import Data.Map.Strict qualified as HMap
import Data.Map.Strict qualified as Map
import Debug.Trace (traceM)
import Hedgehog (Gen, MonadTest, Property, Range, assert, forAll, property, (===))
import Hedgehog.Gen (discard)
import Hedgehog (Gen, MonadTest, Property, Range, forAll, property, (===))
import Hedgehog.Gen qualified as Gen
import Hedgehog.Range qualified as Range
import PlutusTx.AssocMap qualified as AssocMap
Expand Down Expand Up @@ -130,7 +126,7 @@ map2 =
)

newtype AssocListS k v = AssocListS [(k, v)]
deriving (Show, Eq)
deriving stock (Show, Eq)

nullS :: AssocListS k v -> Bool
nullS (AssocListS l) = null l
Expand Down
7 changes: 3 additions & 4 deletions plutus-tx/src/PlutusTx/Data/AssocList.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@ import PlutusTx.These

import Prelude qualified as Haskell

-- TODO: fix docs
{- | An associative map implementation backed by `P.BuiltinData`.
{- | A list associating keys and values backed by `P.BuiltinData`.
This map implementation has the following characteristics:
This implementation has the following characteristics:
* The `P.toBuiltinData` and `P.unsafeFromBuiltinData` operations are no-op.
* Other operations are slower than @PlutusTx.AssocMap.Map@, although equality
checks on keys can be faster due to `P.equalsData`.
* Many operations involve converting the keys and/or values to/from `P.BuiltinData`.
Therefore this map implementation is likely a better choice than @PlutusTx.AssocMap.Map@
Therefore this implementation is likely a better choice than @PlutusTx.AssocMap.Map@
if it is part of a data type defined using @asData@, and the key and value types
have efficient `P.toBuiltinData` and `P.unsafeFromBuiltinData` operations (e.g., they
are primitive types or types defined using @asData@).
Expand Down

0 comments on commit 0d75e65

Please sign in to comment.