Skip to content

Commit

Permalink
role annotations - it seems ghc 9.8 wants them
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-martin committed Jan 18, 2024
1 parent fe6539d commit 951a0d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions asana.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ library
OverloadedStrings
RankNTypes
RecordWildCards
RoleAnnotations
ScopedTypeVariables
StandaloneDeriving
TypeApplications
Expand Down
3 changes: 3 additions & 0 deletions library/Asana/Api/Request.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ maxRequests :: Int
maxRequests = 50

-- | Type for a single-resource response, containing @{ data: { ... } }@
type role Single representational
newtype Single a = Single
{ sData :: a
}
Expand All @@ -60,6 +61,7 @@ instance (FromJSON a) => FromJSON (Single a) where
parseJSON = genericParseJSON $ aesonPrefix snakeCase

-- | Type for a list-resource response, containing @{ data: [{ ... }] }@
type role Page representational
data Page a = Page
{ pData :: [a],
pNextPage :: Maybe NextPage
Expand All @@ -81,6 +83,7 @@ instance FromJSON NextPage where
parseJSON = genericParseJSON $ aesonPrefix snakeCase

-- | Generic type for un/wrapping an item as @{ data: <item> }@
type role ApiData representational
newtype ApiData a = ApiData
{ adData :: a
}
Expand Down
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ default-extensions:
- OverloadedStrings
- RankNTypes
- RecordWildCards
- RoleAnnotations
- ScopedTypeVariables
- StandaloneDeriving
- TypeApplications
Expand Down

0 comments on commit 951a0d2

Please sign in to comment.