Skip to content

Commit

Permalink
Update lib/local-cluster/lib/Cardano/Wallet/Launch/Cluster/Monitoring…
Browse files Browse the repository at this point in the history
…/Http/ApiT.hs

Co-authored-by: Heinrich Apfelmus <heinrich.apfelmus@iohk.io>
  • Loading branch information
paolino and HeinrichApfelmus committed May 7, 2024
1 parent bce55b8 commit c629d5a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import GHC.Generics
( Generic
)

-- | A newtype wrapper to avoid orphan instances
-- | A value of type 'ApiT'@ a@ is equivalent to a value of type @a@.
-- However, the type 'ApiT'@ a@ has a custom JSON encoding that
-- is independent of the original definition of @a@.
--
-- In other words, the 'ApiT' type constructor allows us to separate the
-- concern of presenting @a@ in a HTTP/JSON interface from
-- the definition of @a@ as a data type.
newtype ApiT a = ApiT {unApiT :: a}
deriving newtype (Eq, Show, Generic)

0 comments on commit c629d5a

Please sign in to comment.