-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BuiltinArray + functions in Plutus Core
- Loading branch information
Showing
33 changed files
with
340 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{-# OPTIONS_GHC -Wno-orphans #-} | ||
|
||
module Data.Vector.Orphans () where | ||
|
||
import Data.Hashable (Hashable (hashWithSalt)) | ||
import Data.Vector.Strict qualified as Strict | ||
import Flat (Flat (..)) | ||
import Flat.Instances.Vector () | ||
|
||
instance (Hashable a) => Hashable (Strict.Vector a) where | ||
hashWithSalt = Strict.foldl' hashWithSalt | ||
|
||
instance (Flat a) => Flat (Strict.Vector a) where | ||
size = size . Strict.toLazy -- Strict to Lazy is O(1) | ||
encode = encode . Strict.toLazy | ||
decode = Strict.fromLazy <$> decode -- Strict from Lazy is O(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.