27 Aug 20:56
Re: Haskell symbol ~
Neil Mitchell <ndmitchell <at> gmail.com>
2008-08-27 18:56:56 GMT
2008-08-27 18:56:56 GMT
Hi > At the same place, I found that example, > but wasn't wise enough to figure out > what it does: > > (f *** g) ~(x,y) = (f x, g y) > > Can you help me understand it? It means exactly the same as: (f *** g) xy = (f (fst xy), g (snd xy)) i.e. if you call (f *** g) undefined, you will get (f undefined, g undefined). If the pattern was strict (i.e. no ~) you would get undefined. Please update the keyword wiki so it makes sense to you, after you have got your head round it. Thanks Neil
RSS Feed