#haskell - Fri 9 Mar 2007 between 01:49 and 04:35

NY Lost Funds



faxI guess ill just use if
jcreighfax: what are you trying to do, anyway?
faxtrying to get rid of else return () in:
glguy?src when
lambdabotwhen p s = if p then s else return ()
hpastefax pasted "(no title)" at http://hpaste.org/889
faxwell I tried when but it just says, Couldn't match expected type `()' against inferred type `IO ()'
hm
hpasteglguy annotated "(no title)" with "with when" at http://hpaste.org/889#a1
faxOhhh
I see exactly why that works now
ok thats great cheers again :D
hpasteglguy annotated "(no title)" with "=<< chaining (if you were interested)" at http://hpaste.org/889#a2
glguyoops, you'd delete the 'l'
faxooh
I didnt notice the =<< bit
jcreighthunk is the first WM I've seen with comments giving the complexity of internal functions... (not that I make a habit of reading WM source code...who knows, maybe that sort of thing is all over in, oh, stumpwm or whatever.)
glguyit doesn't necessarily help anything here, just showing
faxyeah I was just reading about >> and >>=
so I think I sort of see whats going on there
glguydoes it give the complexity assume a strict execution?
assuming
newshamhttp://koweycode.blogspot.com/2007/01/think-of-monad.html <- added a comment.
lambdabotTitle: koweycode: think of a monad...
jcreighglguy: I don't know enough to answer your question. I just see comments that say "/O(log n)/" and I assumed that it meant something. :)
sjanssenglguy: yes, it assumes strict evaluation, because the underlying data structures are spine strict
glguygood deal :)
dmwitlispy: it ignores :t for me, but ?type works.
rahikkaladmwit: I'm not a /b/tard, but other people on some of the IRC channels I'm on are
dmwit=(
Sorry.
dancorfor testing do you usually write a fcn that you call from ghci, or can you do something cool like python if __name__ == '__main__' for testing modules
lispydancor: most people would use smallcheck, quickcheck or hunit for testing
dancor: python's trick doesn't really have an analog
dancorlispy: but even then your test code goes somewhere right
lispydancor: well, you can use #ifdefs to hide it
dancorlispy: is it unusual to have a test fcn in there that isn't actually used in the normal executable
lispythat's fairly common with hunit users
dancorok
lispyi need to go to bed, but i bet a some google searches could turn up some nice examplse

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 

IrcArchive

NY Lost Funds