00:00:00 --- log: started haskell/10.01.16 00:00:27 --- quit: hackagebot (Remote closed the connection) 00:00:40 --- join: Flarelocke1 (n=sfodstad@c-71-193-197-4.hsd1.or.comcast.net) joined #haskell 00:01:27 --- join: hackagebot (n=hackageb@joyful.com) joined #haskell 00:01:42 --- quit: Quadresce_ (Client Quit) 00:02:06 --- join: Saizan (n=saizan@host236-200-dynamic.27-79-r.retail.telecomitalia.it) joined #haskell 00:04:34 okay - I'm stumped for the night 00:04:37 good night 00:05:01 --- quit: mtnviewmark () 00:05:59 --- quit: erg0t (Remote closed the connection) 00:08:07 --- quit: Rotaerk_ ("Leaving") 00:09:21 --- join: paulvisschers (n=paulviss@105-14-ftth.onsnetstudenten.nl) joined #haskell 00:09:22 --- join: jaspervdj (n=jaspervd@ip-83-134-146-6.dsl.scarlet.be) joined #haskell 00:09:37 --- join: ts33kr_ (n=ts33kr@169-123-135-95.pool.ukrtel.net) joined #haskell 00:09:37 --- quit: Nomad010 (Read error: 110 (Connection timed out)) 00:11:17 --- quit: mikmik () 00:11:49 --- quit: ts33kr (Read error: 60 (Operation timed out)) 00:12:12 <[Bool]> hi, does anyone know where I can paste my script so I can show it to someone 00:12:22 @paste 00:12:23 Haskell pastebin: http://moonpatio.com/fastcgi/hpaste.fcgi/ 00:12:44 <[Bool]> oh nice thanks 00:13:38 --- quit: PepeSilvia ("leaving") 00:14:07 --- join: mtnviewmark (n=markl@m208-18.dsl.rawbw.com) joined #haskell 00:14:13 okay - so I'm back 00:14:14 --- quit: dnm_ (Read error: 110 (Connection timed out)) 00:14:25 <[Bool]> hello, welcome back 00:14:36 that thing --- it's in the .hi file for Data.Generics.SYB.WithClass.Instances 00:14:39 but not in the .o file 00:14:49 would that be, perhaps, a compiler bug? 00:15:14 Data.Generics.SYB.WithClass 00:15:23 --- quit: O_4 () 00:15:25 Data.Generics.SYB.WithClass.Instances.dataType[abOQ] 00:15:27 rather 00:15:37 --- quit: araujo ("Leaving") 00:15:52 that is the closure - which is in the interface file, but not in the .o or .a --- and hence 00:16:04 something compiled against this doesn't link 00:16:11 --- join: mahogny (n=mahogny@c-9ca372d5.032-230-73746f34.cust.bredbandsbolaget.se) joined #haskell 00:17:36 and as if Douglas Adams was watching --- it is dataTypeOf42 00:18:31 --- join: gio123 (n=jhjhxh@gprs1.gprs.ge) joined #haskell 00:19:13 jaspervdj: your examples for hakyll use Text.Render rather than Text.Hakyll.Render 00:19:36 --- quit: fhobia (Read error: 113 (No route to host)) 00:20:12 uh, in the tutorial, you mean? 00:20:50 --- join: thetallguy1 (n=beshers@cpe-75-80-161-44.san.res.rr.com) joined #haskell 00:20:59 kamatsu: I see, you're right 00:21:05 kamatsu: I'll fix it 00:21:22 --- quit: thetallguy (Read error: 104 (Connection reset by peer)) 00:21:48 --- quit: mmaruseacph2 (Remote closed the connection) 00:22:09 --- quit: mwc_ ("leaving") 00:22:10 --- quit: ksf (Read error: 110 (Connection timed out)) 00:23:18 jaspervdj: $root gives me errors, what am i doing wrong 00:23:28 jaspervdj: hakyll.hs: Key not found: "root" 00:24:10 <[Bool]> hello, can anyone tell me what I am doing wrong here? I am trying to make a function that takes in a number x and gives back it's factorial. This is what I have: 00:24:12 <[Bool]> ftr x = [1..x] 00:24:13 <[Bool]> ftr [] = [] 00:24:13 <[Bool]> ftr (x:xs) = (ftr x)* (ftr xs) 00:24:32 --- join: danvet (n=daniel@cable-static-49-187.intergga.ch) joined #haskell 00:24:39 [Bool]: uh, why do you have a list there? 00:24:52 kamatsu: are you sure you're using hakyll >= 1.0 00:24:58 <[Bool]> so that the list can multiply with one before 00:25:02 jaspervdj: let me check, i just cabal install hakyll 00:25:04 <[Bool]> so say factorial 10 00:25:15 <[Bool]> 1..10 is gonna give me 1,2,3,4 00:25:25 <[Bool]> then i want to multiply all them together 00:25:33 [Bool]: okay, so that's: 00:25:41 [Bool]: you shoul define two distinct functions 00:25:53 mtnviewmark: did you build syb-with-class yourself? is syb-with-class built as part of building happstack-data? 00:25:54 ftr x = foldl (*) 1 [1..x] 00:25:58 if you call them both ftr they are assumed to be a single one 00:26:07 I cabal install'd it myself 00:26:16 and reinstalled it just this evening 00:26:27 <[Bool]> ok thanks 00:26:37 <[Bool]> but I'd rather not use foldl 00:26:37 jaspervdj: ah, forgot to cabal update 00:26:41 <[Bool]> it's built in 00:26:52 [Bool]: right, so, without built in functions, you should reimplement foldl and do that 00:26:58 --- quit: Taejo ("Leaving") 00:27:02 <[Bool]> oh ok 00:27:08 <[Bool]> @src foldl 00:27:09 foldl f z [] = z 00:27:09 foldl f z (x:xs) = foldl f (f z x) xs 00:27:18 kamatsu: also, refresh the web page, I fixed it already :-) 00:27:18 mtnviewmark: are you on ghc 6.12? try installing it with documentation and profiling disabled, that helped for me 00:27:25 jaspervdj: great 00:27:30 uh, wouldn't it work to say: fac x = x * (fac (x-1)) 00:27:50 I'm on 6.10.4 00:27:58 Geheimdienst: and fac 0 = 1, yeah 00:28:00 <[Bool]> gehei: wow nice thinking 00:28:12 [Bool]: That is how factorial is usually defined mathematically. 00:28:21 oy, but turning off profiling means my whole happstack install will have to be non-profiling 00:29:04 [Bool]: frankly i'm suprised you hadn't seen that one before.. hence i gave the foldl example 00:29:13 [Bool]: It's on the wikipedia page for haskell 00:29:22 <[Bool]> o 00:29:56 --- join: Nomad010 (n=nomad@pc08.tsl.uct.ac.za) joined #haskell 00:29:59 this thing in question seems to be something generated from $( deriveData [''ByteString] ) 00:31:55 so, I see that the .hi file (when dumped) has two objects of the form dataType[a... 00:32:30 and the .a and .p_a files also, each have two symbols of the form dataTypeZMa.... 00:32:35 only they don't match 00:34:05 AHA 00:34:30 correction -- the .p_hi file - the interface file for the profiling version matches the .p_a profiling lib 00:35:05 the NON profiling interface file .hi -- has symbols that don't match the .a lib! 00:35:53 I know that symbol names get munged with every optimization step 00:35:57 --- quit: hgolden ("Konversation terminated!") 00:35:58 I wonder if this is a bug of some sort with that 00:36:13 okay - now I really have get to sleep 00:36:20 I will plow forward tomorrow 00:36:24 --- quit: mtnviewmark () 00:36:35 good night, and good luck 00:37:53 --- quit: kadoban_ (Read error: 104 (Connection reset by peer)) 00:38:59 --- join: kadoban (n=mud@cpe-24-93-17-195.rochester.res.rr.com) joined #haskell 00:40:00 --- join: mrothe (n=markus@exherbo/developer/mrothe) joined #haskell 00:40:34 --- join: tibbe (n=tibell@81.62.59.227) joined #haskell 00:40:54 --- join: xinming_ (n=hyy@218.73.142.34) joined #haskell 00:40:57 --- quit: xinming (Read error: 104 (Connection reset by peer)) 00:41:48 --- join: c_wraith (n=c_wraith@209.237.247.90) joined #haskell 00:47:48 --- quit: mrothe ("leaving") 00:47:53 --- join: mrothe (n=markus@exherbo/developer/mrothe) joined #haskell 00:49:28 --- join: altmattr (n=altmattr@124-168-167-241.dyn.iinet.net.au) joined #haskell 00:50:33 I have been doing a lot of html/js/css coding recently with jQuery and it struck me just how exceedingly functional the "query the DOM" approach is 00:50:40 poucet: Hello, are you here? 00:50:52 is anyone doing work on creating guis in haskell using this approach? 00:52:24 --- quit: cognominal (Read error: 104 (Connection reset by peer)) 00:52:44 --- join: nomadmonad (n=nomadmon@dsl-hkibrasgw1-ffcec300-71.dhcp.inet.fi) joined #haskell 00:53:13 altmattr: indeed, you might even say jquery's $ is a monad... 00:53:31 or at least a functor 00:55:06 --- join: iblechbot (n=iblechbo@ppp-93-104-37-203.dynamic.mnet-online.de) joined #haskell 00:55:39 it is also a really nice way to code a gui as well - I used to hate it terribly, but modern js libs pull the DOM approach ahead of the nested containers (QT, swing, etc) if you ask me 00:57:07 --- part: Geheimdienst left #haskell 00:57:41 altmattr: i agree 00:57:52 functors are fun 00:58:00 --- quit: Raynes (Read error: 110 (Connection timed out)) 00:58:39 you could make it a full blown monad with little work 00:58:40 --- join: LouisJB (n=LouisJB@louisb.gotadsl.co.uk) joined #haskell 01:00:13 --- join: lpsmith (n=lpsmith@unaffiliated/lpsmith) joined #haskell 01:02:12 "$ is a monad" because of how it's similar to list comprehensions? 01:03:55 --- join: int-e (n=noone@td9091a4f.pool.terralink.de) joined #haskell 01:06:17 --- join: kqrx_ (n=kqrx@90-230-116-157-no61.tbcn.telia.com) joined #haskell 01:07:52 --- quit: kqrx (Read error: 110 (Connection timed out)) 01:07:58 --- join: master_of_master (i=master_o@p57B57DF5.dip.t-dialin.net) joined #haskell 01:08:33 --- quit: shivnetra (Client Quit) 01:09:58 --- join: tibbe_ (n=tibell@74.125.121.49) joined #haskell 01:10:16 Saizan: if the language of the client side of the web was haskell, it would be a dom comprehension or dom monad 01:11:52 yeah, so the bind would be essentially concat 01:11:55 *concatMap 01:12:05 yeah 01:13:05 --- quit: Nomad010 (Read error: 110 (Connection timed out)) 01:14:42 --- join: gogonkt_ (n=info@218.13.46.1) joined #haskell 01:17:05 --- join: dr_maligno___ (n=dr_malig@95.214.95.224) joined #haskell 01:17:12 it's a bit of a shame that saying "give me all the nodes with id foo" takes time proportional to the page size 01:17:13 --- join: tibbe__ (n=tibell@81.62.59.227) joined #haskell 01:17:29 --- quit: dr_maligno___ (Client Quit) 01:17:46 Hm, in which implementation? 01:18:25 --- quit: tibbe (Read error: 104 (Connection reset by peer)) 01:18:26 --- nick: tibbe__ -> tibbe 01:18:29 firefox in my case 01:18:57 --- join: MrFahrenheit (n=RageOfTh@users-55-45.vinet.ba) joined #haskell 01:19:11 too bad it's not practical to enforce that ids actually be unique. (bad web designers would blame the browser, loudly, and cause pr incidents) 01:19:36 --- quit: jaspervdj ("leaving") 01:20:07 i could say the same for class :) 01:20:25 * Saizan doesn't have a benchmark though 01:20:34 --- quit: master_o1_master (Read error: 110 (Connection timed out)) 01:22:36 --- quit: dju__ (Client Quit) 01:23:16 --- join: _Jedai_ (n=kvirc@ARouen-252-1-64-84.w90-23.abo.wanadoo.fr) joined #haskell 01:23:35 --- quit: tibbe_ (Read error: 60 (Operation timed out)) 01:24:07 --- join: dju (i=dju@89-158-236-229.rev.dartybox.com) joined #haskell 01:25:48 --- quit: gogonkt (Read error: 110 (Connection timed out)) 01:27:45 --- quit: dr_maligno_ (Read error: 110 (Connection timed out)) 01:28:13 --- quit: perspectival (Read error: 110 (Connection timed out)) 01:28:26 --- quit: ttt-- (Remote closed the connection) 01:28:42 --- quit: tibbe () 01:30:32 --- quit: Raymond (Client Quit) 01:30:36 --- join: tibbe (n=tibell@81.62.59.227) joined #haskell 01:31:18 --- quit: monochrom ("This computer has woken up.") 01:31:31 --- join: Raymond (n=Raymond@adsl-70-132-1-166.dsl.snfc21.sbcglobal.net) joined #haskell 01:31:36 --- quit: Zeiris (Read error: 104 (Connection reset by peer)) 01:31:51 --- join: jaspervdj (n=jaspervd@ip-83-134-146-6.dsl.scarlet.be) joined #haskell 01:31:55 --- quit: jaspervdj (Client Quit) 01:32:59 I need to learn this language now 01:36:22 LYAH is usually a good place to start http://learnyouahaskell.com/ 01:37:07 --- quit: tibbe () 01:39:50 --- join: napsy (n=luka@93-103-201-54.dynamic.dsl.t-2.net) joined #haskell 01:44:37 --- quit: weihsiu (Client Quit) 01:44:39 --- nick: nablaa_ -> nblaa 01:44:45 --- nick: nblaa -> nablaa 01:44:52 --- join: tibbe (n=tibell@81.62.59.227) joined #haskell 01:46:01 --- join: domor (n=user@i114-180-123-126.s06.a014.ap.plala.or.jp) joined #haskell 01:47:59 --- join: dnm_ (n=dnm@c-68-49-47-248.hsd1.va.comcast.net) joined #haskell 01:49:15 --- join: tingi (i=tingi_1@unaffiliated/tingi) joined #haskell 01:50:21 --- join: Axman6 (n=Axman6@pdpc/supporter/student/Axman6) joined #haskell 01:51:31 --- part: tingi left #haskell 01:53:30 c_wraith: even non-unique lookups could be fast.. 01:53:52 Peaker: it's true. My comment was tangentially related at best 01:55:23 --- quit: altmattr () 01:56:03 --- join: der_eq (n=eq@dslb-088-070-001-062.pools.arcor-ip.net) joined #haskell 01:57:35 --- join: saterus (n=user@dsl092-048-071.sfo4.dsl.speakeasy.net) joined #haskell 01:57:40 --- join: paolino (n=paolino@host137-41-dynamic.20-87-r.retail.telecomitalia.it) joined #haskell 02:00:21 --- quit: rfh () 02:00:54 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 02:02:23 --- quit: novas0x2a ("Leaving.") 02:03:11 --- join: d0ugal (n=dougal@84.19.236.179) joined #haskell 02:03:46 --- quit: chrisf (Read error: 110 (Connection timed out)) 02:04:34 --- quit: nomadmonad () 02:05:15 --- join: anklav (n=quassel@87.252.235.42) joined #haskell 02:05:29 --- join: jaspervdj (n=jaspervd@ip-83-134-146-6.dsl.scarlet.be) joined #haskell 02:06:16 --- join: altmattr (n=altmattr@124-168-167-241.dyn.iinet.net.au) joined #haskell 02:07:08 --- nick: ts33kr_ -> ts33kr 02:09:00 --- join: Tobsan (n=wto@c83-249-244-102.bredband.comhem.se) joined #haskell 02:11:24 --- join: lazni (n=lazni@118.71.1.87) joined #haskell 02:12:47 --- join: Athas (n=athas@0x50a157d6.alb2nxx15.dynamic.dsl.tele.dk) joined #haskell 02:12:50 --- quit: xinming_ (Read error: 104 (Connection reset by peer)) 02:13:31 --- quit: eagletmt ("Tiarra 0.1+svn-35634: SIGINT received; exit") 02:14:51 --- join: xinming (n=hyy@125.109.76.217) joined #haskell 02:15:01 --- nick: Tobsan -> wto 02:18:27 --- join: eagletmt (n=eagletmt@pa3307d.kngwnt01.ap.so-net.ne.jp) joined #haskell 02:18:36 --- join: itewsh (n=itewsh@ATuileries-152-1-57-172.w82-123.abo.wanadoo.fr) joined #haskell 02:18:39 --- quit: saterus (Read error: 113 (No route to host)) 02:19:22 --- join: PepeSilvia (n=bspaans@82-170-80-87.ip.telfort.nl) joined #haskell 02:21:40 --- quit: alvarezp (Read error: 60 (Operation timed out)) 02:22:05 --- quit: ramses_ (Read error: 110 (Connection timed out)) 02:22:16 --- part: altmattr left #haskell 02:23:21 --- quit: amuck (Read error: 60 (Operation timed out)) 02:23:36 --- quit: anklav (Remote closed the connection) 02:23:56 --- join: visof (n=visof@41.238.235.79) joined #haskell 02:29:15 --- quit: domor (Read error: 104 (Connection reset by peer)) 02:30:42 --- nick: AndyP_ -> AndyP 02:31:36 --- join: alvarezp (n=alvarezp@201.160.167.202.cable.dyn.cableonline.com.mx) joined #haskell 02:31:36 So how worky is GHC 6.12? 02:31:45 If I replace 6.10.4 with it will I be happy and satisfied with my world? 02:31:50 --- quit: tibbe () 02:31:50 Will the Haskell Platform work? 02:32:04 pretty sure that the platform doesn't work with 6.12 02:34:24 Darn. 02:34:33 (I want fancy type families.) 02:34:54 --- quit: napsy ("Lost terminal") 02:34:58 --- join: jayne (i=maddhatt@freenode/staff/jayne) joined #haskell 02:35:01 --- join: alfa (n=alfa@93-34-164-222.ip50.fastwebnet.it) joined #haskell 02:35:01 Un Saluto a tutti 02:35:13 --- join: amuck (n=amuck@h245.61.19.98.dynamic.ip.windstream.net) joined #haskell 02:35:20 --- quit: amiri (Read error: 104 (Connection reset by peer)) 02:35:46 --- join: domor (n=user@i114-180-123-126.s06.a014.ap.plala.or.jp) joined #haskell 02:35:56 --- join: amiri (n=amiri@cpe-76-90-107-15.socal.res.rr.com) joined #haskell 02:36:02 --- quit: jaspervdj ("leaving") 02:36:05 --- part: soiamso left #haskell 02:36:12 --- quit: alfa (Client Quit) 02:37:19 --- join: napsy (n=luka@93-103-201-54.dynamic.dsl.t-2.net) joined #haskell 02:37:21 the haskell platform doesn't "work" with a compiler ehird 02:37:27 it is a bundle of compiler and libraries 02:37:33 --- join: dschoepe (n=dschoepe@unaffiliated/dschoepe) joined #haskell 02:37:34 i nkow 02:37:36 --- nick: smiler_ -> smiler 02:37:36 *know 02:37:38 you can always grab 6.12.1 and all the libraries that come with the platform 02:37:40 i just mean do all the libraries work with 6.12 02:37:48 or is there breakage 02:37:58 my experience so far has been that things just-work 02:38:21 the only thing I found broken was breifly zlib didn't compile, and I think that was an OS X 64 bit issue, not a ghc 6.12 issue 02:40:07 --- quit: smorg (Remote closed the connection) 02:40:47 well, actually, each release of the Haskell Platform is designed around a specific version of ghc 02:41:13 --- join: polux (n=brauner@cht33-1-82-228-78-155.fbx.proxad.net) joined #haskell 02:41:34 if it works with the next it's just luck :) 02:41:38 --- nick: polux -> Guest96239 02:42:29 --- join: smorg (n=smorg@174-20-139-221.mpls.qwest.net) joined #haskell 02:43:28 the last 6.10 haskell platform release was meant to be september 02:43:32 didn't happen ? 02:44:50 --- quit: phr (Remote closed the connection) 02:45:03 when was 2009.2.0.2 released? 02:45:38 --- quit: lpsmith (Read error: 60 (Operation timed out)) 02:46:04 July 2009 02:49:33 --- join: emma_ (n=em@unaffiliated/emma) joined #haskell 02:49:46 --- quit: Niccus ("out") 02:49:54 Saizan: right, the point I was making was that you could grab the libraries and get on with it – it'll be newer versions of the libraries most likely, but it should all work (for the most part) 02:51:11 --- join: wattwood (n=wattwood@c-98-202-165-129.hsd1.ut.comcast.net) joined #haskell 02:51:31 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 02:52:09 --- quit: itewsh (Client Quit) 02:52:11 --- join: RayNbow (i=kirika@scientia.demon.nl) joined #haskell 02:52:50 --- join: mansour (n=mansour@CPE0014bf895399-CM0014f8c19014.cpe.net.cable.rogers.com) joined #haskell 02:53:59 --- quit: emma (Nick collision from services.) 02:54:26 --- nick: emma_ -> emma 02:55:52 --- join: maskd (n=maskd@unaffiliated/maskd) joined #haskell 02:57:41 @seen jaspervdj 02:57:42 Unknown command, try @list 02:57:49 --- nick: magicman|sleep -> magicman 02:58:11 --- quit: napsy ("Lost terminal") 02:59:01 preflex: seen jaspervdj 02:59:01 -preflex(n=preflex@95-88-118-220-dynip.superkabel.de)- jaspervdj was last seen on #haskell 2 hours, 8 minutes and 20 seconds ago, saying: poucet: Hello, are you here? 03:00:31 --- join: tingi (i=tingi_1@unaffiliated/tingi) joined #haskell 03:01:18 --- quit: PsiOmega (Read error: 60 (Operation timed out)) 03:02:36 --- join: Mowah (n=no@81-234-104-159-no80.tbcn.telia.com) joined #haskell 03:03:17 --- part: tingi left #haskell 03:03:31 wow 03:03:37 that was lots of work 03:08:45 --- join: HaskellLove (n=chatzill@95.180.184.108) joined #haskell 03:09:48 --- quit: Beetny (" HydraIRC -> http://www.hydrairc.com <- s0 d4Mn l33t |t'z 5c4rY!") 03:14:13 --- join: PsiOmega (n=me@78-69-70-66-no170.tbcn.telia.com) joined #haskell 03:15:27 * hackagebot upload: ldif 0.0.3 - The LDAP Data Interchange Format (LDIF) parser (RadoslavDorcik) 03:15:33 --- join: rmhdk (n=Rasmus_M@x1-6-00-23-69-ab-b0-42.k151.webspeed.dk) joined #haskell 03:16:33 --- join: pao (n=__pao__@212.183.161.117) joined #haskell 03:17:12 --- part: rmhdk left #haskell 03:18:33 --- join: igel (n=igel@port-92-203-79-133.dynamic.qsc.de) joined #haskell 03:22:07 --- quit: ramses_ (Read error: 110 (Connection timed out)) 03:23:32 --- join: Zephyrus (n=emanuele@unaffiliated/zephyrus) joined #haskell 03:25:00 What's the simplest way to get ["'", "''", "'''"] etc? 03:25:39 > iterate (++ "'") "'" 03:25:41 ["'","''","'''","''''","'''''","''''''","'''''''","''''''''","'''''''''","'... 03:25:51 > iterate ('\'':) "" 03:25:52 ["","'","''","'''","''''","'''''","''''''","'''''''","''''''''","'''''''''"... 03:26:05 ugh, I'm dumb 03:26:08 more efficient too ;) 03:26:08 should have thought of that 03:26:10 thanks :) 03:26:19 > repeat '\'' 03:26:19 also yours has a smiley 03:26:20 "''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''... 03:26:28 yup 03:26:29 nvm 03:26:33 now to combine it with ['a'..'z'] 03:26:37 and smilies make code run faster 03:26:42 and i have a list of variables to try 03:26:48 (don't ask) 03:27:05 hmm 03:28:04 > [x:y | y <- iterate ('\'':) "", x <- ['a'..'z']] 03:28:05 ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s... 03:28:08 --- join: Schmallon (n=matthias@i59F76127.versanet.de) joined #haskell 03:28:48 --- join: potatishandlarn (n=potatish@c-4f6629d4-74736162.cust.telenor.se) joined #haskell 03:29:02 concatMap (\x -> zipWith (:) ['a'..'z'] $ cycle [x]) $ iterate ('\'':) "" 03:29:05 Axman6: damn you 03:29:05 --- join: soiamso (n=soiamso@unaffiliated/soiamso) joined #haskell 03:29:08 --- quit: adu () 03:29:09 with your conciseness and beauty 03:29:20 i think i just leveled up :) 03:29:35 i remember when i used to say that to people 03:29:38 next step: go through each of them in order, seeing if they're in the map 03:29:47 Axman6: to your cocredit i am sleep deprived. 03:29:50 first i didn't understand what they were doing, then i did, but couldn't have thought of it myself 03:29:58 and thus any working code that doesn't look like cthulhu is a work of art to me 03:30:07 heh 03:30:21 it's no wonder i'm messing with type systems; values are just a bit beyond my capabilities right now 03:30:46 :t scanr 03:30:48 forall a b. (a -> b -> b) -> b -> [a] -> [b] 03:30:53 ok, not that function I want 03:31:00 @hoogle (a->Bool)->[a]->a 03:31:00 Data.List find :: (a -> Bool) -> [a] -> Maybe a 03:31:00 Prelude dropWhile :: (a -> Bool) -> [a] -> [a] 03:31:00 Prelude filter :: (a -> Bool) -> [a] -> [a] 03:31:08 head . filter then 03:31:23 (that Maybe will only apply if there are an infinite number of items int he map, which seems unlikely) 03:32:19 Axman6: that gave me some nice visuals in ghci O_O 03:32:31 --- quit: ibid (Read error: 104 (Connection reset by peer)) 03:32:35 nlogax: i can imagine :) 03:33:00 --- join: Beetny (n=Beetny@ppp121-45-54-127.lns20.adl2.internode.on.net) joined #haskell 03:33:10 damn, that does look good :P) 03:33:12 p 03:33:15 ghci is pretty much trip station 03:33:16 -p*****]' 03:33:22 you plug in some amazing infinite list 03:33:26 and bam 03:33:39 and then you run out of memory 03:33:42 and your computer explodes 03:34:09 that should run in pretty close to constant space 03:34:22 well, it'll eventually increase, due to the iterate bit 03:34:41 wow that was all the code I needed to write? 03:34:44 now my code compiles yay! 03:34:53 let's see in what special way it is broken this time 03:34:54 :) 03:35:20 --- quit: aiko (Nick collision from services.) 03:35:26 --- join: aiko (i=aik@shell.noname-ev.de) joined #haskell 03:35:31 --- quit: aiko (Nick collision from services.) 03:35:34 ...now that is unexpected. 03:35:42 ohh 03:35:43 oh i see 03:35:58 i need alpha-conversion >_< 03:36:24 --- quit: xinming (Remote closed the connection) 03:36:44 oh no, that req-- no it doesn't 03:37:05 --- join: aiko_ (i=aik@shell.noname-ev.de) joined #haskell 03:37:28 noo i do 03:37:34 that sucks 03:37:52 i am ensaddened 03:38:00 * ehird shuts up 03:40:24 --- quit: djinni (Client Quit) 03:40:34 --- join: djinni (n=djinni@li14-39.members.linode.com) joined #haskell 03:41:13 --- join: cognominal (n=cognomin@82.67.232.89) joined #haskell 03:41:56 --- quit: HaskellLove ("ChatZilla 0.9.85 [Firefox 3.0.8/2009033100]") 03:41:59 --- quit: dolio (Read error: 104 (Connection reset by peer)) 03:42:02 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 03:42:27 --- quit: ski_ ("Lost terminal") 03:43:11 --- quit: Flarelocke1 (Read error: 110 (Connection timed out)) 03:44:10 --- quit: Pthing (Remote closed the connection) 03:46:23 --- join: xinming (n=hyy@125.109.76.217) joined #haskell 03:46:44 --- quit: xinming (Broken pipe) 03:46:51 --- join: xinming (n=hyy@125.109.76.217) joined #haskell 03:47:32 --- join: Raynes (n=Raynes@unaffiliated/raynes) joined #haskell 03:48:28 --- join: rajeshsr (n=rajeshsr@59.92.24.121) joined #haskell 03:51:22 --- join: shambler (i=kingrat@mm-215-192-84-93.dynamic.pppoe.mgts.by) joined #haskell 03:53:24 --- join: jrib (n=jrib@upstream/dev/jrib) joined #haskell 03:54:59 --- join: BCoppens (n=bartcopp@kde/coppens) joined #haskell 03:55:55 ..waagh. Bad eliezer. You most certainly /can/ program a conscious bein in haskell. ^^; 03:57:26 @vixen Are you a conscious being? 03:57:26 whoa whoa whoa, one question at a time! 03:57:30 --- join: ibid (i=ajk@debian/developer/ajk) joined #haskell 03:58:21 @vixen It was only one 03:58:21 i understand 03:58:27 meh 03:59:32 --- quit: igel ("your ad here") 03:59:46 anyone knows how hard would implementing Constraint Handling Rules efficiently in haskell be? 04:02:29 what do you mean by constraint handling rules? 04:02:30 --- join: u_quark (n=u_quark@vpn-131-230.vpn.ntua.gr) joined #haskell 04:02:49 Saizan: something like prolog? 04:03:01 if you mean just constraint satisfaction, the backtracking algorithms for example can be straightforwardly implemented in a functional way 04:03:51 --- quit: mxc () 04:03:53 --- join: dr_maligno_ (n=dr_malig@95.214.57.150) joined #haskell 04:04:02 Saizan: I don't think it's to bad to implement CHR. It's been done a few times. 04:05:11 --- join: PolitikerNEU (n=Politike@d86-33-36-2.cust.tele2.at) joined #haskell 04:05:18 --- join: arthurL (n=craig@pc1crl9.stunet.aber.ac.uk) joined #haskell 04:05:57 --- join: Paczesiowa (n=paczesio@213-238-83-105.adsl.inetia.pl) joined #haskell 04:06:36 --- join: raichoo (n=raichoo@i577BAA2A.versanet.de) joined #haskell 04:06:43 ah, CHR meant something specific 04:09:39 --- join: dalymbi (n=akofestu@41.248.141.45) joined #haskell 04:10:12 augustss: ah, i've only found stmchr, do you remember the others? 04:10:19 opqdonut: yeah, sorry 04:10:44 why do we need existential types? the only reason to use them is to pack values and functions working on them together. why not just pack results of those functions? instead of "forall a. Show a => Showable a", just use "Showable String" and a smart constructor for creating such values. 04:11:17 Saizan: some guy who was in york, he's now in france. Sorry, his name escapes me right now. 04:11:43 augustss: thanks anyhow :) 04:11:48 Paczesiowa: It's fairly clear, basically it's when the typeclass(es) you are defining for the existential box define multiple functions 04:12:04 and you may need the results of more than one of those functions 04:12:29 --- join: PhilRod (n=phil@cpc3-oxfd2-0-0-cust793.oxfd.cable.ntl.com) joined #haskell 04:12:36 kamatsu: you can keep a tuple of all results 04:12:52 Paczesiowa: yes, that kinds works. But what if I want to apply 'foo :: Show a => a -> Int' to the thing in the box? 04:13:12 Paczesiowa: there are actually odd cases where you run into trouble doing that, but quite often that does work well. 04:13:13 Paczesiowa: A function I didn't foresee when making the box. 04:13:44 Paczesiowa: What if you have an existential type over some monadic action? 04:13:57 --- join: dobblego (n=nobody@220-245-107-64.static.tpgi.com.au) joined #haskell 04:14:03 http://okmij.org/ftp/Computation/Existentials.html <- relevant 04:14:05 augustss: thank you, that makes sense. 04:14:18 --- quit: djinni (Client Quit) 04:14:26 --- join: djinni (n=djinni@li14-39.members.linode.com) joined #haskell 04:14:50 Saizan: I'm not clicking that, I'll lose another 2 hours... 04:14:59 hehe 04:15:26 who am I kidding, I'll click it anyway... 04:15:29 it's even ocaml.. 04:16:53 "working with encodings is not as nice as the real thing" seems to be the bottom line here 04:18:36 --- quit: Mowah (Client Quit) 04:19:36 --- join: HaskellLove (n=chatzill@95.180.184.108) joined #haskell 04:19:49 Oleg - The Answer to Type, the Universe, and Everything. 04:20:20 --- join: tibbe (n=tibell@44-35.78-83.cust.bluewin.ch) joined #haskell 04:20:42 --- quit: dr_maligno_ ("Leaving") 04:20:44 --- quit: nominolo (Read error: 60 (Operation timed out)) 04:20:47 I need to change an element value in a List. How to do that? Will I have to zip and use Data.Map? 04:21:04 HaskellLove: "change"? 04:21:19 there are even experimentations with first-class existential types, without needing to declare a custom wrapper, implemented in UHC i think 04:21:20 HaskellLove: no, you don't have to 04:21:33 you can use breakAt, change the head, and then ++ 04:21:41 having a list [2,2,1] i would like to get a list [2,3,1] for example, so that is element with index 1 changed to 3 04:22:08 right, so as opqdonut said, breakAt, change, then ++ 04:22:13 s/breakAt/splitAt/ ? 04:22:20 > let f xs n a = let (ys,z:zs)=breakAt n xs in ys++a:zs in f [1,2,3,4,5] 3 0 04:22:21 Not in scope: `breakAt' 04:22:22 @type splitAt 04:22:23 ah 04:22:23 --- join: dfdf (i=dfdf@c125185.upc-c.chello.nl) joined #haskell 04:22:23 forall a. Int -> [a] -> ([a], [a]) 04:22:29 > let f xs n a = let (ys,z:zs)=splitAt n xs in ys++a:zs in f [1,2,3,4,5] 3 0 04:22:30 [1,2,3,0,5] 04:22:31 there 04:22:46 --- quit: domor (Read error: 60 (Operation timed out)) 04:24:07 --- join: ketil (n=ketil@9.85-200-87.bkkb.no) joined #haskell 04:24:10 --- join: Jacolyte1 (n=blaine@97-126-213-14.slkc.qwest.net) joined #haskell 04:24:35 --- join: nominolo (n=nominolo@5ac6d829.bb.sky.com) joined #haskell 04:25:07 --- quit: lazni ("Leaving.") 04:27:19 --- quit: rajeshsr (Read error: 110 (Connection timed out)) 04:27:58 --- join: lazni (n=lazni@118.71.1.87) joined #haskell 04:28:04 --- join: rajeshsr (n=rajeshsr@59.92.69.187) joined #haskell 04:29:53 --- join: mmaruseacph2 (n=mihai@p16.eregie.pub.ro) joined #haskell 04:30:31 --- join: cobol000_ (n=r4y@p5496D17F.dip.t-dialin.net) joined #haskell 04:31:30 g xs i n = a ++ (n:bs) where (a, b:bs) = splitAt i xs 04:31:50 thanks guys, although it would be cool if haskell guys provided such function already 04:32:02 well it's pretty inefficient 04:32:17 if you need to do that often you're better off with an IntMap or so 04:32:40 --- quit: gio123 (Read error: 110 (Connection timed out)) 04:35:50 --- quit: Jacolyte_ (Read error: 110 (Connection timed out)) 04:37:13 I am not so sure about that i am looking at it now. You will need to convert to IntMap, insert and then convert back to list. I think that will cost more then the function above 04:37:39 --- join: gonsor (n=quassel@kel30.kel.stud.uni-goettingen.de) joined #haskell 04:37:39 i meant: don't use lists at all 04:37:57 and converting an intmap to a list is linear time 04:38:11 so just pass around intmaps and traverse them with toList 04:38:55 unless you use tail or ++ a lot, in which case Data.Sequence might be a good choice 04:41:43 --- quit: cobol000 (Read error: 110 (Connection timed out)) 04:42:56 --- quit: Paczesiowa (Remote closed the connection) 04:43:24 --- quit: nominolo (Read error: 110 (Connection timed out)) 04:45:24 --- join: nominolo (n=nominolo@5ad04214.bb.sky.com) joined #haskell 04:46:41 --- quit: MarcWebe1 (Client Quit) 04:47:29 --- quit: zax () 04:47:59 bah I accidently pushed cabal-install-0.6.4 into fedora 12 updates which conflict with haskell-platform 04:48:21 though I think cabal-install 0.6.2 and 0.6.4 are compatible 04:48:32 --- join: tarleb (n=tarleb@e179236077.adsl.alicedsl.de) joined #haskell 04:49:47 --- quit: cognominal (Read error: 60 (Operation timed out)) 04:50:32 --- join: nomadmonad (n=nomadmon@gprs-prointernet-ffb7c200-76.dhcp.inet.fi) joined #haskell 04:51:15 --- quit: dobblego (Read error: 110 (Connection timed out)) 04:52:13 --- join: ceii (n=quentin@238-156.77-83.cust.bluewin.ch) joined #haskell 04:52:14 --- quit: PepeSilvia ("leaving") 04:52:21 --- join: nominolo_ (n=nominolo@5ac6d824.bb.sky.com) joined #haskell 04:52:54 opqdonut toList? I thought you said dont use lists at all 04:53:16 --- quit: nominolo (Read error: 60 (Operation timed out)) 04:53:17 --- quit: hiptobecubic ("For a holy stint, a moth of the cloth gave up his woolens for lint.") 04:55:29 HaskellLove: it will convert the list lazily 04:55:40 HaskellLove: so with luck it acts like an iterator 04:56:17 yeah but he said dont use lists at all and now i am confused a bit 04:56:46 HaskellLove: I think he meant that there is no reason to convert the IntMap to a list before it is needed as a list 04:57:03 aha ok 04:57:16 --- join: Tomas_ (n=Tomas@h87-241-95-17.dynamic.se.alltele.net) joined #haskell 04:57:36 --- nick: Tomas_ -> Tomas 04:57:47 --- join: sepp2k (n=sexy@p548CFDDD.dip.t-dialin.net) joined #haskell 04:58:34 --- quit: nominolo_ (Remote closed the connection) 04:59:18 --- join: nominolo (n=nominolo@5ac6d824.bb.sky.com) joined #haskell 04:59:36 --- join: lostman (n=user@mw493.dar.cam.ac.uk) joined #haskell 05:00:06 HaskellLove: and what others said: If you want to replace the n'th element of a list with something else, chances are that your data representation is wrong 05:00:29 my algorithm requires such function 05:00:32 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 05:01:14 HaskellLove: often such algorithms can be reworked to not require it. 05:01:26 yes, I would agree with jlouis 05:01:30 what is your algorithm? 05:01:47 It is work in progress actually for euler 31 05:01:54 --- quit: lostman ("leaving") 05:02:07 and sometimes you are lucky and the rework of the algorithm improves the running time considerably 05:02:20 --- join: lostman (n=user@mw493.dar.cam.ac.uk) joined #haskell 05:02:35 HaskellLove: That problem can be solved without any such replacement 05:02:50 i need that function to do this: given a list such as [2,2,1] return me [[Int]], one such example is [2,1,1,1] so it is a sequental explosion of the 2s 05:03:48 the result would be [[2,1,1,1], [1,1,1,1,1]] 05:03:51 get it? 05:04:07 yes 05:04:10 basically i apply explode function to each element that can be exploded 05:04:19 right, requires no "replacing" 05:04:28 --- quit: nominolo (Remote closed the connection) 05:04:59 it does, because, i take a value at some index and apply a function to it, and then return the whole new list 05:05:09 not "some index" 05:05:17 --- join: arjanb (i=borganis@borganism.student.utwente.nl) joined #haskell 05:05:45 also, wouldn't that example you have give: 05:06:06 [[1,1,2,1],[2,1,1,1],[1,1,1,1,1]] 05:06:20 --- join: ultwe (n=ultwe@78.144.154.88) joined #haskell 05:06:32 here's how i would do it 05:06:43 --- join: Pthing (n=pthing@cpc11-pres4-0-0-cust168.pres.cable.virginmedia.com) joined #haskell 05:06:52 no order does not matter 05:07:02 --- quit: vpetro ("ZNC - http://znc.sourceforge.net") 05:07:05 all it matters is, you have one 2 and three 1s 05:07:08 HaskellLove: another approach you might ponder on is not to generate the lists but just count them 05:07:10 I'd use an array 05:07:24 --- quit: MrFahrenheit (Read error: 113 (No route to host)) 05:07:34 jlouis thought of that yes, but i need lists for my algorithm further development 05:07:52 > nub $ map sort $ concatMap (\n -> take n $ repeat 1) [2,1,1] 05:07:53 No instance for (GHC.Num.Num [a]) 05:07:53 arising from the literal `1' at kamatsu i dont need map, i need to get the new list with an element at given index changed 05:08:58 --- quit: uorygl (Remote closed the connection) 05:09:01 --- join: uorygl (n=warrie@lunch.normish.org) joined #haskell 05:09:07 --- quit: jfoutz (Remote closed the connection) 05:09:08 --- quit: zaarg (Remote closed the connection) 05:09:11 --- quit: drhodes (Remote closed the connection) 05:09:12 --- join: zaarg (n=james@avalon.stillidream.org) joined #haskell 05:09:14 --- quit: kevincla1k (Remote closed the connection) 05:09:14 --- quit: inimino (Excess Flood) 05:09:17 --- join: kevinclark (n=kev@67-207-137-28.slicehost.net) joined #haskell 05:09:17 HaskellLove: my point is that it's not a given index, it's every index 05:09:18 --- join: jfoutz (n=jfoutz@173-45-244-32.slicehost.net) joined #haskell 05:09:40 --- join: nominolo (n=nominolo@5ac6d824.bb.sky.com) joined #haskell 05:09:43 HaskellLove: you need every step along the way, which map won't give you, but you don't need arbitrary index 05:10:27 --- quit: kpreid (Read error: 60 (Operation timed out)) 05:10:35 HaskellLove: It would be reasonably easy to make a replacement for map that does what you want 05:10:40 ah i get what you mean, but i filter cases that can not be exploded and i pass valid indices so yes i need indices... an alternative is to make my function use Maybe which i do not like in this case 05:10:55 --- join: inimino (n=inimino@atekomi.inimino.org) joined #haskell 05:11:03 yep ok thank you guys i am back to work will see if my algorithm goes well 05:11:04 HaskellLove: Filter them before the map? 05:11:10 HaskellLove: have you thought of a way to avoid the combinatorial explosion? 05:11:44 --- quit: dolio (Read error: 104 (Connection reset by peer)) 05:12:00 yeah in a comprehension list i filter numbers that are equal to the maximum of the list of two numbers, for example for [1,2,1,2] the indices for values 2 wont be returned 05:12:03 --- join: dv_ (n=dv@84.119.107.5) joined #haskell 05:12:43 --- join: xinming_ (n=hyy@218.73.141.32) joined #haskell 05:12:59 HaskellLove: The problem is you're treating the list like an array 05:13:06 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 05:13:08 jlouis no, i just wanna solve it first, i tried lot of stuff i cant solve this euler 31 for days, it paralized me and filled with feeling of incompetence and stupidity i cant do else until i solve it haha 05:13:13 HaskellLove: When dealing with lists, never think about indices 05:13:48 ah good point, Cale pointed these things to me, to forget about indices and imperative style 05:13:56 will go with array then 05:14:14 --- join: drhodes (n=none@209-20-72-61.slicehost.net) joined #haskell 05:14:37 HaskellLove: I have solved this problem without Arrays. I still think you're doing it wrong. 05:14:57 HaskellLove: The solution isn't to keep thinking about indexes and not use a list, the solution is to stop thinking about indexes and use a list 05:15:07 --- join: pwerken (n=pwerken@a-eskwadraat.nl) joined #haskell 05:15:13 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 05:15:23 First solve it via plain recursion, and then think about how to speed it up. 05:15:37 Plain recursion is plenty fast enough, really... 05:15:42 kamatsu, this is personal :) it is one of those problems that make you feel miserable when you cant solve it, i dont want to study others solutions i must do it myself 05:15:59 will let you know what i have soon 05:16:02 HaskellLove: which euler problem are you solving 05:16:09 BONUS: 31 05:16:11 --- quit: DarthShrine () 05:16:18 Is it just me or is there a higher propensity in here than in other channels for people to name themselves with Haskell in their nick? 05:16:26 HaskellLove: My solution is 5 lines. It should be similar for you. 05:16:30 oh that one 05:16:31 It happens a befuddlingly large amount. 05:16:32 that's a cute one 05:16:51 --- quit: Jafet ("Leaving.") 05:16:51 HaskellLove: If you're writing a massive program, i suggest going back to drawing board 05:17:05 --- join: Jafet (n=Jafet@unaffiliated/jafet) joined #haskell 05:17:12 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16053#a16053 -- this was the solution I already tried to explain to HaskellLove 05:18:11 Cale: right, but I think he should solve it first without memoization 05:18:16 --- join: rovar (n=rick@pool-96-246-129-111.nycmny.east.verizon.net) joined #haskell 05:18:17 I agree. 05:18:43 Just try to understand that fromCoins without the added memo table. 05:18:50 kamatsu: here's a solution using an array: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16057#a16057 05:18:53 My completely naive one is 3 lines long and it still solves it in reasonable time 05:19:07 @remember Axman6 and smilies make code run faster 05:19:08 I will never forget. 05:19:36 --- quit: xinming (Read error: 60 (Operation timed out)) 05:19:37 Jafet: Lol! when did Axman6 say that? 05:19:45 --- join: koeien37 (n=jochem@20-83-ftth.onsneteindhoven.nl) joined #haskell 05:19:50 --- join: alc (n=alc@222.128.128.108) joined #haskell 05:20:28 No idea, the lag was horrible 05:20:31 In any case, manipulating lists of coins seems like the wrong thing. 05:20:32 --- quit: medfly (Remote closed the connection) 05:20:39 SICP does it!! 05:20:42 (though you could do it that way too) 05:21:28 --- join: ccasin (n=ccasin@pool-68-238-222-15.phil.east.verizon.net) joined #haskell 05:21:54 the trick with 31 is to think about it really recursively :) 05:22:27 You could also do it using generating series, but that requires a bit more cleverness and setup 05:22:33 Cale: It's not much slower than just counting 05:23:33 --- join: jsgf (n=jeremy@dsl-203-33-163-122.NSW.netspace.net.au) joined #haskell 05:23:44 --- quit: iblechbot (Read error: 110 (Connection timed out)) 05:23:48 The generating series for the number of ways to make change for n is the product over denominations d of 1/(1-x^d) 05:24:14 I dunno, for me Project Euler teaches you very little about using Haskell for real programming 05:24:25 (if you use haskell to solve the problems) 05:24:35 it just teaches you to think functionally if you're used to imperative stuff 05:24:36 It's nice for giving you something to do while learning the syntax and features 05:24:37 That is, the number of ways to make change for n pennies is the coefficient of x^n in the series 1/((1-x)(1-x^2)(1-x^5)...(1-x^200)) 05:24:49 i found it handy for learning haskell, it got me used to the syntax and thinking in composition and infinite lists 05:25:09 Right, but my first language was Lisp, to me most Project Euler problems weren't good for learning 05:25:17 i suppose it's a different strokes scenario 05:25:28 and before anyone asks, i don't know what Lisp 05:25:28 It's also much easier to solve PE problems in haskell than some other languages, I found. At least easier than python 05:25:36 Berengal: PE? 05:25:41 kamatsu: Project Euler 05:25:44 oh, lol 05:25:47 i feel like an idiot now 05:25:54 Lisp is very simple -- you always know that no matter what the textbook is telling you to do now, it's going to end up part of your metacircular interpreter 05:26:06 that is true, they are substantially easier in Haskell 05:26:32 SeriesCoefficient[1/((1 - x) (1 - x^2) (1 - x^5) (1 - x^10) (1 - x^20) (1 - x^50) (1 - x^100) (1 - x^200)), {x, 0, 200}] 05:26:40 ^^ mathematica solution to Euler 31 05:26:54 Cale is talking about generating functions which I do not know about yet... 05:26:55 * Berengal first got 10 in Java before he gave up, then got 40 in python before he gave up, then got 65 in haskell before he gave up because it became more about math, less about programming 05:27:05 That's because you didn't read the generatingfunctionology book 05:27:08 I hate the term "generating function" though. 05:27:19 Which you were told in #math for about ten minutes to read 05:27:21 And generatingfunctionology is an awful book :( 05:27:30 i tried to read it i could not 05:27:42 --- join: igel (n=igel@port-92-203-79-133.dynamic.qsc.de) joined #haskell 05:27:52 --- join: flik (n=lane123@88.205.167.57) joined #haskell 05:27:59 --- quit: arthurL ("Leaving") 05:28:00 The issue i have with Lisps is that they're supposedly an infinitely customizable language (and indeed i suppose they are) but then Lisp programmers never really make full use of that 05:28:08 05:28:09 Because you're a programmer, and programmers don't have to bother with math 05:28:09 --- quit: Jafet ("Leaving.") 05:28:18 hallo 05:28:19 generatingfunctionology somehow manages to completely miss the point of generating series. 05:28:20 --- join: Jafet (n=Jafet@unaffiliated/jafet) joined #haskell 05:28:26 flik: hi! 05:28:36 ;) 05:29:09 flik: wait.. i knew a flik from a completely unrelated thing, but it could just be a shared net alias 05:29:13 How you? 05:29:33 flik: how did you find this channel? 05:30:03 --- join: kpreid (n=kpreid@cpe-72-228-72-196.twcny.res.rr.com) joined #haskell 05:30:13 I Russian;) has found this channel casually 05:30:19 Cale, a better book is? 05:31:03 What weather at you? 05:31:05 --- join: zakwilson (n=zak@c-68-35-255-11.hsd1.fl.comcast.net) joined #haskell 05:31:12 HaskellLove: Unfortunately, I'm not 100% sure what to recommend. All the books that I know of are {suitable for beginners, handle things in a decent way, widely available}: pick any two. 05:31:30 flik: I don't mean to be rude, but are you interested in the Haskell programming language, or just here to chat idle-y 05:31:31 --- join: mxc (n=mxc@cm78.epsilon8.maxonline.com.sg) joined #haskell 05:32:12 I here to talk to you 05:32:18 If you want the latter two, you might go with something like Goulden and Jackson's bible "Combinatorial Enumeration". 05:32:35 Or many books on combinatorial species. 05:32:48 --- part: soiamso left #haskell 05:33:40 --- quit: visof (Remote closed the connection) 05:33:54 mauke What weather at you? 05:34:04 The only books which I've seen that are suitable for beginners and handle things sanely are the course notes for MATH 249 and C&O 330 by David M. Jackson at the University of Waterloo. 05:34:13 Unfortunately, they're a bit hard to get. 05:34:24 --- quit: bbe ("暂离") 05:34:31 ok Cale i will look for some books now 05:34:34 (You can phone up the print services and I think they can still print copies and ship them) 05:34:46 --- nick: magicman -> magicman|gone 05:35:06 --- quit: zakwilson (Client Quit) 05:36:10 --- part: flik left #haskell 05:36:14 I should really try a bit more to look through the various books, but I really think generatingfunctionology is an unfortunate book. It's free, so everyone uses it, but it would be extremely hard to recover the right perspective on things from the way that book does it. 05:36:34 thanks Cale 05:37:05 i think any book will do, i found some 05:37:08 If you can find a book which is about combinatorial species that is easy enough to understand, let me know 05:37:10 --- join: redcuber (n=redcuber@65.242.175.35) joined #haskell 05:37:14 Nice modus operandi Cale -- "come for the project euler, stay for the combinatorial series" 05:37:49 --- join: araujo (n=araujo@gentoo/developer/araujo) joined #haskell 05:40:33 I could do a quick intro right now, if you want. At least, perhaps enough to understand the generating series for making change :) 05:40:44 --- join: tingi (i=tingi_1@unaffiliated/tingi) joined #haskell 05:40:56 --- part: tingi left #haskell 05:42:30 hmm here or in pm, i dont want to be baned for talking non haskell ;) 05:43:09 There's a short introduction to this in "Art and Craft of Problem Solving" 05:44:09 --- quit: tibbe () 05:44:48 --- join: EEEuler (n=denis@CPE001cdf7d81b4-CM0019474d4cee.cpe.net.cable.rogers.com) joined #haskell 05:44:54 --- quit: ramses_ (Read error: 110 (Connection timed out)) 05:46:51 --- join: bel5f5 (n=yupeng@58.31.230.86) joined #haskell 05:47:04 HaskellLove: I'm an op, and mathematical topics are generally okay here :) 05:47:10 --- quit: rdd (Read error: 60 (Operation timed out)) 05:47:16 Jafet bookmarked, thanks 05:47:43 Cale so i dont waste your time i am gonna do some reading for a week and then come back to this ;) 05:50:37 --- quit: lostman ("Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/") 05:50:49 --- join: paper_cc (n=paper_cc@217.10.38.198) joined #haskell 05:50:52 --- join: tibbe (n=tibell@44-35.78-83.cust.bluewin.ch) joined #haskell 05:51:09 --- quit: rovar (Read error: 110 (Connection timed out)) 05:51:33 * Cale sees if he can coerce mathematica into giving a general formula for the coefficient of x^n in that series :) 05:52:03 You could apply the negative binomial theorem a whole bunch to extract one, I suppose. 05:52:55 --- join: boscop (n=boscop@g226245165.adsl.alicedsl.de) joined #haskell 05:53:45 --- quit: ccasin (Read error: 104 (Connection reset by peer)) 05:54:45 --- join: canseek (n=reisen@94-193-191-154.zone7.bethere.co.uk) joined #haskell 05:55:45 --- join: dpratt71 (n=dpratt71@pool-72-65-103-79.ptldme.east.myfairpoint.net) joined #haskell 05:56:03 I suspect it would be not really any better than the recursive counting solution in the end 05:57:34 Fore! 05:57:55 --- quit: jsgf (Read error: 110 (Connection timed out)) 05:58:19 --- quit: ttmrichter (Connection timed out) 05:58:26 --- join: bgs100 (n=ian@unaffiliated/bgs100) joined #haskell 05:59:16 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 05:59:18 --- join: ttmrichter (n=ttmricht@58.49.29.114) joined #haskell 05:59:44 --- join: weihsiu (n=walter@220-134-133-103.HINET-IP.hinet.net) joined #haskell 06:00:33 --- quit: PolitikerNEU (Read error: 110 (Connection timed out)) 06:00:50 --- join: cognominal (n=cognomin@82.67.232.89) joined #haskell 06:00:59 --- join: amz (i=zeratul@189.4.115.61) joined #haskell 06:01:11 --- join: aeter (n=adr@host-static-87-116-84-9.mreja.net) joined #haskell 06:01:19 --- quit: alc () 06:01:37 I'm trying to understand bottom, and it's relation to strict code in haskell 06:01:50 _|_ is a type with no values right, and is a subtype of all other types 06:02:01 ... no, _|_ is a value 06:02:03 _|_ is a value 06:02:07 sort-of a value :) 06:02:08 --- quit: ulfdoz (Read error: 110 (Connection timed out)) 06:02:08 which is a member of each type 06:02:10 but that value is in all types 06:02:13 even Void 06:02:14 Er, hold on 06:02:15 lol damnit beaten twice 06:02:18 --- quit: igel ("your ad here") 06:02:25 koeien37: unfortunately :) 06:02:28 Void is a type with only one value: _|_ 06:02:31 There's no subtyping in Haskell. 06:02:34 'Because the bottom type is used to indicate the lack of a normal return, it typically has no values' 06:02:37 Damn you wikipedia 06:02:49 bottom type != bottom value 06:02:55 ... that sounds like it needs work. 06:02:55 bottom type is what we call Void 06:03:09 anyone ever counted the number of sudoku games, if it's possible by a program ? 06:03:13 Wikipedia says that _|_ denotes an empty type 06:03:17 Anyway 06:03:17 canseek: if you're coding strict haskell you "don't need" to worry about bottoms 06:03:27 I suppose that if there was a subtype relation, Void would be a subtype of every type, and _|_ would be its only member. 06:03:30 paolino: that is probably out of reach for a computer program to count 06:03:31 opqdonut: maybe not but I want to 06:03:44 it's much more interesting with nonstrict programs 06:03:45 paolino: I'm not entirely sure though 06:04:01 anyway, a strict function f is a function such that f _|_ = _|_ 06:04:02 canseek: A function f is called strict if f _|_ = _|_ 06:04:03 Ok wait er, so in haskell _|_ is a value, that inhabits every type right? 06:04:04 hehe 06:04:05 in other words, if f 06:04:07 Yeah I just 06:04:11 DOn't understand it 06:04:16 's argument doesn't evaluate to a proper value, f doesn't either 06:04:28 canseek: You can think of _|_ as a representation of nontermination 06:04:31 --- join: PolitikerNEU (n=Politike@d86-33-36-2.cust.tele2.at) joined #haskell 06:04:35 koeien37: that meaning it's possible by pen and paper only ? 06:04:39 Brb sorry, phone 06:04:41 think C: f(g(x)), but g(x) is nonhalting or does a division by zero 06:04:43 paolino: I would think so 06:04:56 there are probably some mathematicians that have written papers about it 06:04:58 then f does not return any meaningful result 06:05:10 canseek: It's the "value" which represents program errors as well as the infinite-loop variety of nontermination. 06:05:47 ah, I've found one 06:05:58 they used a computer, but not to enumerate all solutions 06:06:17 probably loads of symmetry reduction on paper 06:06:21 yes 06:07:26 --- quit: paper_cc ("Leaving.") 06:07:32 Right sorry about that 06:07:44 Maybe I'll understand better if I understand this 06:07:46 I read that 06:08:06 canseek: So, let's examine why it's important to treat this thing as a value 06:08:12 f _|_ = _|_ + 1 = _|_ 06:08:27 Consider something like 1 : _|_ 06:08:39 (:) is interestingly not a strict function 06:08:44 --- join: Zephyrus__ (n=emanuele@unaffiliated/zephyrus) joined #haskell 06:08:46 > head (1 : undefined) 06:08:48 1 06:08:52 --- join: NEEDMOAR (n=user@190.193.95.183) joined #haskell 06:08:58 --- join: pemryan (n=pem@159.226.35.246) joined #haskell 06:09:05 Ok 06:09:29 Why is undefined _|_ though, I thought undefined was defined as like 06:09:34 undeined = error "" 06:09:38 it is. 06:09:38 yes 06:09:41 paolino yes they did, and the author of the count is in #haskell ;) 06:09:42 So why is that _|_? 06:09:43 but that's how we think of it 06:09:43 --- nick: xinming_ -> xinming 06:09:51 _|_ represents all errors and other forms of nontermination 06:09:55 --- join: paper_cc (n=paper_cc@217.10.38.198) joined #haskell 06:10:04 1/0 would also be _|_ 06:10:08 well, div 1 0 06:10:19 --- join: PepeSilvia (n=bspaans@82-170-80-87.ip.telfort.nl) joined #haskell 06:10:33 error and nontermination, so why for example is 06:10:35 id _|_? 06:10:37 it seems to me that _|_ conflates multiple concepts that really aren't the same thing 06:10:55 syntaxglitch: denotationally they are 06:11:08 --- quit: nomadmonad (Read error: 60 (Operation timed out)) 06:11:09 _|_ is an operator? 06:11:12 no. 06:11:13 a value 06:11:22 ah, ok. 06:11:30 every type has _|_ as one of its values 06:11:38 NO 06:11:41 :t undefined 06:11:41 forall a. a 06:11:48 well unboxed values don't 06:11:52 ack 06:11:52 --- quit: dolio (Read error: 104 (Connection reset by peer)) 06:11:57 but it's a good starting point :) 06:12:08 Alright er 06:12:25 I'm still confused but, what about this then, why is forall a . a _|_? What exactly is the reasoning behind it? 06:12:27 then again, unboxed values are just boxed values without the box...? 06:12:29 *zen* 06:12:38 _|_ is a theoretical concept, relating to certain models of lambda calculus 06:12:40 opqdonut: Yes they do. A function Int -> Int# may return _|_ 06:12:47 that's why it appears a bit funny in practical contexts 06:12:52 canseek: (forall a. a) means "I am in all types at the same type" 06:12:59 the real symbol is: ⊥ 06:13:00 canseek: _|_ :: forall a. a because for any type, you can write a definition like let x = x in x 06:13:00 canseek: the only value with that property is _|_ 06:13:04 Berengal: hmm, good point 06:13:10 argh 06:13:13 canseek: and it doesn't matter what type x has there 06:13:16 fixed: canseek: (forall a. a) means "I am in all types at the same time" 06:13:19 --- quit: dpratt71 ("Leaving.") 06:13:20 Cale: he was asking the other direction 06:13:23 what mauke said 06:13:27 --- quit: Pthing (Remote closed the connection) 06:13:29 Oh I think I see, as in 06:13:32 Oh, why are there no other values which belong to every type? 06:13:35 :t undefined 06:13:36 forall a. a 06:13:41 Because a matches all possible types, and the only common value is _|_, it is _|_? 06:13:45 Bool and Integer have almost empty intersection already 06:13:54 canseek: correct 06:14:05 Hmm 06:14:06 --- join: Mowah (n=no@81-234-104-159-no80.tbcn.telia.com) joined #haskell 06:14:41 --- join: phyrex1an (n=phyrex1a@icewall.csbnet.se) joined #haskell 06:14:47 --- quit: paper_cc (Read error: 104 (Connection reset by peer)) 06:14:47 this is sort of related to: 06:14:50 :t Nothing -- this 06:14:51 forall a. Maybe a 06:14:55 --- join: paper_cc (n=paper_cc@217.10.38.198) joined #haskell 06:14:58 --- join: arthurL (n=craig@pc1crl9.stunet.aber.ac.uk) joined #haskell 06:15:03 Nothing is the value that is in Maybe a for all values of a 06:15:24 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 06:15:31 so having _|_ is kinda like having all our types be Maybe types 06:15:36 canseek: This sort of thing comes out of trying to reason about the behaviour of programs while still admitting general recursion into the mix. 06:15:38 but _|_ is not observable and Nothing is 06:15:46 --- join: paper_cc1 (n=paper_cc@217.10.38.198) joined #haskell 06:16:32 It makes more sense, though I still don't see how for example 06:16:46 f _|_ = _|_ + 1 would be _|_ 06:16:58 that depends on the implementation of (+) 06:16:59 canseek: Well, it depends on the definition of + 06:17:16 --- quit: PepeSilvia ("leaving") 06:17:23 if you use Peano arithmetic, depending on (+), it might very well be that it's not _|_ 06:17:37 Alright well 06:17:42 Church numerals! 06:17:44 but for Integer (+) is strict in both arguments 06:17:49 The function succ is strict right? And is strict x = x + 1 06:18:02 depends again on your implementation 06:18:09 And if I'm right in understanding that functions are strict only in the case of f _|_ = _|_, then I don't understand it 06:18:16 that's the definition of strict 06:18:25 canseek: succ is strict *for Int* 06:18:34 try this example: 06:18:35 canseek: other instances of enum might not be strict. 06:18:40 f x y = if x == 0 then y else 0 06:18:49 c_wraith: can you explain why? 06:18:52 then f x is _not_ strict for all x 06:19:01 canseek: Basically, a function is strict if it needs to pattern match on its parameter before it can produce any part of its result 06:19:30 --- join: comak (n=mak@dynamic-78-8-243-87.ssp.dialog.net.pl) joined #haskell 06:19:33 :t const 0 06:19:34 forall t b. (Num t) => b -> t 06:19:42 canseek: consider natural numbers. data Nat = Zero | Succ Nat 06:19:42 > (const 0) undefined 06:19:43 0 06:19:46 const 0 is not strict 06:19:56 const undefined is strict 06:19:56 canseek: the succ x = Succ x 06:20:04 mauke: indeed 06:20:06 --- quit: Zephyrus (No route to host) 06:20:07 canseek: and that's not strict. 06:20:16 --- quit: HaskellLove ("ChatZilla 0.9.85 [Firefox 3.0.8/2009033100]") 06:20:28 c_wraith: unfortunately that type is not isomorphic to lifted natural numbers... 06:20:33 unlike Integer 06:20:41 --- join: _JFT_ (n=_JFT_@modemcable204.87-177-173.mc.videotron.ca) joined #haskell 06:20:50 opqdonut: doesn't mean it can't be an instance of Enum (though it'd necessarily be partial) 06:20:57 sure 06:21:12 --- join: maskd- (n=maskd@unaffiliated/maskd) joined #haskell 06:22:09 Sorry c_wraith, I'm still confused 06:22:18 I don't understand why 06:22:25 Needing to pattern match makes it strict 06:22:32 It doesn't pattern match, though. 06:22:40 It doesn't examine its argument *at all* 06:22:49 --- join: tingi (i=tingi_1@unaffiliated/tingi) joined #haskell 06:22:58 --- join: nomadmonad (n=nomadmon@gprs-prointernet-ffb9c200-1.dhcp.inet.fi) joined #haskell 06:23:01 I meant in general 06:23:03 --- part: tingi left #haskell 06:23:05 Not the example you gave 06:23:09 canseek: Okay, perhaps I should have been more precise -- matching a pattern which *involves a data constructor* makes something strict. 06:23:19 --- join: sepp2k1 (n=sexy@p548CF531.dip.t-dialin.net) joined #haskell 06:23:40 canseek: patterns like x can and will immediately match against _|_ without observing it. 06:23:41 Cale, id x = x is strict, there's no data constructor there? 06:24:02 Mmm 06:24:06 canseek: well, yeah, that one is strict because in the case that you pass it _|_, it immediately produces _|_ 06:24:16 I'm sure I'm driving you mad here, sorry D: 06:24:22 canseek: nah, it's cool :) 06:24:36 Oh right because _|_ is the same on either side, right ok but 06:24:44 (there are also "lazy pattern matches" to confuse you even more) 06:24:49 Consider something like (\fac n -> if n == 0 then 1 else n * fac (n-1)) 06:24:53 Yeah I don't want to be confused more 06:25:01 Is this function strict? 06:25:04 hmm :) 06:25:10 (\fac n -> if n == 0 then 1 else n * fac (n-1)) _|_ 06:25:18 I have no idea... D: 06:25:20 = (\n -> if n == 0 then 1 else n * _|_ (n-1)) 06:25:31 this is not _|_. 06:25:49 In particular, this function isn't _|_ because if you give it 0, it will give you 1 06:26:13 (but for any other number, it will give _|_) 06:26:25 Cale, that makes sense, but still doesn't explain for example why succ on Ints is _|_ 06:26:33 it is strict, you mean 06:26:35 As passing 1, would result in 2, which doesn't seem right 06:26:40 --- quit: sepp2k1 (Client Quit) 06:26:56 --- join: sepp2k1 (n=sexy@p548CF531.dip.t-dialin.net) joined #haskell 06:26:57 Ints are represented by machine words 06:27:01 canseek: succ on Ints is strict because just knowing that some Int is the succ of another Int doesn't actually tell you anything at all about it 06:27:28 Er... 06:27:40 So in order to know the first thing about the result of succ n where n is an Int, you must know at least a little bit about n 06:28:20 My brain hurts this is so confusing D: 06:28:34 However, for natural numbers, knowing that some natural number k is the successor of another is a usable piece of information: you know that it's not 0 then. 06:29:08 :t foldM 06:29:09 forall a b (m :: * -> *). (Monad m) => (a -> b -> m a) -> a -> [b] -> m a 06:29:10 Let's use: 06:29:17 data Nat = Zero | Succ Nat 06:29:25 a simple unary representation of naturals 06:29:41 So that 3 for instance is written Succ (Succ (Succ Zero)) 06:29:54 Ok 06:29:57 and let's consider the function 06:30:09 add Zero m = m 06:30:11 --- join: danblick (n=Dan@c-24-18-233-183.hsd1.wa.comcast.net) joined #haskell 06:30:19 add (Succ n) m = Succ (add n m) 06:31:06 Make sense so far? 06:31:20 I like that you can define infinity with that representation as: let x = Succ x in x 06:31:45 Cale, I think so, go on 06:31:49 canseek: okay 06:31:51 --- join: ufopp (n=ufopp@ip68-0-153-9.tc.ph.cox.net) joined #haskell 06:31:57 > let x = succ x in x 06:31:58 * Exception: Prelude.Enum.().succ: bad argument 06:32:03 canseek: We can also define an ordering on them... 06:32:16 Zero <= m = True 06:32:21 --- join: jaspervdj (n=jaspervd@ip-83-134-146-6.dsl.scarlet.be) joined #haskell 06:33:07 Ok 06:33:07 (Succ n) <= (Succ m) = n <= m 06:33:14 (Succ n) <= Zero = False 06:33:33 --- quit: paper_cc (Read error: 110 (Connection timed out)) 06:33:34 --- quit: maskd (Read error: 110 (Connection timed out)) 06:33:45 So, let's try doing some computation, but we'll involve _|_ in the mix. 06:34:43 Succ Zero <= Succ (Succ _|_) 06:34:57 --- nick: maskd- -> maskd 06:35:00 This matches the second pattern and reduces to 06:35:00 --- join: Jag_ (i=Jag@ACaen-151-1-53-22.w86-215.abo.wanadoo.fr) joined #haskell 06:35:04 Zero <= Succ _|_ 06:35:08 --- join: Nomad010 (n=nomad@41.145.96.123) joined #haskell 06:35:23 and then that matches the first pattern, and we get 06:35:24 True 06:35:51 Ok 06:36:06 --- join: takuan (n=takuan@94-225-32-158.access.telenet.be) joined #haskell 06:36:06 Hey, cool, Succ _|_ sort of resembles infinity 06:36:17 actually, you don't need the succ 06:36:20 fix Succ 06:36:34 mauke: ah, of course 06:36:44 Succ _|_ "resembles" every number which is larger or equal to 1 06:36:56 --- quit: sepp2k (Read error: 110 (Connection timed out)) 06:37:26 Let's try something else... what do we get when we add (Succ Zero) to _|_ ? 06:37:50 add (Succ Zero) _|_ 06:37:59 = Succ (add Zero _|_) 06:38:07 = Succ _|_ 06:38:34 So we're actually *not* left with _|_ 06:38:39 Alright I'm happy so far, as Succ _|_ is what was in my head before you even answered your own question 06:38:46 The function add (Succ Zero) is non-strict. 06:39:21 Yeah that makes sense 06:40:08 We could even take the least fixed point of add (Succ Zero) and we'd get something which looked like Succ (Succ (Succ (...))) 06:40:42 --- quit: danblick1 (Read error: 110 (Connection timed out)) 06:40:48 Mmmm 06:40:48 @undefine 06:41:14 @let add Zero m = m; add (Succ n) m = Succ (add n m) 06:41:15 Defined. 06:41:27 (I added the definition of Nat from above to lambdabot) 06:41:33 hax 06:41:33 Hold on 06:41:35 > fix (add (Succ Zero)) 06:41:37 No instance for (GHC.Show.Show L.Nat) 06:41:37 arising from a use of `M3259530882... 06:41:40 --- quit: LouisJB () 06:41:42 er, right :) 06:41:59 @undefine 06:42:01 @let add Zero m = m; add (Succ n) m = Succ (add n m) 06:42:02 Defined. 06:42:07 > Succ Zero 06:42:08 Succ Zero 06:42:11 > fix (add (Succ Zero)) 06:42:13 Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Suc... 06:42:29 (needed additional instances :) 06:42:56 dolio: I'm curious if you've solved lostman's CT problem (yourself). 06:43:10 --- join: bens_ (n=bens@d58-110-168-188.sun5.vic.optusnet.com.au) joined #haskell 06:43:28 :t Succ 06:43:29 Nat -> Nat 06:43:31 canseek: I'm not sure how much you know about fix and recursion theory though. 06:43:35 > fix Succ 06:43:36 Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Suc... 06:43:47 Cale nothing, I'm just trying to think this through though sorry 06:43:51 okay :) 06:43:54 --- nick: sepp2k1 -> sepp2k 06:43:58 umm where is normalise defined? 06:44:07 @hoogle normalise 06:44:07 System.FilePath.Posix normalise :: FilePath -> FilePath 06:44:08 System.FilePath.Windows normalise :: FilePath -> FilePath 06:44:15 thanks 06:44:24 aep: import it as System.FilePath, though 06:44:30 yeah 06:44:34 canseek: fix is an operation which finds the least-defined value which is a fixed point of the function you give it 06:44:51 canseek: A fixed point of a function f is a value x such that x = f x 06:45:10 For example, 1 is a fixed point of the function f x = x^2 06:45:21 (however, so is _|_) 06:46:07 canseek: fix can be defined in Haskell as just fix f = x where x = f x -- which is very much like the definition I just gave :) 06:46:08 --- join: pantsman (n=pantsman@pdpc/supporter/active/pantsman) joined #haskell 06:46:30 Cale oh man that's trippy 06:46:50 This fix can be used to write recursive functions without having to give them names 06:46:52 canseek: laziness is pretty awesome. :) 06:47:06 As an example, recall... 06:47:12 WAit but 06:47:15 x can never be defined 06:47:15 okay 06:47:17 So that is 06:47:18 _|_ right 06:47:20 er, hm? 06:47:26 > fix (0:) 06:47:26 canseek: why can't it be defined? 06:47:26 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... 06:47:27 x can be quite defined 06:47:31 It's only _|_ if f is strict. 06:47:32 How so? 06:47:38 > fix (1+) 06:47:42 Let's go through an example. 06:47:42 mueval-core: Time limit exceeded 06:47:42 canseek: consider f = \_ -> 42 06:47:48 Hang on people! 06:47:50 hehe 06:47:52 Wait wait 06:47:57 * mauke hangs on 06:47:57 ok, I'm waiting 06:48:03 --- quit: bo0ts__1 (Read error: 113 (No route to host)) 06:48:08 Let's use the standard example of the factorial function 06:48:10 Cale's the mathematician. He can take this one. :) 06:48:14 My bad 06:48:14 I 06:48:18 Wasn't thinking 06:48:20 but that involves a function value 06:48:26 sure 06:48:35 It's a good example of a recursive function 06:48:36 x can be applied later, my mind 06:48:48 So you'd normally write: 06:48:49 Completely skipped partial application 06:48:52 Does the fact that adjoints lift to functor categories immediately give the fact that completeness and cocompleteness lift pointwise? 06:48:53 (something akin to) 06:49:05 fac n = if n == 0 then 1 else n * fac (n-1) 06:49:43 Analogously, let's look at what happens when we write fix (\fac n -> if n == 0 then 1 else n * fac (n-1)) 06:50:00 Well, this will give us x, where x is defined like: 06:50:06 x = (\fac n -> if n == 0 then 1 else n * fac (n-1)) x 06:50:29 and then we can apply the lambda 06:50:42 x = (\n -> if n == 0 then 1 else n * x (n-1)) 06:51:05 and rearrange the n over to the other side of the = sign if we want 06:51:10 x n = if n == 0 then 1 else n * x (n-1) 06:51:26 So, up to a renaming, this is identical to the recursive definition of fac 06:52:05 Mmm 06:52:09 You lost me a bit there 06:52:15 But I get the use of fix overall 06:52:24 Which step is problematic? 06:52:41 (I don't mind explaining further) 06:53:41 Well, you lost me with those descriptions, if you don't mind explaining then, would you mind explaining something else? Back to bottom instead? Because, while I think I understand bottom now 06:53:49 I don't understand this: 06:53:50 okay 06:53:51 --- quit: dalymbi (Client Quit) 06:53:53 --- quit: bens_ (Read error: 60 (Operation timed out)) 06:53:55 --- join: twanvl (n=twanvl@ip5451f037.direct-adsl.nl) joined #haskell 06:54:02 http://en.wikibooks.org/wiki/Haskell/Denotational_semantics#Strict_and_Non-Strict_Semantics 06:54:19 I'm trying desperately to figure out the succ example, thinking over what you described 06:54:22 But I just don't see it 06:54:44 (I've got a page open about fix to go over next by the way, just so you know I didn't just ignore you about fix) 06:55:18 okay 06:55:37 canseek: save this link for later, but check it out. http://www.vex.net/~trebla/haskell/fix.xhtml 06:55:43 I can't see the page yet, my crappy router needs to be reset. 06:55:55 --- join: ulfdoz (n=mary@p3EE241A1.dip.t-dialin.net) joined #haskell 06:56:14 Rofl 06:56:23 Thanks c_wraith, got it open 06:56:49 (whenever I have been on a torrent, it seems to accumulate fail until making new connections to things is unbearably slow) 06:57:05 (and this condition persists until it's been reset) 06:57:33 t 06:57:59 okay, here it is 06:58:03 My routers just as bad Cale, I havfe to restart it every few days or my connection slows to a crawl 06:58:35 canseek: So, I've actually given you a counterexample to that being a strict function 06:58:46 But for Int it really is strict 06:59:41 This is because the only values of type Int are either _|_ or are fully defined numbers 06:59:43 The description they give about why _|_ + 1 = _|_, goes way over my head 07:00:03 Which is why I'm lost, I've read as much as I could over the C looking operators 07:00:06 But it just doesn't make sense 07:00:11 Whereas in my Nat type, there are values like Succ (Succ _|_) which are partially defined 07:00:38 Okay 07:01:04 I guess I'll start from... do you know what a partial ordering is? 07:01:50 oh, they describe it further up on that page 07:01:52 THe wikibooks article discussed it briefly, I can google it if you like 07:01:55 Yeah 07:02:50 canseek: one thing I think it important to point out is: _|_ doesn't always indicate an error. It can also indicate a function which just doesn't return because it calculates indefinitely 07:03:16 c_wraith: yeah got it, thanks though 07:03:24 So every type in Haskell receives a partial order which says that x <= y (they write it with the fancy square <= sign) basically whenever it's possible to replace occurrences of _|_ in x with other values in order to obtain y. 07:03:36 either way, if you try evaluating it, you go into a tail spin you can't really come out of 07:03:55 --- quit: Sup3rkiddo (Read error: 60 (Operation timed out)) 07:04:14 So, if we look at the type Bool 07:04:23 It has 3 values: _|_, False, and True 07:04:31 Ok 07:04:45 and _|_ <= False, _|_ <= True, and that's all 07:04:54 Hence 'bottom' 07:04:56 (under this definedness ordering) 07:04:57 yeah 07:04:58 To answer my question, one simply needs to show whether Δ^J∘F is essentially ΔF which is the case, so (co)completeness lifts to functor categories because adjoints lift. 07:05:18 Now, let's consider the type [Bool] 07:05:28 It has _|_ at the bottom again 07:05:41 and then right above that, we have [] and _|_ : _|_ 07:05:56 ⊑ 07:05:59 --- join: roconnor (n=roconnor@76-10-150-163.dsl.teksavvy.com) joined #haskell 07:06:28 and then above _|_ : _|_, we have (False : _|_), (True : _|_), (_|_ : []) and (_|_ : (_|_ : _|_)) 07:06:43 This would be easier if I could draw you a picture :) 07:06:56 I was just about to say, I might see if I can draw it to see if I can understand you 07:07:07 Cale: http://www.skrbl.com/ 07:07:11 @google Hasse diagram 07:07:12 http://en.wikipedia.org/wiki/Hasse_diagram 07:07:13 Title: Hasse diagram - Wikipedia, the free encyclopedia 07:07:16 ⊑ is hard to type :-( 07:07:51 I just use <= since there's only one ordering that's being discussed. 07:07:58 mauke: I type \sq and then click on it. I'm not sure what I'd need to type to get just it. 07:08:18 http://en.wikibooks.org/wiki/Haskell/Denotational_semantics has diagrams 07:08:47 \sqsubseteq 07:09:28 ≤ is also too hard 07:09:35 Berengal: yeah, there's one which is close to the one I want using [()] 07:09:37 Berengal: yeah I saw those, but the list type is a little harder to imagine 07:09:42 --- join: hoknamahn (n=hoknamah@91.104.110.155) joined #haskell 07:10:02 er, actually, that one has a mistake in it. 07:10:52 Oh I see it 07:10:57 http://en.wikibooks.org/wiki/File:List-graph.png -- there's a ():[] which should be ():_|_ 07:11:15 and then above it there's a ():_|_ which is... really out of place 07:11:20 --- quit: pao () 07:11:29 Who made this? :) 07:11:47 Rofl 07:12:05 there are errata and history exactly on that page 07:12:29 I haven't loaded that actual page :P 07:12:43 hehe 07:12:44 too bad <= is overloaded for both ⇐ and ≤ 07:13:05 --- join: astrocub (n=astrocub@unaffiliated/ibuffy) joined #haskell 07:13:11 too bad the convention is sort of backward. 07:13:36 How often do people use ⇐? 07:13:41 <= usually corresponds to -> 07:13:53 and => (implication) corresponds to -> 07:14:00 --- quit: mmaruseacph2 (Remote closed the connection) 07:14:01 huh? 07:14:03 (in the right categories) 07:14:30 Usually you want arrows pointing in the direction of larger things. 07:14:32 --- quit: shambler ("We are full of wrong assumptions.") 07:14:47 What does ⊑ mean in general, as used in that List-graph.png? 07:14:53 --- join: mmaruseacph2 (n=mihai@p16.eregie.pub.ro) joined #haskell 07:14:55 ⇐←→⇒ 07:15:43 kpreid: Well, it's all screwed up in that diagram, but x ⊑ y is supposed to mean that y can be obtained from x by replacing occurrences of _|_ with various values. 07:16:11 So use ⊂ instead of ⇐ 07:16:21 (x is less defined than or equal to y) 07:16:23 Er 07:16:29 Cale: It's not /all/ screwed up, only one branch of it is. 07:16:36 well, yeah 07:16:41 Cale, that actually makes this whole thing much easier to understand 07:16:45 Replacing _|_ I mean 07:16:47 --- join: Sup3rkiddo (n=sudharsh@unaffiliated/sudharsh) joined #haskell 07:16:50 yes 07:17:27 Hmm 07:17:35 Bare with me then, let me re-read that example about succ 07:17:43 Cale: I see 07:17:51 So we can think of any evaluation of an expression as starting at _|_ and successively moving upward in the lattice as more and more about the structure of the resulting value is revealed. 07:18:19 --- quit: Dessous () 07:18:30 --- join: Dessous (n=slash@a88-115-70-173.elisa-laajakaista.fi) joined #haskell 07:18:42 In this view _|_ just represents any part of the structure which evaluation hasn't revealed to us yet. 07:20:08 I'm probably miles off but 07:20:13 * ddarius needs to modify my LaTeX SCIM table to have some symbols it doesn't have, but he doesn't remember which those were. 07:20:17 Would that mean that, _|_ + 1 (in that page example) is _|_ because 07:20:26 --- join: reprore (n=reprore@ntkngw356150.kngw.nt.ftth.ppp.infoweb.ne.jp) joined #haskell 07:20:33 > undefined + 1 07:20:34 * Exception: Prelude.undefined 07:20:40 The _|_ in _|_ + 1 hasn't been 'evaluated' yet, therefore _|_ + 1 also cannot be? 07:23:00 Well, because there are no Int or Integer values other than _|_ itself and fully-defined numbers, it must be the case that either _|_ + 1 is _|_ or we have that _|_ + 1 is some fully-defined number k 07:23:24 --- quit: augur (Read error: 110 (Connection timed out)) 07:24:00 Whee! 07:24:16 But, if _|_ + 1 was k, then n + 1 would be k for any n, because every function we can define in Haskell preserves the definedness ordering 07:24:26 --- quit: ville ("Lost terminal") 07:24:30 --- quit: ceii (Remote closed the connection) 07:25:30 That is, since _|_ <= n for any n, we must have that _|_ + 1 <= n + 1 07:25:50 and if _|_ + 1 = k, this means that k <= n + 1 07:25:54 Can someone type the top symbol, the opposite of ⊥? 07:25:55 --- join: ville (n=ville@a91-153-254-237.elisa-laajakaista.fi) joined #haskell 07:26:01 τ 07:26:02 ⊤ 07:26:04 er 07:26:10 no, that's tau 07:26:14 Cale, badum tish 07:26:22 --- quit: jims ("Leaving.") 07:26:33 --- quit: arnihermann (Read error: 60 (Operation timed out)) 07:26:35 I think I get it, k would be a constant, that would be the same for any n, which is impossible 07:26:40 Therefore it can only be _|_? 07:26:44 yeah 07:26:54 It just wouldn't be addition otherwise. 07:27:07 TТΤ⊤ 07:27:18 can't you just type 'T' 07:27:20 choose one 07:27:34 But this is a consequence of the fact that if k isn't _|_, then k must be fully defined, and so if k <= n + 1, then k = n+1 07:27:57 if i have a polymorphic type T t = A a | B b how would i refer to T in general? 07:28:03 Strange, my input editor maps \bot to ⊤ 07:28:03 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 07:28:08 aep: that looks invalid 07:28:15 err not type. data 07:28:21 Cale, I see I see 07:28:22 still invalid 07:28:23 --- join: arnihermann (n=arniherm@194-144-43-217.du.xdsl.is) joined #haskell 07:28:25 But this isn't true for our lazy natural type -- we have lazy naturals which are not _|_ and yet not completely defined. 07:28:29 um it compiles 07:28:40 --- join: Icewing (n=Icewing@unaffiliated/icewing) joined #haskell 07:28:41 --- quit: takuan (Operation timed out) 07:28:56 aep: irc.hs:1:13: Not in scope: type variable `a' 07:29:00 irc.hs:1:19: Not in scope: type variable `b' 07:29:15 err sorry 07:29:16 Thanks Cale, you've been extremely patient with me, I appreciate it 07:29:24 data T a = A a | B a 07:29:28 canseek: You're quite welcome 07:29:55 aep: T 07:29:58 One last question, that won't take any time, what input editor are you talking about? The whole \bot etc 07:30:08 mauke: well i cant use that as constructor 07:30:16 aep: what do you mean by referring to T in general? where do you want to use it? 07:30:24 --- quit: lazni ("Leaving.") 07:30:25 aep: yes, you can 07:30:32 i think i'm doing it all wrong. let me elaborate the long story 07:30:59 --- quit: Peaker (Read error: 110 (Connection timed out)) 07:31:16 i'm trying to make a monad for passing around a Box. the box has an attribute that defines how flow works 07:31:39 so i tried making the attribute a polymorphic type 07:31:43 --- quit: ulfdoz (Read error: 110 (Connection timed out)) 07:31:48 --- part: jutaro left #haskell 07:31:55 --- join: jims (n=jsandrid@216.242.143.128) joined #haskell 07:32:02 as in data MyMonad a = MyMonadGoesWest a | MyMonadGoesEast a 07:32:31 that's pretty wrong i guess? 07:32:42 well, how would you define return? 07:32:46 west or east? 07:32:47 yeah... 07:32:50 no idea 07:32:54 how would you define join? 07:32:56 --- join: lazni (n=lazni@118.71.1.87) joined #haskell 07:33:08 aep: maybe you just want the state monad? 07:33:15 sounds like the state monad to me 07:33:15 i guess that answers the question if i'm doing it wrong. but how do i do it right? 07:33:22 Looks closer to Either to me. 07:33:28 hum. 07:33:33 @src Either 07:33:34 Source not found. And you call yourself a Rocket Scientist! 07:33:36 but, not quite the same 07:33:41 yeah it's a state engine. let me read up on StateT. thanks 07:33:53 aep: start with plain State 07:33:56 --- join: THC4k (n=Miranda@p5B0C8472.dip0.t-ipconnect.de) joined #haskell 07:33:56 aye 07:33:56 StateT is a transformer, you probably just want State 07:34:22 --- quit: dfrey (Read error: 104 (Connection reset by peer)) 07:34:26 --- quit: astrocub (Read error: 110 (Connection timed out)) 07:34:33 --- quit: medfly (Remote closed the connection) 07:34:54 --- quit: comak (Read error: 54 (Connection reset by peer)) 07:35:17 --- quit: danblick (Read error: 60 (Operation timed out)) 07:35:27 --- join: Pellwurst (n=Fynn@g224154048.adsl.alicedsl.de) joined #haskell 07:35:33 --- join: dfrey (n=quassel@96.54.183.85) joined #haskell 07:35:33 Jafet: what was the input editor you mentioned? 07:35:44 @unmtl State s a 07:35:44 s -> (a, s) 07:35:46 SCIM, which has a somewhat-working latex mode 07:36:09 --- join: augur (n=augur@c-98-218-226-149.hsd1.dc.comcast.net) joined #haskell 07:36:22 that is cool 07:36:24 --- quit: mmaruseacph2 (Remote closed the connection) 07:36:25 i didn't know that 07:36:28 Ah ok, I'll check it out, thanks Jafet 07:36:51 As I found out though, the database seems to be sloppily made 07:36:59 does it invoke latex? 07:37:09 aep: if you wanted to reimplement State yourself then you would have data MyMonad a = MyMonad (WestOrEast -> (a, WestOrEast)) where data WestOrEast = West | East. But don't do that, just use State :-) 07:37:11 or is it just a mapping ? 07:37:26 It maps some latex sequences to Unicode characters 07:37:39 Well, not sequences. Whatever they're called 07:38:10 how do I solve this: 07:38:17 kpreid: just out of interest, what the heck does that mean? :D 07:38:22 --- quit: amiri ("leaving") 07:38:47 --- join: mmaruseacph2 (n=mihai@p16.eregie.pub.ro) joined #haskell 07:39:47 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 07:40:07 --- join: silver__ (n=sil@213.184.241.199) joined #haskell 07:40:08 wouldnt that sort of encapsulate things on every >>= pass? 07:40:21 "data D = D { ... ; init :: InitFun; bufSize :: Int } " and init uses the bufSize. Now a user says: "defaultD { bufSize = 100 }" but of course that fails since the "init" will use the *old* bufSize. 07:40:26 ≥ 1 × 07:40:34 cool, that works. Thanks 07:41:17 --- quit: Jafet ("Leaving.") 07:41:17 --- quit: smorg (Remote closed the connection) 07:41:28 --- join: Jafet (n=Jafet@unaffiliated/jafet) joined #haskell 07:41:34 taruti: split the state from the functions that manipulate it 07:41:52 --- quit: koeien37 ("Leaving.") 07:41:52 taruti: and make the latter ones take the former as argument 07:42:19 then congrats, you've implemented an OO language :) 07:42:24 --- quit: reprore (Remote closed the connection) 07:42:36 well it *is* useful in some cases. 07:42:50 yup 07:42:51 --- join: carlocci (n=nes@93.37.211.93) joined #haskell 07:43:00 --- join: amiri (n=amiri@cpe-76-90-107-15.socal.res.rr.com) joined #haskell 07:43:01 * Jafet multiple dispatches on Saizan's momma 07:43:08 --- join: Taejo (n=person@196-210-210-186.dynamic.isadsl.co.za) joined #haskell 07:44:55 data D = D { ... ; init :: D -> InitFun; bufSize :: Int }; realInit :: D -> InitFun; realInit d = d init d ? 07:44:55 or is there a more sensible way 07:45:30 --- quit: shambler_ (Read error: 60 (Operation timed out)) 07:46:09 ´ 07:46:12 --- join: HaskellLove (n=chatzill@95.180.184.108) joined #haskell 07:46:21 oh, what a statement, sorry about that :) 07:46:38 --- join: reprore (n=reprore@ntkngw356150.kngw.nt.ftth.ppp.infoweb.ne.jp) joined #haskell 07:47:43 data DFuns = DF { init :: DState -> InitFun }; data DState = DState { bufSize :: Int }, data D = D DState DFuns 07:48:05 aep: no, because you define >>= (or join) and that's it's job to do the right thing with it 07:48:10 Saizan: that will make record updates harder 07:48:31 defaultD { fooFun = myFoo, bufSize = 400 } 07:48:39 aep: the point being that the state monad is really a thin wrapper around s -> (a, s) 07:48:49 kpreid: i see 07:48:49 a function from an old state to a result and a new state 07:49:04 @src >>= State 07:49:04 Source not found. And you call yourself a Rocket Scientist! 07:49:14 eh, I forget how to do that 07:49:38 @src State >>= 07:49:38 Source not found. It can only be attributed to human error. 07:49:46 taruti: i guess your version was nicer then 07:50:16 taruti: it's more appropriate actually, if init calls some methods you really want it to use the current ones 07:51:08 for State: m >>= k = State $ \s -> let (a, s') = m s in k a s' 07:51:20 (dropping the newtypes.. you otherwise need runStates) 07:52:29 --- join: CESSMASTER (n=CESSMAST@unaffiliated/joelywoely) joined #haskell 07:53:03 --- join: mreggen (n=mreggen@cm-84.215.18.49.getinternet.no) joined #haskell 07:53:30 eh, which for the sake of correctness: m >>= k = State $ \s -> let (a, s') = runState m s in runState (k a) s' 07:54:20 --- join: comak (n=mak@dynamic-78-8-243-87.ssp.dialog.net.pl) joined #haskell 07:54:33 --- join: ksf (n=ksf@g224057205.adsl.alicedsl.de) joined #haskell 07:55:16 augh, they've put a load of auxiliary methods in Applicative for base4.2 07:55:23 well by a load I mean two 07:55:31 but two that don't need to be there really 07:55:35 taruti's second version is the recursive record approach. 07:55:40 (same for Alternative) 07:56:25 --- join: ccasin (n=ccasin@pool-68-238-222-15.phil.east.verizon.net) joined #haskell 07:56:56 what sort of error does "read" throw, and how can I catch it? 07:57:08 try 'reads' 07:57:12 @type reads 07:57:14 forall a. (Read a) => String -> [(a, String)] 07:57:25 oh, wait 07:57:39 there's usually a better way of doing things than throwing and catching errors 07:57:44 (like reads) 07:58:16 reads is a fine function 07:58:29 read throws an error using the 'error' function 07:58:31 why does reads return a list? 07:58:44 multiple parses, I'm guessing 07:58:48 yes 07:58:56 example? 07:59:02 there aren't many 07:59:08 which is a little annoying - I want to enforce the "must parse entire string" behavior of read 07:59:13 I think I heard it explained in terms of regular expressions 07:59:21 ccasin: read is implemented in terms of reads 07:59:25 Is it possible to detect if any symbols collide with each other when importing modules? 07:59:25 --- join: astrocub (n=astrocub@unaffiliated/ibuffy) joined #haskell 07:59:45 You get a compile error 07:59:50 benmachine: yeah, I'm not saying it can't be done :) 07:59:54 Jafet: When I use one, yes. 08:00:10 --- join: jeffwheeler (n=jeff@71.145.154.202) joined #haskell 08:00:17 How do you want to detect it then? 08:00:19 --- quit: canseek ("leaving") 08:00:25 > case reads "() " of {[x, []] -> "Full parse"; [x, y] -> "Partial parse"; _ -> "No parse"} 08:00:26 Couldn't match expected type `(a, GHC.Base.String)' 08:00:26 against inferre... 08:00:37 Polarina: No, there's no tool I know of that detects that. 08:00:39 Jafet: Trying to study a little without looking at referencing documents the whole day. 08:00:44 :/ 08:00:48 augustss: Ok. 08:00:51 I'm not sure what that means 08:01:11 augustss: GHC won't give a warning with appropriate options? 08:01:13 > reads " () " 08:01:14 Polarina: It's intentional that collisions are allowed until you try to use the symbol. 08:01:14 [(()," ")] 08:01:18 > reads "" 08:01:20 [] 08:01:25 > case reads "() " of {[(x, [])] -> "Full parse"; [(x, y)] -> "Partial parse"; _ -> "No parse"} 08:01:26 ddarius: Not that I know. 08:01:26 Ambiguous type variable `a' in the constraint: 08:01:26 `GHC.Read.Read a' 08:01:26 ar... 08:01:30 So, you all are right and I should probably just use reads, but I'm trying to put something together quickly and the types don't work out. So, is there anyway to actually catch read's type of error? 08:01:37 > case reads "() " of {[((), [])] -> "Full parse"; [(x, y)] -> "Partial parse"; _ -> "No parse"} 08:01:38 "Partial parse" 08:01:39 For example, if I import Data.Map, not qualified, it collides with things in Prelude, but nothing complains unless I actually use something that collides. 08:01:53 ccasin: there's no easy way outside of IO 08:02:01 > case reads "()" of {[((), [])] -> "Full parse"; [(x, y)] -> "Partial parse"; _ -> "No parse"} 08:02:02 benmachine: I'm happy to use IO 08:02:02 "Full parse" 08:02:10 ccasin: yeah, there is 08:02:17 ccasin: http://hackage.haskell.org/package/spoon 08:02:23 Polarina: that's right. And until you use something, you don't really care. 08:02:24 benmachine: but, I observe the prelude's "catch" doesn't seem to catch this error 08:02:29 ccasin: that was probably better phrased as, there's no easy way, and there's no way outside of IO 08:02:41 augustss: :( 08:02:46 Control.Exception.catch will probably do it but it's a pai 08:02:47 pain 08:02:50 benmachine: spoons does it outside of IO (somehow) 08:02:58 spoon is an evil hack 08:03:04 --- join: notfancy (n=notfancy@186.137.88.3) joined #haskell 08:03:06 Polarina: I think it's rather nice 08:03:08 Created to counter other evil hacks... 08:03:14 agreed 08:03:14 Hi everybody 08:03:19 spoon is an evil hack 08:03:23 Oh, looking at spoon source 08:03:27 "unsafePerformIO" 08:03:28 kamatsu: unsafePerformIO. So.. not really outside 08:03:32 bah 08:03:32 ccasin: use reads 08:03:33 --- join: rdd (n=user@c83-250-152-128.bredband.comhem.se) joined #haskell 08:03:38 It appears not. 08:03:39 ccasin: it's really much easier to do fmap fst . listToMaybe . reads 08:03:42 --- quit: astrocub (Client Quit) 08:03:47 :t fmap fst . listToMaybe . reads 08:03:48 forall a. (Read a) => String -> Maybe a 08:03:54 --- join: astrocub (n=astrocub@unaffiliated/ibuffy) joined #haskell 08:04:04 that function should be in the prelude 08:04:12 yeah I think it'd be nice 08:04:41 Doesn't force the full parse constraint of read 08:04:46 --- nick: ath_ -> ath 08:04:47 true 08:04:55 case on reads would do that if you cared 08:04:56 the problem is I don't really want a maybe - I'd just have to throw a more catchable exception because I need to bubble up through a bunch of layers of cruft 08:05:16 suit yourself 08:05:24 ccasin: readIO 08:05:27 I mean, Maybes are very good at that sort of thing 08:05:39 @type fmap fst . listToMaybe . filter (null.snd) . reads 08:05:40 forall a. (Read a) => String -> Maybe a 08:05:59 augustss: thank you, this is perfect 08:06:11 --- quit: HaskellLove ("ChatZilla 0.9.85 [Firefox 3.0.8/2009033100]") 08:06:28 --- join: gio123 (n=jhjhxh@gprs1.gprs.ge) joined #haskell 08:06:41 --- quit: michael| (Read error: 110 (Connection timed out)) 08:07:12 benmachine: yes, I agree, I am an expressive types advocate :) I'm just in a hurry to test something 08:08:00 ccasin: well, then, Control.Exception 08:08:21 I will be more helpful in a sec 08:08:24 but that's where to start 08:08:30 http://hackage.haskell.org/packages/archive/base/4.2.0.0/doc/html/Control-Exception.html#t%3AException 08:08:39 probably ErrorCall 08:08:56 it depends what exactly you want to do 08:09:25 but the documentation for catch has a decent example 08:09:37 I'll just make it a practice to import everything as qualified. 08:09:40 benmachine: no worries, augustss's readIO is perfect 08:09:47 ccasin: but with readIO you can catch it with the regular catch. 08:10:52 yes, I've had trouble with Control.Exception, perhaps since I'm not sure which sort of exception to catch. But readIO is just the thing, thanks. 08:11:10 oh 08:11:11 k 08:11:54 (still think Maybe is the way to go :P you just replace a few $s with <$>s and you are sorted) 08:12:01 is there any haskell package for color printing to commandline? 08:12:01 --- join: Mathnerd314 (n=chatzill@dsl.6.28.53.206.cos.dyn.pcisys.net) joined #haskell 08:12:08 (but I suppose sometimes that may be more hassle than it's worth 08:12:11 ) 08:12:20 aep: vty 08:12:24 @hackage vty 08:12:24 http://hackage.haskell.org/package/vty 08:12:24 thanks 08:12:48 --- quit: kniu ("Leaving") 08:12:52 oh not a full blown gui, just some escape code helpers 08:13:01 well vty has those too 08:13:13 hm ok 08:13:16 @hackage ansi-terminal 08:13:17 http://hackage.haskell.org/package/ansi-terminal 08:13:18 module Graphics.Vty.Inline 08:13:24 @hackage ansi-wl-pprint 08:13:24 http://hackage.haskell.org/package/ansi-wl-pprint 08:13:36 ok, those might be simpler 08:13:42 nice 08:15:03 --- quit: weihsiu (Client Quit) 08:15:04 --- quit: reprore (Remote closed the connection) 08:15:41 --- join: reprore_ (n=reprore@ntkngw356150.kngw.nt.ftth.ppp.infoweb.ne.jp) joined #haskell 08:15:46 --- quit: mmaruseacph2 (Remote closed the connection) 08:16:05 --- quit: ccasin ("Leaving") 08:17:55 --- quit: raichoo ("Leaving.") 08:18:04 I'm stumped with something I can't quite tease apart 08:18:23 I'm trying to express a function generating a list 08:18:41 something like xs = e : f (xs **so far**) 08:19:11 namely, e : f [e] : f [e, f [e]] : f [e, f [e], f [e, f[e]]] and so on 08:19:16 ... 08:19:46 what would be the type of your function 08:19:51 I've tried xs = e : (map f . tail . inits $ xs) 08:20:04 BONUS: ([a] -> a) -> a -> [a] 08:20:34 From what I see, inits forces one tail too many for it to work 08:21:00 hmm, i'm not quite getting what it would do 08:21:04 what would it return for some sample inputs 08:21:11 --- quit: jeffwheeler ("Leaving") 08:21:37 I'm reading http://arxiv.org/PS_cache/arxiv/pdf/0912/0912.2394v1.pdf 08:21:52 And the sequence in question is A090822 (the second one in the paper) 08:22:18 which is defined as the list of values of a function on the initial segments of that very list 08:22:39 the Gijswijt sequence? 08:22:44 Yeah 08:22:50 --- join: raichoo (n=raichoo@i577BAA2A.versanet.de) joined #haskell 08:24:06 --- join: danblick (n=Dan@c-24-18-233-183.hsd1.wa.comcast.net) joined #haskell 08:24:48 --- quit: Taejo ("Leaving") 08:24:54 --- nick: keseldud1 -> keseldude 08:25:08 Learn you a haskell is not clear enough on Data.Map. :( 08:25:18 hmm im not quite understanding where the string Y comes from 08:25:26 Polarina: what are you confused about? 08:25:33 > let xs = e:(map f . tail . inits xs) in xs 08:25:34 Couldn't match expected type `SimpleReflect.Expr' 08:25:34 against inferred ... 08:25:39 > let xs = x:(map f . tail . inits xs) in xs 08:25:40 Couldn't match expected type `SimpleReflect.Expr' 08:25:40 against inferred ... 08:25:45 BONUS: How to define a function by providing explicit type. I don't see what type to use. 08:26:19 > let xs = x:(map f . tail . inits $ xs) in xs 08:26:23 mueval-core: Time limit exceeded 08:26:25 @genie (a -> b) -> (b -> c) -> (a -> c) 08:26:26 Unknown command, try @list 08:26:28 > let xs = x:(map f . tail . inits $ xs) in take 4 xs 08:26:29 well a Map k v is a map from k to v 08:26:32 mueval-core: Time limit exceeded 08:26:34 @djinn (a -> b) -> (b -> c) -> (a -> c) 08:26:34 f a b c = b (a c) 08:26:35 > let xs = x:(map f . tail . inits $ xs) in take 2 xs 08:26:39 mueval-core: Time limit exceeded 08:26:43 > inits [1,2,3] 08:26:44 look at some of the types of the functions in Data.Map maybe? 08:26:44 [[],[1],[1,2],[1,2,3]] 08:27:06 BONUS: I am importing as qualified and nothing seems to work when qualified. :( 08:27:26 for instance it says how to make your own fromList 08:27:29 and what type it has 08:27:43 what does your import statement look like? 08:27:45 And :t in ghci assumes non-qualification when showing type. 08:27:56 import qualified Data.Map 08:28:03 notfancy: iterate' f x = let {go n = f (take n s) : go (n + 1); s = x : go 1 in s 08:28:04 notfancy: iterate (\x -> x ++ [f x]) works 08:28:10 import qualified Data.Map as M 08:28:18 I don't want the "as 08:28:23 Polarina: ummm but in the tutorial the import statement "import qualified Dta.Map as Map" is used 08:28:24 er, iterate (\x -> x ++ [f x]) [e] 08:28:26 ah 08:28:29 well then you have to change your types accordingly 08:28:49 hrm, I'm having big trouble writing binary data to files in 6.12, it always expands utf8 multi-byte characters even if I use binary files, write from pointers or bytestrings, any hints? 08:28:52 I have. :S 08:28:59 Berngal, opqdonut, thank you! 08:29:00 then what's the problem? 08:29:06 `Data.Map.Map' is not applied to enough type arguments 08:29:06 Expected kind `??', but `Data.Map.Map' has kind `* -> * -> *' 08:29:09 --- quit: raichoo ("Leaving.") 08:29:15 of course the performance for my version is probably horrible 08:29:15 missing type arguments 08:29:23 What type arguments? 08:29:24 but it's the simples obviously working solution :) 08:29:29 this has nothing to do with qualified imports 08:29:30 Polarina: if you see the type of Map.fromList in the tutorial 08:29:30 --- join: raichoo (n=raichoo@i577BAA2A.versanet.de) joined #haskell 08:29:31 it says 08:29:34 Mine is probably a bit faster... possibly 08:29:38 Berengal, I was not very keen on using an explicit index, even though I found that take is lazier than tails 08:29:43 Map.fromList :: (Ord k) => [(k, v)] -> Map.Map k v 08:29:45 --- join: igel (n=igel@port-92-203-79-133.dynamic.qsc.de) joined #haskell 08:29:46 you left out the k v 08:29:52 Oh. 08:29:53 --- join: elt0n (n=elton@p50901BE2.dip0.t-ipconnect.de) joined #haskell 08:29:53 Thanks. 08:30:03 opqdonut, point-freeness got me ;-) 08:30:10 hey i'm new to haskell and I'm wondering what this message means: You cannot give a type signature for an imported value 08:30:20 --- join: interferon (n=interfer@pool-96-224-36-86.nycmny.east.verizon.net) joined #haskell 08:30:24 notfancy: The alternative is to append the result to the end of the list, which has pretty horrible complexity... 08:30:28 is <$> just a lifted $ ? 08:30:35 elt0n: Code example, please. :) 08:30:43 interferon: <$> is fmap 08:30:45 :t <$> -- not quiter 08:30:46 parse error on input `<$>' 08:30:46 --- part: raichoo left #haskell 08:30:46 interferon: <$> is fmap 08:30:54 oh 08:30:58 :t (<$>) 08:30:59 <*> is a bit like lifted $ 08:31:00 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 08:31:01 lifted fmap or regular fmap? 08:31:05 :t (<*>) 08:31:06 forall (f :: * -> *) a b. (Applicative f) => f (a -> b) -> f a -> f b 08:31:08 regular. 08:31:11 @src (<$>) 08:31:12 f <$> a = fmap f a 08:31:13 interferon: it's identical to fmap 08:31:15 * Polarina hates Monads. 08:31:16 http://pastebin.com/d205fd5b 08:31:17 i think i don't really understand fmap 08:31:22 interferon: <*> is a lifted $ 08:31:24 on sequences, i understand 08:31:26 Polarina, here it is 08:31:28 Polarina: Monads are great 08:31:29 but what does it mean for other types? 08:31:48 full of weasel words, but significant, http://flyingfrogblog.blogspot.com/2010/01/naive-parallelization-c-vs-haskell.html 08:31:49 interferon: the same thing :-) 08:31:50 interferon: It changes the contents without changing the structure 08:31:55 elt0n: i'm guessing you need to indent the monad function declarations 08:31:55 @index when 08:31:55 Control.Monad, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Cont, Control.Monad.Error, Control.Monad.List 08:31:55 elt0n: And what's the exact error message? 08:31:56 "These benefits are well worth this level of performance degradation in many applications so parallel Haskell would seem to have immediate practical applications." 08:31:57 is it that simple? 08:32:08 talk about damning with faint praise. 08:32:15 elt0n: you're trying to redefine functions from Monad, I think 08:32:16 Heffalump: ^ :) 08:32:37 Polarina, http://pastebin.com/d31e7ff33 08:32:37 dons: Oh yeah, that one was rather interesting 08:32:38 dons: do you think he's feeling ok? 08:32:44 he might be sick. 08:32:44 mauke, hmm good idea 08:32:58 dons: Does it test paralellization with ghc 6.12? 08:33:00 headline! jdh30 sez "parallel Haskell would seem to have immediate practical applications" 08:33:16 elt0n: You need to define mzero some expression. 08:33:17 --- join: rfh (n=holzi199@212.186.133.195) joined #haskell 08:33:17 @remember jdh30 parallel Haskell would seem to have immediate practical applications 08:33:18 Done. 08:33:21 mwhaha 08:33:35 --- join: Modius (n=Modius@cpe-70-123-130-159.austin.res.rr.com) joined #haskell 08:33:36 > let xs = 1:map sum (tail (inits xs)) in xs 08:33:40 mueval-core: Time limit exceeded 08:33:45 Polarina: unsure. 08:34:18 Polarina, ahh ok thx 08:34:20 has anyone here read "Algorithms: A Functional Programming Approach"? 08:34:33 or something similar that they can vouch for? 08:35:02 @src inits 08:35:02 inits [] = [[]] 08:35:02 inits (x:xs) = [[]] ++ map (x:) (inits xs) 08:35:05 dons: There still does seem to be some issues with parallelism in haskell, particularly the last-core slowdown issue 08:35:29 But it's still better than the alternatives :) 08:35:42 > let inits' ~(x:xs) = [[]] ++ map (x:) (inits' xs); xs = 1:map sum (tail (inits xs)) in xs 08:35:43 oh noes! there's no quickcheck Arbitrary instance for Complex! 08:35:43 note, linux-spec. 08:35:46 mueval-core: Time limit exceeded 08:35:54 remember the famous "no last core slowdown" on the mac? 08:35:56 Oh, yes indeed 08:36:14 But still: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=15957 08:36:53 (However, note that my last timing was with n+1 cores 08:36:54 interferon: I would, if I could download it. 08:36:57 dons: good read, thanks for the link. Posted to reddit yet? 08:37:01 s/would/would've/ 08:37:03 > let inits' ~(x:xs) = [[]] ++ map (x:) (inits' xs); xs = 1:map sum (tail (inits' xs)) in xs 08:37:04 [1,1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,13107... 08:37:08 There we go. 08:37:17 > let inits' ~(x:xs) = [[]] ++ map (x:) (inits' xs); xs = x:map f (tail (inits' xs)) in xs 08:37:19 [x,f [x],f [x,f [x]],f [x,f [x],f [x,f [x]]],f [x,f [x],f [x,f [x]],f [x,f ... 08:37:30 kamatsu: i put it on the haskell reddit. 08:37:39 Berengal: is there a bug ticket for this btw? 08:37:41 --- quit: cognominal (Connection timed out) 08:37:47 --- quit: interferon () 08:37:54 Berengal: i'm not sure if "The last core slowdown" has an issue in the bug tracker-- but it should. 08:38:04 dons: It does, let me look it up for you 08:38:04 just to document what is known 08:38:07 --- join: cognominal (n=cognomin@82.67.232.89) joined #haskell 08:38:13 you might add your test case. 08:38:39 my japanese RWH arrived! 08:38:43 dons: http://hackage.haskell.org/trac/ghc/ticket/3553 08:38:50 dons: What are you going to do with it? 08:38:57 --- join: _andy_ (n=andy@c-98-201-121-195.hsd1.tx.comcast.net) joined #haskell 08:38:57 keep it :) 08:39:00 ^______^ 08:39:03 why is it Japanese? 08:39:10 --- join: gehmehgeh (n=niemand@unaffiliated/gehmehgeh) joined #haskell 08:39:13 RWH has been translated 08:39:18 ah 08:39:19 It's somewhat surreal, that post 08:39:20 I don't know, somehow that's what the people in Japan speak 08:39:22 "we see the incredible result that the fastest program overall is the least optimized Haskell" 08:39:24 this is the author's copy. 08:39:31 notfancy: he's a wacky guy. 08:39:50 dons: Also, I don't have a ghc-trac account, and the register page is 404 08:39:54 --- join: naten (n=naten@24-117-139-61.cpe.cableone.net) joined #haskell 08:39:57 grr. my dns is out of date since the hackage move. 08:40:05 dons: Why'd you purchase a Japanese copy of RWH? 08:40:15 pikhq: i was sent a copy by the publisher. 08:40:29 dons: Fair enough. 08:40:35 --- quit: papna (Remote closed the connection) 08:40:46 if you already know haskell, what better way to learn japanese than to read a haskell book in japanese 08:40:48 --- join: lpsmith (n=lpsmith@unaffiliated/lpsmith) joined #haskell 08:40:52 --- join: mmaruseacph2 (n=mihai@p16.eregie.pub.ro) joined #haskell 08:40:54 hehe good idea 08:41:01 what's the character for "monad" ? 08:41:05 BONUS: ... That's freaking hard to do, y'know. 08:41:06 * dons looks 08:41:10 haha 08:41:11 dons: There won't be one 08:41:15 good luck typing it out 08:41:19 dons: I know jdh 08:41:20 --- join: mun_ (n=mun@94-193-244-76.zone7.bethere.co.uk) joined #haskell 08:41:23 Though at least much of the technical verbiage in this context is... English. 08:41:24 dons: Japanese has phonetic characters too 08:41:35 notfancy: Your initial solution to the sequence problem using inits was good. The problem was simply that inits is slightly too strict. opqdonut's solution using iterate is grotty. 08:41:37 I had the pleasure to watch his meltdown in slow-motion 08:41:38 Mo-na- 08:41:40 * Jafet shades 08:41:42 -de-su! 08:41:44 pikhq: i already knew english and i read a haskell book in english and i learned haskell 08:41:45 monado 08:41:51 so i don't know why it shouldn't work the other way around 08:42:07 dons: I'm going to guess it's written out as "monado" in katakana or "monad" in romaji. 08:42:08 --- join: anRch (n=markmill@64.134.99.185) joined #haskell 08:42:14 BONUS: ... Japanese is a hard language to read. 08:42:19 ddarius: grotty? 08:42:23 モナド 08:42:24 so is haskell if you don't know it, hahah 08:42:27 ddarius: I've copied your last definition for later inspection 08:42:37 The spoken language and the grammar aren't too hard. But reading it is very difficult. 08:42:38 notfancy: slow motion ... in person? 08:42:46 hmm, like Haskell, Japanese grammar is made up of a few very simple concepts 08:42:47 * dons tries to read the subtext of notfancy's comment. 08:42:52 BONUS, english -> (english -> haskell) -> haskell and haskell -> (japanese -> haskell) -> japanese don't have the same type 08:43:07 kamatsu: Quite true. 08:43:08 notfancy: It's identical to yours, the only difference is it uses a variant of inits that only works on infinite lists but can therefore be slightly lazier since it doesn't need to check for the end of the list. 08:43:12 also like Haskell, its meaning can be clouded to those who don't know it due to whacky characters 08:43:14 dons: not in person, online, five or six years ago he started posting on the OCaml list 08:43:19 He was rather insightful 08:43:26 oh, of course. we all know him :) 08:43:33 opqdonut: The performance issues and their source (or were you wondering about the meaning of "grotty") 08:43:34 i imagine RWH in japanese is like: Advancedu ribrary designu: buirding a Broom firter 08:43:41 --- quit: ufopp () 08:43:49 BONUS: lol! 08:43:51 Jafet: haha 08:43:52 ddarius: the meaning, i know it was a bad solution :) 08:44:00 @google define:grotty 08:44:01 No Result Found. 08:44:07 --- quit: Mathnerd314 ("ChatZilla 0.9.86 [Firefox 3.5.6/20091201220228]") 08:44:11 I learnt Java from reading a Japanese book 08:44:12 @wn grotty 08:44:14 *** "grotty" wn "WordNet (r) 2.0" 08:44:14 grotty 08:44:14 adj : very unpleasant or offensive ; "a grotty little play" 08:44:14 [also: {grottiest}, {grottier}] 08:44:18 anyway, good to see some parallel haskell press. 08:44:22 kamatsu: hehe 08:44:25 it was really weird to see anime characters explaining composition over inheritance 08:44:28 http://www.urbandictionary.com/define.php?term=grotty 08:44:39 BONUS: "Adobansedo raiburari desainu: birudeingu ei Buruumu firuta." 08:44:43 medfly: thanks :) 08:44:54 Buruumu sounds cute 08:44:56 expert romaji mangler 08:45:12 4 years of Japanese, I *better* get some use out of it. :P 08:45:31 pikhq: http://lambda.bugyo.tk/cdr/mwl/ 08:45:37 Manga de wakaru lisp! 08:45:39 haha 08:45:41 .oO( buruuma filter ) 08:45:41 man, very few coding related terms have words in my language and the ones that do are rarely used 08:45:46 kamatsu: That was quite amusing. 08:45:47 I imagine Japanese programmers just use English 08:45:56 Yukihiro matsumoto does 08:46:08 he's the only japanese programmer i know of 08:46:09 * ddarius recently met a Japanese programmer. 08:46:13 does he design bloom filters? 08:46:15 dons: now I know what is the sound of somebody eating their own words 08:46:21 notfancy: ah i think i see. so he started off quite coherent, but seemed to meltdown over a few years? 08:46:23 dons: it's rather sad 08:46:24 Jafet: *Most* programmers just use English. 08:46:29 It's kinda the lingua franca. 08:46:30 --- join: hrehf (n=s@dslb-094-221-106-021.pools.arcor-ip.net) joined #haskell 08:46:38 dons: right, he shilled out rather progressively 08:46:39 I wonder if anyone has learnt Java from a Javanese book 08:46:41 (sorry) 08:46:42 Where "most" very, very closely approximates "all" 08:46:45 I even daresay *American* english 08:46:52 opqdonut: unfortunately the language there is Bahasa Indonesia 08:46:58 oh, that's sad. i've only seen the last couple of years, which hasn't been so much fun. 08:47:10 kamatsu: I'd go with "bizarre hybrid of American and British English". 08:47:14 lol! 08:47:23 dons: that's the problem with people that get invested as the years pass, I'm afraid 08:47:24 pikhq: Perhaps 08:47:35 I know that that's what *I* use, at least. 08:47:37 everyone know that ICFP is in Japan next year? 08:47:46 I remember on reddit once they did a comparison of curse word count in various code bases 08:47:48 dons: as you see, I'm trying to de-invest myself from OCaml ;-) 08:47:49 what use is that knowledge 08:47:52 Next year meaning this year or 2011? 08:47:55 2011 08:47:58 2010 is Baltimore. 08:48:01 Haskell had the lowest 'fuck' count 08:48:08 What month for 2010? 08:48:14 notfancy: that's an interesting observation. 08:48:20 ddarius: Sep-Oct 08:48:24 --- quit: gonsor (Read error: 60 (Operation timed out)) 08:48:32 I mentioned that because Haskell started in england, everyone here should say 'bollocks' 08:48:41 blimey! 08:48:43 any cool haskell events this summer? i was thinking of visiting the US in the summer 08:48:48 oh dear! 08:49:04 kamatsu: Fiku vin. 08:49:05 --- quit: tibbe () 08:49:06 :P 08:49:25 pikhq: esperanto? 08:49:28 is that esperanto? 08:49:32 --- quit: rajeshsr (Read error: 110 (Connection timed out)) 08:49:36 kamatsu: Jes. 08:49:43 --- quit: ehird (Remote closed the connection) 08:50:00 Mi ne parolas Esperanton 08:50:18 Malbone. 08:50:40 mi ne komprenas 08:50:55 vi estas la sola esperantisto kiun mi renkontas 08:50:57 KOMPRENU! 08:51:12 läget annars då 08:51:17 Interesa. 08:51:26 * mauke blames this "esperanto phrasebook" 08:51:27 --- join: deso (n=deso@x0561a.wh30.tu-dresden.de) joined #haskell 08:51:35 Heheh. 08:51:36 nihongo to eigo wa daijoubu dakedo, esperantogo(?) ga zenzen wakaranaindayo. 08:52:04 --- join: spaceodyssey (n=algol@unaffiliated/fdd) joined #haskell 08:52:06 um i need to parse a file in the format key\nvalue\nkey\nvalue. would do it with a quick DFA, but haskell doesnt _have_ that. what do i do? :( 08:52:06 i don't have japanese IME on this computer =( 08:52:07 --- quit: lazni ("Leaving.") 08:52:16 kamatsu: Zan nen da ne. Esperantogo wa totemo omoshiroii dayo... 08:52:23 I, too, lack an IME. 08:52:31 warum sprechen hier alle ausländisch? 08:52:46 And my kanji's gone to shit, what with the "not having studied for 2 years" thing. 08:53:45 --- join: saccade_ (n=saccade@209-6-54-113.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com) joined #haskell 08:54:14 pikhq: jitsu wa, sono gengo ga dasoku da to to omouyone. 08:54:28 this channel is full of anime fanbois. 08:54:37 buŝoŝtopu min per kulero 08:54:43 medfly: I started watching anime after I stated learning Japanese. 08:54:54 i don't watch anime at all, although I speak Japanese 08:54:54 aep: map snd . filter (odd . fst) . zip [1..] . zip`ap`tail . lines 08:54:58 s/stated/started/ 08:55:19 Berengal: Ah, the god of consecutive numbers. zip`ap`tail. 08:55:24 :) 08:55:27 http://pbfcomics.com/?cid=PBF071-Weeaboo.gif 08:55:46 Berengal: uuuh i need a minute to read up on that. thanks! :D 08:55:50 pikhq: The zip-join-ap triumverate is surprisingly versatile :P 08:55:58 Berengal: :) 08:56:23 Polarina, hey i just realized that MonadPlus already exists...but how can i import it? 08:56:36 elt0n: Do you know the path? 08:56:39 aep: It might not work. I haven't tested it... 08:56:40 --- quit: dv_ ("Verlassend") 08:56:46 @src ap 08:56:46 ap = liftM2 id 08:56:48 elt0n: it's not a separate module 08:56:58 'import Control.Monad' 08:56:59 Ah, of course 08:57:04 > map snd . filter (odd . fst) . zip [1..] . zip`ap`tail . lines $ "foo\nbar\nfoo2\nbar2\nfoo3\nbar3\n" 08:57:05 Precedence parsing error 08:57:05 cannot mix `L..' [infixr 9] and `Control.Mona... 08:57:13 this channel is like a collection of anything nerdy 08:57:15 ah, I know. I'll see if someone has already defined a Complex qc instance using 'find . -name "*.hs" -exec grep "instance Arbitrary Complex" {} \;;' 08:57:18 good ol find! 08:57:21 > (map snd . filter (odd . fst) . zip [1..] . zip`ap`tail . lines) $ "foo\nbar\nfoo2\nbar2\nfoo3\nbar3\n" 08:57:22 Precedence parsing error 08:57:22 cannot mix `L..' [infixr 9] and `Control.Mona... 08:57:23 is there anything it can't do? 08:57:23 mauke, and than Monad and MonadPlus is available? 08:57:30 > (map snd . filter (odd . fst) . zip [1..] . (zip`ap`tail) . lines) $ "foo\nbar\nfoo2\nbar2\nfoo3\nbar3\n" 08:57:31 [("foo","bar"),("foo2","bar2"),("foo3","bar3")] 08:57:32 Berengal: i get :1:46: Not in scope: `ap' 08:57:35 gwern: needs more grep -r. or ack. 08:57:38 aep: Control.Monad 08:57:39 elt0n: yes 08:57:41 ah 08:57:49 err forgot how to do that in ghci 08:57:53 mauke: grep -r is slow. also wouldn't it check every file? 08:57:54 :m + 08:57:58 ah mauke thx it works 08:58:11 bollocks 08:58:12 gwern: yes (but ack wouldn't) 08:58:21 I'd have to install ack tho 08:58:23 aep: 'import Control.Monad' 08:58:24 :t zip`ap`tail 08:58:25 forall b. [b] -> [(b, b)] 08:58:40 gwern: that's a good idea in general :-) 08:58:40 mauke: ghci cant do that 08:58:45 aep: yes, it can 08:58:47 find with -exec to do the grep may help 08:58:48 aep: :m +Control.Monad 08:58:49 @unpl ap zip tail 08:58:50 (zip >>= \ b -> tail >>= \ a -> return (b a)) 08:58:55 mauke: :1:0: parse error on input `import' 08:58:59 Berengal: thanks 08:59:02 aep: ah, your ghci is too old then 08:59:02 --- quit: nomadmonad (Read error: 60 (Operation timed out)) 08:59:06 oh 08:59:06 --- join: iblechbot (n=iblechbo@ppp-93-104-37-203.dynamic.mnet-online.de) joined #haskell 08:59:18 mauke, and can you tell me in which module Alg is defined? 08:59:38 elt0n: I've never heard of Alg 08:59:38 --- quit: cognominal (Read error: 104 (Connection reset by peer)) 08:59:48 @hoogle alg 08:59:50 Data.Data AlgConstr :: ConIndex -> ConstrRep 08:59:50 Network.Browser AlgMD5 :: Algorithm 08:59:50 Network.Browser AlgMD5sess :: Algorithm 09:00:01 --- join: IceDane (n=icedane@1410ds1-aeg.0.fullrate.dk) joined #haskell 09:00:13 --- join: Quadrescence (n=quad@unaffiliated/quadrescence) joined #haskell 09:00:13 waa. "No instance for (Monad ((->) [String])) arising from a use of `ap' at :1:45-55" 09:00:26 aep: import Control.Monad.Instances 09:00:28 aep: Control.Monad.Instances -_- 09:00:35 or .Reader 09:00:49 ah! sorry 09:01:29 --- join: Rayne (n=Rayne@pD9E3778B.dip.t-dialin.net) joined #haskell 09:02:18 well it works, but i'm still clueless why :D 09:02:20 mauke, ok seems to be a bug in my code 09:02:44 aep: Have fun figuring it out :P 09:03:05 yeah ;) 09:03:25 @hoogle Parser 09:03:25 module Language.Haskell.Parser 09:03:26 Text.Parsec.ByteString type Parser = Parsec ByteString () 09:03:26 Text.Parsec.String type Parser = Parsec String () 09:03:32 aep: map snd . filter (odd . fst) . zip [1..] simply drops every other item from the list, by the way... 09:04:00 evens is still not in Prelude? 09:04:03 @hoogle evens 09:04:03 No results found 09:04:06 :/ 09:04:12 I really wish the time package would be more modular. Now it is either a large superfluous package as a dependency or using old-time or clock :( 09:04:19 aep: ap f g x = f x (g x) for the function monad 09:04:41 http://mauke.ath.cx/tmp/flow.png 09:04:41 > evens [1..] 09:04:42 Not in scope: `evens' 09:05:35 @let evens (x:xs) = x:odds xs; evens [] = []; odds (x:xs) = evens xs; odds [] = [] 09:05:36 Defined. 09:05:41 > evens [1..] 09:05:42 [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,5... 09:05:44 hum. on my entire hard drive, no Complex arbitrary instances 09:05:46 yay 09:05:47 frustrting 09:06:03 Well, I'm off to lunch 09:06:08 Thank you everybody 09:06:18 ciao notfancy 09:06:33 --- quit: notfancy ("Java user signed off") 09:07:16 > uncurry zip . evens *** odds . lines $ "foo\nbar\nfoo2\nbar2\nfoo3\nbar3\n" 09:07:17 Couldn't match expected type `([a], [b])' 09:07:17 against inferred type `[t]' 09:07:30 > uncurry zip . (evens &&& odds) . lines $ "foo\nbar\nfoo2\nbar2\nfoo3\nbar3\n" 09:07:31 [("foo","bar"),("foo2","bar2"),("foo3","bar3")] 09:07:49 aep: ^ a simpler but still point-free definition 09:08:17 the pointful version would be "f x = zip (evens x) (odds x)" 09:08:26 which is pretty legible already 09:08:43 did someone say liftM2 zip evens odds? 09:09:06 good pointr 09:09:07 -r 09:09:14 heh, point 09:09:47 my head just exploded trying to decipher (zip`ap`tail) 09:09:58 --- quit: Jafet (Connection timed out) 09:09:59 hehe 09:10:02 that tends to happen 09:10:09 @quote zip.ap.tail 09:10:10 quicksilver says: zip`ap`tail - the Aztec god of consecutive numbers 09:10:12 Polarina: Sæll. 09:10:16 aep: ap is just the S combinator 09:10:21 IceDane: Hæ! 09:10:26 Berengal: what? 09:10:27 whæt 09:10:37 Yes, we are foreigners 09:10:38 aep: in SKI combinator calculus 09:10:42 --- join: tener (n=tener@host-87-99-43-73.lanet.net.pl) joined #haskell 09:10:47 Berengal: um 09:10:49 what? 09:10:52 aep: S f g x = f x (g x) 09:11:09 aep: I = \x -> x; K = \x -> \y -> x, S = \f -> \g -> \x -> f x (g x) 09:11:17 IceDane: Hvað segist? :P 09:11:19 aep: It's turing compelte 09:11:19 > ap (f :: Expr -> Expr -> Expr) g x 09:11:20 f x (g x) 09:11:21 > (=<<) (f :: Expr -> Expr -> Expr) g x 09:11:22 f (g x) x 09:11:29 zip`ap`tail = ap zip tail = \x -> zip x (tail x) 09:11:34 --- quit: rdd (Read error: 54 (Connection reset by peer)) 09:11:52 does that just mean: run one function and apply the result to another? 09:11:56 Haha - ekki mikið. En held ekki að þeim lítist vel á það að við tölum íslensku hérna.. 09:12:07 --- join: rdd (n=rdd@c83-250-152-128.bredband.comhem.se) joined #haskell 09:12:13 IceDane: Það yrði ekki fyrsta skipti, er svo sem alveg í lagi. :) 09:12:15 aep: Basically, but the other function also gets the original value 09:12:21 Nú jæja 09:12:32 Eru fleiri ? 09:12:35 sug min kuk 09:12:48 Berengal: You don't need 'I' 09:12:49 IceDane: Ég hef séð tvo aðra, a.m.k. 09:12:51 :-( 09:13:01 Eru þeir frá huga þá eða? 09:13:09 Berengal: so you're ziping the list with the same list shifted by one? 09:13:17 augustss: All you need is lambda 09:13:19 --- quit: jaspervdj ("leaving") 09:13:23 aep: Yep 09:13:24 s/ambda/ove/ 09:13:24 IceDane: Nei, ég kom hér bara einn daginn hér og spurði hvort eitthverjir íslendingar væru hér. 09:13:26 Berengal: I = S K K 09:13:31 Já okay 09:13:33 --- join: Rixi (n=Rixiii@79-100-1-90.btc-net.bg) joined #haskell 09:13:42 --- quit: saccade_ ("This computer has gone to sleep") 09:13:42 no, S K S! 09:13:51 Skrifað haskell lengi eða? 09:13:57 --- join: sinelaw (n=sinelaw_@IGLD-84-228-156-220.inter.net.il) joined #haskell 09:13:59 S K I 09:14:06 IceDane: Er frekar nýr, en hef öggulittla reynslu. 09:14:08 Berengal: zomg recursion 09:14:17 IceDane: Mér finnst þetta bara skemmtilegt fyrst og fremst. 09:14:25 mauke: 'cept not really :P 09:14:39 Já, sama hér. Öll þessi tungumál með sama syntaxinn eru ekkert skemmtileg 09:14:40 Y (S K) 09:14:50 Þegar maður er alveg "what the hell" er þetta skemmtilegt 09:14:50 IceDane: Nákvæmlega! :D 09:14:53 --- join: ufopp (n=ufopp@ip68-0-153-9.tc.ph.cox.net) joined #haskell 09:15:14 --- join: zakwilson (n=zak@c-68-35-255-11.hsd1.fl.comcast.net) joined #haskell 09:15:30 is this #haskell-is now 09:15:34 IceDane: Ert þú búinn að taka þátt í forritunarkeppninni á huga? :P 09:15:45 kmc: There is one? :O 09:15:49 no... 09:15:49 :O 09:15:52 :( 09:15:55 So, we stay here then. 09:16:03 mauke: S K K has a better type 09:16:06 So you are implicitly suggesting that we should make one? 09:16:06 how do I register my own modules and use them? Is there a doc link for that 09:16:21 augustss: they both have the same type 09:16:34 can't hurt, there seems to be interest 09:16:43 Polarina: Ég hef ekki sent inn ennþá, en ég mun gera það. Það verður hins vegar í C++ 09:16:53 S K S is symetric 09:16:57 IceDane: Ég er að gera mitt í Haskell. 09:17:05 mauke: not with HM 09:17:07 IceDane: Er ansi sáttur með það eins og er. 09:17:14 Polarina, Google translates your nick to "Polaris" :) 09:17:24 Uss. 09:17:28 kmc: Haha. 09:17:30 --- join: cloudhead (n=cloudhea@modemcable019.251-202-24.mc.videotron.ca) joined #haskell 09:17:38 :t (ap const const, ap const ap) 09:17:39 forall b (m :: * -> *) a b1. (Monad m) => (b -> b, m (a -> b1) -> m (a -> b1)) 09:17:48 IceDane: Hví uss? 09:17:52 --- quit: cloudhead (Remote closed the connection) 09:17:56 --- join: ulfdoz (n=mary@p3EE241A1.dip.t-dialin.net) joined #haskell 09:18:02 > ap const ap True 09:18:03 Couldn't match expected type `GHC.Bool.Bool' 09:18:03 against inferred type ... 09:18:12 > ap const const True 09:18:13 True 09:18:25 --- join: cloudhead (n=cloudhea@modemcable019.251-202-24.mc.videotron.ca) joined #haskell 09:18:37 but true = const 09:18:37 --- quit: cgibreak1 (Read error: 60 (Operation timed out)) 09:18:38 Polarina: Ég er samt ekki full viss um að náunginn sem sér um þetta hafi kunnáttu til þess að geta tekið, segjum 10, forrit í mismunandi tungumálum og gefið einkannir eftir því hvort var best. 09:18:47 ouch. the magnitude optimization is wrong! 09:18:53 --- join: barca4ever (n=kashka00@AC820E20.ipt.aol.com) joined #haskell 09:19:05 --- join: trofi (n=slyfox@93.85.105.172) joined #haskell 09:19:05 Uss af því að það væri frekar erfitt, fyrir mig allavega. 09:19:11 IceDane: Ég myndi halda slíkt hið sama, en allar keppnir eru skemmtilegar yfir höfuð. 09:19:24 Já, það er einmitt það 09:19:30 --- join: tomh- (n=tomh-@unaffiliated/tomh) joined #haskell 09:19:39 OK, enough Icelandic. As much as I like it. 09:19:52 IceDane: Ég er algjör núbbi í haskell yfir höfuð, tók mig tár og blóð að koma þessu til að virka. 09:19:55 augustss: Ok. 09:19:57 o0 09:20:01 --- quit: mxc () 09:20:09 is it spanish hour yet? 09:20:19 IceDane: #haskell-blah 09:20:26 imagine everyone wrote in his own language here.. 09:20:26 --- nick: tener -> KSkrzet 09:20:39 Ja, hur skulle det se ut? 09:20:42 Some would speak in lojban... 09:20:50 das wäre ja wie das internet 09:20:56 augustss: Jeg ikke forstår dig. :( 09:20:59 Det er ikke til at vide. 09:21:00 what's wrong with english? 09:21:13 wir sollten uns auf englisch einigen -.- 09:21:15 what is this "own language" thing? 09:21:22 I mean native language 09:21:25 damd: hokka no gengo de zenbu ga chigau dayo ne. 09:21:46 but you can invent you own if you like :p 09:21:48 and use it here 09:22:05 that would be a great way for the haskell community to avoid success 09:22:07 say "can I use Perl?"; 09:22:22 --- join: cognominal (n=cognomin@82.67.232.89) joined #haskell 09:22:37 --- nick: Jacolyte1 -> Jacolyte 09:22:44 "Hi, I'm looking for help with haskell... what? what!? I need to learn Icelandic to learn Haskell? Bah, now i wasted all those months learning category theory!" 09:23:18 http://en.wikipedia.org/wiki/Fj%C3%B6lnir_(programming_language) 09:23:26 someone should translate the manual to english :-/ 09:24:58 i'm off all 09:24:59 goodnight 09:25:01 --- quit: kamatsu ("Lost terminal") 09:25:02 The most metal programming language 09:25:11 http://www.reddit.com/r/haskell/comments/apm5d/why_are_haskell_complex_floats_so_much_slower/c0isx20 <-- anyone know why this optimization breaks? it's not obvious to me 09:25:14 mauke: Google can. 09:25:32 Dragonfjölnir⁈ 09:25:40 --- nick: KSkrzet -> KSkrzet_ 09:25:54 --- nick: KSkrzet_ -> KSkrzet 09:25:57 --- quit: anRch () 09:26:46 --- join: mauke_ (n=mauke@p3m/member/mauke) joined #haskell 09:27:13 --- join: conal (n=conal@misc-148-66-75-114.pool.starband.net) joined #haskell 09:28:05 --- quit: mauke (Read error: 60 (Operation timed out)) 09:28:06 --- nick: mauke_ -> mauke 09:28:18 gwern: because the order of computation results in different results with Doubles. 09:28:56 --- quit: bel5f5 ("Leaving.") 09:29:02 --- join: smorg (n=smorg@174-20-139-221.mpls.qwest.net) joined #haskell 09:29:10 --- join: leandrom (n=leandro@host148.190-227-251.telecom.net.ar) joined #haskell 09:29:29 gwern: Does it really break, or is it possible to redefine "correct" to include your program? We're talking floats here... 09:29:54 > magnitude ((-12.936926911905847) :+ (-5.429932106037269)) :: Complex CReal 09:29:55 No instance for (GHC.Float.RealFloat 09:29:55 (Data.Complex.Comp... 09:30:08 1 :: CReal 09:30:13 > 1 :: CReal 09:30:15 1.0 09:30:25 > 1 :: Complex CReal 09:30:26 1.0 :+ 0.0 09:30:47 @type magnitude 09:30:48 forall a. (RealFloat a) => Complex a -> a 09:30:50 Berengal: heck, I dunno. floats scare me 09:30:59 --- join: sinelaw_ (n=sinelaw_@IGLD-84-228-221-115.inter.net.il) joined #haskell 09:31:16 gwern: basically with floats (a+b)+c /= a+(b+c) 09:31:25 > magnitude (((-12.936926911905847) :+ (-5.429932106037269)) :: Complex CReal) 09:31:27 14.0302616012734447623775791964899325489354 09:31:28 Bad version of CReal 09:31:36 --- quit: _JFT_ () 09:31:38 oh :) 09:31:43 taruti: but I feed the same numbers in the same order into both 09:31:48 you wanted to final expression to be Complex CReal 09:31:49 --- join: cgibreak1 (n=cgibreak@96.230.235.195) joined #haskell 09:31:50 --- join: cytzol (n=cytzol@tmp-103-139.essex.ac.uk) joined #haskell 09:32:06 --- quit: Argue (Connection reset by peer) 09:32:12 gwern: Me too. I usually just put my fingers in my ears and go "LALALA" whenever I need them... or put "accurat to the first digit" in the comments... 09:32:21 gwern: but the implementations differ and thus even if they are both correct provide different answers. 09:32:25 myMagnitude is better 09:32:55 gwern: usually different floating point implementations of the same thing produce slightly different results. 09:32:59 It has the last digit correctly rounded 09:33:50 For doing ray tracing I'd just use a naive magnitude 09:33:58 --- quit: ufopp () 09:34:04 you never get numbers large enough that it matters 09:34:25 And it's easy to do without touching the Complex module 09:34:39 If ghc is in a good mood. 09:35:14 --- quit: PhilRod (Read error: 110 (Connection timed out)) 09:35:24 > sqrt $ (-12.936926911905847)^2 + (-5.429932106037269)^2 :: CReal 09:35:26 14.0302616012734447623775791964899325489354 09:35:55 last digit correctly rounded? 09:36:14 Last digit in the result from myMagnitude is correct 09:36:20 ...3445 09:36:23 RT fails in the presence of a grouchy compiler? 09:36:51 should you care about the last digit? 09:37:24 --- join: gio12345 (n=jhjhxh@gprs1.gprs.ge) joined #haskell 09:37:29 You should care about all of them, but you can't count on them being right :) 09:37:40 yup :> 09:38:17 --- nick: dino-_ -> dino- 09:38:31 --- quit: Badger (Remote closed the connection) 09:38:42 Floats are very icky. 09:39:51 --- join: nprice (n=nprice@cpe-76-184-72-104.tx.res.rr.com) joined #haskell 09:40:17 wow, jdh admitted haskell may be useful 09:40:25 * copumpkin faints 09:40:45 where? 09:40:59 http://flyingfrogblog.blogspot.com/2010/01/naive-parallelization-c-vs-haskell.html 09:41:14 must be feeling mellow after his holiday 09:41:20 --- nick: sjanssen_ -> sjanssen 09:41:38 Maybe he's having a bad day. 09:42:52 --- join: tkiexn (n=orzho@xdsl-87-79-191-127.netcologne.de) joined #haskell 09:42:52 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:42:52 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:42:52 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:42:53 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:42:54 --- quit: igel (Remote closed the connection) 09:42:54 --- quit: tkiexn (K-lined) 09:43:00 --- join: tvxbek (n=sqncbuaa@adsl-233-188-64.mia.bellsouth.net) joined #haskell 09:43:00 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:43:00 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:43:00 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:43:01 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:43:03 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:43:05 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:43:06 --- mode: ChanServ set +o mauke 09:43:06 --- part: tvxbek left #haskell 09:43:07 --- mode: ChanServ set +o Heffalump 09:43:22 --- join: jeffwheeler (n=jeff@71.145.154.202) joined #haskell 09:43:48 --- join: Paczesiowa (n=paczesio@213-238-83-105.adsl.inetia.pl) joined #haskell 09:44:00 --- quit: daybreakcx ("Leaving.") 09:44:06 --- mode: mauke set -o mauke 09:44:10 --- quit: c_wraith (Remote closed the connection) 09:44:29 --- join: avpq (n=cobl@st3r.net) joined #haskell 09:44:29 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:29 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:29 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:30 --- join: qbqepfw (n=nsrgga@st3r.net) joined #haskell 09:44:30 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:30 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:30 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:30 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:31 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:32 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:34 --- quit: qbqepfw (K-lined) 09:44:34 --- quit: avpq (K-lined) 09:44:51 --- join: ayiczwquih (n=qtepy@ool-45742488.dyn.optonline.net) joined #haskell 09:44:51 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:51 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:51 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:51 --- join: dopls (n=fgkrcxdo@ool-45742488.dyn.optonline.net) joined #haskell 09:44:51 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:51 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:51 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:52 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:52 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:54 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:54 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:44:55 --- quit: ayiczwquih (K-lined) 09:44:55 --- quit: dopls (K-lined) 09:44:55 +m 09:45:00 --- mode: Heffalump set +m 09:45:03 --- mode: Heffalump set +v copumpkin 09:45:07 --- mode: Heffalump set +v augustss 09:45:16 --- mode: Heffalump set -m 09:45:24 --- join: kxnbtmkqrtdm (n=kfwi@bd21ae72.virtua.com.br) joined #haskell 09:45:24 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:45:24 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:45:24 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:45:25 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:45:27 Censor the spam -- respect LILO's memory! http://peoplesprimary.com/users/dave0230/DSCF0356.jpg 09:45:27 --- mode: Heffalump set +m 09:45:31 or +R 09:45:32 --- kick: kxnbtmkqrtdm was kicked by Heffalump (Heffalump) 09:45:37 that's probably safest 09:45:39 what's +R? 09:45:40 --- mode: ChanServ set +o Lemmih 09:45:45 only registered users may speak 09:45:46 anyone else msg me for voice.. 09:45:48 --- quit: augustss (K-lined) 09:45:51 --- join: bahmshzr (n=lxemwkun@cpe-69-133-205-122.cinci.res.rr.com) joined #haskell 09:45:52 wtf 09:45:53 huh? wtf? 09:45:56 --- join: obtfkr (n=gbc@cpe-69-133-205-122.cinci.res.rr.com) joined #haskell 09:45:56 augustss k-lined! 09:46:02 someone got confused 09:46:02 --- quit: bahmshzr (Broken pipe) 09:46:03 --- quit: obtfkr (Broken pipe) 09:46:18 Always knew that guy was up to no good! 09:46:24 it's true 09:46:25 --- mode: Heffalump set +R-m 09:46:28 he's been abusing haskell forever 09:46:35 still need to manually voice people who aren't registered, presumably. 09:46:40 can someone take a look at Person type on wikipedia for Haskell and tell me why is it 'asbtract'? 09:46:55 * Heffalump will also need to disappear shortly 09:46:58 --- mode: Heffalump set +o mauke 09:47:04 --- quit: paper_cc1 (Read error: 110 (Connection timed out)) 09:47:10 ddarius: http://code.haskell.org/~dolio/agda-share/html/CExp.html 09:47:14 --- quit: dfrey (Remote closed the connection) 09:47:33 --- topic: set to '["msg an op if you can't talk", "hackage torrent @ http://bit.ly/7ObzIP ","Haskell 2010 is out: http://hackage.haskell.org/trac/haskell-prime/wiki#Status", "Haskell News: http://reddit.com/r/haskell", "The Haskell programming language", "http://haskell.org", "Paste: http://hpaste.org", "Logs: http://tunes.org/~nef/logs/haskell/"]' by Heffalump 09:47:35 --- join: gonsor (n=quassel@kel30.kel.stud.uni-goettingen.de) joined #haskell 09:47:48 wow. that url is one impressive beastie. 09:47:50 (don't click it) 09:47:55 --- quit: trin_cz (Read error: 60 (Operation timed out)) 09:48:08 --- quit: sinelaw (Read error: 110 (Connection timed out)) 09:48:22 does anyone know when the next issue of the The Monad Reader will come out? 09:48:30 --- join: Adamant (n=Adamant@unaffiliated/adamant) joined #haskell 09:48:33 --- join: Gowilla (n=ganesh@82.153.21.1) joined #haskell 09:48:34 oh, it's Last Measure 09:48:50 --- quit: Paczesiowa (K-lined) 09:49:12 I think they must be k-lining unregistered users 09:49:23 --- mode: Heffalump set +v Gowilla 09:49:26 can I talk now? 09:49:28 ok, good. 09:49:48 @hoogle token 09:49:48 Heffalump: but he used chanserv to op himself 09:49:48 Text.Parsec.Prim token :: Stream s Identity t => (t -> String) -> (t -> SourcePos) -> (t -> Maybe a) -> Parsec s u a 09:49:49 Text.ParserCombinators.Parsec.Prim token :: Stream s Identity t => (t -> String) -> (t -> SourcePos) -> (t -> Maybe a) -> Parsec s u a 09:49:49 module Text.Parsec.Token 09:49:59 who did? 09:50:13 --- join: protojay (n=protojay@81.147.100.94) joined #haskell 09:50:14 If you click the link, your browser connects to IRC and keeps spamming that link a few hundred times, as if by magic. 09:50:15 omg augustss was a spammer 09:50:20 Heffalump: augustss, http://snapplr.com/3w7y 09:50:21 Then you presumably get k-lined. 09:50:32 heh, nice 09:50:37 how on earth does it do that, browser exploit? 09:50:46 probably an iframe 09:50:51 let's see ... 09:50:56 ouch 09:50:57 Gowilla: It auto-submits a form using javascript to "http://irc.freenode.org:6667" 09:51:04 with irc commands in the POST data 09:51:06 yes 09:51:12 --- mode: Heffalump set +v mmaruseacph2 09:51:20 javascript is so sinister 09:51:24 I need to go in a minute 09:51:30 shall I op some more people to give voice out? 09:51:58 --- quit: Philonous1 (Client Quit) 09:52:04 We do not appear to require voice...? 09:52:09 People can identify easily enough 09:52:11 not if you're registered 09:52:12 --- join: Philonous (n=uart14@dslb-188-103-052-187.pools.arcor-ip.net) joined #haskell 09:52:14 * Heffalump gone for a bit 09:52:18 Right 09:52:43 --- join: mattrepl (n=mattrepl@pool-72-83-118-99.washdc.fios.verizon.net) joined #haskell 09:53:10 I wonder how people can still surf the web without decent java script protection 09:53:16 exploit code: http://pastebay.com/83116 09:53:36 i have nothing to say atm anyway soo 09:53:58 mauke: are you sure telling everybody is the wisest idea? 09:54:16 more people should use noscript 09:54:17 sure 09:54:22 stops javacrap in its tracks 09:54:40 Was it the noscript guy who fucks with other firefox extensions? 09:54:42 sshc: telling? it's right there in the page that's been spammed all over freenode 09:54:42 --- quit: Mowah (Client Quit) 09:54:42 JS should really have some of these security mechanisms builtin 09:55:05 sshc: full disclosure :) 09:55:29 beware, antisec might go after mauke! 09:55:32 except they got owned 09:55:38 --- quit: gio123 (Connection timed out) 09:55:59 Vanadium: He tried to circumvent addblock for his own site. But that's a nuisance at worst 09:56:08 if i have "do x <- some_io ; use_x x; use_x x; " will some_io be done twice? 09:56:18 aep: no 09:56:27 phew. thanks 09:56:37 yikes 09:56:59 --- quit: redcuber (K-lined) 09:57:25 anyone want to take a ballpark guess of what wc -l returns on the latest hackage archive? 09:57:32 i.e. 1802 packages | wc -l 09:57:43 --- join: Flarelocke1 (n=sfodstad@c-71-193-197-4.hsd1.or.comcast.net) joined #haskell 09:57:48 Random guess: 600K 09:57:52 --- quit: sinelaw_ (Success) 09:57:55 300K 09:57:56 400k 09:57:59 900K 09:58:00 aep: some_io >>= \x -> use_x x >> use_x x 09:58:02 Or somesuch. 09:58:02 the exploit author might be an idiot. chars.substring(rnum,rnum+1) better written as chars.charAt(rnum) 09:58:04 srsly? 09:58:09 7.5M 09:58:12 :O 09:58:14 I was closest! 09:58:17 mauke: Wrong type? 09:58:25 what do i win, bob 09:58:29 hehe 09:58:30 Zao: well, evidently it works 09:58:32 Javascript does not have a char type 09:58:39 --- quit: alvarezp (Read error: 110 (Connection timed out)) 09:58:39 7500000 / 1802 09:58:41 > 7500000 / 1802 09:58:42 4162.042175360711 09:58:44 Either way just gives you a one-character string 09:58:59 now, i don't really think that's a plausible amount for lines of code. 09:59:05 4k is too high an avg. 09:59:14 --- quit: sioraiocht (Nick collision from services.) 09:59:16 benmachine: I would assume charAt :: String -> Idx -> Char and substring :: String -> Idx -> Idx -> String 09:59:17 but that's mostly due to that it includes all the data files 09:59:24 > 4000 / 200 09:59:25 20.0 09:59:28 lol 09:59:35 Although I guess that JS is insane like usual. 09:59:36 Assuming 200/module, that's 20 modules/package 09:59:47 Zao: javascript doesn't have char type. or a type system like that. 10:00:00 surely the vast majority of packages are one or two modules 10:00:04 --- quit: ksf (Read error: 60 (Operation timed out)) 10:00:06 --- quit: RayNbow ("When science finally locates the center of the universe, some people will be surprised to learn they're not it") 10:00:09 i'd think so, yes. 10:00:18 And 200 module is really rather arbitrary... 10:00:32 --- part: protojay left #haskell 10:00:33 --- quit: _andy_ (Read error: 113 (No route to host)) 10:01:28 --- quit: elt0n ("Leaving") 10:01:34 ah, nice. the php script seems to generate different js code so everyone gets a different channel 10:01:46 --- quit: sioraioc_ (Client Quit) 10:01:54 that's nice 10:01:56 --- join: sioraiocht (n=tomh@unaffiliated/sioraiocht) joined #haskell 10:02:02 --- join: perspectival (n=perspect@cpe-071-070-222-116.nc.res.rr.com) joined #haskell 10:02:46 --- join: phaer (n=phaer@chello084112190080.11.vie.surfer.at) joined #haskell 10:03:16 this exploit would be defeatable by delayed voicing 10:03:29 --- join: Athas` (n=athas@0x50a157d6.alb2nxx15.dynamic.dsl.tele.dk) joined #haskell 10:03:35 --- quit: Pellwurst ("bye, bye...") 10:03:38 also by making the ircd dropping connections that start with "POST" 10:03:46 *drop 10:04:09 I've been thinking a bit about C++0x's variadic templates lately. Is there a way in haskell (or any other functional programming language) to define one tuple type that can handle an arbitrary number of elements while still being type safe? Or more generally: is such a thing possible without introducing the possibility of the compiler going into an infinite loop (like in c++)? 10:04:39 sepp2k: it's easy if you just want all the same types in it 10:04:54 otherwise you're basically going for an hlist, I guess 10:04:54 sepp2k: What would the C++ equivalent be? 10:04:56 sepp2k: the problem with arbitrary-element tuples is, what can you do with them? 10:04:59 HList might be a solution to that, though it's not a particularly elegant one 10:05:01 Aye 10:05:30 --- join: b6 (n=brian@ip72-204-54-71.fv.ks.cox.net) joined #haskell 10:05:31 you can't pattern match on them because you don't know how big they are, you can't retrieve the nth element because you don't know what type it is, etc 10:05:39 --- quit: IceDane () 10:06:03 @hoogle expression 10:06:04 Text.Parsec.Expr buildExpressionParser :: Stream s m t => OperatorTable s u m a -> ParsecT s u m a -> ParsecT s u m a 10:06:04 Text.ParserCombinators.Parsec.Expr buildExpressionParser :: OperatorTable tok st a -> GenParser tok st a -> GenParser tok st a 10:06:13 --- join: sinelaw_ (n=sinelaw_@IGLD-84-228-221-115.inter.net.il) joined #haskell 10:06:21 :t x 10:06:22 Expr 10:06:26 @hoogle Expr 10:06:27 module Text.Parsec.Expr 10:06:27 module Text.ParserCombinators.Parsec.Expr 10:06:27 Text.Parsec.Expr buildExpressionParser :: Stream s m t => OperatorTable s u m a -> ParsecT s u m a -> ParsecT s u m a 10:06:32 --- quit: sinelaw_ (Read error: 104 (Connection reset by peer)) 10:06:39 burp: SimpleReflect in the show package, I think 10:06:46 oh, thanks 10:06:51 --- join: sinelaw (n=sinelaw_@IGLD-84-228-221-115.inter.net.il) joined #haskell 10:07:40 benmachine: Vanadium: In C++0x you can define a template tuple so that you could do: Tuple tup(1,'c',2); char c = tup.get<1>(); which would check at compile-time that: the arguments to the constructor have the right types and that the element at index 1 is really a char. 10:07:48 --- quit: comak (Connection timed out) 10:08:01 Well, we have arbitrary tuples to begin with 10:08:32 --- join: comak (n=mak@dynamic-78-8-243-87.ssp.dialog.net.pl) joined #haskell 10:08:37 HList looks interesting 10:08:43 could that be done with TH? 10:08:48 I don't have a solution yet, but I think it might be possible with HList, type-naturals and some type classes... 10:08:54 idk i dont know too much about TH 10:08:54 sepp2k: I am not sure what you want your tuples to do beyond what regular tuples do 10:08:58 BONUS: that is what I was thinking 10:09:01 Vanadium: But you couldn't define an equivalent type yourself, could you? 10:09:03 (but neither do I) 10:09:18 the type being 'tuple' or the type being 'tuple'? 10:09:28 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16199 runInteractiveProcess issue with cat and rev. 10:09:31 it sounds a bit like a normal ADT? 10:09:33 Every tuple type is its own type 10:09:35 we just don't have a method of doing stuff like (1,'a',"bah") !! 2 10:09:39 Vanadium: I don't want them to do anything more than they do. I want to know how I would define them if they didn't exist. 10:10:02 Ah 10:10:12 --- join: djanderson (n=doug@cpe-76-179-99-75.maine.res.rr.com) joined #haskell 10:10:22 --- mode: Heffalump set -o Heffalump 10:10:25 --- quit: KSkrzet (K-lined) 10:10:29 You can probably do something crazy involving something close to type-level lists 10:10:32 data Pair a b = Pair a b 10:10:44 hmm no 10:10:47 yes 10:10:53 Pair a (Pair c d), and so on 10:10:59 yeah you can do that 10:11:11 I wondered if normal tuples shouldn't be done like that 10:11:23 --- quit: MyCatVerbs (Read error: 113 (No route to host)) 10:11:40 we could have only pairs, and then (a, b, c) would be syntactic sugar for ((a, b), c) and/or (a, (b, c)) 10:11:47 oh that 10:11:48 --- quit: dolio (Read error: 104 (Connection reset by peer)) 10:11:52 i never really got the benefit of that 10:12:02 what does it offer 10:12:05 Vanadium: But I couldn't (and can't actually) that returned the ith element of a tuple. 10:12:13 +define a function 10:12:26 --- quit: ramses_ (Read error: 110 (Connection timed out)) 10:12:30 You mean a function that takes an index? 10:12:33 BONUS: class instances for tuples tend to be a bit crappy 10:12:42 Vanadium: Yes. 10:12:47 Well, neither can you in C++ 10:12:55 how would i access bla with foo in [(bla,foo),(.. ? 10:13:03 err foo with bla 10:13:07 since it is tup.get<1>() and not tup.get(1) 10:13:16 That's true. 10:13:31 aep: lookup, assuming all the types work out? 10:13:35 i'm p sure that some TH hackery could enable something like that 10:13:35 @type lookup 10:13:35 :t lookup 10:13:36 forall a b. (Eq a) => a -> [(a, b)] -> Maybe b 10:13:37 forall a b. (Eq a) => a -> [(a, b)] -> Maybe b 10:13:40 There's no such thing as compile-time arguments in haskell, I guess. 10:13:55 but it's not like it's that useful because pattern matching 10:14:05 @type find 10:14:06 forall a. (a -> Bool) -> [a] -> Maybe a 10:14:21 sepp2k: well, there's TH, but that requires more effort 10:14:34 i forgot to mention: i need do do that two times for two sequential keys. i was trying not to run a full search every time 10:14:46 --- join: nohluhtC (n=yogsotho@pool-71-163-202-169.washdc.east.verizon.net) joined #haskell 10:15:03 take 2 . filter? 10:15:39 no, what i am actually trying is get (foo,bla),(bar,baz) into a record type with foo and bar 10:15:55 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 10:15:55 benmachine: Ah, that looks interesting. 10:16:46 [("foo","bla"),("bar","baz")] ==> T {foo="bla",bar="baz"} 10:17:07 with many other possible keys in the list 10:17:31 so a regular find would search the whole list once for every key :/ 10:18:36 --- quit: Athas (Connection timed out) 10:18:37 in a non pure language, i'd just do something like; reference1,reference2; for all (x,y) in list do { if(x=="bla")reference1)=y } 10:19:41 hmm maybe i can use filter and then expect the result to be at a specific position in the result list 10:19:48 --- join: Pellwurst (n=Fynn@g224154048.adsl.alicedsl.de) joined #haskell 10:20:02 --- quit: nohluhtC (Read error: 54 (Connection reset by peer)) 10:20:46 surely using lookup for each entry in the record type is not any slower than going through the list once but checking against every field name for every entry 10:21:02 foldr (.) id . map (\(a, b) -> if a == "foo" then (\x -> x { foo = b }) else if a == "bar" then (\x -> x { bar = b }) else id) 10:21:05 wooo 10:21:14 --- join: _andy_ (n=andy@75-148-137-210-Houston.hfc.comcastbusiness.net) joined #haskell 10:21:26 that is a slightly silly way of doing it 10:21:35 Otherwise you could presumably build something that looks like lookup but returns a list that does not have the element you were looking for in addition to it 10:22:19 --- join: ksf (n=ksf@g224055211.adsl.alicedsl.de) joined #haskell 10:23:18 does Network.HTTP support HTTP pipelining? 10:23:28 what's pipelining? 10:23:38 using a single tcp connection to make multiple requests 10:23:46 copumpkin: i think the new version just might. (the curl package certainly does) 10:23:53 copumpkin: if you find out, let us know. 10:23:57 sure 10:24:00 Network.Browser? 10:24:10 I couldn't tell whether that was using it or not 10:24:19 well if you can't tell, does it matter? :P 10:24:46 I think that it uses a persistent connection 10:24:50 I'm going to be pounding a server that isn't mine like crazy, so I wanted to minimize it 10:25:00 heh 10:25:02 --- join: der_eq_ (n=eq@dslb-088-070-013-100.pools.arcor-ip.net) joined #haskell 10:26:58 --- join: HugoDaniel (n=hugo_gom@81.193.59.226) joined #haskell 10:27:17 --- quit: der_eq (Read error: 60 (Operation timed out)) 10:28:37 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 10:31:06 --- quit: _andy_ (Client Quit) 10:31:38 --- quit: sinelaw (Read error: 110 (Connection timed out)) 10:31:54 --- join: andy (n=andy@75-148-137-210-Houston.hfc.comcastbusiness.net) joined #haskell 10:32:18 --- nick: andy -> Guest52822 10:33:57 --- quit: THC4k (Read error: 60 (Operation timed out)) 10:34:02 --- join: mgmwwi (n=vincent@ppp-208-115.33-151.iol.it) joined #haskell 10:34:13 --- join: elspru (n=elspru@216-66-143-145.dsl.look.ca) joined #haskell 10:34:18 --- quit: Yogsothon (Read error: 110 (Connection timed out)) 10:35:20 --- part: elspru left #haskell 10:35:21 --- join: elspru (n=elspru@216-66-143-145.dsl.look.ca) joined #haskell 10:35:23 --- join: eu-prleu-peupeu (n=Hugo_Gom@81.193.61.91) joined #haskell 10:35:29 --- part: eu-prleu-peupeu left #haskell 10:35:43 --- join: eu-prleu-peupeu (n=Hugo_Gom@81.193.61.91) joined #haskell 10:36:25 hey, suddenly my darcs changed from vim to nano 10:36:34 how to change it back? 10:37:05 echo $EDITOR 10:37:08 elspru: check your $EDITOR? 10:37:11 --- quit: jeffwheeler (Remote closed the connection) 10:37:21 nano is pretty easy to exit, you know 10:37:45 it actually tells you the command on the menu at the bottom, which is nice 10:37:49 Gracenotes: it even tells you how. unlike vi... 10:37:53 or emacs... 10:37:56 *vigorous nodding* 10:38:03 ya i know, but it's not what i'm used to 10:38:05 --- join: Athas`` (n=athas@0x50a157d6.alb2nxx15.dynamic.dsl.tele.dk) joined #haskell 10:38:15 osfameron: emacs tells you how 10:38:19 --- join: tensorpu` (n=user@99.148.206.229) joined #haskell 10:38:26 oh, i forgot to transfer over my bashrc after ubuntu reinstall 10:38:27 the first thing vim tells you is how to quit and how to access the help 10:38:28 gwern: really? 10:38:34 --- quit: HugoDaniel (Read error: 60 (Operation timed out)) 10:38:34 the startup screen includes 'Exit Emacs C-x C-c' 10:38:37 --- join: THC4k (n=Miranda@p5B0C8472.dip0.t-ipconnect.de) joined #haskell 10:38:46 * osfameron doesn't have an emacs to play with 10:38:58 except people who aren't familiar with emacs probably won't recognize that notation :-) 10:38:58 that's assuming you know what C-x C-c means of course :-) 10:39:19 gwern: ya that never helped me 10:39:24 i never learned to exit emacs 10:39:29 i just kill it 10:39:29 --- quit: coyo (Read error: 104 (Connection reset by peer)) 10:39:30 osfameron: and nano assumes you know what ^X is... 10:39:40 true. but that's more likely I think 10:39:40 --- join: rdd` (n=rdd@c83-250-152-128.bredband.comhem.se) joined #haskell 10:39:45 gwern: caret notation is more common than C- 10:39:49 and all these editors assume you can read 10:39:54 the rotters! 10:39:54 Both assume you have a keyboard 10:39:59 the cads! 10:40:14 --- join: Spockz|lap (n=Spockz@71pc198.sshunet.nl) joined #haskell 10:40:38 --- quit: Athas` (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: zakwilson (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: rdd (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: mun_ (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: reprore_ (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: CESSMASTER (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: medfly (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: pantsman (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: xinming (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: jfoutz (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: zaarg (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: emma (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: Raymond (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: dju (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: wattwood (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: tensorpudding (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: damd (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: uman (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: AndyP (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: SimonRC (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: jbauman (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: thetallguy2 (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: pham (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: Shimei (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: nick8325 (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: Lycurgus (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: sahazel (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: Khisanth (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: dibblego (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: nwf (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: SubStack (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: dax__ (farmer.freenode.net irc.freenode.net) 10:40:38 --- quit: Feuerbach (farmer.freenode.net irc.freenode.net) 10:40:48 --- join: xinming (n=hyy@218.73.141.32) joined #haskell 10:40:49 is there a nicer solution than: "map fromJust . takeWhile isJust" ? 10:40:52 --- join: CESSMASTER (n=CESSMAST@unaffiliated/joelywoely) joined #haskell 10:40:57 --- join: jfoutz (n=jfoutz@173-45-244-32.slicehost.net) joined #haskell 10:40:59 --- join: zaarg (n=james@avalon.stillidream.org) joined #haskell 10:41:01 --- join: AndyP (n=andyp@ubuntu/member/andyp) joined #haskell 10:41:03 hey what's the release date for haskell platform with GHC 6.12 10:41:07 ertai: catMaybes 10:41:10 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 10:41:18 Oh, wait, not if you really mean takeWhile 10:41:25 --- join: SimonRC (n=sc@fof.durge.org) joined #haskell 10:41:28 --- quit: Spockz () 10:41:29 Yep I really mean it 10:41:36 --- join: SubStack (n=substack@nat/modzer0/session) joined #haskell 10:41:37 i made use of a . today in a program. i'm so proud of myself, i'm like puffy rooster 10:41:46 --- join: uman (n=uman@unaffiliated/uman) joined #haskell 10:41:51 condraculations 10:41:56 :D 10:42:00 --- join: Spockz (n=spockz@71pc198.sshunet.nl) joined #haskell 10:42:01 --- part: CESSMASTER left #haskell 10:42:07 BONUS: March-ish, I think 10:42:12 how do IORefs work? 10:42:17 hoogle isn't working for me right now 10:42:21 sshc: Magic 10:42:23 is it pretty much C pointers? 10:42:27 sshc: They're pointers to memory locations 10:43:10 they work like refs in OCaml :-) 10:43:23 --- join: rakir (n=aschmidt@65.Red-88-30-122.staticIP.rima-tde.net) joined #haskell 10:43:44 is it possible to make a pointer to a pointer? 10:43:50 s/pointer/IORef/g 10:44:08 --- join: jethomas (n=jaime@CPE00226b802746-CM001bd7abdf68.cpe.net.cable.rogers.com) joined #haskell 10:44:09 sshc: Yes 10:44:20 or is it possible to mutate a reference to point to something else? 10:44:20 --- join: stoop (n=stoop@c-68-34-110-14.hsd1.dc.comcast.net) joined #haskell 10:44:22 sshc: You can pass them around and store them like any ordinary value 10:44:26 sshc: yes 10:44:38 Cale: how do i do that? 10:44:43 Hoogle isn't working for me 10:44:46 sshc: See newIORef / readIORef / writeIORef 10:44:52 In Data.IORef 10:44:55 Cale: Hoogle isn't working for me 10:45:08 http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Data-IORef.html 10:45:13 http://holumbus.fh-wedel.de/hayoo/hayoo.html 10:45:15 I guess i'll wait for it to respond 10:45:21 * Cale doesn't bother with hoogle 10:45:28 Cale: why not? 10:45:30 Just use the documentation 10:45:49 --- join: emma (n=em@unaffiliated/emma) joined #haskell 10:45:52 hoogle is good when you don't know what you're looking for 10:46:02 --- quit: Guest52822 (Read error: 54 (Connection reset by peer)) 10:46:15 But when you do, it's easier just to go directly, I think. 10:46:21 --- join: dax (n=dax@85.119.156.201) joined #haskell 10:46:32 --- join: tener (n=tener@host-87-99-43-73.lanet.net.pl) joined #haskell 10:46:32 newIORef :: a -> IO (IORef a) 10:46:34 readIORef :: IORef a -> IO a 10:46:37 writeIORef :: IORef a -> a -> IO () 10:46:39 --- join: zakwilson (n=zak@c-68-35-255-11.hsd1.fl.comcast.net) joined #haskell 10:46:39 --- join: mun_ (n=mun@94-193-244-76.zone7.bethere.co.uk) joined #haskell 10:46:39 --- join: reprore_ (n=reprore@ntkngw356150.kngw.nt.ftth.ppp.infoweb.ne.jp) joined #haskell 10:46:39 --- join: pantsman (n=pantsman@pdpc/supporter/active/pantsman) joined #haskell 10:46:39 --- join: wattwood (n=wattwood@c-98-202-165-129.hsd1.ut.comcast.net) joined #haskell 10:46:39 --- join: Raymond (n=Raymond@adsl-70-132-1-166.dsl.snfc21.sbcglobal.net) joined #haskell 10:46:39 --- join: dju (i=dju@89-158-236-229.rev.dartybox.com) joined #haskell 10:46:39 --- join: damd (n=damd@unaffiliated/damd) joined #haskell 10:46:39 --- join: Feuerbach (n=roman@89.252.62.139) joined #haskell 10:46:39 --- join: nick8325 (n=nick@cust-95-80-13-27.csbnet.se) joined #haskell 10:46:39 --- join: sahazel (n=sah@64.13.131.178) joined #haskell 10:46:39 --- join: Lycurgus (n=Ren@cpe-72-228-150-44.buffalo.res.rr.com) joined #haskell 10:46:39 --- join: dibblego (n=nobody@220-245-107-64.static.tpgi.com.au) joined #haskell 10:46:39 --- join: Khisanth (n=Khisanth@pool-141-157-230-238.ny325.east.verizon.net) joined #haskell 10:46:39 --- join: nwf (n=nwf@67.62.51.95) joined #haskell 10:46:39 --- join: Shimei (n=kamikaze@fc07-11-110.srfc01.resnet.ubc.ca) joined #haskell 10:46:39 --- join: thetallguy2 (n=beshers@cpe-98-155-85-94.san.res.rr.com) joined #haskell 10:46:39 --- join: jbauman (n=jbauman@c-69-181-136-118.hsd1.ca.comcast.net) joined #haskell 10:46:45 a can be any type at all 10:46:54 --- quit: amuck (Client Quit) 10:46:57 Including an IORef type 10:47:04 --- part: b6 left #haskell 10:47:14 --- quit: pantsman (No route to host) 10:47:29 --- quit: barca4ever (Connection timed out) 10:47:51 --- join: Vitka (n=Vitka@broadband-95-84-168-90.nationalcablenetworks.ru) joined #haskell 10:48:13 Underneath it all is a MutVar# 10:48:28 (but who cares about that) 10:48:29 Which I assume is built-in, because none of the docs I've looked at include source 10:48:49 You might as well think of IORefs as built-in. 10:49:04 --- quit: jbauman (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: thetallguy2 (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: Raymond (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: wattwood (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: Shimei (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: nick8325 (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: zakwilson (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: Lycurgus (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: sahazel (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: Khisanth (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: damd (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: dibblego (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: nwf (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: Feuerbach (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: dju (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: reprore_ (farmer.freenode.net irc.freenode.net) 10:49:04 --- quit: mun_ (farmer.freenode.net irc.freenode.net) 10:49:12 --- join: Raymond (n=Raymond@adsl-70-132-1-166.dsl.snfc21.sbcglobal.net) joined #haskell 10:49:12 --- join: Khisanth (n=Khisanth@pool-141-157-230-238.ny325.east.verizon.net) joined #haskell 10:49:13 You might as well think of any opaque type as built-in 10:49:13 --- join: jbauman (n=jbauman@c-69-181-136-118.hsd1.ca.comcast.net) joined #haskell 10:49:13 --- join: Lycurgus (n=Ren@cpe-72-228-150-44.buffalo.res.rr.com) joined #haskell 10:49:13 --- join: wattwood (n=wattwood@c-98-202-165-129.hsd1.ut.comcast.net) joined #haskell 10:49:14 --- join: nwf (n=nwf@67.62.51.95) joined #haskell 10:49:15 --- join: pham (i=foobar@174-21-108-18.tukw.qwest.net) joined #haskell 10:49:15 --- join: Shimei (n=kamikaze@fc07-11-110.srfc01.resnet.ubc.ca) joined #haskell 10:49:17 --- join: dju (i=dju@89-158-236-229.rev.dartybox.com) joined #haskell 10:49:22 --- join: zakwilson (n=zak@c-68-35-255-11.hsd1.fl.comcast.net) joined #haskell 10:49:22 Oh, great, looks like we're back to netsplit land. 10:49:23 --- join: Feuerbach (n=roman@89.252.62.139) joined #haskell 10:49:23 --- join: dibblego (n=nobody@220-245-107-64.static.tpgi.com.au) joined #haskell 10:49:23 --- join: mun_ (n=mun@94-193-244-76.zone7.bethere.co.uk) joined #haskell 10:49:25 --- join: nick8325 (n=nick@cust-95-80-13-27.csbnet.se) joined #haskell 10:49:31 --- join: thetallguy (n=beshers@cpe-98-155-85-94.san.res.rr.com) joined #haskell 10:49:50 banana split! 10:50:10 --- join: sahazel (n=sah@64.13.131.178) joined #haskell 10:50:19 --- quit: arjanb (".") 10:50:21 --- quit: mgmwwi (Read error: 54 (Connection reset by peer)) 10:50:36 --- join: reprore (n=reprore@ntkngw356150.kngw.nt.ftth.ppp.infoweb.ne.jp) joined #haskell 10:52:58 --- quit: Jacolyte ("Lost terminal") 10:53:17 --- part: headyadmin left #haskell 10:54:30 --- join: monochrom (n=trebla@toronto-hs-216-138-220-146.s-ip.magma.ca) joined #haskell 10:54:37 --- join: rajeshsr (n=rajeshsr@59.92.51.248) joined #haskell 10:54:49 Oh haha the spammer stroke again? 10:55:10 --- quit: ramses_ (Read error: 110 (Connection timed out)) 10:55:27 --- mode: ChanServ set +o monochrom 10:55:33 --- join: hgolden (n=hgolden@cpe-76-95-167-216.socal.res.rr.com) joined #haskell 10:55:49 if you are unregistered, pm me or an op to get voice. 10:56:12 --- join: chrisf (n=chatzill@ip-118-90-130-215.xdsl.xnet.co.nz) joined #haskell 10:58:40 --- join: Jacolyte (n=blaine@unaffiliated/jacolyte) joined #haskell 10:58:45 Cale: it was 80% packet loss on some line yesterday :) 10:59:11 monochrom: They got augustss this time. 11:00:02 --- mode: monochrom set +v Vitka 11:00:03 --- join: alvarezp (n=alvarezp@201.160.167.202.cable.dyn.cableonline.com.mx) joined #haskell 11:00:20 --- join: Poeir (n=Poeir@c-98-228-48-133.hsd1.il.comcast.net) joined #haskell 11:01:02 As in, the libel says something about augustss? 11:01:12 As in he got k-lined. 11:01:23 :t (1:) 11:01:24 forall t. (Num t) => [t] -> [t] 11:01:59 scanr (1:) [1..5] 11:02:11 > scanr (1:) [1..5] 11:02:12 Couldn't match expected type `b -> b' against inferred type `[t]' 11:02:24 Hmm. 11:02:35 --- join: novas0x2a (n=mike@adsl-75-23-61-176.dsl.pltn13.sbcglobal.net) joined #haskell 11:02:46 scanr (1:) [[1..5]] 11:02:57 > scanr (1:) [[1..5]] 11:02:58 Couldn't match expected type `b -> b' against inferred type `[t]' 11:03:22 > scanl (1:) [1..5] 11:03:23 Couldn't match expected type `b -> [t]' against inferred type `[t]' 11:03:28 > scanr (:) [] [1..5] 11:03:29 [[1,2,3,4,5],[2,3,4,5],[3,4,5],[4,5],[5],[]] 11:03:58 Hmm. 11:04:12 > scanr (1:)[] [1..5] 11:04:13 Couldn't match expected type `b -> b' against inferred type `[t]' 11:04:26 Wrong type for the combining function 11:04:40 scanr takes the same parameter types as foldr 11:04:49 oh, haha it is still the HTTP POST spam trick 11:05:05 Something to take the place of (:) in the list, something to take the place of [] in the list, and a list 11:05:14 I want to append a list of 1 to list elements. 11:05:16 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16201#a16201 <-- any suggestions? will this work as I expect it to? 11:05:17 Ah. 11:05:26 --- mode: monochrom set +v ddarius 11:05:35 > map (1:) [[2,3,4],[5,6,7]] 11:05:36 [[1,2,3,4],[1,5,6,7]] 11:05:39 like that? 11:06:05 > scanr (+) 0 [1..5] 11:06:06 [15,14,12,9,5,0] 11:06:18 > scanl (+) 0 [1..5] 11:06:20 [0,1,3,6,10,15] 11:06:29 dolio: Interesting way of describing G. I didn't formally work through it, but I just directly put trivial functions (functions to the terminal object of Set) into the non-A components of the natural transformation. 11:06:55 More like: f(4)=[[4],[3,1],[2,1,1],[1,1,1,1]] 11:07:29 Then use it to find combination of possible sums for given n. 11:08:27 --- quit: tener (Read error: 60 (Operation timed out)) 11:08:45 Then narrow to sums of only 3 elements. Seems like simple conbinatorics, but list construction goes over my head. 11:08:59 > take 0 undefined 11:09:00 [] 11:09:36 --- join: sshc_ (n=sshc@unaffiliated/sshc) joined #haskell 11:09:53 Oh, the way I'd normally do that is by first writing a function which generates the partitions of n with parts that are at most k 11:10:08 --- quit: cytzol () 11:11:28 --- quit: perspectival ("Leaving.") 11:12:28 Is it possible to use universal quantification inside contexts? 11:12:32 --- quit: NEEDMOAR (Read error: 60 (Operation timed out)) 11:13:21 --- quit: hgolden (Remote closed the connection) 11:13:53 --- join: abbe (i=smidgen@xn--chteau-d-if-x7a.abbe.members.pirateparty.in) joined #haskell 11:13:57 Maybe, but still I need to find out how to append a list of same values to list element to get list of lists. 11:14:07 Unfoldr, perhaps? 11:14:10 dolio: It also seems related to Ran_D where D : Set -> Cat is the discrete category functor. Also, Ran_D exists because D has a left adjoint, π_0 which leads to -∘D ⊣ -∘π_0 = Ran_D 11:14:34 Vitka: I would use a list comprehension 11:14:45 ddarius: by the way, the memory inefficiencies in agda making category theory difficult have apparently been fixed 11:15:17 copumpkin: I've installed Agda but I haven't used it yet. 11:15:28 --- quit: der_eq_ (Read error: 113 (No route to host)) 11:15:42 > iterate (nub . concatMap (\x -> case x of a:b:bs -> [a+b:bs,a:b:bs]; _ -> [x]) . nub) [replicate 4 1] !! 3 11:15:43 [[4],[3,1],[2,1,1],[1,1,1,1]] 11:15:54 partititions? 11:15:59 Wow, my capslock key is distinctly dirtier looking than all my other keyboard keys. 11:16:19 --- join: Zaph0d_ (n=chatzill@c-68-40-195-74.hsd1.mi.comcast.net) joined #haskell 11:16:20 --- quit: conal () 11:16:21 integer partitions. 11:16:21 this can be done without the nubs, which would be significantly more efficient 11:16:22 --- mode: monochrom set +v Berengal 11:16:23 ddarius: cause you never use it 11:16:27 ? 11:16:28 elspru: Indeed. 11:16:28 ddarius: are you secretly a 14-year-old 4channer? 11:16:30 Is it possible to use universal quantification inside contexts? 11:16:31 oh 11:16:50 Berengal: not as far as I know 11:16:56 copumpkin: :( 11:16:57 Berengal: Try it and find out. 11:17:00 Hmm. 11:17:17 I tried something, and it didn't work, but I thought I might've gotten the syntax wrong or something 11:17:32 --- join: sajkr (n=psyker@bljak.org) joined #haskell 11:17:35 --- join: zax (n=zax@h210n2-g-va-a12.ias.bredband.telia.com) joined #haskell 11:17:43 ddarius: You should remap it to something useful, instead 11:17:57 > let partitions' n k | k > n = partitions' n n; partitions' 0 k = [[]]; partitions' n k | k <= 0 = []; partitions' n k = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x] in partitions' 4 4 11:17:57 Thanks, will see if I can denub this solution and denoob myself. 11:17:59 [[4],[3,1],[2,2],[2,1,1],[1,1,1,1]] 11:18:10 Er. 11:18:34 --- join: O_4 (n=souchan@ip-118-90-97-106.xdsl.xnet.co.nz) joined #haskell 11:18:42 --- join: tener (n=tener@host-87-99-43-73.lanet.net.pl) joined #haskell 11:18:42 (longer, but I think more straightforward computationally) 11:18:44 I have a type Foo a, where a is a phantom type, a type family Opposite with instances Opposite A = B and Opposite B = A, and a list with Cons :: a b -> List a (Opposite b) -> List a b, and now I'm trying to write a Show instance for that list... 11:18:52 jon meachem is going to be unhappy to see DrIFT-cabalized :) 11:19:01 but what's life if you don't annoy people? 11:19:48 --- quit: tener (Client Quit) 11:20:02 --- join: Badger (i=badger@satgnu.net) joined #haskell 11:20:07 isn't the main objection to cabalizing things that it's lots of effort sometimes? 11:20:30 --- nick: Badger -> Guest64043 11:20:37 gwern: or you are being more annoying than encouraging him to support your work? 11:20:38 aavogt: meachem's main points seem to be that it's less easily extensible than make, and less portable 11:20:43 --- join: KSkrzet (n=tener@host-87-99-43-73.lanet.net.pl) joined #haskell 11:20:58 aavogt: I'm afraid it went past encouraging and way into annoying back in 2008 11:20:58 I turned my caps key into left-control. Much easier to get to than that pinky-buster in the corner. 11:21:35 --- quit: rfh (Read error: 104 (Connection reset by peer)) 11:21:35 dino-: I do that too 11:21:40 dino-: I'm used to my left Ctrl being where it is and I type on a laptop keyboard, so it isn't that far away... 11:22:28 ddarius: Which part of G was interesting? f o Fg? 11:22:51 dolio: The description using Hom-sets rather than my more direct route. 11:23:02 Ah. Okay. 11:23:03 dino-: I did the same when my job consisted mostly of Ctrl-C -> Ctrl-V and Ctrl-Shift-Tab 11:23:28 --- quit: novas0x2a (Remote closed the connection) 11:23:33 The old Sun keyboard were like this. It's much more sane. 11:24:04 --- part: Guest64043 left #haskell 11:24:13 --- quit: Zaph0d_ ("ChatZilla 0.9.86 [Firefox 3.5.7/20091221164558]") 11:24:14 Now, do the caps control thing and start using ctrl-[ to generate ESC -> keeps you close to the home keys for vim perfection! 11:24:27 --- join: Badger (i=badger@uncyclopedia/badger) joined #haskell 11:24:30 --- join: novas0x2a (n=mike@adsl-75-23-61-176.dsl.pltn13.sbcglobal.net) joined #haskell 11:24:44 ESC is even further in the suburbs. Crazy! 11:24:52 --- quit: sshc (Connection timed out) 11:24:59 dino-: You should use the heel of your hand to hit ctrl, quoth Xah Lee, which makes a lot of sense 11:25:01 bleh, registration requirement 11:25:12 --- join: xanonus (n=xanonus@p5B0CE128.dip.t-dialin.net) joined #haskell 11:25:19 Which is very difficult to do if it's in that position 11:25:37 --- quit: thorkilnaur ("Leaving") 11:25:59 --- join: coyo (n=unf@99-6-151-42.lightspeed.rcsntx.sbcglobal.net) joined #haskell 11:26:04 go go thread necromancy! 11:26:05 Twey: Wouldn't pressing keys with the heel of your hand take you (mildly) out of proper hand positioning for typing? 11:26:24 Well, not the heel — the blade, I suppose 11:26:35 What's the <+yournamehere> + for? 11:26:35 The ridge of bone just beneath the little finger 11:26:42 is there some sort of copy constructor for record data types? 11:26:44 Voicing, dino- 11:26:55 aep: No 11:27:12 (nor would it make sense to, given Haskell's evaluation model) 11:27:18 so i have to pass ALL of the fields every time? D: 11:27:25 aep: No. 11:27:38 No, you can create a default and modify it 11:27:48 let's see, the last message was 2 December 2008, and today is 16 January 2010; so a good year, month, and 14 days 11:27:52 well i need to modify a passed value 11:28:05 aep: Use record update syntax. 11:28:08 aep: let newRecord = oldRecord { newField = newValue } 11:28:14 foo x = x where x.bla=something else 11:28:24 Twey: nice thanks 11:28:32 foo x = x { bla = "something else" } 11:28:36 let newRecord = tubularBells { oldfield = mike } 11:28:42 Hehe 11:28:52 oO 11:28:53 * Berengal gives up and implements a Forgettable class 11:29:01 http://web.archive.org/web/20061011094943/http://haskell.org/hawiki/UsingRecords 11:29:04 aep: there's also some record wildcards extension in ghc 11:29:39 aavogt: How does that help here? 11:29:56 I suppose if you want to use the old value of the field 11:30:15 Twey: I think you can write X { .. } = Y { .. , otherv = otherthing } 11:30:32 aavogt: Hmm, really? 11:30:33 or some magic like that 11:30:38 But wouldn't that give two ‘otherv’s? 11:30:38 I regularly get the "possibly incorrect indentation" error when using a case/if inside a "do", is there anything special I have to be careful with? (stupid question maybe, but I'm really frustrated :/) 11:30:39 --- join: nominolo_ (n=nominolo@5acc3f13.bb.sky.com) joined #haskell 11:30:42 --- join: mtnviewmark (n=markl@198.144.208.18) joined #haskell 11:31:03 theclaw: Make sure it's indented more than the ‘do’, and the cases are indented more than the ‘case’ 11:31:25 (the ‘of’ keyword also needs to be indented more than the ‘case’ but less than the cases, if you put it on a separate line) 11:32:08 (Who would put the 'of' on a separate line?) 11:32:23 Twey: why less than the cases? 11:32:35 Twey: this is just a snippet: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16203#a16203 11:32:39 anything wrong with it? 11:32:45 ddarius: if the expression being meatched on is really long? 11:32:58 theclaw: We can't tell without the context. 11:33:01 as in, if it spans multiple lines 11:33:02 mauke: The cases are considered part of the ‘of’ block, aren't they? 11:33:17 Twey: yes? 11:33:24 ddarius: just a second 11:33:27 aavogt: I'd still have the 'of' on the last line of the multiple line expression. 11:33:32 theclaw: missing ) 11:33:46 > case 5 {;of;1 -> "foo"; 5 -> "bar" } 11:33:47 : parse error on input `;' 11:33:59 'of' opens the block of layout 11:34:04 > case 5 of { 1 -> "foo"; 5 -> "bar" } 11:34:05 "bar" 11:34:06 Right 11:34:16 theclaw: you seem to have an unmatched paren 11:34:20 meh! 11:34:25 So the cases need to be indented more than it, and it needs to be indented more than ‘case’ 11:34:30 --- quit: Rayne ("Battery 0: Charging, 0%, charging at zero rate - will never fully charge.") 11:34:31 Twey: no 11:34:49 or it is closed on another line 11:34:51 aavogt, mauke - yes, that was the problem - I got confused by the "possibly incorrect indentation" message 11:34:54 Twey: The next line can start anywhere (modulo containing blocks) 11:34:55 thanks! 11:35:00 --- join: wisemanby (n=wiseman@mm-155-220-84-93.dynamic.pppoe.mgts.by) joined #haskell 11:35:08 --- join: mreh (n=mreh@92.10.122.227) joined #haskell 11:35:18 ddarius: Define ‘the next line’? 11:35:30 that'll teach me to click a link from a spambot again 11:35:44 Twey: The next line of code after a block opening keyword (assuming there is nothing following it on that line) 11:35:59 mreh: that'll teach you to enable javascript on untrusted sites :-| 11:36:18 yes :D 11:36:48 Twey: For example, at the beginning of you code you probably have 'module Foo where\nmain = ...' which has "main" starting much less indented than the opening 'where' 11:36:48 ddarius: So you're saying that this is valid? http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16205#a16205 11:37:03 Twey: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16206#a16206 11:37:05 Twey: If there is no containing block of layout, yes. 11:37:11 Twey: You likely do exactly that with modules. 11:37:15 Twey: untested, but my internal haskell parser says this is fine :-) 11:37:31 Huh. 11:38:00 Twey: It could even be less indented than the case (albeit that would be sinfully ugly) 11:38:10 ddarius: see my example 11:38:19 --- join: perspectival (n=perspect@71.23.100.103) joined #haskell 11:38:40 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16205#a16207 11:38:48 mauke: Where? 11:38:51 Oh 11:39:20 --- quit: kmc (Read error: 110 (Connection timed out)) 11:39:58 Twey: You likely do many such things all the time. For example, you likely indent do blocks less than the opening 'do'. 11:40:20 Sure, but they're indented more than the line the ‘do’ is on 11:40:46 that's irrelevant 11:40:55 Twey: Yes, but that means nothing to the do expression, and would only matter if it was in a containing block of layout. 11:40:58 Hum. 11:41:09 Interesting. 11:41:18 I take pretty significant advantage to the extra flexibility Haskell's layout provides over Python style layout. 11:41:20 > case do [];[];[] of [] -> error "this works too?" 11:41:21 * Exception: this works too? 11:41:43 aavogt: Why wouldn't it work? 11:41:55 because the do might extend 11:42:07 The of breaks it 11:42:09 > do case do [];[];[]; of [] -> error "this works too?" 11:42:11 * Exception: this works too? 11:42:14 The parsing of the do that is 11:42:49 Indeed. It's effectively no different than 3*5 being terminated by + in 3*5+6 11:43:00 There's some "as far right as possible" rule in the grammar at places, which means that if it encounters an illegal construct it backtracks 11:43:17 --- quit: nominolo (Read error: 110 (Connection timed out)) 11:43:17 > case \x -> x of f -> f "hello" 11:43:19 "hello" 11:43:39 The do-notation syntax allows for empty statements 11:43:48 > case 1 :: Int of x -> x 11:43:49 1 11:43:59 > do Nothing == Nothing == Just () 11:44:00 Precedence parsing error 11:44:00 cannot mix `GHC.Classes.==' [infix 4] and `GH... 11:44:03 huhu 11:44:19 > do [1,2,3];;;[4,5];; 11:44:21 [4,5,4,5,4,5] 11:44:22 --- part: rakir left #haskell 11:44:35 > do [1,2,3];;let;;[4,5];; 11:44:36 > True == True == True == True 11:44:36 : parse error on input `;' 11:44:37 Precedence parsing error 11:44:37 cannot mix `GHC.Classes.==' [infix 4] and `GH... 11:44:39 > do [1,2,3];;let;;[4,5];; 11:44:40 --- join: dufflebunk (n=dufflebu@adsl-71-131-196-56.dsl.sntc01.pacbell.net) joined #haskell 11:44:40 : parse error on input `;' 11:44:42 > do [1,2,3];;let{};;[4,5];; 11:44:43 [4,5,4,5,4,5] 11:44:46 heh 11:44:54 > if True; then 't'; else 'f' 11:44:55 : parse error on input `;' 11:44:58 aww 11:45:06 > let infixr == ; (==) = (Prelude.==) in True == True == False == False 11:45:07 True 11:45:13 I think the parsing of True == True == True should produce a valid AST according to the grammar... 11:45:15 > let in let in let in 5 11:45:16 5 11:45:24 Even if == isn't associative 11:45:29 What kind of insect is on the cover of the real world haskell book? 11:45:43 stupid question, but it's been bugging me recently 11:45:50 haha i see what you did there 11:45:54 rhino beetle imo 11:45:56 Isn't it a rhino beetle? 11:46:01 Yeah, IIRC 11:46:14 hercules beetle 11:46:16 * Berengal thinks programming books should never have bugs on their covers 11:46:17 maybe i'll put a dung beetle on lyah 11:46:22 Berengal: well if you decide something is infix, then it is not infixr or infixl 11:46:27 says so right on http://book.realworldhaskell.org/ 11:46:38 Huh 11:46:52 http://en.wikipedia.org/wiki/Hercules_beetle 11:47:00 mauke: So it does, thanks. 11:47:04 Ah 11:47:13 Which is a subspecies of rhinocerous beetle 11:47:33 rhinoceros** 11:47:40 (there's a word I haven't had a chance to use in a while) 11:49:44 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 11:50:30 --- quit: xanonus (Client Quit) 11:50:42 Berengal: you'd prefer if fixity checking was done at runtime or something? 11:50:57 --- join: joevandyk (n=joe@pool-98-111-95-62.sttlwa.fios.verizon.net) joined #haskell 11:51:07 --- quit: joevandyk (Client Quit) 11:51:11 aavogt: No, not at all. That would just be silly... 11:51:28 aavogt: I'm happy with the way things are 11:51:45 > let infix == ; (==) = (Prelude.==) in True == True == False == False 11:51:46 Precedence parsing error 11:51:47 cannot mix `==' [infix 9] and `==' [infix 9] ... 11:52:22 > let (==) = (Prelude.==) in True == True == False == False 11:52:23 True 11:52:24 --- join: xanonus (n=xanonus@p5B0CE128.dip.t-dialin.net) joined #haskell 11:55:33 --- join: mjsor (n=mjsor@75-93-57-35.war.clearwire-wmx.net) joined #haskell 11:58:07 --- join: augustss (n=lennart@host86-161-120-241.range86-161.btcentralplus.com) joined #haskell 11:58:56 --- join: Beelsebob1 (n=Beelsebo@host86-166-25-72.range86-166.btcentralplus.com) joined #haskell 11:59:50 --- join: Rotaerk (n=Rotaerk@c-174-54-255-117.hsd1.pa.comcast.net) joined #haskell 12:00:06 --- join: arsenm (n=matt@146-115-73-104.c3-0.brl-ubr1.sbo-brl.ma.cable.rcn.com) joined #haskell 12:00:36 --- quit: medfly (Read error: 110 (Connection timed out)) 12:01:20 --- quit: mtnviewmark (Client Quit) 12:01:22 --- join: hatds (n=chatzill@pool-141-151-20-234.phlapa.east.verizon.net) joined #haskell 12:01:34 --- join: tommd (n=Thomas_D@65-102-54-130.ptld.qwest.net) joined #haskell 12:01:46 --- join: pluhngz (n=oracle@207-207-60-178.fwd.datafoundry.com) joined #haskell 12:02:42 --- quit: mjsor () 12:03:26 --- quit: O_4 ("Come alive!") 12:03:35 --- quit: nprice ("brb") 12:04:02 so quiet 12:04:22 maybe it's the +R hehe 12:04:43 --- part: pluhngz left #haskell 12:04:57 --- quit: Philippa (Read error: 60 (Operation timed out)) 12:05:44 well, I can fix that 12:06:01 Are we still being spammed? 12:06:39 (yep, ##physics right now for example) 12:06:40 let's see 12:06:49 --- mode: ChanServ set +o Heffalump 12:06:57 --- mode: Heffalump set -R 12:07:30 --- join: kmc (n=keegan@207.237.163.75) joined #haskell 12:07:52 * Heffalump watches paranoidly 12:08:49 * augustss agonizes over how much current work to put in his slides. 12:09:05 because it's unfinished, or because it's secret? 12:09:24 --- quit: Raynes (Read error: 110 (Connection timed out)) 12:09:26 hmm, I need a way to submit a POST request with no user interaction 12:09:45 that's the only thing this exploit really needs javascript for 12:09:49 Secret. In the usual way these things are secret. 12:09:56 /join #lispcafe 12:10:29 --- join: s76_ (n=todos@64-104-124-91.pool.ukrtel.net) joined #haskell 12:10:46 --- quit: nominolo_ (Read error: 54 (Connection reset by peer)) 12:10:47 Eh, Andrew Appel suggested it 22 years ago, so I can put it on slides. :) 12:12:00 --- quit: Beelsebob (Read error: 110 (Connection timed out)) 12:12:09 oh no, it's augustss the spamm0r 12:12:11 --- join: Raynes (n=Raynes@unaffiliated/raynes) joined #haskell 12:12:15 --- join: PhilRod (n=phil@cpc3-oxfd2-0-0-cust793.oxfd.cable.ntl.com) joined #haskell 12:12:19 mauke what kind of action? 12:12:38 is there any smarter way for this? http://codepad.org/KoME8NMS 12:12:44 xerox: what? 12:13:00 --- join: nominolo (n=nominolo@5ac9a24f.bb.sky.com) joined #haskell 12:13:12 --- quit: novas0x2a ("Leaving.") 12:13:14 I'm back with a vengence! 12:13:50 mauke I mean there's not much user interaction needed to run javascript except clicking on an url 12:14:09 xerox: I want to make it work without javascript 12:14:35 or here some more context http://codepad.org/Pz4EOOqo it's quite ugly, but i dont know any better :/ 12:14:36 and it all works, except for x.submit() 12:15:36 --- quit: AnMaster (Read error: 60 (Operation timed out)) 12:15:49 --- quit: s76__ (Read error: 60 (Operation timed out)) 12:17:22 --- join: AnMaster (n=AnMaster@unaffiliated/anmaster) joined #haskell 12:17:55 mauke ? 12:18:39 xerox: that's GET, not POST 12:18:44 :| 12:20:00 --- quit: Gowilla ("leaving") 12:20:42 > let l = 5 in test l = [x:xs | x <- [l,l-1..1], xs <- list2' x ] 12:20:43 : parse error on input `=' 12:20:54 Oops 12:22:12 * hackagebot upload: pointless-lenses 0.0.4 - Pointless Lenses library (HugoPacheco) 12:22:18 mauke: How set are you on the "no user interaction"? 12:22:35 mauke: What if you just cram everything into a hidden form and make the user click a 'yes i confirm to be over eighteen years of age' button? 12:22:51 Vitka: The idea behind the function I gave before is that every nonempty partition of n with largest part at most k consists of a maximal part x with 1 <= x <= k, followed by a partition of (n-x) into parts of size at most x. 12:22:53 mauke wants to eliminate that button too. 12:22:55 Vanadium: too trivial 12:23:07 --- join: yyz (n=lep@i5E86A749.versanet.de) joined #haskell 12:23:52 --- join: ralph (n=ralph@wlan-nat-outside-222-52.uoregon.edu) joined #haskell 12:23:58 augustss: Isn't most work previously researched by John Reynolds 10-30 years ago? 12:24:06 html alone has a pretty passive semantics. you can't do it. 12:24:12 > let l = 5; test l = [x:xs | x <- [l,l-1..1], xs <- test x ] in test 5 12:24:14 * Exception: stack overflow 12:24:32 ddarius: yes, I'm sure he's done this too. It's trivial anyway. 12:24:54 What secret? 12:25:07 --- quit: mun_ (Read error: 110 (Connection timed out)) 12:25:13 --- quit: ramses_ (Read error: 110 (Connection timed out)) 12:25:22 --- quit: M| ("leaving") 12:25:44 Cale: It doesn't seem to work for x > k. 12:26:02 > let partitions' n k | k > n = partitions' n n; partitions' 0 k = [[]]; partitions' n k | k <= 0 = []; partitions' n k = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x] in partitions' 8 3 12:26:03 [[3,3,2],[3,3,1,1],[3,2,2,1],[3,2,1,1,1],[3,1,1,1,1,1],[2,2,2,2],[2,2,2,1,1... 12:26:09 --- join: itewsh (n=itewsh@ATuileries-152-1-47-86.w82-123.abo.wanadoo.fr) joined #haskell 12:26:28 oh? 12:26:37 --- join: M| (n=mies@24-236-161-69.dhcp.bycy.mi.charter.com) joined #haskell 12:26:39 > let partitions' n k | k > n = partitions' n n; partitions' 0 k = [[]]; partitions' n k | k <= 0 = []; partitions' n k = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x] in partitions' 3 8 12:26:40 [[3],[2,1],[1,1,1]] 12:26:45 x will never be larger than k 12:26:51 --- quit: Philonous (Remote closed the connection) 12:27:06 What about f(8)=[7,1] for example? 12:27:28 That's not a partition of 8 into parts of size at most 3, like you asked for 12:27:31 --- quit: thetallguy1 (Read error: 104 (Connection reset by peer)) 12:27:36 > let partitions' n k | k > n = partitions' n n; partitions' 0 k = [[]]; partitions' n k | k <= 0 = []; partitions' n k = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x] in partitions' 8 8 12:27:37 [[8],[7,1],[6,2],[6,1,1],[5,3],[5,2,1],[5,1,1,1],[4,4],[4,3,1],[4,2,2],[4,2... 12:28:11 --- quit: PhilRod (Remote closed the connection) 12:29:10 No, parts can be up to n, but sum parts == n, and there are k parts total. (3 in my case) 12:29:43 Oh, if you want at most k parts, then you need to conjugate the partitions. 12:30:09 Well, or you could add another parameter for the number of parts 12:30:39 I suck at math I can't find respective combinatorial problem, so I'm trying to implement algorithm I've found and understood. 12:31:05 --- nick: helmut_ -> helmut 12:31:07 > let partitions' n k m | k > n = partitions' n n m; partitions' 0 k 0 = [[]]; partitions' n k | (k <= 0 || m <= 0) = []; partitions' n k m = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x (m-1)] in partitions' 8 8 2 12:31:08 --- join: anklav (n=quassel@87.252.235.42) joined #haskell 12:31:09 Equations for `partitions'' have different numbers of arguments 12:31:09 oops 12:31:19 > let partitions' n k m | k > n = partitions' n n m; partitions' 0 k 0 = [[]]; partitions' n k m | (k <= 0 || m <= 0) = []; partitions' n k m = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x (m-1)] in partitions' 8 8 2 12:31:21 [[7,1],[6,2],[5,3],[4,4]] 12:31:29 > let partitions' n k m | k > n = partitions' n n m; partitions' 0 k 0 = [[]]; partitions' n k m | (k <= 0 || m <= 0) = []; partitions' n k m = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x (m-1)] in partitions' 8 8 3 12:31:29 --- quit: Pellwurst ("bye, bye...") 12:31:30 [[6,1,1],[5,2,1],[4,3,1],[4,2,2],[3,3,2]] 12:31:48 Oh. 12:32:10 Partitions of n into parts of size at most k with exactly m parts 12:32:27 --- join: somnium (n=user@adsl-1-6-215.dab.bellsouth.net) joined #haskell 12:33:15 --- part: somnium left #haskell 12:33:39 Putting a bound on the size of the parts is important for the recursive decomposition because you want to construct weakly decreasing sequences. 12:34:13 So when the sequence starts with some number x, it has to be followed by a partition that has no parts larger than x 12:34:15 * hackagebot upload: amqp 0.1 - Client library for AMQP servers (currently only RabbitMQ) (HolgerReinhardt) 12:34:45 hmm, I see that the Haskell' proposal for scrapping the MR is lacking an owner 12:34:52 That what I tried to do, appending ones, and them I wanted to go up to n recursively. 12:35:09 --- join: bastl (n=bastl@i577B89D8.versanet.de) joined #haskell 12:35:09 But anyway, thanks. 12:35:42 --- join: rfh (n=holzi199@212.186.133.195) joined #haskell 12:35:53 can i map a C struct to some haskell type? 12:36:16 --- join: bremner (n=bremner@pivot.cs.unb.ca) joined #haskell 12:36:25 aep: see Storable class in Foreign.* modules 12:37:36 --- join: rdeshpande (n=rdeshpan@207-38-135-237.c3-0.avec-ubr2.nyr-avec.ny.cable.rcn.com) joined #haskell 12:37:39 would some kind op mind popping over to #xmonad? it needs droneproofing 12:37:40 --- quit: Poeir ("Leaving") 12:37:58 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 12:39:06 --- join: hkr (n=hkr@cp1135305-a.dbsch1.nb.home.nl) joined #haskell 12:39:18 --- quit: hoknamahn (Remote closed the connection) 12:41:48 Vitka: well, going up is no harder, it just means you write a function which puts a bound on the smallest part 12:43:26 --- join: dblhelix (n=dblhelix@117.Red-80-37-197.staticIP.rima-tde.net) joined #haskell 12:45:01 Yeah, but I'm still struggling with proper use of recursion, as you can see. 12:46:52 --- join: thetallguy1 (n=beshers@cpe-75-80-161-44.san.res.rr.com) joined #haskell 12:47:16 --- quit: psychicist_ ("leaving") 12:49:13 --- quit: paolino ("Leaving.") 12:50:05 --- quit: comak (Connection timed out) 12:50:13 --- join: shambler (n=kingrat@93.84.160.0) joined #haskell 12:50:32 --- join: comak (n=mak@dynamic-78-8-243-87.ssp.dialog.net.pl) joined #haskell 12:51:44 > let partitions' n k | k <= 0 = partitions' n 1; partitions' 0 k = [[]]; partitions' n k | (n < k) = []; partitions' n k = [x:xs | x <- [k..n], xs <- partitions' (n-x) x] in partitions' 6 1 12:51:45 [[1,1,1,1,1,1],[1,1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,4],[1,2,3],[1,5],[2,2,2... 12:51:51 > let partitions' n k | k <= 0 = partitions' n 1; partitions' 0 k = [[]]; partitions' n k | (n < k) = []; partitions' n k = [x:xs | x <- [k..n], xs <- partitions' (n-x) x] in partitions' 4 1 12:51:52 [[1,1,1,1],[1,1,2],[1,3],[2,2],[4]] 12:52:57 > let partitions' n k m | k <= 0 = partitions' n 1 m; partitions' 0 k 0 = [[]]; partitions' n k m | (n < k || m <= 0) = []; partitions' n k m = [x:xs | x <- [k..n], xs <- partitions' (n-x) x (m-1)] in partitions' 8 1 3 12:52:59 [[1,1,6],[1,2,5],[1,3,4],[2,2,4],[2,3,3]] 12:53:05 * Berengal wishes Haskell had proper goal support 12:54:39 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 12:54:54 --- quit: mmaruseacph2 (Remote closed the connection) 12:55:07 "goal support"? 12:55:55 Like in Agda 12:56:21 You can make holes in expressions, and it tells you which type should be in that hole 12:56:42 Also, you can ask for the type of other things in the environment at that hole, such as local bindings 12:56:56 --- join: {newbie} (n={newbie}@bl7-189-42.dsl.telepac.pt) joined #haskell 12:56:58 @google Chameleon type debugger 12:56:59 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.73.6170&rep=rep1&type=pdf 12:57:00 Title: The Chameleon Type Debugger (Tool Demonstration) 12:57:04 --- quit: m_W (Success) 12:57:08 --- join: m_W (n=mwj@c-69-141-106-205.hsd1.nj.comcast.net) joined #haskell 12:57:18 <{newbie}> hi guys does anyone know of a nice intro to monads 12:57:24 oh dear 12:57:34 {newbie}, how much Haskell experience do you have? 12:57:34 <{newbie}> it could have a bit of theory mixed in but not much 12:57:37 "The essence of functional programming" 12:57:38 <{newbie}> 0 12:57:44 <{newbie}> it's not for haskell 12:57:46 oh 12:57:50 what's it for? 12:57:54 <{newbie}> but since your are the main used of monads 12:58:04 Definitely not. 12:58:05 <{newbie}> kmc: it's to get the general concepts 12:58:12 <{newbie}> to apply in any language 12:58:12 sounds like theory is not the main goal... so what do you want to know them for? 12:58:14 ah 12:58:15 Haskell monads are not really category theory monads 12:58:16 --- join: nomadmonad (n=nomadmon@dsl-hkibrasgw1-ffcec300-71.dhcp.inet.fi) joined #haskell 12:58:19 well, i'd advise learning Haskell then 12:58:23 They look like them, if you squint a bit 12:58:25 Berengal: They are definitely a special case. 12:58:43 --- quit: rdeshpande (Client Quit) 12:58:50 <{newbie}> I tried to follow some tutprials for clojure 12:58:57 At least if you idealize Haskell slightly. 12:59:00 {newbie}, the explanation of Haskell monads will assume you've learned a lot of other things about Haskell first 12:59:04 <{newbie}> but I didn 't get the core idia 12:59:07 because they're not a beginner topic 12:59:08 ah 12:59:10 clojure has monads? 12:59:16 any functional language has them 12:59:28 C# has monads, they are just ugly as hell 12:59:32 --- join: lostman (n=user@mw493.dar.cam.ac.uk) joined #haskell 12:59:33 I'd think types are a requirement... 12:59:39 merehap: The LINQ syntax isn't bah. 12:59:41 Berengal, clojure has types of course 12:59:42 s/bah/bad 12:59:45 they are not static 12:59:51 but why would static types be required for monads? 12:59:53 Types are not a requirement. 12:59:56 --- quit: ramses_ (Read error: 60 (Operation timed out)) 12:59:56 kmc: I meant static types 13:00:01 --- join: Colours (n=Colours@unaffiliated/colours) joined #haskell 13:00:03 all you need is return and bind 13:00:04 ddarius: not too bad anyway 13:00:07 <{newbie}> kmc: so hasking here 13:00:08 you can write those in a dynamically typed language 13:00:17 <{newbie}> was not he best idea 13:00:19 kmc: But you need type-based dispatch 13:00:19 {newbie}, i can try to give you the general idea 13:00:20 <{newbie}> right? 13:00:24 of monads 13:00:29 without Haskell stuff mixed in 13:00:37 but i warn you it may be pretty vague 13:00:52 Berengal, sure, and type-based dispatch is ubiquitous in dynamically typed languages 13:01:04 <{newbie}> 1okay 13:01:08 <{newbie}> thanks alot 13:01:09 <{newbie}> ! 13:01:17 kmc: No it's not. dynamically typed languages only have value-based dispatch 13:01:17 You don't need type-based dispatch. 13:01:43 Berengal, and the type is part of the value 13:02:23 ddarius: The alternative is to select the monad beforehand. Push it into the context, sort of thing 13:02:47 kmc: But you need a value to get at the type. For "return", you have to value. 13:03:05 Berengal: There are probably more alternatives than that (I'm not quite sure what you mean), but there only needs to be one alternative. 13:03:18 {newbie}, here's a simple example of a monad 13:03:19 --- quit: medfly ("Leaving") 13:03:24 in Haskell, we have this Maybe type 13:03:24 ddarius: as in, monads are still useful when you have returnmaybe , bindMaybe, or that it is possible to have code for a general monad without type-based dispatch? 13:03:30 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 13:03:35 aavogt: Both. 13:03:37 --- quit: dblhelix ("...") 13:03:47 #xmonad is being flooded 13:03:50 luna: Not in scope: `xmonad' 13:03:50 --- quit: medfly (Client Quit) 13:03:54 if T is a type, then (Maybe T) is another type 13:04:00 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 13:04:16 <{newbie}> okay that similar to scalas Option 13:04:30 for each value x in T, the value (Just x) is in (Maybe T) 13:04:37 and additionally, the value Nothing is in (Maybe T) 13:04:42 --- quit: medfly (Client Quit) 13:04:43 {newbie}, yes i imagine so 13:04:45 ddarius: I haven't seen a non-painful way that doesn't use type-based dispatch 13:05:00 :t Nothing 13:05:01 forall a. Maybe a 13:05:03 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 13:05:10 now this is just a fairly ordinary algebraic data type 13:05:34 <{newbie}> okay 13:05:35 --- quit: medfly (Client Quit) 13:05:42 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 13:06:05 --- join: path[l] (i=UPP@120.138.102.34) joined #haskell 13:06:22 --- join: dwahler (n=david@208-168-246-23-dynamic.dsl.candw.ky) joined #haskell 13:07:01 but it's also a monad, which means that two functions exist for this type 13:07:27 --- nick: tensorpu` -> tensorpudding 13:07:33 one of them I'll call "inject". it takes a value of type T, and gives you a value of type Maybe T 13:07:38 in this case, it just maps x to Just x 13:08:14 the other one I'll call "bind". it takes a value of type Maybe (Maybe T), and gives you a value of type Maybe T 13:08:24 we'll collapse both Nothing and (Just Nothing) into Nothing 13:08:29 why would you call join bind? 13:08:31 *cough* join *cough* 13:08:33 sorry 13:08:36 yes, it's called join 13:08:46 sorry, bind is another thing i'll get to in a second 13:08:51 (Just (Just x)) becomes (Just x) 13:08:55 {newbie}, with me so far? 13:08:56 --- quit: Lycurgus ("Exeunt IRC") 13:09:00 <{newbie}> okay so inject is like a wrapper 13:09:11 --- join: Torrieri (n=Torrieri@nelug/crew/torrieri) joined #haskell 13:09:17 --- quit: comak (Operation timed out) 13:09:19 <{newbie}> join I'm still trying to understand 13:09:24 and join reduces a double layer of wrapping to a single layer 13:09:32 --- join: comak (n=mak@dynamic-78-8-243-87.ssp.dialog.net.pl) joined #haskell 13:09:41 there are lots of redundant sets of terminology 13:10:19 <{newbie}> okay 13:10:35 so a monad is just any type with this structure: inject and join 13:10:42 And map 13:10:48 Can't have a monad without map 13:10:51 good point 13:11:07 map takes a function (A -> B) and gives us a function (Maybe A -> Maybe B) 13:11:21 > join :: Maybe (Maybe ()) -> Maybe () 13:11:23 {Nothing->Nothing;Just Nothing->Nothing;Just (Just ())->Just ()} 13:11:23 --- quit: leandrom (Read error: 113 (No route to host)) 13:11:28 (map f) will map Nothing to Nothing, and will map (Just x) to (Just (f x)) 13:11:29 --- quit: dolio (Read error: 104 (Connection reset by peer)) 13:11:31 in :: Maybe (IO Int) how would i use some other io? oO 13:11:36 so it "lifts" a function into the wrapper type 13:11:40 aep, what do you mean? 13:11:52 where () is some arbitrary value here 13:11:54 well i can't do things like x <- read 13:11:56 <{newbie}> so a monad is just that? 13:12:06 --- join: trin_cz (n=trin_cz@167.155.broadband11.iol.cz) joined #haskell 13:12:07 it could be something more useful like an Int or something 13:12:23 {newbie}, a monad is any type with this structure. but i haven't yet explained why they're useful 13:12:33 {newbie}: You might want to read http://blog.sigfpe.com/2010/01/monads-are-trees-with-grafting.html 13:12:51 i haven't explained why we want to talk about monads in general, instead of just the properties of Maybe and each other monad individually 13:13:29 * hackagebot upload: hack-handler-hyena 2010.1.17 - Hyena hack handler (JinjingWang) 13:13:31 that's probably the best way to appreciate them anyway 13:13:36 <{newbie}> ok so now is the interesting part! 13:13:37 --- quit: Jag_ (Read error: 110 (Connection timed out)) 13:13:40 --- join: kisvoros (n=kisvoros@catv-89-134-148-229.catv.broadband.hu) joined #haskell 13:13:43 --- quit: comak (Read error: 60 (Operation timed out)) 13:13:52 in terms of functional programming, we want to use inject, join, and map to define another function i'll call "bind" 13:13:56 --- join: jinjing (n=jinjing@221.221.250.145) joined #haskell 13:14:02 --- join: comak (n=mak@dynamic-78-8-243-87.ssp.dialog.net.pl) joined #haskell 13:14:09 --- join: DrTeggy (n=drteggy@HSI-KBW-078-043-113-207.hsi4.kabel-badenwuerttemberg.de) joined #haskell 13:14:17 I call it the haskell logo 13:14:25 lol 13:14:36 inject? 13:14:39 --- part: snorble left #haskell 13:14:44 tensorpudding: return 13:14:51 tensorpudding, this is a non-Haskell-specific explanation 13:15:01 tensorpudding: pure 13:15:01 hmm, so only haskell calls it return? 13:15:05 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 13:15:10 --- join: novas0x2a (n=mike@adsl-75-23-61-176.dsl.pltn13.sbcglobal.net) joined #haskell 13:15:12 i think "inject" is a clearer name 13:15:13 i thought CT called it eta 13:15:20 tensorpudding: Renamed for the occation for the purposes of connotations, I assume 13:15:23 inject has a better duality with extract 13:15:29 :t extract 13:15:31 forall source. (Extract source) => (Int, Int) -> source -> source 13:15:36 {newbie}, bind is a function of two arguments. in our case, it will take a value of type (Maybe A), and a function (A -> Maybe B) 13:15:37 eject? 13:15:38 eh? 13:15:41 it returns a value of type (Maybe B) 13:15:44 i'm thinkinf of the comonad one 13:16:01 (Comonad w) => w a -> a 13:16:25 @hoogle coreturn 13:16:26 No results found 13:16:31 --- join: dobblego (n=nobody@220-245-107-64.static.tpgi.com.au) joined #haskell 13:16:38 actually, seems that it is generalized to Copointed 13:16:53 bind Nothing f = Nothing 13:17:00 --- join: snorble (n=snorble@s83-179-14-105.cust.tele2.se) joined #haskell 13:17:01 bind (Just x) f = Just (f x) 13:17:10 sorry 13:17:11 --- quit: portnov (Read error: 60 (Operation timed out)) 13:17:13 bind (Just x) f = f x 13:17:21 --- quit: DrTeggy (Client Quit) 13:17:29 Vanadium: http://mauke.ath.cx/exe/cake 13:17:42 what this represents is a "computational strategy". we take a result, that could represent success or failure, and a function. if the result was failure, we don't call the function and we simply return failure. if the first result was success, we call the function, which can succeed or fail 13:18:18 --- join: DrTeggy (n=drteggy@HSI-KBW-078-043-113-207.hsi4.kabel-badenwuerttemberg.de) joined #haskell 13:18:23 <{newbie}> kmc the strategy you speak about 13:18:27 <{newbie}> it's in the f 13:18:32 <{newbie}> or in the moand itself? 13:18:38 > let partitions' n k m | k > n = partitions' n n m; partitions' 0 k 0 = [[]]; partitions' n k m | (k <= 0 || m <= 0) = []; k ==0 = 0; partitions' n k m = [x:xs | x <- [k,k-1..0], xs <- partitions' (n-x) x (m-1)] in partitions' 8 8 3 13:18:39 Conflicting definitions for `partitions'' 13:18:40 In the binding group for: partit... 13:18:40 it's in the definition of "bind" 13:18:40 mauke evil 13:18:56 which is specific to each monad 13:19:11 xerox: click it :-) 13:19:18 <{newbie}> ok 13:19:28 mauke no :) 13:19:32 {newbie}, so Maybe represents "computation with failure" 13:19:38 you can see the irc messages in your browser, it's pretty awesome 13:20:05 > let partitions' n k m | k > n = partitions' n n m; partitions' 0 k 0 = [[]]; partitions' n k m | (k <= 0 || m <= 0) = []; partitions' n k m | k ==0 = 0; partitions' n k m = [x:xs | x <- [k,k-1..0], xs <- partitions' (n-x) x (m-1)] in partitions' 8 8 3 13:20:06 No instance for (GHC.Num.Num [[t]]) 13:20:06 arising from a use of `partitions'' ... 13:20:21 mauke: Write this on the button: "Do not click the Ackerman function!" :) 13:20:26 > let partitions' n k m | k > n = partitions' n n m; partitions' 0 k 0 = [[]]; partitions' n k m | (k < 0 || m <= 0) = []; partitions' n k m | k ==0 = 0; partitions' n k m = [x:xs | x <- [k,k-1..0], xs <- partitions' (n-x) x (m-1)] in partitions' 8 8 3 13:20:27 No instance for (GHC.Num.Num [[t]]) 13:20:27 arising from a use of `partitions'' ... 13:20:33 {newbie}, other monads represent computation with other features 13:20:38 --- join: sinelaw (n=sinelaw_@IGLD-84-228-221-115.inter.net.il) joined #haskell 13:20:44 for example, lists are also a monad 13:20:46 we can write: 13:20:58 inject : a -> [a] 13:21:02 builds a singleton list 13:21:05 join : [[a]] -> [a] 13:21:08 flattens a list of lists 13:21:16 map : (a -> b) -> ([a] -> [b]) 13:21:19 the ordinary map function 13:21:29 the list monad then represents nondeterministic computation 13:21:44 a function of type (a -> [b]) takes a value of type a, and yields zero or more values of type b 13:21:50 <{newbie}> o now I get one of the examples that used lists! 13:22:02 we can use the monad operators to compose this with another function (b -> [c]) 13:22:18 and so forth 13:22:23 > let partitions' n k m | k > n = partitions' n n m; partitions' 0 k 0 = [[]]; partitions' n k m | (k < 0 || m <= 0) = []; partitions' n k m | k == 0 = 0; partitions' n k m = [x:xs | x <- [k,k-1..1], xs <- partitions' (n-x) x (m-1)] in partitions' 8 8 3 13:22:24 No instance for (GHC.Num.Num [[t]]) 13:22:24 arising from a use of `partitions'' ... 13:22:25 building a big chain of nondeterministic computations 13:22:47 which will be searched in a breadth first way, building a list of possible results at each stage.... except in Haskell, evaluation is lazy so it's not really breadth first 13:23:22 --- join: domor (n=user@i114-182-187-130.s06.a014.ap.plala.or.jp) joined #haskell 13:23:39 --- quit: rajeshsr (Remote closed the connection) 13:23:49 other things we represent as monads: exceptions, logic programming, mutable state, IO, parsers, code generators, software transactional memory 13:24:11 <{newbie}> kmc in the case of lists 13:24:12 the point of recognizing "monad" as an abstraction is that we can use the same combinators and syntax for all of these 13:24:14 <{newbie}> using moands 13:24:33 <{newbie}> the first function could be combined with the second to yield 13:24:46 <{newbie}> something like fun)a -> [c]) 13:25:02 <{newbie}> using monad operations* 13:25:14 there are functors, and there are monads, and then there are the things inbetween 13:25:21 --- quit: Beelsebob1 (Remote closed the connection) 13:25:22 yes 13:25:27 :t (>=>) 13:25:28 forall a (m :: * -> *) b c. (Monad m) => (a -> m b) -> (b -> m c) -> a -> m c 13:25:52 --- join: IceDane (n=icedane@1410ds1-aeg.0.fullrate.dk) joined #haskell 13:25:55 {newbie}, if you're into theory, the composition of functions like (a -> M b) forms a category called the Kleisli category of the monad M 13:26:00 --- join: Beelsebob (n=Beelsebo@host86-166-25-72.range86-166.btcentralplus.com) joined #haskell 13:26:26 --- join: xcthulhu (n=xcthulhu@62.21.188.75) joined #haskell 13:26:30 <{newbie}> kmc so if I understand this correctly 13:26:36 --- part: Gunni^ left #haskell 13:26:45 <{newbie}> monads are like a super sized composition function 13:27:01 O: "openFile: resource exhausted (Too many open files)" 13:27:02 <{newbie}> that expresses some sor of adidional control 13:27:08 <{newbie}> before composing 13:27:09 Hah, simply flipping arrows around gives you lots of definitions for free! 13:27:14 --- join: RayNbow (i=kirika@scientia.demon.nl) joined #haskell 13:27:25 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16209#a16209 13:27:57 bind is kinda like a fancy composition 13:28:09 i kinda think of it like a bunch of elephants 13:28:30 m a is the elephant, and it sticks out its tail a, which the elephant m b behind it grabs with its trunk 13:28:40 {newbie}, yes. defining a new monad consists of two things: 1) define a datatype with one type parameter; 2) define how to inject values into this type, and how to compose functions of the form (a -> M b) 13:28:53 --- quit: djanderson (Client Quit) 13:28:59 tensorpudding: Someone had an analogy like that, but with unicorns... 13:29:24 --- join: jao (n=jao@232.Red-83-50-64.dynamicIP.rima-tde.net) joined #haskell 13:29:26 @quote analogy 13:29:26 lilac says: * lilac looks forward to Cale explaining category theory by analogy to Call of Duty 13:29:27 @quote analogy 13:29:28 lilac says: * lilac looks forward to Cale explaining category theory by analogy to Call of Duty 13:29:47 <{newbie}> kmc thanks very much for the explanation 13:29:47 @quote bad.explanations 13:29:47 dmwit says: analogies are endofunctors in the category of bad explanations 13:29:51 {newbie}, no problem 13:29:54 <{newbie}> I think 13:30:03 @quote dons analogy 13:30:04 dons says: xerox: what analogy or metaphor did you use? monad-as-garbage-bin? monad-as-refrigerator? monads-as-unicycle? 13:30:14 @quote monochrom like 13:30:15 monochrom says: If you're having trouble learning monads, try to learn something harder, like algebraic geometry. 13:30:21 <{newbie}> i'll play a bit with haskell just to improuve my understanding of monads 13:30:21 Oh hahaha 13:30:29 {newbie}, cool :) 13:30:32 <{newbie}> :D 13:30:38 @quote unicorn 13:30:39 v_ says: Haskell shits rainbows, monads and unicorns 13:30:44 --- quit: KSkrzet (Read error: 60 (Operation timed out)) 13:30:45 Ugh 13:30:49 hmm 13:30:54 unicorns don't exist 13:31:00 Ideally you should also verify that the monad you designed satisfies the laws. 13:31:07 they're like forall a b. a -> b 13:31:08 @quote late.rob 13:31:08 Duqicnk says: a monad is like a train that runs backwards in time, which is made of tiny chocolate robots 13:31:17 tensorpudding: at least one does. it's pink, and invisible ;-) 13:32:35 if unicorns were like haskell, they would be awfully beautiful but you'd never want to look under the hood 13:32:47 @quote monad 13:32:47 WillDonnelly says: monads are okay after a bit (though I'm still a little suspicious of them) 13:32:50 @quote monad 13:32:50 buttbot2 says: "I'd butt linux on the butt, I'd like to give xmonad a try" 13:32:52 @quote monad 13:32:53 Cale says: Removing monad comprehensions was actually the snowball which caused the avalanche of fail in Haskell 98 13:33:09 --- quit: perspectival (Read error: 110 (Connection timed out)) 13:33:12 How true. 13:33:41 @quote Polarina 13:33:41 No quotes match. You untyped fool! 13:33:43 :( 13:34:04 --- quit: comak (Connection timed out) 13:34:33 --- join: comak (n=mak@dynamic-78-8-243-87.ssp.dialog.net.pl) joined #haskell 13:34:48 @quote o.c.m.u.e.t.i.g 13:34:48 taruti says: damn GHC. I had a nice example for a pretty but inefficient way to compute things and now the new GHC optimizes it to be fast ._. 13:34:57 theres no foreign function interface for c++, is there? 13:35:06 McManiaC, from Haskell to C++? 13:35:17 using C++ stuff in haskell 13:35:17 --- join: scrie (n=user@113.106.205.8) joined #haskell 13:35:21 calling C++ from any other language (or from another C++ implementation on the same machine) is a royal pain 13:35:30 Right, there is none. 13:35:32 you're best off wrapping your C++ functions with a C API 13:35:35 which is not too hard 13:35:38 --- quit: anklav (Read error: 104 (Connection reset by peer)) 13:35:39 --- join: perspectival (n=perspect@cpe-071-070-222-116.nc.res.rr.com) joined #haskell 13:36:15 the garbage collector collects fds, right? how do i call it manually? 13:36:27 fds? 13:36:30 @index performGC 13:36:31 System.Mem 13:36:33 --- join: Philonous (n=uart14@dslb-188-103-052-187.pools.arcor-ip.net) joined #haskell 13:36:35 file dewscriptors 13:36:39 --- join: wto_ (n=wto@c83-249-244-102.bredband.comhem.se) joined #haskell 13:37:15 --- quit: sinelaw (Read error: 60 (Operation timed out)) 13:37:16 -w 13:37:26 i don't think the GC would have anything to do with closing file descriptors 13:37:31 unless you've associated one with a ForeignPtr 13:37:36 --- quit: wto (Read error: 60 (Operation timed out)) 13:37:39 @hoogle finalizePtr 13:37:40 No results found 13:37:50 ... but when you deal with many files (or network connections or pipes) you'll probably be happier with strict IO or explicitely closing files. 13:37:53 Don't wait for GC to close files. (It can, but you don't know how long to wait.) Just bloody close yourself. 13:37:53 --- nick: mental -> lament 13:38:03 ok manual performGC doesnt work. what do i need to do to close open fds? 13:38:11 hClose ? 13:38:12 well i can't. i dont have the fd 13:38:13 :t hClose 13:38:14 Not in scope: `hClose' 13:38:18 aep: why not? 13:38:21 i used readFile 13:38:30 how often? 13:38:32 don't use lazy IO 13:38:37 ~200K times 13:38:37 if you care about when it happensl 13:38:39 OK, ensure you completely consume that string. That ensures close file. 13:38:46 eek 13:38:51 then make sure you either consume all the returned data ... or that it's no longer reachable before the GC runs. 13:38:58 i never completely read any of them D: 13:39:02 --- join: NEEDMOAR (n=user@190.193.95.183) joined #haskell 13:39:05 lazy IO is a hack 13:39:12 --- quit: DrTeggy ("Colloquy for iPhone - http://colloquy.mobi") 13:39:44 so i should use the low level api? 13:39:55 --- quit: spaceodyssey ("101001110110^|^<#4][.0.2.6.") 13:40:23 i think the problem is my mapM 13:40:40 i have something like "mapM readFile files " 13:40:40 we don 13:40:54 i read that this might couse problem, but i dont know any better :/ 13:42:38 --- quit: cognominal (Connection timed out) 13:43:15 --- join: cognominal (n=cognomin@82.67.232.89) joined #haskell 13:43:19 can you turn that into a mapM processFile files where processFile would extract the necessary data from the file and then close it? 13:43:35 i do that 13:43:41 except i dont know how to close it 13:44:48 low level api will do it i guess 13:45:25 :t withFile 13:45:26 Not in scope: `withFile' 13:45:29 I don't understand what you mean by low level api, and if I understood I would still refuse to say it. 13:45:37 @hoogle withFile 13:45:38 System.IO withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r 13:45:57 openFile and hClose and withFile are not low level. 13:46:32 If you get down to hGetBuf then maybe I might agree it begins to be slightly low level. 13:46:59 openFile "/dev/hda" 13:47:17 --- quit: Spockz|lap (Remote closed the connection) 13:47:49 huh withfile is cool 13:48:19 --- nick: xcthulhu -> xcthulhu_ 13:48:51 but how do i read from the handle now ? :/ 13:48:54 You can even use hGetContents *if* you're careful to read enough data (by forcing the extracted data, say) before the file gets closed - i.e. before the Handle -> IO r part returns. 13:49:03 other then character by character 13:49:19 :t ContT (withFile "bla" ReadMode) 13:49:21 Not in scope: `withFile' 13:49:21 Not in scope: data constructor `ReadMode' 13:49:25 uh 13:49:28 --- join: Mortomes (n=mortomes@unaffiliated/mortomes) joined #haskell 13:49:30 int-e: what? 13:49:33 aep: how much do you want to read? 13:49:46 only the first few lines from a few thousand files 13:49:53 hGetLine? 13:50:03 --- join: c_wraith (n=c_wraith@c-76-115-7-85.hsd1.or.comcast.net) joined #haskell 13:50:12 i wasted 8 hours building this with lists D: 13:50:28 --- quit: xcthulhu_ (Client Quit) 13:51:12 this is really discouraging. pretty much all high level stuff i tried so far seems to not work at all in reality 13:51:22 How large is each file? How much memory you're willing to use? 13:51:36 not much, and not much 13:51:48 like 3kb 13:52:06 but it doesn't matter. i don't see whay i have to read the entire file in the first place 13:52:12 i though thats what lazy evaluation is for 13:52:15 you don't 13:52:39 yes, i dont if i use imperative api 13:52:41 technically that's not what lazy evaluation is for 13:52:47 which is hard, since haskell doesnt allow DFAs 13:52:50 use strict bytestring or the strict i/o library to readFile. They are not lazy, they read the whole file into memory. The benefit is you need little change to your code. 13:52:59 aep: DFAs? 13:53:06 state engines 13:53:13 how does Haskell not allow them? 13:53:40 --- quit: roconnor (Remote closed the connection) 13:53:44 --- join: NNshag (n=shag@lns-bzn-37-82-253-45-49.adsl.proxad.net) joined #haskell 13:53:51 stuff like ref1,ref2 while(line=read file){ if(line. .. then ref1=line 13:54:05 that's not a DFA 13:54:31 well whats the correct word? :) 13:54:31 also, you can write that in Haskell 13:54:36 FSM? 13:54:41 If you still complain, I'll just prescribe another 8 hours of learning and using Oleg's Iteratee, does exactly all your requirements: lazy, automatic close, high level, clean conscience, untainted soul... 13:54:42 ramen 13:54:49 a while loop? variables? 13:54:55 C 13:54:57 --- quit: Nshag (Read error: 110 (Connection timed out)) 13:55:03 I can write C in Haskell 13:55:12 McManiaC: got a link? 13:55:12 i feel icky using one ioref 13:55:21 tho i'm about to use a whole damn array of 'em 13:55:25 it's kind of hard to write Haskell in C, though 13:55:42 aep: hm? 13:55:43 --- join: Bronto22 (n=mennoh@ip5456f7e7.speed.planet.nl) joined #haskell 13:55:57 yeah i know. the depressing thing is that haskell seems to awesome in its purity concepts, but in the end everyone just uses it like C 13:56:05 McManiaC: wrong nick, sorry 13:56:08 what are you talking about? 13:56:10 monochrom: got a link? 13:56:11 kay 13:56:12 "everyone just uses it like C" 13:56:14 what everyone? 13:56:21 aep: I don't! 13:56:21 programs with zero side effects aren't very interesting 13:56:30 who was it that was like "IO is not always like C" 13:56:36 --- join: jsgf (n=jeremy@dsl-203-33-163-122.NSW.netspace.net.au) joined #haskell 13:56:50 even got a hackage package. http://hackage.haskell.org/package/iteratee 13:57:06 --- join: kwos (n=kwos@sjc135n6.joh.cam.ac.uk) joined #haskell 13:57:13 --- join: dpratt71 (n=dpratt71@pool-72-65-103-79.ptldme.east.myfairpoint.net) joined #haskell 13:57:23 hi 13:57:35 Hello kwos 13:57:37 Hmm. My haskell code looks nothing like C. Even the bits where I'm doing imperative things, it's nothing like C. 13:57:43 thanks 13:57:47 aep: so basically you're saying that Haskell sucks because lazy IO - which is well recognized as a slick but dangerous hack that doesn't work in a number of cases - doesn't work for your problem. 13:58:09 int-e: i didn't say "haskell sucks" 13:58:36 If I used Haskell like C, I would be retrofitting every data structures into arrays. Clearly I don't; I use Data.Map. 13:58:38 you should, "Haskell sucks because I can't get it to do the right thing for me!" 13:58:41 i was whining that its awesomeness is impratical 13:59:02 ok, I'm with monochrom. learn about iteratees 13:59:10 monochrom: You retrofit every data structure into associative maps? You use Haskell like Perl? 13:59:29 like c++ 13:59:34 int-e: doing :) 13:59:40 --- join: roconnor (n=roconnor@76-10-150-163.dsl.teksavvy.com) joined #haskell 13:59:43 Oh I use MVar and Chan too. 13:59:56 although i'm not sure i can handle it in my nobism. sounds hard 14:01:02 --- join: maikeru (n=maikeru@24-107-56-173.dhcp.stls.mo.charter.com) joined #haskell 14:01:16 I don't understand why if I write my main and I/O code in C style then it is called I use Haskell like C. It's just half of my program. The other half is unlike C, unlike everything. How is it like C? I don't understand. 14:01:41 It is like when you see my source code files are in ascii you say I use haskell like plain text file. 14:01:45 --- join: Peter_ (n=chatzill@adsl-dyn247.78-98-16.t-com.sk) joined #haskell 14:01:51 --- nick: maikeru -> michael| 14:01:53 How is main and IO like C anyway? Haskell's IO language is very high-level 14:01:54 what the heck is enumFd? 14:02:22 Hello, I was wondering, has anyone been successful in getting Leksah to work on a Windows 7 machine? 14:02:54 um... look, i'm just some random noob who reads about lazy evaluation, thinks its awesome, uses it, and it breaks. then i ask here and i am told to use the same aproach i did 30 years ago in C 14:03:13 OH MAN SOMETHING IS LIKE C THEN HASKELL IS NOT COOL 14:03:19 --- quit: paulvisschers (Remote closed the connection) 14:03:22 I don't know any Haskellers who use Window7, but I have used Leksah on Linux and based on that wouldn't yet use Lesksah for any development yet (on any platform). 14:03:32 *sigh* never mind 14:03:48 aep: yeah, readFile is technically broken 14:03:54 but it's not lazy evaluation that breaks - what breaks is lazy IO. 14:04:03 aep: Lazy evaluation doesn't break. Lazy execution does. 14:04:09 Do you know that the other half of my program uses the same approach Backus did 30 years ago in FP. 14:04:09 i see 14:04:12 --- quit: {newbie} () 14:04:22 --- quit: ultwe (Remote closed the connection) 14:05:13 ok so the general aproach is to split programs into IO and pure and try to keep lazy out of the IO part ? 14:05:22 (Hey, we could blame the OS for not giving us unlimited FDs ... :) ) 14:05:39 aep: yep 14:05:46 aep: Yes. Splitting IO and pure code is a good thing 14:05:54 make sense, thanks 14:05:59 My general approach is I don't reject 30-year-old methods automatically. 14:06:08 aep: And usually makes for better algorithms too, since you won't be interleaving pure computation with IO 14:06:14 why do I get "...missing" messages with "cabal configure"? that package is installed via cabal 14:06:23 tommd: well, what IDE/editor would you recommend in that case? I am not very fond of vim and have not yet tried Emacs. I read that there is an eclipse plugin for Haskell, but my experiences with eclipse were very discouraging so far. 14:06:25 and cabal install works 14:07:20 --- join: HeavensRevenge (n=quassel@CPE001d0fe73b7d-CM00111ae5c642.cpe.net.cable.rogers.com) joined #haskell 14:08:02 Peter_: Emacs and vim are the go-to editors for haskell, I believe. There's also yi, which is about as user-friendly as those two. A simple text editor with highlighting also works, and leksah isn't useless 14:08:25 --- join: DarthShrine (n=angus@60-242-109-62.tpgi.com.au) joined #haskell 14:09:25 I did try leksah, but I can't get it to load the packages properly, so I guess I am going to have to try emacs 14:09:30 McManiaC: does cabal configure work after you've done a cabal install? 14:09:49 Berengal: let me test… 14:10:07 --- join: takuan (n=takuan@d51535133.access.telenet.be) joined #haskell 14:10:10 --- quit: araujo ("Leaving") 14:10:34 Peter_: You can use any editor you want. 14:11:07 --- quit: shambler ("We are full of wrong assumptions.") 14:14:00 ddarius:I know I can use any editor, I just don't know which one would be the most suitable for a person spoiled by MS Visual studio :) 14:14:03 --- join: genneth (n=genneth@cpc1-cmbg6-0-0-cust415.cmbg.cable.ntl.com) joined #haskell 14:14:47 --- quit: trofi (Read error: 60 (Operation timed out)) 14:14:57 --- quit: q[mrw] (Read error: 54 (Connection reset by peer)) 14:15:30 Peter_: There's an EclipseFP plugin I think that has support for Haskell... I haven't used it, but it might be something to look into 14:16:02 Peter_: You could use MS Visual Studio. 14:16:19 Visual Haskell is bitrotted. 14:16:37 the GHC integration only ever worked with GHC 6.6, and wasn't all that good even there. 14:16:48 There's something compelling about a simple editor and REPL as well... 14:17:00 one colleague does use it just as an editor for later Haskell code, but I don't think very many people do 14:17:09 * ddarius just uses vim and doesn't use any "haskell mode" beyond Haskell syntax highlighting. 14:17:18 Yes, Visual Haskell has basically been abandoned for at least 5 years and does no have support for VS 2008 or greater 14:17:41 I'm working on Hascaml++, should be out in early 2034 14:17:54 * Berengal uses emacs for the syntax highlighting, automatic-ish indentation, and quick send-to-ghci 14:18:05 i can has caml? 14:18:16 ++ 14:18:20 --- part: aeter left #haskell 14:18:21 haha 14:18:23 --- quit: jtootf (Read error: 110 (Connection timed out)) 14:18:39 --- quit: abbe (Read error: 60 (Operation timed out)) 14:18:57 i can has LOLCODE? http://lolcode.com/ 14:18:58 --- join: jtootf (n=psujkov@82.193.114.220.ipnet.kiev.ua) joined #haskell 14:19:02 --- join: C-S (n=FreeBSD@84-72-45-59.dclient.hispeed.ch) joined #haskell 14:19:07 * Berengal finds it interesting how "c++" returns the value of c in c++... 14:19:33 Clearly that is meant to symbolise source code compatibility ;) 14:20:24 Also, int x = c++; if (c > x) printf("c++ is less than c"); 14:21:03 * Berengal is done trolling 14:22:16 yes, c++ increases the value of c 14:23:26 but you still use the old value. 14:23:35 --- join: KSkrzet (n=tener@dynamic-78-8-6-75.ssp.dialog.net.pl) joined #haskell 14:24:16 --- join: sieson (n=sasan@host81-102-109-204.not-set-yet.ntli.net) joined #haskell 14:25:20 The magnitude of c, rather… 14:25:26 I've just started learning Haskell and I don't know whats the difference between the glasgow haskell compiler and haskell 98. Is there any major difference between the two? 14:25:48 sieson: haskell98 is a language standard. GHC is a compiler (which supports that standard) 14:25:52 well, one is a compiler and the other is a language 14:26:08 I'd say the difference is pretty major :) 14:26:18 GHC supports a lot of additional features beyond Haskell 98 14:26:27 --- quit: IceDane () 14:26:52 How much of it does it really support by default? 14:27:01 Taking into account the later addendums to the report... 14:27:05 I'm trying to read data from a named pipe, but it gives me EOF when no other process is writing to it. Is there a way to wait for data on a handle that return eof? A bussy loop works, but it kills performance, naturally. 14:27:26 Philonous: threadDelay :) 14:27:28 --- join: papermachine (n=papermac@c-98-223-32-15.hsd1.in.comcast.net) joined #haskell 14:27:33 Philonous: ffi ;) 14:27:38 Philonous: I'd say EOF is the correct behaviour in that case... 14:27:47 --- quit: Peter_ (Remote closed the connection) 14:27:58 Berengal: thanks - So there is no compiler which is called haskell 98? I have to download GHC in order to compile standard haskell code? 14:27:59 Berengal: It's correct, but I still want to wait for a process writing to the pipe 14:28:12 sieson: yes, install GHC. 14:28:23 --- quit: KSkrzet (Client Quit) 14:28:24 sieson: what OS are you using? 14:28:31 Philonous: threadDelay then 14:28:38 taruti: ubuntu 14:28:46 Philonous: you could do a blocking open 14:28:51 Berengal: I wanted to avoid threadDelay as it leaves me with fiddly details like how long to wait between tries 14:28:53 Philonous: Or you could poke around in some of the IO libraries. I think there might've been a blockUntilReadable function somewhere 14:28:53 --- mode: mauke set -o mauke 14:29:04 Berengal: EOF is readable 14:29:06 --- quit: Vitka ("~ Trillian Astra - www.trillian.im ~") 14:29:08 sieson: apt-get install ghc6 14:29:16 mauke: There's that... 14:29:34 how's the haskell platform coming along for ubuntu, anyone know? 14:29:47 BONUS: I thought it was in 9.10 14:29:48 Philonous: System.Posix supports blocking reads/writes. 14:30:00 BONUS: Or possibly it's slated for 10.4 14:30:13 BONUS: In which case it's in some beta repo somewhere 14:30:25 taruti: thanks 14:30:32 Ah ok. Then I'm working on Fs's rathen than handles? 14:30:40 Fds* 14:31:00 yes 14:31:01 --- quit: sieson ("Ex-Chat") 14:31:05 --- join: sjanssen_ (n=sjanssen@cpe-76-84-99-142.neb.res.rr.com) joined #haskell 14:31:18 Philonous: You could write your own Handle implementation of them, if you wanted... 14:31:21 --- quit: deso (Remote closed the connection) 14:31:31 But I'm guessing that's a bit overkill for your purposes 14:31:35 --- quit: takuan (Read error: 60 (Operation timed out)) 14:31:39 Philonous: just make sure the handle is set to be blocking. and the use fdRead. 14:31:40 --- quit: gio12345 (Connection timed out) 14:32:24 s/handle/fd 14:32:52 Philonous: I don't quite believe it. Named pipe does not give EOF just because the other process doesn't write. The other process has to close the write end in order for the read end to see EOF. 14:33:01 --- join: Guest52822 (n=andy@adsl-99-23-238-102.dsl.hstntx.sbcglobal.net) joined #haskell 14:33:22 --- join: emax (n=user@5ED6AFDD.cable.ziggo.nl) joined #haskell 14:33:28 monochrom: what other process? 14:33:43 Whoever has the write end. 14:33:43 --- join: saccade_ (n=saccade@209-6-54-113.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com) joined #haskell 14:34:01 monochrom: True, but there is no other process yet. 14:34:03 no one 14:34:10 --- join: det (n=chris@ip24-253-23-87.lv.lv.cox.net) joined #haskell 14:35:17 <- newbie - Hi everybody, just visiting during my first steps into Haskell. 14:35:28 emax: Welcome 14:35:34 emax: welcome. feel free to ask any questions 14:35:46 --- join: Hack0rDie (n=Hack0rDi@41.140.89.165) joined #haskell 14:37:08 thanks Philonous c_wraith - no questions so far just beginning to learn. will probably have them later on. 14:37:08 OK, man fifo(7) says "The FIFO must be opened on both ends (reading and writing) before data can be passed. Normally, opening the FIFO blocks until the other end is opened also." So you don't even get to the read stage, let alone EOF. 14:37:38 --- join: Peter___ (n=chatzill@adsl-dyn247.78-98-16.t-com.sk) joined #haskell 14:37:44 monochrom: "normally" 14:37:48 parsec :( it seems that my parser either needs more or less 'try's 14:37:49 unless you use O_NONBLOCK 14:37:51 monochrom: Haskell handles are always opened non-blocking, so I just get EOF when I try to read from them 14:37:55 Oh gosh, nevermind, it then says on Linux it doesn't block. 14:38:44 --- quit: THC4k (Read error: 113 (No route to host)) 14:38:45 olsner_: that's my main complaint with parsec, and why I eventually switched to an alternate parser combinator library 14:38:49 --- quit: papermachine (Remote closed the connection) 14:39:11 Text.ParserCombinators.ReadP relieves you from try. 14:39:15 olsner_: there are lots of other alternatives that don't need try 14:39:18 ReadP is nice 14:39:34 why is parsec so popular? 14:39:55 monochrom: It says it doesn't block on Linux if you open it in both read and write mode 14:39:59 taruti: ReadP has no error messages 14:40:04 the thing is, I already have the full parser (wrote it one or two years ago) ... I guess I could port it to another combinator library though 14:40:15 OTOH when I use Parsec, I add one lexical layer on top of it, the lexical layer has try, above it I don't try anymore. 14:40:23 Or is there a simpler way to have a shell script communicating with a running haskell process than FIFOs? I am fooling around with an XMPP bot and I want to use it to notify on termination of a script 14:40:32 wait, that makes sense 14:40:38 I like uu-parsinglib because of both not needing try, and because it will correct small errors in input, if so desired. 14:41:15 Philonous: what happens when you open the fifo in ReadWriteMode? 14:41:20 --- join: Rayne (n=Rayne@pD9E3778B.dip.t-dialin.net) joined #haskell 14:41:22 dcoutts_: various ReadP derivates have them. 14:41:26 Philonous: I agree named pipe is the simplest for this. Shell scripts can't do alot. Can't even tell it to use unix-domain sockets. 14:41:28 --- quit: dwahler ("Lost terminal") 14:42:05 >2 + 2 == 5 14:42:14 you need more space 14:42:20 --- quit: sjanssen (Read error: 110 (Connection timed out)) 14:42:24 --- quit: Guest52822 ("Leaving") 14:42:28 taruti: the only reason I use ReadP is because it's in the base lib, so it's the only choice for Cabal. It's ok apart from the complete lack of error reporting. 14:42:33 --- quit: Icewing (Remote closed the connection) 14:42:59 dcoutts_: and also not needing trys. there are fancier alternatives of course. 14:43:22 I have a feeling ReadP is designed for typeclass Read users. 14:43:22 yes, composable by default is good 14:43:42 --- quit: itewsh (Client Quit) 14:43:43 --- part: Hack0rDie left #haskell 14:43:45 > 2 + 2 == 5 14:43:46 False 14:43:57 monochrom: yes, the instance of it in base is for ghc's faster implementation of ReadS from the Read typeclass 14:44:00 * lament sends lambdabot to room 101 14:44:37 > let 2 + 2 = 5 in 2 + 2 14:44:38 5 14:44:52 --- quit: trin_cz (Read error: 113 (No route to host)) 14:45:02 --- join: cytzol (n=cytzol@78.32.81.25) joined #haskell 14:45:54 Actually, I think parsec is popular because it has a cool name. I mean... "readP"? "uu-parsinglb"? "parsec"? If I don't have any idea that the advantages and disadvantages of each, the one with the coolest name wins. 14:46:07 and it's one of the older ones 14:46:16 and was distributed with ghc 14:46:22 and had good docs 14:46:46 the good docs part is true. parsec has great docs. And a pretty large supply of composite combinators. 14:46:53 --- join: THC4k (n=Miranda@p5B0C8472.dip0.t-ipconnect.de) joined #haskell 14:47:00 and has reasonable performance 14:47:01 mauke: It blocks. 14:47:04 --- quit: ralph (Read error: 110 (Connection timed out)) 14:47:11 --- quit: Torrieri (Read error: 54 (Connection reset by peer)) 14:47:38 --- join: ralph (n=ralph@wlan-nat-outside-222-52.uoregon.edu) joined #haskell 14:48:15 mauke: Hah. That's neat. 14:48:31 --- join: slash_ (n=drevil@whgeh0250.cip.uni-regensburg.de) joined #haskell 14:48:43 Hi #haskell! Is there a way to assign aliases to class restrictions on functions, like you can with types? 14:48:51 cytzol: I don't think so 14:48:51 I'm writing "(Random a, Integral a) =>" a lot. 14:49:02 aw. 14:49:34 cytzol: Not really. But you can class (Foo x, Bar y) =>FooBar x y; instance (Foo x, Bary) => FooBar x y 14:49:42 cytzol: It's possible to construct a class which is a subclass of both of them, and with some GHC extensions, write an all-emcompassing instance 14:49:43 --- join: PhilRod (n=phil@cpc3-oxfd2-0-0-cust793.oxfd.cable.ntl.com) joined #haskell 14:50:13 Philonous: that instance doesn't look like it's H98 14:50:29 oh, fugues 14:50:55 Change it to class (Foo x, Bar x) =>FooBar x 14:51:08 --- join: altmattr (n=altmattr@124-168-167-241.dyn.iinet.net.au) joined #haskell 14:51:18 mauke: Unfortunately it's not. But the gain in readability might be worth the extensions 14:51:23 --- nick: LeNsTR -> LeNsTR|Sleep 14:53:45 Philonous: Hey, that works. I guess I language'd the extensions already. 14:54:32 cytzol: I think it's UndecidableInstances 14:54:43 --- quit: altmattr (Client Quit) 14:54:57 Yeah, I must've needed that for something else. Can't remember what it was though. 14:56:34 --- nick: Zephyrus__ -> Zephyrus 14:58:34 --- join: abbe (i=shotted@xn--chteau-d-if-x7a.abbe.members.pirateparty.in) joined #haskell 14:59:22 --- quit: PolitikerNEU (Remote closed the connection) 14:59:25 --- quit: nomadmonad () 15:00:06 --- join: eli (n=eli@winooski.ccs.neu.edu) joined #haskell 15:00:36 --- quit: jmcarthur ("WeeChat 0.2.6.3") 15:00:43 --- join: altmattr (n=altmattr@124-168-167-241.dyn.iinet.net.au) joined #haskell 15:01:17 --- quit: maskd (Remote closed the connection) 15:01:32 --- quit: gehmehgeh (Remote closed the connection) 15:03:03 --- join: Ultwe (n=Ultwe@78.144.154.88) joined #haskell 15:03:05 --- join: jjann (n=jan@f053084067.adsl.alicedsl.de) joined #haskell 15:05:27 --- join: jmcarthur (n=weechat@76.73.220.85) joined #haskell 15:05:50 --- join: welterde (i=welterde@not.welterde.de) joined #haskell 15:06:50 --- quit: slash_ (Client Quit) 15:07:22 --- quit: danvet (Remote closed the connection) 15:07:57 --- part: bastl left #haskell 15:08:25 --- quit: Peter___ ("ChatZilla 0.9.86 [Firefox 3.5.7/20091221164558]") 15:11:20 --- quit: dolio (Read error: 104 (Connection reset by peer)) 15:11:21 --- part: wattwood left #haskell 15:11:25 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 15:11:33 --- quit: scrie (Read error: 110 (Connection timed out)) 15:11:58 --- quit: cytzol (Read error: 104 (Connection reset by peer)) 15:12:10 --- join: cytzol (n=cytzol@78.32.81.25) joined #haskell 15:12:20 --- quit: Bronto22 ("Leaving.") 15:13:28 --- join: Scork (n=scork@91.182.106.12) joined #haskell 15:13:36 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 15:14:03 Any haskell programmer here that can help me with an error? 15:14:51 No, we're all here just to discuss obscure elements of Icelandic culture 15:14:51 just pastebin it and someone might help 15:14:59 hpaste.org 15:15:16 it's simple enough that I don't need to paste the code somewhere 15:15:26 It helps if youi ask the question 15:15:32 :) 15:15:37 I'm just beginning to learn haskell and the prob I have is that I get the following error 15:15:43 ... 15:15:53 input error on input '|' 15:16:07 you did something wrong 15:16:08 Should I just say "I agree it's so simple"? 15:16:09 when I use th | to seperate constructors 15:16:14 lol 15:16:19 I'd guess the error is in the code... so, paste the code? :P 15:16:21 I hope you'll say yes 15:16:22 k 15:16:37 --- join: jfischof (n=jfischof@173-11-112-238-SFBA.hfc.comcastbusiness.net) joined #haskell 15:16:38 say yes to what? 15:17:30 does anyone know if you can use Template Haskell to derive multi-parameter type classes? 15:17:45 Any sufficiently advanced knowledge is indistinguishable from prophecy. 15:17:55 --- quit: kqrx_ (Client Quit) 15:18:02 psychic debugging :-) 15:18:10 Any knowledge indistinguishable from prophecy is insufficiently advanced? 15:18:10 there ya go http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16210#a16210 15:18:19 jfischof: My guess is "yes, TH can do anything", but I have no proof 15:18:31 @th-faq 15:18:31 Unknown command, try @list 15:18:46 nooo now it compiles 15:18:51 Berengal: hmm ok 15:19:01 Berengal: TH is pretty awesome 15:19:03 --- quit: dpratt71 ("Leaving.") 15:19:48 --- join: yitz (n=abba@line236.adsl.actcom.co.il) joined #haskell 15:19:51 jfischof: It produces an AST. Anything you can write you can write with TH, except TH has horribly syntax in comparison to regular haskell... 15:19:59 horrible* 15:19:59 this channel works magic on my code lol 15:20:02 tnx guys 15:20:02 Scork: that looks fine to me. 15:20:05 what was the name of that easier-to-use-than-ncurses haskell cli? 15:20:16 maybe you forgot to save before :loading? 15:20:17 I dunno why I had the error now :s 15:20:21 nah 15:20:25 yeah, but I think compared to other 15:20:26 maybe you just needed to save the file 15:20:39 can it be indenting? 15:20:39 meta programming apis, it looks good 15:20:53 , pprint [| class Foo a b c where f :: a -> b -> c |] 15:20:54 luna: parse error on input `class' 15:21:07 , pprint [d| class Foo a b c where f :: a -> b -> c |] 15:21:08 luna: Not in scope: `pprint' 15:21:12 Scork: there isn't any indenting 15:21:22 the where clause 15:21:37 --- quit: kwos ("Computer has gone to sleep") 15:21:39 , ppdoc [d| class Foo a b c where f :: a -> b -> c |] 15:21:40 luna: Not in scope: `ppdoc' 15:22:09 the where's fine 15:22:59 , ppDoc [d| class Foo a b c where f :: a -> b -> c |] 15:23:00 luna: Too many parameters for class `Foo' 15:23:07 --- nick: olsner_ -> olsner 15:23:21 --- quit: ramses_ ("leaving") 15:23:38 --- join: ramses_ (n=ramses@d54C3BD85.access.telenet.be) joined #haskell 15:23:57 --- join: gbacon (n=gbacon@67.58.77.138) joined #haskell 15:25:50 anyways, the ast from that quotation is [ClassD [] Foo [PlainTV a_0,PlainTV b_1,PlainTV c_2] [] [SigD f (AppT (AppT ArrowT (VarT a_0)) (AppT (AppT ArrowT (VarT b_1)) (VarT c_2)))]] 15:26:42 --- quit: Mr_Awesome ("Hilarity ensues.") 15:26:46 --- join: dschoepe_ (n=dschoepe@unaffiliated/dschoepe) joined #haskell 15:26:56 --- quit: gonsor (Read error: 54 (Connection reset by peer)) 15:27:12 --- part: eli left #haskell 15:28:08 --- quit: sajkr ("leaving") 15:28:28 --- join: Pthing (n=pthing@cpc11-pres4-0-0-cust168.pres.cable.virginmedia.com) joined #haskell 15:33:16 --- quit: nominolo (Read error: 60 (Operation timed out)) 15:35:04 --- join: nominolo (n=nominolo@5ac9a24f.bb.sky.com) joined #haskell 15:35:06 --- quit: iblechbot (Read error: 110 (Connection timed out)) 15:36:35 --- quit: Khisanth (Remote closed the connection) 15:39:43 --- nick: magicman|gone -> magicman 15:40:44 --- join: kquick2 (n=quick@70-56-179-209.phnx.qwest.net) joined #haskell 15:41:09 --- quit: ramses_ (Success) 15:42:05 --- quit: PhilRod (Remote closed the connection) 15:42:47 --- quit: dschoepe (Read error: 110 (Connection timed out)) 15:43:33 --- join: LITesterB (i=nobody@CPE001cf0f641f7-CM000a7365ada2.cpe.net.cable.rogers.com) joined #haskell 15:43:40 --- quit: amz ("It is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring.") 15:44:38 --- quit: altmattr () 15:45:50 is there any way to declare data types in ghci? 15:46:18 :load my-data-type.hs 15:46:25 --- quit: LITesterB (Read error: 104 (Connection reset by peer)) 15:46:32 bye everybody 15:46:33 --- quit: emax ("ERC Version 5.2 (IRC client for Emacs)") 15:46:41 but can I right the definition in ghci? 15:46:46 --- part: blackh left #haskell 15:46:49 no 15:46:54 thanks 15:47:06 --- join: Artalizian (n=scork@91.182.106.12) joined #haskell 15:47:09 assuming right = write 15:47:11 you could write a filesystem where filenames correspond to values! 15:47:12 --- join: jamby (n=jamby@cpe-74-74-142-146.rochester.res.rr.com) joined #haskell 15:47:16 :) 15:47:28 :load "/filefs/data MyData = etc" 15:50:21 --- quit: HeavensRevenge (Remote closed the connection) 15:51:36 --- quit: alexsuraci (Client Quit) 15:52:15 --- quit: jamby ("Leaving") 15:52:16 --- nick: dschoepe_ -> dschoepe 15:53:32 --- quit: [Bool] (Read error: 60 (Operation timed out)) 15:54:41 --- quit: Ultwe (Read error: 104 (Connection reset by peer)) 15:54:56 --- quit: int-e ("leaving") 15:56:10 --- quit: jsgf (Read error: 113 (No route to host)) 15:56:40 That is the most evil application of write-your-own-filesystem I have seen. 15:56:54 why, thank you. 15:57:17 --- quit: tarleb ("Leaving") 15:57:18 You should post it to haskell-cafe. Many people will have heart attacks. 15:57:26 --- join: pheaver (n=pheaver@c-76-105-221-184.hsd1.or.comcast.net) joined #haskell 15:57:40 (/dev/fd can be used to similar effect if the context of generating the filename is a shell) 15:57:50 also, data: URLs 15:58:04 But Oleg alone will approve of it, and he will also suggest that you involve delimited continuations in your filesystem. 15:58:19 --- join: gonsor (n=quassel@kel30.kel.stud.uni-goettingen.de) joined #haskell 15:58:26 I'm not on haskell-cafe, so I don't know how to say it right. feel free to forward :-) 15:58:41 I am not on haskell-cafe either! 15:58:42 Oleg will suggest delimited continuations in your breakfast, even 15:58:44 --- quit: pheaver (Client Quit) 15:59:31 --- join: altmattr (n=altmattr@124-168-167-241.dyn.iinet.net.au) joined #haskell 15:59:41 * kpreid does not know the significance of delimited continuations 15:59:42 Well I bring up Oleg and delimited continuation because he has used it to emulate a concurrent-safe filesystem and posted it to haskell-cafe. 16:00:28 --- quit: reprore (Read error: 54 (Connection reset by peer)) 16:00:43 --- quit: Scork (Read error: 110 (Connection timed out)) 16:01:07 using STM to do it is less mind-blowing 16:01:38 --- join: maskd (n=maskd@unaffiliated/maskd) joined #haskell 16:02:54 --- join: arthurL^ (n=craig@pc1crl9.stunet.aber.ac.uk) joined #haskell 16:03:14 --- join: nominolo_ (n=nominolo@5acc3f0f.bb.sky.com) joined #haskell 16:03:41 --- join: leandrom (n=leandro@host148.190-227-251.telecom.net.ar) joined #haskell 16:03:42 --- quit: arthurL^ (Client Quit) 16:04:24 --- join: theorb (n=theorb@91.84.53.6) joined #haskell 16:05:03 speaking of oleg, I skimmed this paper recently: http://www.cs.rutgers.edu/~ccshan/prepose/prepose.pdf -- and up till now, I didn't notice he was one of the authors, actually; but the mention of oleg made me think of type hackery 16:05:38 anyway, the code on the middle right of page 5 (reifyIntegral) made me go "you can DO that?!" 16:06:04 it's perfectly obvious once I've seen it, but ... 16:06:10 eheh 16:06:40 i think i had the same exact reaction at the time 16:06:51 i get that reaction to a lot of oleg's work 16:07:23 I mean, I've sort of known that you can compose dictionaries at runtime since ghc doesn't do code-gen (as in c++ templates). but it didn't occur to me to do it so ... explicitly 16:07:59 --- quit: meanburrito920_ (Read error: 60 (Operation timed out)) 16:08:57 --- quit: nominolo (Read error: 110 (Connection timed out)) 16:10:24 --- quit: altmattr () 16:10:25 Is David Siegel here on #haskell? I'm curious about his Yata twitter client. 16:11:42 --- quit: dolio (Read error: 104 (Connection reset by peer)) 16:12:00 --- join: lzgz (n=lzgz@194.186.53.42) joined #haskell 16:12:30 --- quit: xanonus (Client Quit) 16:12:50 --- join: nvoorhies (n=nvoorhie@166.205.139.91) joined #haskell 16:13:29 --- join: miclorb (n=michaeln@redhat/jboss/miclorb) joined #haskell 16:14:02 That's… woah 16:14:17 --- join: xanonus (n=xanonus@p5B0CE128.dip.t-dialin.net) joined #haskell 16:15:04 --- quit: xanonus (Client Quit) 16:15:17 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 16:15:33 --- quit: Zephyrus (Client Quit) 16:16:15 kpreid: Play with polymorphic recursion more. 16:17:44 --- join: altmattr (n=altmattr@124-168-167-241.dyn.iinet.net.au) joined #haskell 16:17:54 --- quit: theorbtwo (Read error: 110 (Connection timed out)) 16:17:55 --- nick: theorb -> theorbtwo 16:19:15 --- part: rfh left #haskell 16:19:41 --- join: LouisJB (n=LouisJB@louisb.gotadsl.co.uk) joined #haskell 16:19:47 --- quit: nominolo_ (Read error: 110 (Connection timed out)) 16:19:55 --- join: HIV (n=Commuter@c-66-31-116-172.hsd1.ma.comcast.net) joined #haskell 16:19:59 I am virus that destorys the human immune system 16:20:42 --- join: bbe (n=bbe@121.233.97.78) joined #haskell 16:22:35 --- join: meanburrito920_ (n=john@unaffiliated/meanburrito920) joined #haskell 16:23:50 @where ops 16:23:51 shapr Cale glguy dons sjanssen sorear dcoutts Saizan allbery_b dibblego conal Philippa bos arjanb psnl xerox vincenz davidhouse Heffalump kosmikus wli Pseudonym Igloo musasabi quicksilver monochrom 16:23:59 --- mode: ChanServ set +o dcoutts_ 16:24:24 --- quit: medfly (Read error: 60 (Operation timed out)) 16:24:29 I thought GHC 6.12 had full UTF8 support with putStrLn etc…? why do I still need Codec.Binary.UTF8.Light.hPutUTF8Ln to use utf8? 16:24:42 I use System.IO.hPutStrLn 16:24:49 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 16:24:52 how would you lay this out better: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16211#a16211 16:24:57 it looks like shit right now 16:25:24 --- quit: Raymond ("Leaving") 16:25:27 McManiaC: in ghc-6.12, the standard System.IO handle stuff uses the locale encoding by default. 16:25:49 well then it should use utf8 16:26:01 --- join: amz (i=zeratul@189.4.115.61) joined #haskell 16:26:07 McManiaC: right, unless you've changed to binary mode or explicitly set the encoding. 16:26:36 I didnt… 16:26:41 McManiaC: obviously the String you print needs to be Unicode 16:26:52 rather than say utf8 bytes 16:27:10 mreh: does it typecheck? 16:27:32 mreh: do you mean return (Key note mode) ? 16:27:58 yitz: I want a default to fall back on, if there is no key then return C Major as default 16:28:14 it's tonal music, so I can justify that 16:28:28 mreh: i meant the (parseMode >>= (\mode -> Key note mode)) part 16:29:03 --- quit: amz (Client Quit) 16:29:07 mreh: I tried to make it prettier using a where clause 16:29:26 --- mode: ChanServ set -o dcoutts_ 16:30:13 dcoutts_: ah my handle was in binary mode 16:30:34 mreh: does your program generate sound? 16:30:36 McManiaC: ok 16:30:46 thx for the hint :) 16:30:50 np :-) 16:31:21 McManiaC: so is locale encoding what you want, or are you using a file format that must be utf8? 16:31:55 no, locale encoding is fine 16:31:56 --- quit: ralph (Read error: 110 (Connection timed out)) 16:32:33 --- join: damd (n=damd@c83-254-66-137.bredband.comhem.se) joined #haskell 16:32:45 mreh: Assuming you are using parsec, this should work for the mode: option Major parseMode 16:33:15 --- join: Cthulhon (n=yogsotho@pool-71-163-77-45.washdc.east.verizon.net) joined #haskell 16:33:21 --- join: erikc (n=erikc@64-46-22-205.dyn.novuscom.net) joined #haskell 16:33:26 --- quit: nvoorhies (Client Quit) 16:33:26 twanvl: I saw your revision, what's option? 16:33:44 --- quit: gonsor (Read error: 104 (Connection reset by peer)) 16:33:47 --- quit: ulfdoz (Read error: 110 (Connection timed out)) 16:33:50 --- join: roostaj (n=roostaj@74.196.172.213) joined #haskell 16:33:54 --- join: IceDane (n=icedane@1410ds1-aeg.0.fullrate.dk) joined #haskell 16:33:55 --- quit: electrogeek ("leaving") 16:33:57 :t Tip 16:33:58 Not in scope: data constructor `Tip' 16:34:01 --- join: amz (i=zeratul@189.4.115.61) joined #haskell 16:34:26 oh, it's a parsec function. ne'er mind 16:34:49 --- join: gonsor (n=quassel@kel30.kel.stud.uni-goettingen.de) joined #haskell 16:34:56 --- join: nvoorhies (n=nvoorhie@166.205.139.91) joined #haskell 16:35:35 can't you do option (Key C Major) (Key <$> parseNote <*> (option Major parseMode)) then ? 16:35:50 I don't understand applicative 16:36:13 --- quit: medfly ("Leaving") 16:36:28 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 16:36:34 (f <$> a <*> b <*> ... <*> z) ==> liftMn f a b ... z 16:37:13 except that Applicative includes some types not in Monad 16:37:14 what monad is Key? 16:37:21 --- quit: RayNbow ("When science finally locates the center of the universe, some people will be surprised to learn they're not it") 16:37:23 :info Map 16:37:24 Functor? 16:37:27 :( 16:37:32 what about Functor? 16:38:18 @hoogle Map 16:38:19 module Data.Map 16:38:19 Data.Map data Map k a 16:38:19 Prelude map :: (a -> b) -> [a] -> [b] 16:38:20 is that one of the classes in Functor? 16:38:39 i don't know what you mean 16:38:40 Functor doesn't contain classes 16:38:43 Functor is a class 16:38:46 not class, type 16:38:52 Applicative is a class. every Applicative is a Functor 16:39:27 every Monad is an Applicative and a Functor, in theory. in practice, for historical reasons the std lib is written such that this is not enforced 16:40:11 --- join: jhnx (n=fwiffo@unaffiliated/fwiffo) joined #haskell 16:40:16 doesn't haskell use the offside rule? 16:40:35 but not in the top level function definition... 16:40:49 for a monad M you can always define an applicative instance by instance Applicative M where { pure = return; (<*>) = ap } 16:40:53 --- quit: HIV (Client Quit) 16:40:56 offside rule for layout? 16:40:58 --- quit: gonsor (Read error: 104 (Connection reset by peer)) 16:41:02 kmc: yes 16:41:31 http://haskell.org/onlinereport/lexemes.html#sect2.7 16:41:35 --- join: kwos (n=kwos@sjc135n6.joh.cam.ac.uk) joined #haskell 16:41:42 --- join: gonsor (n=quassel@kel30.kel.stud.uni-goettingen.de) joined #haskell 16:41:47 http://haskell.org/onlinereport/syntax-iso.html#sect9.3 16:41:58 --- quit: medfly ("Leaving") 16:42:06 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 16:42:07 those are the precise rules 16:42:21 the top level is slightly special 16:42:54 :t Map.Tip 16:42:56 Couldn't find qualified module. 16:43:04 :t Data.Map.Tip 16:43:04 :t Data.Map.Tip 16:43:05 Not in scope: data constructor `Data.Map.Tip' 16:43:05 Not in scope: data constructor `Data.Map.Tip' 16:43:07 roostaj, it's not exported 16:43:13 http://www.haskell.org/ghc/docs/6.10-latest/html/libraries/containers/src/Data-Map.html 16:43:20 you can do all sort of fun things at the top level it seems, definitions behind the "=" sign 16:43:28 data Map k a = Tip | Bin {-# UNPACK #-} !Size !k a !(Map k a) !(Map k a) 16:43:32 mreh, what do you mean? 16:43:48 --- quit: Athas`` (Remote closed the connection) 16:43:50 there are lots of things allowed at top level not allowed in a "let" or "where" 16:43:52 http://hpaste.org/fastcgi/hpaste.fcgi/view?id=16211#a16211 <--- the last one in this 16:43:55 such as data, class, instance, etc. 16:43:59 kmc: maybe I'm confused... shouldn't Tip be of type Map k a? 16:44:07 --- join: jfischoff (n=jfischof@173-11-112-238-SFBA.hfc.comcastbusiness.net) joined #haskell 16:44:09 kmc: I mean top level function definitions 16:44:10 roostaj, it is 16:44:14 what indication do you have that it's not? 16:44:34 mreh, what's special about the last paste here? 16:44:38 also, the last paste contains no function definitions 16:44:44 --- join: bens_ (n=bens@d58-110-168-188.sun5.vic.optusnet.com.au) joined #haskell 16:44:50 --- join: conal (n=conal@misc-148-66-75-114.pool.starband.net) joined #haskell 16:45:14 kmc: parseKey is a function 16:45:20 kmc: Oh, maybe I was just reading the export list wrong. When it says "Map" it doesn't actually export the constructors. It would have to say "Map (..)" right? 16:45:22 no, it's a Parser 16:45:27 a function has "->" in its type 16:45:32 and can be applied 16:45:36 roostaj: right 16:45:38 --- join: Zeiris (n=Zeiris@d207-216-71-36.bchsia.telus.net) joined #haskell 16:45:47 unless Parser here is a type synonym for a function, but i don't believe it is, if you're using Parsec 16:45:47 yitz: kmc: thanks! 16:45:56 roostaj, yes 16:45:58 or Map(Tip) 16:45:59 > let Just x = undefined x 16:46:00 not an expression: `let Just x = undefined x' 16:46:00 kmc: it's a top level definition, that's what I was getting at 16:46:07 > Just x = undefined x 16:46:08 mreh, okay 16:46:08 : parse error on input `=' 16:46:11 so what's the special part about it? 16:46:22 the <|> is to the left of the = 16:46:31 can't you do that in "let" as well? 16:47:14 kmc: really? 16:47:44 --- part: altmattr left #haskell 16:47:57 i'll have to try that out 16:48:00 i'm not sure, did you try? 16:48:34 --- quit: gonsor (Read error: 54 (Connection reset by peer)) 16:48:41 i think the requirement is that the next line starts indented from the first one 16:48:42 --- quit: jinjing () 16:48:45 the layout rule doesn't care where the '=' is 16:49:01 the only tokens it cares about are let, where, do, of, {, and module 16:49:12 if two lines are indented equally they get a ; between them 16:49:20 if the second one is indented more, it continues the one above 16:49:21 --- join: gonsor (n=quassel@kel30.kel.stud.uni-goettingen.de) joined #haskell 16:49:29 if it,s indented less, it closes the block and so gets a } prepended to it 16:49:50 --- quit: profmakx (Read error: 60 (Operation timed out)) 16:49:54 --- join: profmakx (n=profmakx@moore.morphism.de) joined #haskell 16:49:58 --- quit: Zeiris (Read error: 104 (Connection reset by peer)) 16:50:20 --- join: Zeiris (n=Zeiris@d207-216-71-36.bchsia.telus.net) joined #haskell 16:50:22 --- nick: profmakx -> Guest74841 16:51:00 mreh: it's not the equal sign that matters, it's the first character of what starts the declaration (the function name) 16:51:09 does "do" have precedence then? 16:51:51 which do are you referring to? 16:52:01 presumably do-notation 16:52:08 in your examples I mean 16:52:20 do-noation 16:52:54 take precedence in what sense? 16:53:13 --- quit: yitz () 16:53:32 --- quit: carlocci ("eventually IE will rot and die") 16:53:46 --- quit: dschoepe (Read error: 113 (No route to host)) 16:53:54 01:53 *** carlocci QUIT "eventually IE will rot and die" 16:54:01 isn't that a cheerful quit message 16:54:16 i think it expresses the hopes of web developers everywhere 16:54:33 it sure does 16:54:54 me i couldnt care less about OS politics, but man do web devs ever hate IE for a reason 16:55:40 IE can stay around as long as they want, so long as they at least try to render things correctly 16:56:08 tensorpudding clearly hasn't tried writing a modern website with IE6 support 16:56:31 and conform to web standards, rather than make conflicting ones 16:56:32 IE6 is the devil. 16:56:54 --- quit: cognominal (Read error: 60 (Operation timed out)) 16:57:29 is there a parsec "command" to ignore whitespace? 16:57:30 how to see the doc or function source inside ghci? 16:58:04 --- join: reprore_ (n=reprore@ntkngw356150.kngw.nt.ftth.ppp.infoweb.ne.jp) joined #haskell 16:58:16 yes, that is what i meant, is adhering to standards 16:58:22 littering whole sections of code with `many (char ' ')` doesn't appeal 16:58:28 --- join: rdd`` (n=rdd@c83-250-152-128.bredband.comhem.se) joined #haskell 16:58:34 mreh: i think "spaces"? 16:58:36 mreh, make a name for it then 16:58:40 :t spaces 16:58:41 Not in scope: `spaces' 16:58:43 jhnx: ghci doesn't have that feature 16:58:53 --- join: hgolden (n=hgolden@cpe-76-95-167-216.socal.res.rr.com) joined #haskell 16:58:53 @hoogle spaces 16:58:53 Text.Parsec.Char spaces :: Stream s m Char => ParsecT s u m () 16:58:54 Text.ParserCombinators.Parsec.Char spaces :: Stream s m Char => ParsecT s u m () 16:58:54 Text.ParserCombinators.ReadP skipSpaces :: ReadP () 16:58:54 --- quit: eu-prleu-peupeu (Read error: 104 (Connection reset by peer)) 16:58:55 --- join: eu-prleu-peupeu1 (n=Hugo_Gom@81.193.61.91) joined #haskell 16:59:05 ooh 16:59:05 jhnx, i have this website on hotkey: 16:59:06 http://www.haskell.org/ghc/docs/6.10-latest/html/libraries/ 16:59:15 s u m ()! what does that spell? 16:59:29 tensorpudding: stream userstate monad return type 16:59:39 sum unit 16:59:44 as in, "that's sum unit you got there" 16:59:48 lol 16:59:53 said the actress to the bishop 16:59:59 hahaha 16:59:59 you should probably be "tokenizing" to remove spaces before parsing 17:00:00 eh people throw around standards as the same old OS politics. problem is when IE did implement a standard but broken 17:00:17 "you're cute! are you a singleton?" 17:00:19 it's gotten better, it's just the slow JS engine now 17:00:29 --- join: Guest48051 (n=Khisanth@pool-151-204-135-88.ny325.east.verizon.net) joined #haskell 17:00:38 --- quit: jfischoff ("Leaving") 17:01:44 so IE still has a large market share 17:01:58 --- quit: jfischof (Read error: 110 (Connection timed out)) 17:02:01 IE6 is the big problem 17:02:11 IE after 6 is a substandard browser but isn't holding up the future in a big way 17:02:29 --- join: dpratt711 (n=dpratt71@72.95.107.120) joined #haskell 17:02:33 but IE6 is mostly extinct 17:02:37 yeah. IE7 and 8 are at least acceptable. 6 requires a huge amount of testing and bad hacks to work around 17:02:44 and IE6 is *not* mostly extinct 17:02:47 tensorpudding: IE6 is as alive as IE7 according to recent statistics 17:02:51 it's heavily used in coroporate environments 17:02:54 at this point it's totally acceptable to give IE6 users an inferior experience 17:03:04 the kind that commercial products often are requird to support. 17:03:06 IE7 is default in Vista and 7 isn't it? 17:03:11 IE6 is all over the place with most corporate desktops 17:03:22 win7 comes with ie8 17:03:26 okay 17:03:27 --- join: AirCastle (i=inhahe@adsl-074-186-083-219.sip.mia.bellsouth.net) joined #haskell 17:03:27 Vista and 7 aren't common in corporate environments. 17:03:36 --- quit: tommd ("Leaving.") 17:03:57 7 is all shiny though 17:04:03 don't they like shiny? 17:04:10 7 is not too bad. 17:04:11 corporate policy forbids shiny. :) 17:04:30 aero looks a lot more grown up than the fisher-price luna theme 17:04:30 Shiny is irrelevant if your software doesn't work on it. 17:04:56 --- join: fishey1 (n=Cody@ool-4573344b.dyn.optonline.net) joined #haskell 17:04:57 more specifically, lots of corporations use badly-written web apps that don't work on version of IE other than 6. Often involving ActiveX, too 17:05:08 *shudder* 17:05:10 that was some rather poor planning 17:05:27 microsoft should have stopped supporting XP 17:05:42 yeah they should have told all their customers to piss up a rope 17:05:44 didn't they almost do that, but uproar? 17:05:46 cuz that's how you do business 17:06:02 c_wraith: other corps have moved on to supporting multiple web browsers, but only those created in certain phases of the moons and with the right incantations muttered over before it was kicked out the door 17:06:03 they have to stop supporting an OS sometime 17:06:10 they have an eol schedule 17:06:32 Also, IE6 on XP service pack 3 uses the IE 7 javascript engine... Which isn't compatible with the IE6 dom model, exactly. 17:06:32 --- quit: augur (Read error: 110 (Connection timed out)) 17:06:34 do they still support 2000? 17:06:34 they just extended it for xp due to demand 17:06:36 *moon even 17:06:36 nope 17:07:00 Which results in IE6 on XP SP3 having strange bugs that no other browser does 17:07:02 --- quit: colors (Read error: 60 (Operation timed out)) 17:07:10 win2k is in extended support 17:07:17 it will be eol'd entirely june this year 17:07:38 --- quit: welterde (Read error: 60 (Operation timed out)) 17:07:58 --- quit: DarthShrine () 17:08:02 how could I concatenate the result of "many p" if p :: [a]? 17:08:09 liftM? 17:08:14 there are still a lot of installations of NT4. plenty of third party support for it i bet 17:08:24 --- quit: medfly ("Leaving") 17:08:35 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 17:08:36 :t liftM 17:08:37 forall a1 r (m :: * -> *). (Monad m) => (a1 -> r) -> m a1 -> m r 17:08:42 mreh: liftM many p 17:08:54 mreh: liftM concat (many p) 17:08:55 I mean 17:09:10 --- quit: medfly (Client Quit) 17:09:21 --- join: medfly (n=lio@IGLD-84-228-215-183.inter.net.il) joined #haskell 17:09:22 --- quit: medfly (Client Quit) 17:09:29 :t liftM concat 17:09:30 forall a (m :: * -> *). (Monad m) => m [[a]] -> m [a] 17:09:32 wait, no, I need to learn to think before I type. 17:09:50 :t (concat <$>) 17:09:50 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 17:09:51 forall a (f :: * -> *). (Functor f) => f [[a]] -> f [a] 17:10:00 :t fmap concat 17:10:01 forall a (f :: * -> *). (Functor f) => f [[a]] -> f [a] 17:10:11 liftM for lists is just plain ol map 17:10:39 the functor here is Parser 17:10:56 --- quit: nvoorhies (Read error: 104 (Connection reset by peer)) 17:11:15 --- quit: reprore_ (Remote closed the connection) 17:11:16 --- join: [1]Beetny (n=Beetny@ppp121-45-54-127.lns20.adl2.internode.on.net) joined #haskell 17:11:33 --- quit: Beetny (Read error: 113 (No route to host)) 17:11:34 --- quit: dolio (Read error: 104 (Connection reset by peer)) 17:12:20 --- nick: wto_ -> wto 17:13:00 btw what's the can't talk thingy in topic 17:13:20 there was a flood of spam bots 17:13:24 so they set +R 17:13:30 ok 17:13:30 meaning you need to be registered to talk 17:13:37 or maybe it's +r 17:14:08 that flood was crazy 17:14:30 it was a clever hack 17:14:58 --- join: dolio (n=quassel@nr22-66-161-253-48.fuse.net) joined #haskell 17:15:01 --- quit: hrehf ("bfg") 17:15:02 how did they do it? the jpg link trick was sneaky, then I was automatically k-lined 17:15:04 is that the viral click attack? 17:15:16 --- quit: rdd` (Connection timed out) 17:15:19 that was awful cute 17:15:47 "cute"? :) 17:15:48 mreh exploit code: http://pastebay.com/83116 17:16:05 I don't want to click on that 17:16:06 I find noscript to be a pretty awesome counter. 17:16:17 --- join: nohluhtC (n=yogsotho@pool-71-163-68-184.washdc.east.verizon.net) joined #haskell 17:16:24 mreh hehe, it's safe. 17:16:29 --- join: tommd (n=Thomas_D@64.122.192.43) joined #haskell 17:16:30 mreh: I testify it is just pastebin showing source code. 17:16:44 not sure how normal js evaluation would allow it to work either 17:16:45 syntax highlight too 17:16:56 since it sounds like csrf 17:17:03 sproingie that paste shows how it works 17:17:09 --- join: tibbe (n=tibell@145-135.79-83.cust.bluewin.ch) joined #haskell 17:17:16 what's with all the unescapes? 17:17:22 --- join: deteego (i=6e20f4ba@gateway/web/freenode/x-pztiwccpyztmgxcz) joined #haskell 17:17:22 --- join: welterde (i=welterde@not.welterde.de) joined #haskell 17:17:22 obfuscation 17:17:39 what was the target of the attack> 17:17:42 --- quit: tibbe (Client Quit) 17:17:46 any room? 17:17:48 hey I just wanted to ask, are the compiler projects LHC and JHC for haskell 17:17:50 considered dead? 17:18:01 I don't think they're dead. 17:18:33 it has freenode as the form destination, but auto-submitting it should be seen as a XSS attack 17:18:46 ah well, browser security, ever an oxymoron 17:19:20 --- quit: Guest48051 (Client Quit) 17:19:23 What is XSS? 17:19:26 --- join: Khisanth (n=Khisanth@pool-151-204-135-88.ny325.east.verizon.net) joined #haskell 17:19:27 --- quit: arthurL ("Leaving") 17:19:29 cross site scripting 17:19:36 Ah. 17:19:49 im just wondering since they havent had commits for quite some time 17:20:02 --- quit: fishey (Connection timed out) 17:20:30 it's not exactly cross site, all the code that operates on the page comes from that page (granted, it calls outside, but that's another matter) 17:20:48 --- quit: MoALTz ("Leaving") 17:21:29 --- join: MoALTz (n=heh@92.8.11.157) joined #haskell 17:21:30 if only GHC handled laziness better for optimizations... 17:21:49 --- quit: medfly ("Leaving") 17:22:00 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 17:22:17 is there a package that implements binary trees? 17:22:45 xerox: right but it submits to a third party. i guess that attack's been around before xss, i just dont know what to call it 17:22:49 sshc_: Data.Sequence is a good choice, probably. 17:22:50 variant of csrf i guess 17:23:05 sshc_, binary trees for what purpose? 17:23:05 sshc_: It's actually a 2-3 Finger tree, but it has similar performance constraints 17:23:08 --- quit: kwos ("Computer has gone to sleep") 17:23:18 do you want the semantics of a tree, or do you want to use them as a map or something? 17:23:29 there is Data.Tree 17:23:32 --- quit: miclorb (Remote closed the connection) 17:23:38 if you dont care about efficiency you can easily make your own 17:23:41 or use Data.Tree 17:23:49 --- quit: medfly (Client Quit) 17:23:50 deteego: I care about effeciency 17:23:51 not all trees are maps, not all are even in BST order 17:23:55 BSP 17:24:04 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 17:24:07 well Data.Tree is your best bet 17:24:10 since it is optimized 17:24:23 deteego: does Data.Tree implement *binary* trees? 17:24:43 its multi way trees (aka forests) 17:24:52 then I won't use that 17:24:55 data.tree can represent a binary tree 17:25:22 aavogt: yes, but can it do it effeciently? 17:25:28 --- quit: medfly (Client Quit) 17:25:37 --- join: medfly (n=lio@unaffiliated/medfly) joined #haskell 17:25:37 sshc_: Why not write the one line needed to define binary trees yourself? 17:25:41 can I Parse something as a repeated structure in one pass with Parsec 17:25:42 aavogt: if I know I'm only working with binary trees, wouldn't I be better off using one specificly written for that purpose? 17:26:17 yeah you can easily define binary tree as a data structure in a single line 17:26:18 what is a repeated structure? like many parseMyStuff ? 17:26:30 as long as you dont use laziness it should be fine (efficiency wise) 17:26:44 there's probably more indirection when the data structure is used such that each node has two children, but can allow lots more 17:26:59 monochrom, a symbol that indicates the last element in a list of symbols sould be repeated 17:27:10 should I worry about the binary tree being balanced? 17:27:17 I'm working with BSP 17:27:20 generally yes 17:27:27 deteego: what is this optimization present in Data.Tree? 17:27:27 --- join: mtnviewmark (n=markl@m208-18.dsl.rawbw.com) joined #haskell 17:27:31 depends on what you are using the trees for 17:27:35 --- join: scrie (n=user@113.106.205.8) joined #haskell 17:27:37 deteego: BSP 17:27:37 sshc_: depends 17:27:57 well I assume stuff like IO.Array might be used 17:27:59 or whatnot 17:28:02 sshc_: can you balance BSP trees? 17:28:06 bsp tree will generally not be balanced 17:28:08 mreh: Does it mean an example input string is "0.3*" and humans think of it as 0.3333... ? 17:28:16 if it is it probably wasn't that interesting a space 17:28:24 actually scratch that 17:28:29 augustss: doesn't make sense 17:28:35 its just a basic tree implementation 17:28:36 mononchrom: or as simple as [1,2,3,*,4] = [1,2,3,3,4] 17:28:37 so I guess not 17:28:38 looking at the source 17:28:42 --- join: scrie` (n=user@113.106.205.8) joined #haskell 17:28:47 so Data.Tree wouldn't be any more efficient 17:28:47 --- quit: Quadresce` (Nick collision from services.) 17:29:10 most stuff in Data tends to be optimized (if possible) 17:29:16 it's probably easy to write my own, but, are there any packages at all that implement binary trees? 17:29:17 sshc_: just roll your own 17:29:48 --- quit: JayM (Excess Flood) 17:29:56 augustss: alright. What should I worry about effenciic-wise? 17:29:57 If there is a package providing a binary tree, what you end up using is just one line of it, namely data F = X | Y F F 17:30:00 its such a simple thing that a package for it wouldn' 17:30:02 besides strict binary trees 17:30:04 its such a simple thing that a package for it wouldn't be needed 17:30:18 sshc_: strictness is not necessarily a good thing 17:30:20 deteego: I wouldn't quite say that and anyways "optimized" doesn't mean "uses low-level hacks and craziness" 17:30:21 the package would be like 3 lines long -_- 17:30:31 sshc_: don't worry about efficiency. profile 17:30:34 Nor does it mean "avoids laziness" 17:30:37 --- join: JayM (n=jay@cpe-76-186-94-148.tx.res.rr.com) joined #haskell 17:30:38 ddarius: of course not 17:30:50 but using stuff like Arrays instead of lists is faster for example 17:30:54 --- quit: JayM (Excess Flood) 17:30:58 --- quit: conal () 17:31:04 there could be a lot of general purpose trees that operate on binary trees 17:31:09 s/trees/functions/ 17:31:10 deteego: Not necessarily. 17:31:22 well yeah depends how its used 17:31:26 out of curiosity, does a package exist? 17:31:41 Perhaps you should just look for a BSP package directly. 17:31:41 I will probably write my own, but I still would like to know if one exists 17:31:43 --- join: JayM (n=jay@cpe-76-186-94-148.tx.res.rr.com) joined #haskell 17:31:47 --- quit: JayM (Excess Flood) 17:32:13 monochrom: google isn't revealing any bniray tree or BSP packages 17:32:15 sshc_: Most operations on trees (binary or rose) are trivial. 17:32:17 --- quit: Cthulhon (Read error: 110 (Connection timed out)) 17:32:35 --- join: JayM (n=jay@cpe-76-186-94-148.tx.res.rr.com) joined #haskell 17:32:36 --- quit: JayM (Excess Flood) 17:32:47 there are a number of packages for specialized trees like fingertrees. binary trees, i don't know 17:32:54 I think we just owe you a straight answer to your straight question. No there isn't a binary tree library. 17:32:56 I just searched through hayoo 17:33:02 there's plenty of generics dealing with them, like Foldable 17:33:02 only found Data.Tree 17:33:05 --- quit: kloeri (Remote closed the connection) 17:33:11 which is the generic foldable tree 17:33:17 --- quit: nniro (Read error: 104 (Connection reset by peer)) 17:33:24 yeah there's a lot written to support it. i'd use it 17:33:25 --- join: JayM (n=jay@cpe-76-186-94-148.tx.res.rr.com) joined #haskell 17:33:26 --- join: altmattr (n=altmattr@124-168-167-241.dyn.iinet.net.au) joined #haskell 17:33:26 --- quit: JayM (Excess Flood) 17:33:30 --- join: nniro (n=nniro@unaffiliated/nniro) joined #haskell 17:33:34 Actually, Data.Foldable doesn't provide the fold that you probably would want to write 17:33:54 sproingie: you'd use Data.Tree for binary trees instead of rolling your own? 17:34:05 With something like data Tree a = Tip | Branch a (Tree a) (Tree a) 17:34:15 --- join: JayM (n=jay@cpe-76-186-94-148.tx.res.rr.com) joined #haskell 17:34:16 --- quit: JayM (Excess Flood) 17:34:22 i tend to not need binary trees 17:34:24 --- join: pancho88 (n=pancho@pedo.quebradadehumahuaca.gov.ar) joined #haskell 17:34:37 --- join: jjann_ (n=jan@f053087170.adsl.alicedsl.de) joined #haskell 17:34:37 You'll want to write foldTree t b = f where f Tip = t; f (Branch x l r) = b x (f l) (f r) 17:34:41 --- join: m-i-l-a-1 (n=milan@port-92-204-69-90.dynamic.qsc.de) joined #haskell 17:34:43 i suppose if i do more graphics work i'll have to deal with bsp's or more likely octrees 17:34:51 sproingie: if you did, would you? 17:35:03 --- quit: scrie (Read error: 60 (Operation timed out)) 17:35:10 and then many operations on binary trees are simple from there 17:35:19 I probably would right my own library instead of using data.tree 17:35:32 i'd hope to god there was an octree implementation already out there 17:35:39 especially if you are doing it for graphics (and have certain operations that go through the tree) 17:35:46 actually my current game would probably only have to deal with quadtrees 17:35:53 --- join: JayM (n=jay@cpe-76-186-94-148.tx.res.rr.com) joined #haskell 17:36:01 --- quit: JayM (Excess Flood) 17:36:23 out of curiosity 17:36:30 --- join: uahaf (n=bznggra@so-12536-x0.essex.ac.uk) joined #haskell 17:36:30 --- join: tisrtsmbno (n=xvgxebpl@so-12536-x0.essex.ac.uk) joined #haskell 17:36:30 --- join: acepvbykvi (n=mldwtgqe@so-12536-x0.essex.ac.uk) joined #haskell 17:36:31 --- join: harold (n=419king@pool-71-188-31-6.cmdnnj.east.verizon.net) joined #haskell 17:36:32 inorder t = foldTree id (\x l r -> l . (x:) . r) t [] 17:36:33 --- quit: inimino (Excess Flood) 17:36:33 --- quit: djinni (Excess Flood) 17:36:34 --- join: azaxyqd (n=owzaqxwk@so-12536-x0.essex.ac.uk) joined #haskell 17:36:34 --- join: anuxmm (n=osdpsenl@so-12536-x0.essex.ac.uk) joined #haskell 17:36:34 --- join: zlfhivfhoeoc (n=dwwmfqys@so-12536-x0.essex.ac.uk) joined #haskell 17:36:34 --- join: ksvhpdlorde (n=ezk@so-12536-x0.essex.ac.uk) joined #haskell 17:36:34 --- join: qoshtayvqx (n=rpnkzqmt@so-12536-x0.essex.ac.uk) joined #haskell 17:36:34 --- quit: And[y] (Excess Flood) 17:36:34 --- quit: snhmib (Excess Flood) 17:36:34 --- quit: vpetro (Excess Flood) 17:36:34 --- quit: Exteris (Excess Flood) 17:36:34 --- quit: jones- (Excess Flood) 17:36:34 --- quit: THC4k (Excess Flood) 17:36:34 --- quit: caligula_ (Excess Flood) 17:36:34 --- quit: mansour (Excess Flood) 17:36:34 --- quit: desu (Excess Flood) 17:36:34 --- quit: aavogt (Excess Flood) 17:36:35 --- quit: anji (Excess Flood) 17:36:35 --- quit: OnionKnight (Excess Flood) 17:36:35 --- quit: burp (Excess Flood) 17:36:35 --- join: cqwqpiawlcmd (n=cokwkoqd@so-12536-x0.essex.ac.uk) joined #haskell 17:36:35 --- quit: tromp__ (Excess Flood) 17:36:35 --- join: whanwq (n=pvwopnad@so-12536-x0.essex.ac.uk) joined #haskell 17:36:35 --- quit: jmcarthur (Excess Flood) 17:36:35 --- join: czwylbkpqy (n=zwkkf@so-12536-x0.essex.ac.uk) joined #haskell 17:36:35 --- quit: Raku^ (Excess Flood) 17:36:35 --- quit: aep (Excess Flood) 17:36:35 --- quit: taruti (Excess Flood) 17:36:35 --- join: tnwqlqmye (n=ieggsgwp@so-12536-x0.essex.ac.uk) joined #haskell 17:36:35 --- quit: [1]Beetny (Excess Flood) 17:36:35 --- quit: sebbe1991 (Excess Flood) 17:36:35 --- quit: pastah_rhymez (Excess Flood) 17:36:35 --- quit: wolverian (Excess Flood) 17:36:35 --- quit: thetallguy1 (Excess Flood) 17:36:39 --- quit: kpreid (Excess Flood) 17:36:44 --- log: started haskell/10.01.16 17:36:44 --- join: clog (n=nef@bespin.org) joined #haskell 17:36:44 --- topic: '["msg an op if you can't talk", "hackage torrent @ http://bit.ly/7ObzIP ","Haskell 2010 is out: http://hackage.haskell.org/trac/haskell-prime/wiki#Status", "Haskell News: http://reddit.com/r/haskell", "The Haskell programming language", "http://haskell.org", "Paste: http://hpaste.org", "Logs: http://tunes.org/~nef/logs/haskell/"]' 17:36:44 --- topic: set by Heffalump on [Sat Jan 16 09:47:10 2010] 17:36:44 --- names: list (clog caligula_ OnionKnight anji tavelram faprhn bhclssua ypwgodgehx whanwq tnwqlqmye cqwqpiawlcmd czwylbkpqy azaxyqd qoshtayvqx ksvhpdlorde zlfhivfhoeoc anuxmm harold uahaf acepvbykvi tisrtsmbno m-i-l-a-1 jjann_ pancho88 nniro altmattr scrie` mtnviewmark medfly MoALTz Khisanth deteego welterde nohluhtC dolio AirCastle eu-prleu-peupeu1 hgolden rdd`` Zeiris Guest74841 gonsor bens_ jhnx amz IceDane roostaj erikc meanburrito920_ bbe lzgz) 17:36:44 --- names: list (theorbtwo leandrom maskd Artalizian kquick2 Pthing gbacon cytzol jjann abbe Rayne det saccade_ sjanssen_ C-S jtootf genneth michael| roconnor NNshag c_wraith Mortomes NEEDMOAR wto comak domor snorble dobblego kisvoros path[l] Colours lostman m_W bremner M| yyz AnMaster Raynes s76_ kmc hatds Rotaerk augustss dufflebunk mreh wisemanby coyo Badger zax sshc_ alvarezp Jacolyte chrisf @monochrom sahazel dibblego Feuerbach zakwilson dju Shimei) 17:36:44 --- names: list (pham nwf jbauman dax emma stoop jethomas uman SubStack SimonRC AndyP zaarg jfoutz xinming tensorpudding elspru ksf sioraiocht Flarelocke1 mattrepl Adamant smorg mauke tomh- Rixi Quadrescence lpsmith naten Modius mreggen amiri silver__ ville Dessous Sup3rkiddo Nomad010 pemryan ttmrichter bgs100 boscop EEEuler pwerken drhodes kevinclark uorygl Tomas cobol000_ ketil dfdf ibid BCoppens aiko_ potatishandlarn PsiOmega Guest96239 jayne eagletmt) 17:36:44 --- names: list (Axman6 dnm_ _Jedai_ gogonkt_ master_of_master mrothe kadoban mahogny ts33kr Saizan hackagebot blackdog Aldwuin gnuvince danly__ jonafan SamB_XP avenge bwr noteventime otto_s_ TacticalGrace absentia_ boxxy__ BMeph merehap polk330 evio Paradox924X fihi09 kw317 mornfall Nereid Cale kynky jix Raevel kaol sproingie ksandstr ido dionoea shawn shapr Dashkal saccade willb ve Innominate syntaxglitch PHO_ prb reltuk G0SUB jimmyjazz14 mikste baaba) 17:36:44 --- names: list (idnar juhp Taggnostr ingy @dcoutts mjv gdsx Boney BurgessShale TR2N Bassetts tew88_ kwinz eelco KatrinaTheLamia drwhat skeptomai|awa- kosmikus emouse tamiko dreixel drwho Draconx|Laptop nimred tarbo eyck mjrosenb orbitz j4cbo Blub\0 lenbust_ ajklfjadsf skeptomai|away dcoutts_ bobby_bigloaf DrSyzygy_ Valodim fabjan majoh eno ertai mercury^ Bleadof BrianHV jvoorhis wang mrd mml` nazgjunk quicksilver rapacity BONUS shachaf saiam dilinger) 17:36:44 --- names: list (dixie lavish nornagon icee daed wormwood peddie joga karld ahf MadX` mdordal2 wdonnelly wagle _stenobot epokal Milo- cathper byorgey poucet kalven blazzy erg Jaak zacharyp gniourf_gniourf_ sohum mle mfoemmel edwtjo koeien benmachine etpace smg ystael Ke newsham lanaer dwon_ nasloc__ cp2 anee Aisling Twey Apocalisp jrockway aemp1rei jystic Vanadium webframp J-Mad \toothrot mwc LeoD joe1 thoughtpolice hiredman otulp QtPlatypus Vulpyne_) 17:36:44 --- names: list (jorizma Nafai Jiten awarrington jvogel houeland timlarson netcat olsner bran hopthris1 agemo_ dino- greap kolmodin_ inclement encryptio whoppix rndm_ gbeshers_ geir_ joed yahooooo lhnz nablaa smiler davidL dfeuer_ Deewiant Dodek ath Megant inhortte Draconx Laney jfredett Veinor DekuNut p_l integral jaredj mlh ClaudiusMaximus oeblink kar-1 djahandarie dons aleator_ LeNsTR|Sleep StarFire mux edwinb Ornedan evilhackerdude Igloo theclaw jleedev) 17:36:44 --- names: list (qm13 @Heffalump cizra OscarZ boyscared +Berengal gwern alip Ytinasni dogmaT phnglui leimy franksh MacCoaster jan_ crem pardus aledge +ddarius Gabbie qz @ChanServ Alpounet drbean Cronecker Carnegie keseldude jre2_ noddy shortcir1uit hellige_ koala_man brx luite_ samulihs_ trez prigaux thingwath niksnut voker57 mm_freak geoaxis elly Twigathy diginux BONUS_ Gilly impl stroan ray eek liesen osfameron epmf magicman joni6128 lunabot dcolish) 17:36:44 --- names: list (tkr sbok _br_ jayrk khiroc fritschy arr2 int_e anders^^ kakeman ToRA matthew-_ mog Gracenotes deadguys_ sgf Liskni_si sieni_ Arnar pettter pikhq skaar ski qeb`away dumael mattam ziman t endojelly McManiaC SmurfOR m-i-l-a-n allbery_b __marius1_ jlaire soeren deavid jgrimes Stephan202 glith flux nothingmuch suiside companion_cube ezeike Eelis helmut ps-auxw jontore bbee ahihi Kyrus zsol srcerer preflex Zao mk64ftw opqdonut orbekk Ferdirand) 17:36:44 --- names: list (arjanoosting dqd @Lemmih canvon_ FauxFaux jtra tilman shepheb periodic jdavis Sisu Zr40 tredontho bd_ yottis Vq Astro mietek noj tmug birkenfeld StoneToad glitch emias harlekin mmmdonuts flori alexbobp fnordus bburhans tltstc clarkb mun Baughn felipe_ nlogax pcc1 ehamberg mokus koninkje_away cjay Botje anekos lament TML mfp DigitalKiwi equanimity stu2010 Hunner jql jml lambdabot rey_ mee jlouis EvanCarroll _Jordan_ cods xerox saurik andrewsw-afk) 17:36:44 --- names: list (c9s Nanar) 17:36:44 --- join: djinni (n=djinni@li14-39.members.linode.com) joined #haskell 17:36:45 --- quit: OnionKnight (Excess Flood) 17:36:45 --- quit: caligula_ (Excess Flood) 17:36:45 --- quit: anji (Excess Flood) 17:36:46 --- quit: djinni (Excess Flood) 17:36:47 --- join: Polarina (n=polarina@wesnoth/translator/Polarina) joined #haskell 17:36:47 --- quit: birkenfeld (Excess Flood) 17:36:47 --- join: rpqzrwrdm (n=mxsr@78.147.75.157) joined #haskell 17:36:47 lovely 17:36:48 --- join: vpetro (n=vpetro@173-45-237-71.slicehost.net) joined #haskell 17:36:48 --- join: rbtuscywa (n=sdtxdomk@p579099B7.dip.t-dialin.net) joined #haskell 17:36:48 --- join: djinni (n=djinni@li14-39.members.linode.com) joined #haskell 17:37:00 --- quit: coyo (Excess Flood) 17:37:59 --- quit: pemryan (Excess Flood) 17:38:11 --- quit: BurgessShale (Excess Flood) 17:41:00 --- quit: Adamant (Excess Flood) 17:41:02 --- quit: mattrepl (Excess Flood) 17:41:45 --- quit: olsner (Remote closed the connection) 17:45:43 --- quit: m-i-l-a-n (Success) 17:50:41 --- quit: rdd`` (Remote closed the connection) 18:12:51 --- quit: Khisanth (Read error: 60 (Operation timed out)) 18:20:04 --- quit: Alpounet (Read error: 104 (Connection reset by peer)) 18:36:19 --- quit: NNshag (Client Quit) 18:43:05 --- quit: pikhq (Read error: 54 (Connection reset by peer)) 19:22:48 --- quit: stoop ("Leaving") 19:24:40 --- quit: maskd (Nick collision from services.) 19:44:26 --- quit: bgs100 ("Leaving") 20:10:38 --- quit: m-i-l-a-1 (Read error: 110 (Connection timed out)) 20:14:37 --- quit: Dodek (Read error: 60 (Operation timed out)) 20:22:13 --- quit: boscop ("Gxis revido!") 22:36:44 --- nick: gogonkt_ -> gogonkt 23:09:10 --- quit: lanaer ("leaving") 23:59:59 --- log: ended haskell/10.01.16