Conversation
|
Oh, actually, there was the newtype iso thing that we could include here too, right? |
|
|
||
| instance distributiveCostar :: Distributive f => Distributive (Costar f a) where | ||
| distribute f = Costar \g -> map ((_ $ g) <<< unCostar) f | ||
| distribute f = Costar \a -> map (\(Costar g) -> g a) f |
There was a problem hiding this comment.
Do we need the Distributive constraint on f here?
|
Looks good. Yes, having something like mapNewtype :: forall new old p. (Newtype new old, Profunctor p) => p old old -> p new newwould be good, but we can leave it for a minor release if you like. |
| wrapIso :: forall t a p. (Newtype t a, Profunctor p) => p t t -> p a a | ||
| wrapIso = dimap wrap unwrap | ||
|
|
||
| unwrapIso :: forall t a p. (Newtype t a, Profunctor p) => p a a -> p t t |
There was a problem hiding this comment.
Do you think we need a a -> t argument here to make type inference work in some cases?
There was a problem hiding this comment.
Ah good point, probably. I was going to ask though - do we need both versions here? I know you can turn a profunctor iso lens around, but you need to bring lenses in for that, right?
There was a problem hiding this comment.
I think both are potentially useful, right? Actually, are these the wrong way around?
There was a problem hiding this comment.
Only if you think the names should make sense... ahem.
There was a problem hiding this comment.
On that note, are these names any good anyway?
No description provided.