#haskell - Mon 19 Feb 2007 between 17:29 and 17:41

NY Lost Funds



sjanssenmatthew-_: I think you want liftM2 f
sorearmatthew-_: liftM2
matthew-_many thanks
you guys are great
sorear> liftM2 (+) (Just 3) (Just 4)
lambdabotJust 7
sorear> liftM2 (+) (Just 3) Nothing
lambdabotNothing
sorear> liftM2 (+) [1,2,3] [10,20,30]
lambdabot[11,21,31,12,22,32,13,23,33]
sorear> liftM2 (+) (*2) (*3) 10
lambdabot50
ddariuspjd: Depending on your math background the easiest thing (if it's not all the great) would be to ask about certain things here. E.g. monoids are very simple, but when you have no idea what they are it can be confusing.
pjdi know what they are, yeah
and monads, and functors
ddariuspjd: I didn't know/remember what they were when I started reading CT literature.
JohnnyL@type liftM2
lambdabotforall a1 a2 r (m :: * -> *). (Monad m) => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
ddariusAnyways, one of my favorites is http://www.let.uu.nl/esslli/Courses/barr-wells.html
pjdalso some basic abstract algebra ideas
lambdabotTitle: Courses: Barr / Wells
JohnnyL@src liftM2
lambdabotliftM2 f m1 m2 = do { x1 <- m1; x2 <- m2; return (f x1 x2) }
ddariusThere's a pdf version of that paper that can be found if you'd prefer.
pjdthe lecture notes?
dino-I'm reading the Hughes paper _Generalising Monads to Arrows_, at some point he's discussing class MonadPlus, showing the function to impl as (++). Is that just old? That's not really the operator notation used (except for the [] monad).
soreardino-: that sounds like the kind of thing in the 1.4 prelude ... things were alot more polymorphically useful back then
CaleRight, (++) was the monadic plus in 1.4
ddariuspjd: Yes. Also, these http://www.brics.dk/~mcaccamo/ are very close to how I would (and do in a paper I'm working on) present CT.
lambdabotTitle: Mario Jos&eacute; C&aacute;ccamo
ddarius@google Categorical Manifesto
lambdabothttp://citeseer.ist.psu.edu/goguen91categorical.html
Title: A Categorical Manifesto - Goguen (ResearchIndex)
ddariusFinally, that is a good read.
Albeit, not an introduction or tutorial.
dino-sorear, Cale: Interesting. Thank you.
pjdmuch thanks
those are all new to me
nominolo@impl init
lambdabotMaybe you meant: pl unpl

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 

IrcArchive

NY Lost Funds