comparison paste/paste.17882 @ 2752:964d6cdb2609

<hagb4rd> pastelogs fmap
author HackBot
date Mon, 22 Apr 2013 07:40:06 +0000
parents
children
comparison
equal deleted inserted replaced
2751:a692fa71965d 2752:964d6cdb2609
1 2008-02-21.txt:22:54:08: <oerjan> that is: fmap fst (minViewWithKey . snd . split currentLineNo $ currentProgram). i think.
2 2008-06-07.txt:04:25:30: <augur> positive == return, happy == fmap?
3 2008-06-07.txt:04:26:14: <augur> happy is fmap i think
4 2008-06-07.txt:04:27:58: <augur> happy has to be fmap
5 2008-06-07.txt:04:29:32: <augur> fmap is (a -> b) -> f a -> f b
6 2008-06-07.txt:04:29:46: <augur> fmap is (a -> b) -> f a -> f b
7 2008-10-26.txt:00:12:07: <Asztal> I think it definitely makes things more readable in the case of things like `isPrefixOf` and maybe `fmap`
8 2009-02-16.txt:17:25:38: <ehird> > loeb x = fmap (\a -> a (loeb x)) x
9 2009-02-27.txt:18:15:46: <ehird> 18:15 ehird: @pl fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
10 2009-02-27.txt:18:15:46: <ehird> 18:15 lambdabot: fmap (fmap (fmap fmap)) fmap
11 2009-02-27.txt:18:15:50: <ehird> fmap calculus
12 2009-02-27.txt:18:16:25: <ais523> what does fmap do?
13 2009-02-27.txt:18:16:37: <ehird> 18:15 ehird: :t fmap
14 2009-02-27.txt:18:16:38: <oerjan> adding 4 fmaps gives the same after a while
15 2009-02-27.txt:18:16:49: <ehird> for which fmap = (.)
16 2009-02-27.txt:18:17:00: <ehird> for which fmap = map
17 2009-02-27.txt:18:17:17: <ehird> ideally, map and (.) wouldn't exist and fmap would be called (.)
18 2009-02-27.txt:18:17:54: <oerjan> fmap = liftM for monads
19 2009-02-27.txt:18:18:04: <ehird> lambdabot used to have (.) as fmap
20 2009-02-27.txt:18:18:58: <ehird> 18:17 HugoDaniel has left IRC ("fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap vim")
21 2009-02-27.txt:18:19:41: <ehird> ehird: @. type pl fmap . fmap . fmap fmap fmap fmap (fmap . fmap fmap) . fmap fmap fmap
22 2009-03-24.txt:17:08:31: <ehird> "Or even how to implement Haskell's ap/<*> (translated painstakingly to Java) in terms of fmap, return, and join (this is legally considered torture in 49 states)"
23 2009-04-10.txt:20:58:46: <Deewiant> ehird: fmap (Const . read) (many1 digit)
24 2009-05-15.txt:20:28:14: <Deewiant> findFixPoint f = fmap snd . find (uncurry (==)) . (zip `ap` tail) . iterate f
25 2009-06-23.txt:20:36:36: <ehird> @pl \x -> foo `fmap` bar x
26 2009-06-23.txt:20:36:37: <lambdabot> (foo `fmap`) . bar
27 2009-06-24.txt:15:18:37: <Warrigal> <*> looks like fmap.
28 2009-06-24.txt:15:22:31: <Warrigal> s/map/fmap/
29 2009-06-24.txt:15:27:09: <lambdabot> f <$> a = fmap f a
30 2009-06-24.txt:15:27:28: <Warrigal> Woo, it's fmap.
31 2009-06-24.txt:18:00:14: <ehird> pikhq: also, "fmap" is both (.) and map, for functions and lists
32 2009-06-24.txt:18:00:16: <ehird> > fmap succ [1,2,3]
33 2009-06-24.txt:18:00:23: <ehird> > fmap (fmap succ succ) [1,2,3]
34 2009-06-24.txt:19:15:27: <oerjan> l >>= f = join (fmap f l)
35 2009-06-24.txt:19:16:12: <oerjan> fmap = map, since the functor instances agree (parametricity makes it hard/impossible to have more than one Functor instance)
36 2009-06-24.txt:19:16:32: <Gracenotes> I'm pretty sure fmap [] has one sane instance :)
37 2009-06-25.txt:16:31:39: <ehird> :t fmap
38 2009-06-25.txt:16:31:51: <ehird> but that's what fmap is :P
39 2009-06-25.txt:16:36:58: <ehird> @src (->) fmap
40 2009-06-25.txt:16:36:58: <lambdabot> fmap = (.)
41 2009-06-25.txt:16:38:20: <pikhq> I know you can use fmap in order to confuse people instead of ., though...
42 2009-06-25.txt:16:38:41: <ehird> pikhq: it is the opinion of many that map and (.) should not exist, and that fmap should be called (.)
43 2009-06-26.txt:01:09:10: <oerjan> !haskell import System.Random; main = sequence_ . replicate 200 $ fmap (putStr . (["hurf","durf","hurd"]!!)) randomRIO (0,2)
44 2009-06-26.txt:05:24:26: <pikhq> > fmap ord ['\0'..]
45 2009-06-26.txt:05:27:58: <pikhq> > fmap chr $ (+) <$> (fmap ord ['\0'..]) <*> cycle [1]
46 2009-06-26.txt:05:30:49: <pikhq> > fromZipList $ fmap chr $ (+) <$> (fmap ord ['\0'..]) <*> cycle [1]
47 2009-06-26.txt:05:31:16: <pikhq> > getZipList $ zipList (fmap chr $ (+) <$> (fmap ord ['\0'..])) <*> zipList $ cycle [1]
48 2009-06-26.txt:05:31:35: <pikhq> > getZipList $ ZipList (fmap chr $ (+) <$> (fmap ord ['\0'..])) <*> ZipList $ cycle [1]
49 2009-06-26.txt:05:32:21: <immibis> @help fmap
50 2009-06-26.txt:05:32:31: <pikhq> > fmap chr $ fmap (+1) $ fmap ord ['\0'..]
51 2009-06-26.txt:05:33:19: <pikhq> > fmap . fmap . fmap chr (+1) ord ['\0'..]
52 2009-06-26.txt:05:33:54: <gracenotes> *FMAP* *FMAP* *FMAP* *FMAP* *FMAP* *FMAP*
53 2009-06-27.txt:02:16:43: <oerjan> however, m >>= return . f == fmap f m
54 2009-06-27.txt:02:18:02: <oerjan> no, fmap
55 2009-06-27.txt:02:18:07: <lambdabot> f <$> a = fmap f a
56 2009-06-27.txt:02:48:24: <oerjan> = fmap ((*198.838782).(*1079252848.8)) [1..]
57 2009-07-09.txt:20:00:36: <lambdabot> Data.Traversable fmapDefault :: Traversable t => (a -> b) -> t a -> t b
58 2009-07-09.txt:20:00:36: <lambdabot> Prelude fmap :: Functor f => (a -> b) -> f a -> f b
59 2009-07-12.txt:00:15:15: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
60 2009-07-12.txt:00:15:53: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
61 2009-07-12.txt:00:16:03: <Gracenotes> ..however it takes some time to infer longer fmap chains
62 2009-07-12.txt:00:16:14: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
63 2009-07-12.txt:00:17:33: <Gracenotes> oddly enough, it seems that any chain of fmaps always produces djinn functions in the original order
64 2009-07-12.txt:00:17:54: <ehird> :t t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
65 2009-07-12.txt:00:18:07: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
66 2009-07-12.txt:00:18:13: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
67 2009-07-12.txt:00:18:18: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
68 2009-07-12.txt:00:19:16: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
69 2009-07-12.txt:00:19:40: <ehird> :t fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap fmap
70 2009-07-12.txt:00:19:41: <pikhq> I'm renaming fmap.
71 2009-07-12.txt:00:20:38: <ehird> :t let (.) = fmap in (.) . . (.)
72 2009-07-12.txt:00:20:43: <ehird> :t let (.) = fmap in (.) . (. (.))
73 2009-07-12.txt:00:21:05: <ehird> :t let (.) = fmap in (.) . (. (.)) . (((.) . ((.) . (.)) .) . ((.) .) . (.)
74 2009-07-12.txt:00:21:29: <Gracenotes> me no likey (.) = fmap
75 2009-07-12.txt:00:21:31: <ehird> :t let (.) = fmap in (.) . ((.)) . ( ((.) . ((.) . (.)) .) . ((.) .)) . (.)
76 2009-07-12.txt:00:21:39: <ehird> Gracenotes: but (.) and map are useless; they're just fmap
77 2009-07-12.txt:00:21:47: <pikhq> @src (->) fmap
78 2009-07-12.txt:00:21:48: <lambdabot> fmap = (.)
79 2009-07-12.txt:00:21:54: <ehird> @src [] fmap
80 2009-07-12.txt:00:21:54: <lambdabot> fmap = map
81 2009-07-12.txt:00:22:22: <ehird> @unpl let (.) = fmap in (.) . ((.)) . (((.) . ((.) . (.)) .) . ((.) .)) . (.)
82 2009-07-12.txt:00:22:22: <lambdabot> let { (.) = fmap} in (\ z b c f h i l o s -> z (b c f (h i l o s)))
83 2009-07-12.txt:00:22:29: <ehird> @unlet let (.) = fmap in (.) . ((.)) . (((.) . ((.) . (.)) .) . ((.) .)) . (.)
84 2009-07-12.txt:00:24:00: <pikhq> It's like fmap on the monads!
85 2009-07-12.txt:01:01:29: <lambdabot> fmap
86 2009-07-12.txt:01:09:45: <pikhq> :t ap `fmap` ($)
87 2009-07-12.txt:20:33:28: <ehird> pikhq: Cale used to have lambdabot lie about stuff. It had (.) = fmap
88 2009-07-12.txt:20:34:05: <pikhq> fmap should definitely be called fmap.
89 2009-07-12.txt:20:34:28: <pikhq> It's just a special case of fmap.
90 2009-07-15.txt:13:25:56: <ehird> > let (.) = fmap in head . words "aalso evel"
91 2009-07-16.txt:16:18:31: <lambdabot> Data.Traversable fmapDefault :: Traversable t => (a -> b) -> t a -> t b
92 2009-07-16.txt:16:18:31: <lambdabot> Prelude fmap :: Functor f => (a -> b) -> f a -> f b
93 2009-07-16.txt:16:18:33: <ehird> oh it's fmap
94 2009-07-16.txt:18:51:13: <pikhq> @. hoogle t fmap
95 2009-07-16.txt:18:51:38: <pikhq> @. hoogle type fmap
96 2009-08-15.txt:00:55:24: <pikhq> Now if you had asked about the difference between fmap and functional composition, I could say something.
97 2009-08-15.txt:00:55:32: <pikhq> Like, say, fmap being a generalisation.
98 2009-08-17.txt:04:52:36: <ehird> getArgs >>= mapM readFle >>= fmap (map parse)
99 2009-08-17.txt:04:53:32: <ehird> though (do args <- getArgs; contents <- mapM readFile args; parses <- fmap (map parse)) works too, but is tedious
100 2009-08-17.txt:04:54:05: <pikhq> Bah. fmap (map parse) <<= mapM readFile <<= getArgs
101 2009-10-03.txt:21:54:47: <pikhq> (/fmap/map/liftM2...)
102 2009-12-26.txt:13:13:52: <augur> xs >>= (return . f) == fmap f xs
103 2009-12-26.txt:13:17:48: <AnMaster> augur, what is fmap?
104 2009-12-26.txt:13:18:20: <soupdragon> you can define fmap usint >>= and return
105 2009-12-26.txt:13:18:45: <augur> fmap is i think probably somethat you can think of as like
106 2009-12-26.txt:13:20:06: <augur> and so in order to be a Monad you also have to be a Functor which means you have to have fmap defined.
107 2009-12-26.txt:13:20:58: <augur> fmap id x = x
108 2009-12-26.txt:13:21:19: <augur> fmap (f . g) x = fmap f (fmap g x)
109 2009-12-26.txt:13:22:36: <AnMaster> fmap takes a lambda and whatever it is to map over?
110 2009-12-26.txt:13:22:59: <soupdragon> fmap f m = do x <- m ; return (f x)
111 2010-01-05.txt:16:19:41: <oerjan> it's the same as fmap or <$>
112 2010-01-07.txt:01:01:49: <Asztal> (>>=) is SelectMany(), fmap is Select(), return is different for each one.
113 2010-01-09.txt:16:00:59: <ehird> I wish this were Caleskell and (.) = fmap
114 2010-01-09.txt:16:01:07: <ehird> Hey, maybe I could just define (.) = fmap
115 2010-01-09.txt:16:01:10: <Deewiant> You can set (.) = fmap easily
116 2010-01-09.txt:16:03:03: <pikhq> Deewiant: Caleskell makes (.)=fmap.
117 2010-01-09.txt:16:55:46: <ehird> fmap f (Strict a) = strictorlazy (f $! a)
118 2010-01-09.txt:16:55:46: <ehird> fmap f (Lazy a) = lazy (f a)
119 2010-01-09.txt:17:04:12: <ehird> fmap f x = pure f <*> x
120 2010-01-15.txt:17:47:58: <ehird> main = putStr =<< (fmap concat $ getArgs >>= mapM readFile)
121 2010-01-15.txt:17:53:13: <ehird> main = putStr =<< (fmap (reverse . concat) $ getArgs >>= mapM readFile)
122 2010-02-06.txt:14:25:07: <ehird> anyway, {| 2 + {3 ÷ x} |} is nicer to write than fmap (2 +) (3 ÷ x)
123 2010-02-06.txt:14:38:27: <ehird> which is even generaler than o = fmap, i think
124 2010-02-06.txt:14:38:48: <MissPiggy> fmap and o are quite different thuogh
125 2010-02-06.txt:14:39:02: <MissPiggy> fmap should just be map
126 2010-02-06.txt:14:39:14: <ehird> ok, that doesn't allow . = fmap
127 2010-02-13.txt:18:06:09: <alise> Functor f a = <fmap : (a -> b) -> f a -> f b>
128 2010-02-13.txt:18:07:19: <alise> Functor_List a = <fmap f x = map f x>
129 2010-03-07.txt:22:45:57: <alise_> Presumably along the lines of the elimination given by fmap above.
130 2010-04-02.txt:21:46:27: <pikhq> Functors are objects where fmap makes sense.
131 2010-04-02.txt:23:13:47: <oerjan> Quadrescence: as of now you only need to implement (>>=) and return to make a Monad. and haskell doesn't currently have a feature that allows you to deduce a _superclass_ method (Functor's fmap) from that, that's what this class something feature would do
132 2010-04-05.txt:04:42:35: <oerjan> const () `fmap`
133 2010-05-02.txt:23:38:38: <alise__> *Main> fmap biFro [0..10]
134 2010-05-02.txt:23:42:30: <alise__> *Main> fmap decrush [0..20]
135 2010-05-08.txt:23:15:03: <alise_> No, a monad is fmap, join and unit!
136 2010-06-20.txt:01:29:39: <CakeProphet> I wonder why they didn't just make map and fmap the same function.
137 2010-06-20.txt:01:36:24: <CakeProphet> I was wondering because the semantics of fmap only applies f to Right values
138 2010-06-27.txt:03:32:32: <CakeProphet> ah. fmap?
139 2010-07-12.txt:23:41:47: <aliseiphone> !haskell :t fmap fmap fmap
140 2010-07-12.txt:23:41:48: <EgoBot> fmap fmap fmap :: (Functor ((->) (a -> b)), Functor f1, Functor f) =>
141 2010-07-20.txt:21:32:22: <pikhq> AnMaster: It's infix fmap.
142 2010-07-27.txt:03:26:04: <Mathnerd314> oerjan: x `subset` y = and (fmap (`elem` y) x
143 2010-08-06.txt:17:52:09: <alise> *Main> fmap fromRational (approxE 10000)
144 2010-08-09.txt:17:31:31: <alise> fmap id = id
145 2010-08-09.txt:17:31:34: <alise> fmap (f.g) = fmap f . fmap g
146 2010-08-10.txt:22:51:37: <oerjan> Phantom_Hoover: x >>= return . f = fmap f x (or liftM f x)
147 2010-08-10.txt:22:54:18: <Phantom_Hoover> oerjan, hang on, fmap can work without bind, obviously.
148 2010-11-02.txt:11:19:21: <elliott> unify (H (Conj xs)) (S (Conj ys)) = fmap concat . sequence $ zipWith unify xs ys
149 2010-11-02.txt:11:37:31: <elliott> case catMaybes $ map (\(l,r) -> fmap ((,) r) (unify l x)) ys of
150 2010-11-02.txt:11:39:05: <elliott> unify (H (Conj xs)) (S (Conj ys)) = fmap concat . sequence $ zipWith unify xs ys
151 2010-11-02.txt:11:45:24: <elliott> case mapMaybe (\(l,r) -> fmap ((,) r) (unify l x)) ys of
152 2010-11-30.txt:16:27:04: <elliott> map (\(Rule lhs rhs) -> (rhs,) `fmap` sab lhs t) $ rs
153 2010-11-30.txt:17:08:49: <elliott> case catMaybes . map (\(Rule lhs rhs) -> (rhs,) `fmap` sab lhs t) $ rs of
154 2010-12-11.txt:21:58:04: <elliott> join . fmap return == id
155 2010-12-11.txt:21:58:04: <elliott> join . join == join . fmap join
156 2010-12-11.txt:21:58:20: <elliott> oerjan: wait do you need fmap to do a monad? doesn't join/return suffice
157 2010-12-11.txt:22:00:32: <Phantom_Hoover> (>>= f) = join (fmap f), yes?
158 2010-12-11.txt:22:18:00: <elliott> hm so wait how do you do bind in terms of fmap and join?
159 2010-12-11.txt:22:18:10: <elliott> x >>= f = join (fmap f x)
160 2010-12-11.txt:22:23:26: <Phantom_Hoover> Indeed, (>>=) = flip $ join . fmap
161 2010-12-11.txt:22:25:45: <oerjan> (>>=) = flip $ (join .) . fmap
162 2010-12-11.txt:22:27:03: <Phantom_Hoover> bind = (join .) . flip fmap
163 2010-12-11.txt:22:30:26: <Phantom_Hoover> elliott, how's fmap defined for Tree?
164 2010-12-11.txt:22:48:04: <Phantom_Hoover> elliott, fmap (A B : Set) (f : A -> B).
165 2010-12-11.txt:22:48:35: <Phantom_Hoover> fmap [elided or not actually there depending on what's set] id is a type error.
166 2010-12-11.txt:22:49:03: <elliott> Phantom_Hoover: OK, please give me the full definition of fmap.
167 2010-12-11.txt:22:49:13: <elliott> Phantom_Hoover: OK, please give me the full definition of fmap.
168 2010-12-11.txt:22:49:36: <elliott> Phantom_Hoover: OK, please give me the full definition of fmap.
169 2010-12-11.txt:22:50:00: <Phantom_Hoover> Fixpoint fmap (A B : Set) (f : A -> B) (t : tree A) : tree B := [elided].
170 2010-12-11.txt:22:51:57: <Phantom_Hoover> Essentially, I'm told that fmap id is an error as id : ID rather than * -> *.
171 2010-12-11.txt:22:52:26: <elliott> Phantom_Hoover: You might want to try using {A B : Set} in fmap.
172 2010-12-11.txt:22:53:40: <elliott> Coq < Axiom fmap : forall (A B : Set) (f : A -> B) (t : tree A), tree B.
173 2010-12-11.txt:22:53:40: <elliott> fmap is assumed
174 2010-12-11.txt:22:53:48: <elliott> fmap_id
175 2010-12-11.txt:22:55:33: <elliott> Coq < Definition fmap_id (A : Set) (t : tree A) : tree A := fmap A A (id (A:=A)) t.
176 2010-12-11.txt:22:55:33: <elliott> fmap_id is defined
177 2010-12-11.txt:22:58:34: <elliott> Phantom_Hoover: When you say "fmap A A id t", it can't infer what the value of A is in id's type, (forall A, A -> A).
178 2010-12-16.txt:16:54:35: <Phantom_Hoover> ais523, erm... Functor and fmap?
179 2010-12-16.txt:16:55:02: <ais523> in fact, liftM and fmap are IIRC the same function
180 2010-12-18.txt:22:50:11: <Phantom_Hoover> Anything's a monad if you can get return, join and fmap working on it!
181 2010-12-18.txt:22:51:04: <elliott> fmap seems obvious.
182 2010-12-18.txt:22:53:32: <Deewiant> Phantom_Hoover: join . fmap join = join . join
183 2010-12-18.txt:22:54:16: <Deewiant> = join . fmap return
184 2010-12-29.txt:19:43:14: <Phantom_Hoover_> Surely fmap f = (pure f <*>)
185 2010-12-29.txt:19:53:50: <Phantom_Hoover_> Where fmap f = (pure f <*>)
186 2011-01-09.txt:05:46:51: <oerjan> elliott: well it's fmap/liftM + <=< of course
187 2011-01-09.txt:05:48:00: <oerjan> :t (\f x -> fmap f . x)
188 2011-01-09.txt:05:49:20: <oerjan> lambdabot still defines (.) = fmap :D
189 2011-01-09.txt:05:49:47: <elliott> oerjan: but yes, of course it defines (.) = fmap, as specified by the Caleskell Report
190 2011-01-09.txt:05:50:26: <elliott> fmap fmap fmap
191 2011-01-09.txt:05:51:43: <oerjan> indeed it _is_ fmap fmap fmap
192 2011-01-09.txt:05:52:03: <elliott> fmap fmap fmap fmap fmap fmap fmap
193 2011-01-09.txt:05:52:26: <oerjan> elliott: that reiterates after four fmaps
194 2011-01-14.txt:18:01:51: <lambdabot> ([(c1', s1), (c2', s2)] ++) `fmap` apply c xs
195 2011-01-14.txt:18:16:10: <oerjan> 19:04 lambdabot> ([(c1', s1), (c2', s2)] ++) `fmap` apply c xs
196 2011-01-22.txt:15:25:44: <oerjan> in which case, mdo iorefs <- (: iorefs) `fmap` newIORef whatever should work, i don't think you even need unsafeInterleaveIO for that
197 2011-01-23.txt:20:01:41: <lambdabot> NB: In lambdabot, (.) = fmap
198 2011-01-23.txt:20:03:28: <elliott> olsner: imo map needs to become fmap
199 2011-01-29.txt:03:37:37: <oerjan> :t \f x -> fmap ($ x) f
200 2011-01-29.txt:03:38:03: <elliott> @pl \f x -> fmap ($x) f
201 2011-01-29.txt:03:38:03: <lambdabot> flip (fmap . flip id)
202 2011-01-29.txt:03:38:16: <elliott> let flip = flip (fmap . flip id)
203 2011-01-29.txt:03:52:56: <oerjan> :t \f x -> fmap ($x) f
204 2011-01-29.txt:03:55:23: <oerjan> :t (\f x -> Data.Traversable.traverse f x) `asTypeOf` (\f x -> fmap ($x) f)
205 2011-01-29.txt:03:58:11: <oerjan> :t (\f x -> Data.Traversable.sequenceA f x) `asTypeOf` (\f x -> fmap ($x) f)
206 2011-01-31.txt:02:26:15: <lambdabot> Prelude fmap :: Functor f => (a -> b) -> f a -> f b
207 2011-01-31.txt:02:32:30: <elliott> fmap fmap fmap
208 2011-01-31.txt:02:35:11: <oerjan> :t let map f (Left x) = fmap f x; map f (Right b) = Nothing in map
209 2011-01-31.txt:02:35:51: <oerjan> :t let map f (Left x) = Just $ fmap f x; map f (Right b) = Nothing in map
210 2011-01-31.txt:02:36:47: <oerjan> :t let map f (Left x) = Just $ fmap f x; map f (Right False) = Nothing; map f (Right True) = [] in map
211 2011-01-31.txt:02:36:55: <oerjan> :t let map f (Left x) = Just $ fmap f x; map f (Right False) = Nothing; map f (Right True) = Just [] in map
212 2011-02-03.txt:23:03:52: <lambdabot> Prelude fmap :: Functor f => (a -> b) -> f a -> f b
213 2011-02-03.txt:23:03:52: <lambdabot> Control.Monad fmap :: Functor f => (a -> b) -> f a -> f b
214 2011-02-03.txt:23:04:04: <elliott> @pl flip fmap
215 2011-02-03.txt:23:04:04: <lambdabot> flip fmap
216 2011-02-03.txt:23:09:18: <lambdabot> (`fmap` pUL) . (:<) =<< pSimpleUL
217 2011-02-07.txt:00:40:10: <Deewiant> Use fmap and ap and @unpl
218 2011-02-07.txt:01:16:26: <lambdabot> Data.Traversable fmapDefault :: Traversable t => (a -> b) -> t a -> t b
219 2011-02-07.txt:01:16:26: <lambdabot> Prelude fmap :: Functor f => (a -> b) -> f a -> f b
220 2011-02-07.txt:12:20:21: <lambdabot> (popVec >>=) . (return .) =<< fmap (flip poke) pop
221 2011-02-08.txt:11:41:32: <oerjan> > let (<$) = fmap . const; infixl 1 <$ in do x <- y <$ Just z ; return x
222 2011-02-08.txt:11:41:44: <oerjan> > let (<$) = fmap . const; infixl 1 <$ in do x < - y <$ Just z ; return x
223 2011-02-08.txt:18:13:26: <copumpkin> elliott: I dunno, which do you typically want to fmap?
224 2011-02-09.txt:19:12:46: <elliott> :t fmap
225 2011-02-17.txt:19:50:32: <elliott> oerjan: `fmap` instead of <$>? srsly?
226 2011-02-17.txt:19:57:28: <oerjan> <elliott> oerjan: `fmap` instead of <$>? srsly? <-- if i start using <$>, i'll soon want Applicative notation, and HP's Parsec doesn't have an instance, and basically i don't even want to bother to try because it makes me annoyed
227 2011-03-11.txt:17:35:39: <oerjan> flip and fmap, are there any others like that...
228 2011-04-13.txt:22:57:26: <newsham> oerjan: you could use `fmap` and `ap` instead of <$> and <*> if you wanted to stay in monad
229 2011-04-13.txt:22:57:57: <oerjan> also you mean liftM not fmap
230 2011-04-13.txt:22:58:16: <newsham> ?type (liftM, fmap)
231 2011-05-12.txt:16:10:36: <ais523> I know I tend to define fmap for my own structures if it fits
232 2011-05-12.txt:16:14:24: <ais523> fmapM :: Monad m => (a -> m b) -> (t a) -> m (t b)
233 2011-05-12.txt:16:14:35: <ais523> I think I needed to cross fmap and mapM
234 2011-05-14.txt:10:18:01: <oerjan> synonym for fmap
235 2011-05-14.txt:10:18:03: <CakeProphet> fmap. applies a function to a Functor instance. All monads are functors.
236 2011-05-14.txt:10:20:45: <oerjan> it's the monad equivalent of fmap, existing for stupid "missing subclassing" reasons
237 2011-06-06.txt:22:47:03: <CakeProphet> ah so <$ is fmap.const
238 2011-06-06.txt:22:47:20: <elliott> :t fmap.const
239 2011-06-06.txt:22:48:27: <elliott> because I think we could deduce that (fmap . const) and (<$) are the same by just the types
240 2011-06-06.txt:22:48:35: <lambdabot> fmap :: (a -> b) -> f a -> f b
241 2011-06-06.txt:22:49:00: <oerjan> and i think it applies to fmap.const = (<$)
242 2011-06-06.txt:22:49:25: <elliott> \a b -> fmap _ b
243 2011-06-06.txt:23:04:50: <elliott> > fmap (take 9) (some (Just 9))
244 2011-06-06.txt:23:21:33: <elliott> fmap f (ZipList xs) = ZipList (map f xs)
245 2011-06-13.txt:00:52:51: <elliott_> oh its actually cofmap :: (a -> b) -> acc b -> acc a :P
246 2011-06-13.txt:00:54:19: <elliott_> > fmap succ (9,9)
247 2011-06-13.txt:01:04:35: <elliott_> cofmap :: (a -> b) -> cof b -> cof a
248 2011-06-13.txt:01:04:39: <elliott_> cofmap f (Flip g) = Flip (g . f)
249 2011-06-15.txt:00:59:32: <monqy> not fmap?
250 2011-06-15.txt:00:59:52: <monqy> (I was expecting it to be a synonym of fmap)
251 2011-06-15.txt:00:59:55: <oerjan> i _thought_ they'd also made map a synonym for fmap, but i must have misremembered
252 2011-06-15.txt:01:40:59: <oerjan> it's rather stupid to have map, fmap, <$>, liftM
253 2011-06-15.txt:01:41:43: <lambdabot> f <$> a = fmap f a
254 2011-06-15.txt:01:41:54: <Patashu> so it's just infix fmap
255 2011-06-15.txt:01:41:58: <Patashu> why not just use `fmap` then
256 2011-06-15.txt:01:42:07: <oerjan> Patashu: it can work on functors too, in fact it did before Haskell 98 revision, when fmap = map
257 2011-06-15.txt:01:42:55: <oerjan> it separated map from fmap, making map work just for lists.
258 2011-06-15.txt:01:45:07: <monqy> just use fmap
259 2011-06-15.txt:01:47:56: <monqy> e.g. for a Functor instance of a Monad, fmap f = (>>= return . f)
260 2011-06-15.txt:01:48:27: <lambdabot> fmap :: (a -> b) -> f a -> f b
261 2011-06-15.txt:01:49:59: <Patashu> (+) <$> [1,2] <*> [10,20] becomes <*> ( fmap (+) [1,2] ) ( [10,20] )
262 2011-06-15.txt:01:50:54: <Patashu> > (<*>) ( fmap (+) [1,2] ) ( [10,20] )
263 2011-06-21.txt:11:45:59: <elliott> :t ?f.?g `fmap` x
264 2011-06-21.txt:11:46:02: <elliott> :t ?f.?g `fmap` ?x
265 2011-06-21.txt:11:46:04: <elliott> :t ?f . ?g `fmap` ?x
266 2011-06-21.txt:11:46:05: <lambdabot> cannot mix `.' [infixr 9] and `fmap' [infixl 9] in the same infix expression
267 2011-06-21.txt:12:04:15: <elliott> <elliott> ?pl \f x -> join (fmap f x)
268 2011-06-21.txt:18:53:39: <elliott_> ?pl (\(r,n) -> ifuckinghateyouass r) `fmap` I.zip it countWords
269 2011-06-21.txt:18:53:40: <lambdabot> (ifuckinghateyouass . fst) `fmap` I.zip it countWords
270 2011-06-21.txt:18:53:47: <elliott_> ?pl flip fmap
271 2011-06-21.txt:18:53:47: <lambdabot> flip fmap
272 2011-06-21.txt:18:54:33: <lambdabot> Prelude fmap :: Functor f => (a -> b) -> f a -> f b
273 2011-06-21.txt:18:54:33: <lambdabot> Control.Monad fmap :: Functor f => (a -> b) -> f a -> f b
274 2011-06-21.txt:19:07:04: <elliott_> where opt field ctr = \it -> uncurry (setL field . Just) `fmap` I.zip it ctr
275 2011-06-21.txt:19:32:27: <elliott_> option field ctr = \it -> uncurry (setL field . Just) `fmap` I.zip ctr it
276 2011-06-21.txt:19:39:53: <oerjan> elliott_: perhaps that fmap is also building thunks of what to apply
277 2011-06-23.txt:19:22:47: <elliott_> > foldlM (\r x -> if even x then (9:) `fmap` r else Nothing) [] [0,0,9]
278 2011-06-25.txt:01:03:21: <monqy> :t fmap id
279 2011-07-01.txt:10:21:49: <Deewiant> ?src Either fmap
280 2011-07-01.txt:10:21:49: <lambdabot> fmap _ (Left x) = Left x
281 2011-07-01.txt:10:21:50: <lambdabot> fmap f (Right y) = Right (f y)
282 2011-07-03.txt:02:53:37: <elliott> fmap = liftM
283 2011-07-03.txt:06:59:08: <elliott> fmap f (T ph pf pr) = T ( \ k -> ph ( k .f ))
284 2011-07-03.txt:07:22:14: <elliott> you can't do that fmap
285 2011-07-03.txt:07:26:33: <elliott> so basically I have fmap... for lenses :)
286 2011-07-03.txt:07:27:05: <elliott> yep, what I have is (.), aka generalised fmap :D
287 2011-07-03.txt:07:48:51: <elliott> fmap concat (sequence (concatMap (\(n,_,_) -> [ [d| foo = 9 |] ]) oks))
288 2011-07-03.txt:08:16:00: <elliott> mapM (\(n,_,_) -> funD (transform n) [clause [] (normalB ([|Data.Lens.Lens|] `appE` varE n `appE` lamE [varP _f, varP _x] (recUpdE (varE _x) [(\x->(n,x)) `fmap` [|$(varE _f) ($(varE n) $(varE _x))|]]))) []]) oks
289 2011-07-03.txt:08:35:31: <elliott> mapM (\(n,_,_) -> funD (transform n) [clause [] (normalB ([|Data.Lens.Lens|] `appE` varE n `appE` lamE [varP _f, (asP _x (recP nn [return (n,VarP _y)]))] (recUpdE (varE _x) [(\x->(n,x)) `fmap` [|$(varE _f) $(varE _y)|]]))) []]) oks
290 2011-07-03.txt:11:04:01: <olsner> CakeProphet: you can think of it as fmap (fmap (flip fmap fmap) fmap) fmap, if composition is confusing :)
291 2011-07-03.txt:11:13:35: <olsner> also, (.).(.) = the boobies combinator = fmap fmap fmap
292 2011-07-03.txt:11:16:18: <CakeProphet> but... fmap = (.) for functions right?
293 2011-07-03.txt:11:17:41: <olsner> yes, one functor instance has fmap = (.), and to make matters better lambdabot has (.) defined as fmap
294 2011-07-03.txt:11:24:14: <Phantom_Hoover> <olsner> yes, one functor instance has fmap = (.), and to make matters better lambdabot has (.) defined as fmap
295 2011-07-03.txt:11:33:41: <CakeProphet> :t fmap
296 2011-07-05.txt:00:39:22: <elliott> :t liftM2 (:) (return ?x) (return `fmap` copy ?y)
297 2011-07-05.txt:00:39:24: <elliott> :t liftM2 (:) (return ?x) (return `fmap` ?copy ?y)
298 2011-07-05.txt:00:39:32: <elliott> :t \x y -> liftM2 (:) (return x) (return `fmap` ?copy y)
299 2011-07-05.txt:00:39:43: <elliott> ?pl liftM2 (:) (return x) (return `fmap` ?copy y)
300 2011-07-05.txt:00:39:48: <elliott> ?pl \x y -> liftM2 (:) (return x) (return `fmap` copy y)
301 [too many lines; stopping]