diff options
| -rw-r--r-- | doc/forum/functions_that_yield_properties/comment_5_922e9e20c5326ceb695f7593d8bd72f5._comment | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/forum/functions_that_yield_properties/comment_5_922e9e20c5326ceb695f7593d8bd72f5._comment b/doc/forum/functions_that_yield_properties/comment_5_922e9e20c5326ceb695f7593d8bd72f5._comment new file mode 100644 index 00000000..7cbcdd84 --- /dev/null +++ b/doc/forum/functions_that_yield_properties/comment_5_922e9e20c5326ceb695f7593d8bd72f5._comment @@ -0,0 +1,38 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 5" + date="2016-06-07T07:32:49Z" + content=""" +Unfortunately, the more general type doesn't seem to work: + + withMyAcc + :: (SingI outer, Cannot_ensureProperty_WithInfo inner ~ 'True, + NotSuperset (Targets inner) (Targets outer) ~ 'CanCombine) + => Desc + -> (User -> Property (MetaTypes inner)) + -> Property (MetaTypes outer) + withMyAcc desc mkp = property' desc $ \w -> do + u <- getMyAcc + ensureProperty w (mkp u) + + accountForSean :: Property DebianLike + accountForSean = withMyAcc \"account for Sean\" User.accountFor + +yields + + src/Propellor/Property/SiteSpecific/SPW/Account.hs:85:18: + Couldn't match kind ‘*’ with ‘MetaType’ + Expected type: Property DebianLike + Actual type: Property (MetaTypes outer0) + In the expression: withMyAcc \"account for Sean\" User.accountFor + In an equation for ‘accountForSean’: + accountForSean = withMyAcc \"account for Sean\" User.accountFor + + src/Propellor/Property/SiteSpecific/SPW/Account.hs:85:47: + Couldn't match kind ‘MetaType’ with ‘*’ + Expected type: User -> Property (MetaTypes inner0) + Actual type: User -> Property DebianLike + In the second argument of ‘withMyAcc’, namely ‘User.accountFor’ + In the expression: withMyAcc \"account for Sean\" User.accountFor + +"""]] |
