-
-
Save dminuoso/7ca1d473e20c70b1ddb98fc714f4391c to your computer and use it in GitHub Desktop.
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
• Couldn't match type ‘Inner mode [Authorization tok pat]’ | |
with ‘Inner mode [Authorization tok pat0]’ | |
Expected type: PermsF mode -> Inner mode [Authorization tok pat0] | |
Actual type: PermsF mode -> Inner mode [Authorization tok pat] | |
NB: ‘Inner’ is a non-injective type family | |
The type variable ‘pat0’ is ambiguous | |
• In the ambiguity check for ‘hasPerm’ | |
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes | |
In the type signature: | |
hasPerm :: User -> PermSelector tok pat -> T.Text -> GerdM tok |
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
data Mode = Field | Descr | |
type family Inner tag field where | |
Inner Field f = Maybe f | |
Inner Descr f = T.Text | |
type PermSelector tok pat = forall mode. PermsF mode -> Inner mode [Authorization tok pat] | |
hasPerm :: User -> PermSelector tok pat -> T.Text -> GerdM tok | |
hasPerm = ... | |
data PermsF f = PermsF | |
{ permApiVersions :: Inner f [SimpleAuthorization] | |
, permServerList :: Inner f [Authorization''] | |
, permServerView :: Inner f [Authorization''] | |
, permSearch :: Inner f [Authorization''] | |
, permFlushCache :: Inner f [Authorization''] | |
, permStatistics :: Inner f [Authorization''] | |
, permZoneCreate :: Inner f [Authorization''] | |
, permZoneList :: Inner f [Authorization Filtered DomPat] | |
, permZoneView :: Inner f [Authorization Filtered DomPat] | |
, permZoneUpdate :: Inner f [Authorization' DomPat] | |
, permZoneUpdateRecords :: Inner f [Authorization DomTyPat DomPat] | |
, permZoneDelete :: Inner f [Authorization' DomPat] | |
, permZoneTriggerAxfr :: Inner f [Authorization' DomPat] | |
, permZoneGetAxfr :: Inner f [Authorization' DomPat] | |
, permZoneNotifySlaves :: Inner f [Authorization' DomPat] | |
, permZoneRectify :: Inner f [Authorization' DomPat] | |
, permZoneMetadata :: Inner f [Authorization' DomPat] | |
, permZoneCryptokeys :: Inner f [Authorization' DomPat] | |
, permTSIGKeyList :: Inner f [Authorization''] | |
, permTSIGKeyCreate :: Inner f [Authorization''] | |
, permTSIGKeyView :: Inner f [Authorization''] | |
, permTSIGKeyUpdate :: Inner f [Authorization''] | |
, permTSIGKeyDelete :: Inner f [Authorization''] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment