Mercurial > repo
view paste/paste.26426 @ 9994:d8734db325b9
<hppavilion[1]> le/rn Rogue One//Any regular who gives the slightest Rogue One spoiler shall be hunted down in real life and have their intestines removed through their eye sockets. Members would not be exempt if they existed, which they don\'t.
author | HackBot |
---|---|
date | Sat, 17 Dec 2016 23:40:13 +0000 |
parents | 76650e2fc100 |
children |
line wrap: on
line source
2012-12-21.txt:21:17:04: <shachaf> zzo38: How about Profunctor? 2012-12-23.txt:22:46:51: <shachaf> p is usually a profunctor 2012-12-30.txt:07:11:01: <shachaf> monqy: are you an expert in corepresentable profunctors too 2012-12-31.txt:20:57:31: <shachaf> `quote profunctor 2013-01-02.txt:04:32:12: <shachaf> +findOf :: (RepresentableProfunctor p, Profunctor q, Comonad (Rep p)) => Overloading p q (Accessor (Endo (Maybe a))) s t a b -> p a Bool -> q s (Maybe a) 2013-01-02.txt:04:38:47: <shachaf> +imapMOf_ :: (Profunctor q, Monad m) => Overloading (Indexed i) q (Accessor (Sequenced m)) s t a b -> (i -> a -> m r) -> q s (m ()) 2013-01-02.txt:04:38:50: <shachaf> +iconcatMapOf :: Profunctor q => Overloading (Indexed i) q (Accessor [r]) s t a b -> (i -> a -> [r]) -> q s [r] 2013-01-02.txt:04:38:54: <shachaf> +ifindOf :: Profunctor q => Overloading (Indexed i) q (Accessor (Endo (Maybe a))) s t a b -> (i -> a -> Bool) -> q s (Maybe a) 2013-01-02.txt:04:38:57: <shachaf> +itoListOf :: Profunctor q => Overloading (Indexed i) q (Accessor (Endo [(i,a)])) s t a b -> q s [(i,a)] 2013-01-02.txt:05:00:28: <shachaf> There's a class Profunctor p where lmap :: (a -> b) -> p b c -> p a c; rmap :: (b -> c) -> p a b -> p a c 2013-01-02.txt:05:02:59: <shachaf> zzo38: We have a lot of (co)representable profunctors. 2013-01-02.txt:05:05:41: <shachaf> Not all instances of Profunctor are categories. 2013-01-02.txt:05:08:20: <shachaf> So you can use profunctors to make this different representation of lenses. 2013-01-02.txt:05:09:09: <shachaf> If you pick Profunctor as your constraint, what you get is an isomorphism. 2013-01-02.txt:05:11:44: <shachaf> (forall f. Profunctor f => p a b -> p s t) ~~ (s -> a, b -> t) 2013-01-02.txt:05:12:10: <shachaf> It's a very polymorphic function, so it knows almost nothing about which profunctor you're using. 2013-01-02.txt:05:14:11: <shachaf> (This means that you have to pick some specific concrete profunctor to use.) 2013-01-02.txt:05:19:44: <shachaf> Try to make it a Profunctor instance. :-) 2013-01-02.txt:05:27:40: <shachaf> So pretty much the same trick works for profunctors. 2013-01-02.txt:05:34:58: <shachaf> So that's the basic idea of profunctor lenses. 2013-01-02.txt:05:38:22: <shachaf> +ifindOf :: Profunctor q => Overloading (Indexed i) q (Accessor (Endo (Maybe a))) s t a b -> (i -> a -> Bool) -> q s (Maybe a) 2013-01-02.txt:05:39:34: <elliott> shachaf: well, this isn't quite profunctor stuff directly 2013-01-02.txt:05:47:14: <shachaf> So we get (Profunctor p, Indexable i p, Coindexable j q, Applicative f) => p a (f b) -> q s (f t) 2013-01-02.txt:05:52:50: <shachaf> pins :: (Bizarre p q w, RepresentableProfunctor p) => q (w a b t) [Rep p a] 2013-01-02.txt:16:52:57: <shachaf> i love profunctors 2013-01-03.txt:23:35:38: <shachaf> profunctors 2013-01-04.txt:05:38:45: <shachaf> `echo symmetric lenses > profunctor lenses 2013-01-09.txt:16:12:51: <shachaf> A profunctor lens is representable as either (p a b -> p s t) or as (q t s -> q b a) 2013-01-10.txt:01:40:26: <shachaf> (Well, the last one is just the contravariant half of a profunctor, actually.) 2013-01-10.txt:02:01:47: <shachaf> I suppose that only comes about from categories. With profunctors you get sane (but weird) things. 2013-01-13.txt:22:56:40: <shachaf> monqy: btw did you hear about the "latest advances in profunctor lenses" 2013-01-13.txt:22:57:45: <shachaf> old profunctor lenses = worst thing ever 2013-01-13.txt:23:23:16: <shachaf> Lots of useful profunctors aren't categories. 2013-01-13.txt:23:32:38: <shachaf> monqy: btw edwardk shipped the new profunctors 2013-01-29.txt:10:39:22: <shachaf> coppro: So can you tell me about things that are corepresentable by a costrong copprofunctor? 2013-02-03.txt:08:33:50: <shachaf> and if you think about it profunctor-lenses and simple-lenses are related to "substitutatutatatututability" 2013-02-03.txt:09:18:55: <shachaf> i think these two have a "common superclass" (other than profunctor) 2013-02-03.txt:17:55:06: <shachaf> kmc: And I think functor/profunctor lenses correspond to Liskov substitutability. 2013-02-13.txt:22:15:41: <shachaf> profunctors are better 2013-02-25.txt:21:35:48: <shachaf> monqy: are profunctors dumb 2013-02-25.txt:21:36:08: <boily> shachaf: profunctors are time-traveling evil monstrosities. 2013-02-25.txt:21:36:15: <shachaf> monqy: what about profunctor + strong + choice + category 2013-02-25.txt:21:37:14: <shachaf> profunctor + strong + category 2013-04-02.txt:02:35:31: <oerjan> shachaf: eek it's spreading https://www.fpcomplete.com/user/liyang/profunctors 2013-04-02.txt:05:59:51: <shachaf> Bike: elliott thinks profunctors are too hard for you. 2013-04-08.txt:01:38:25: <shachaf> did you learn about profunctors yet ............... 2013-06-12.txt:11:05:06: <shachaf> mnoqy: do you understand profunctor lenslikes