Skip to content

Commit

Permalink
[inferno-ml] Add some instances for ScriptInputType (#135)
Browse files Browse the repository at this point in the history
We need some of these instances elsewhere
  • Loading branch information
ngua authored Oct 8, 2024
1 parent 599f3c5 commit a898541
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions inferno-ml-server-types/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Revision History for inferno-ml-server-types
*Note*: we use https://pvp.haskell.org/ (MAJOR.MAJOR.MINOR.PATCH)

## 0.9.1
* `Ord`/`VCHashUpdate` instances for `ScriptInputType`

## 0.9.0
* Add `Arbitrary`/`ToADTArbitrary` instances for most types
* Simplify `ModelMetadata`
Expand Down
2 changes: 1 addition & 1 deletion inferno-ml-server-types/inferno-ml-server-types.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: inferno-ml-server-types
version: 0.9.0
version: 0.9.1
synopsis: Types for Inferno ML server
description: Types for Inferno ML server
homepage: https://github.com/plow-technologies/inferno.git#readme
Expand Down
7 changes: 5 additions & 2 deletions inferno-ml-server-types/src/Inferno/ML/Server/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ import GHC.Generics (Generic)
import Inferno.Instances.Arbitrary ()
import Inferno.Types.Syntax (Ident)
import Inferno.Types.VersionControl
( VCObjectHash,
( VCHashUpdate,
VCHashUpdateViaShow (VCHashUpdateViaShow),
VCObjectHash,
byteStringToVCObjectHash,
vcObjectHashToByteString,
)
Expand Down Expand Up @@ -797,8 +799,9 @@ data ScriptInputType
-- the same script identifier to point to the same PID with both
-- types of access enabled
ReadableWritable
deriving stock (Show, Eq, Generic)
deriving stock (Show, Eq, Ord, Generic)
deriving anyclass (NFData, ToADTArbitrary)
deriving (VCHashUpdate) via (VCHashUpdateViaShow ScriptInputType)

instance FromJSON ScriptInputType where
parseJSON = withText "ScriptInputType" $ \case
Expand Down

0 comments on commit a898541

Please sign in to comment.