Is there a free proxy transformer?

Do you think a free proxy transformer is possible? Something like

data FreePT fpa' ab' bmr = .... instance (Proxy p,Functor f) => Proxy (FreePT fp) where .... instance (Functor f) => ProxyTrans (FreePT f) where .... 

This is not only curiosity, I would actually find it useful.

+7
source share
1 answer

This is not an answer, but it does not fit in a comment.

I also needed similar functionality. I suspect the inner type will look like this:

 -- The same `FreeF` type from the `free` package in `Control.Monad.Trans.Free` data FreeF fax = Pure a | Free (fx) newtype FreeP fpa' ab' bmr = FreeP { unFreeP :: pa' (FreeF fa (FreeP fpa' ab' bmr)) b' (FreeF fb (FreeP fpa' ab' bmr)) m (FreeF fr (FreeP fpa' ab' bmr)) } 

In addition, this may not be possible with current equipment, but this is normal. For example, refer to the StateP proxy transformer, which relies on thread_P from ProxyInternal . A similar thread_P may be required to implement FreeP .

+2
source

All Articles