[[!comment format=mdwn
 username="serge1cohen@4282f0c177ae4ac2f90ceddf63d2281e1f739cb1"
 nickname="serge1cohen"
 avatar="http://cdn.libravatar.org/avatar/c86bcca74216ed367c91a99ff27259f0"
 subject="Proposal code, and questrion of polymorphism"
 date="2023-07-11T13:05:10Z"
 content="""
Me again.

To start testing, I have writen a minimal module :

    setProxy :: Url -> Property (HasInfo + UnixLike)
    setProxy u =
        pureInfoProperty \"Providing general proxy information to the host\"
            (InfoVal (HostProxy u))

    getProxy :: Propellor (Maybe HostProxy)
    getProxy = fromInfoVal <$> askInfo

    withProxy :: Desc -> (Maybe HostProxy -> Property DebianLike) -> Property DebianLike
    withProxy desc mkp = property' desc $ \w -> do
        p <- getProxy
        ensureProperty w (mkp p)

In this version the `withProxy` is only handling the case of a `DebianLike` property, whereas I should be able to have a more polymorphic signature akin :

`withProxy :: Desc -> (Maybe HostProxy -> Property a) -> Property a`

But this does not work with the error message :

    [ 76 of 197] Compiling Propellor.Property.Proxy [Source file changed]

    /ActualUsers/serge/IPANEMA/_Info/propellor/src/Propellor/Property/Proxy.hs:37:9: error:
        • ensureProperty outer Property type is not able to be inferred here.
          Consider adding a type annotation.
        • In a stmt of a 'do' block: ensureProperty w (mkp p)
          In the expression:
            do p <- getProxy
               ensureProperty w (mkp p)
          In the second argument of ‘($)’, namely
            ‘\ w
               -> do p <- getProxy
                     ensureProperty w (mkp p)’
       |
    37 |         ensureProperty w (mkp p)
       |         ^^^^^^^^^^^^^^

And I don't know how to provide the information to the compiler that `Property a` may be any type under the `UnixLike` 'metatype'




"""]]
