00:00:00 --- log: started haskell/07.09.14 00:01:03 --- quit: coffeemug (Remote closed the connection) 00:01:18 huh you can't make it tell you which parser it errord in can you? 00:01:31 I don't think that would be possible. 00:01:59 you mean if it's stuck in an infinite loop? 00:02:05 @type Text.ParserCombinators.Parsec.() 00:02:10 Couldn't find qualified module. 00:02:11 When it says, Parse error:(line 1, column 10): 00:02:18 yes, you can 00:02:25 parsec has powerful error handling stuff 00:02:30 a little complex, but powerful :) 00:02:56 --- quit: ToRA (Read error: 110 (Connection timed out)) 00:03:12 --- join: dc__ (n=dc_@62-31-55-56.cable.ubr01.camd.blueyonder.co.uk) joined #haskell 00:05:30 @type (Text.ParserCombinators.Parsec.) 00:05:32 forall tok st a. Text.ParserCombinators.Parsec.Prim.GenParser tok st a -> String -> Text.ParserCombinators.Parsec.Prim.GenParser tok st a 00:05:44 --- quit: drice (Read error: 110 (Connection timed out)) 00:06:48 --- join: doserj (n=doserj@dewey.inf.ethz.ch) joined #haskell 00:07:24 can now tokenize :D 00:07:34 next to parse intro prolog AST 00:07:55 --- join: amiddelk (n=arie@melinda.cs.uu.nl) joined #haskell 00:11:14 --- quit: cognominal_ (Client Quit) 00:13:20 --- join: Tac-Tics (n=tactics@71.239.99.94) joined #haskell 00:17:41 --- quit: scodil ("Lost terminal") 00:17:53 --- quit: Pseudonym ("using sirc version 2.211+ssfe") 00:19:17 --- quit: glguy ("leaving") 00:20:07 --- quit: ChilliX () 00:24:31 --- join: njbartlett (n=njbartle@cpc2-barn4-0-0-cust110.brnt.cable.ntl.com) joined #haskell 00:25:18 --- quit: dc__ () 00:28:10 --- join: boegel (n=boegel@konijn.elis.UGent.be) joined #haskell 00:31:03 --- join: etnt (n=tobbe@84-55-124-2.customers.ownit.se) joined #haskell 00:35:31 --- join: iblechbot (n=iblechbo@ppp-62-216-197-89.dynamic.mnet-online.de) joined #haskell 00:36:09 --- quit: sjanssen ("Konversation terminated!") 00:36:22 --- join: Ben` (n=Ben@cpc2-hem12-0-0-cust201.lutn.cable.ntl.com) joined #haskell 00:37:05 --- join: ADEpt (n=ADEpt@jabber.hst.ru) joined #haskell 00:37:23 --- quit: Weremanatee () 00:39:57 --- join: IvdSangen (n=ivdsange@s55914d08.adsl.wanadoo.nl) joined #haskell 00:45:24 --- quit: RogerTaylor () 00:47:29 --- quit: fluctus (Read error: 110 (Connection timed out)) 00:47:29 --- join: triplah_ (n=tripped@ppp59-167-101-56.lns3.bne1.internode.on.net) joined #haskell 00:47:38 --- quit: qwwqe (Read error: 110 (Connection timed out)) 00:50:11 --- quit: ivo (Read error: 110 (Connection timed out)) 00:50:18 great, i have a lazy semantics checker, which does not check those types which are not used in a code later on ... what means there can be illegal definitions and I do not catch them :-) 00:50:29 how can I force a parameter of a function to evaluate? 00:50:59 checktypes te ve e = ... -- i would like that te and ve would be strict 00:51:35 @go bang patterns 00:51:38 http://hackage.haskell.org/trac/haskell-prime/wiki/BangPatterns 00:51:38 Title: BangPatterns - Haskell Prime - Trac 00:52:10 I've never used them, I'm not sure if they're actually in ghc yet 00:52:39 If they aren't, there's always seq, though figuring out how to use it is another matter 00:53:14 --- quit: Plareplane (Read error: 104 (Connection reset by peer)) 00:55:08 Though that won't actually help you make your semantics checker report any more errors unless you use _|_ 00:57:34 Mitar: I would be very surprised if bang patterns are the correct way to solve this problem 00:57:58 hmm 00:58:17 so when i am adding new defined types to type environment i check them 00:58:18 --- join: RogerTaylor (n=rogertay@58.186.58.197) joined #haskell 00:58:20 normally the 'type' of the whole program 00:58:29 implies that all the sub parts are typed 00:58:32 in some sense 00:58:34 but the problem is that if i never read this type from the environment it is never checked 00:59:09 you could see this as a disadvantage of the way you use 'error' instead of a proper representatio of failure 00:59:19 if you used a proper representation of failure you could write: 00:59:23 welltyped :: Program -> Bool 00:59:46 Mitar pasted "types" at http://hpaste.org/2741 01:00:07 yes, i do this :-) 01:00:28 but it finds it too early it is OK 01:00:39 for example, in my language this is not possible 01:00:57 as types have recursive loop 01:01:02 well the point is, if you represent errors explicitly 01:01:06 such as with an Either type 01:01:14 then 'welltyped' automaticlaly forces evaluation 01:01:19 since it checks for 'Right' everywhere 01:01:28 yes 01:01:30 i know .. 01:01:30 --- join: Plareplane (n=Plarepla@216-197-152-148.sktn.hsdb.sasknet.sk.ca) joined #haskell 01:01:33 any other way? 01:01:33 and you don't need to mess around with strictness anotations and bang patterns 01:01:47 i will have to mess much more with this ... 01:01:54 (i use error now everywhere) 01:01:59 --- join: Itkovian (n=Itkovian@dragnipur.elis.UGent.be) joined #haskell 01:02:08 and to check now for Either all around ... 01:02:21 and to change to do ... 01:02:34 then you have to write an ugly 'welltyped' which sprinkles 'seq' everywhere 01:02:39 to check for errors 01:03:21 i have to force stricknes only on environment variables 01:03:28 and on just one place 01:03:34 well you could check length t > 0 01:03:40 hmm 01:03:42 since your types are strings 01:03:51 that will force them not to be _|_ 01:04:08 the length of environment? 01:04:23 are bang patterns defined in ghc? 01:04:38 no, the length of the individual type strings 01:04:46 but then you can map that over the whole environment 01:04:54 hmm 01:05:05 what type does your environment have? 01:05:07 Map String String ? 01:05:18 --- quit: njbartlett () 01:05:26 --- join: Saul__ (n=Saul@10-15-ftth.onsnetstudenten.nl) joined #haskell 01:06:36 --- join: QplQyer (n=jeroen@state.ugent.be) joined #haskell 01:06:41 no, [(String,Type)] 01:06:56 where the type is data Type = TyNil | TyUnknown | TyVoid | TyInt | TyString | TyFunc [TypedVar] Type | TyArray Type | TyRecord [TypedVar] | TyVar TypeId 01:06:56 --- join: drrho (n=rho@chello213047112079.11.11.vie.surfer.at) joined #haskell 01:07:02 :-) 01:07:27 maybe i could use a quard for this :-) 01:08:01 typecheck te ve e | forceStrict te && forceStrict ve = ... 01:08:02 :-) 01:09:11 forceStrict = id . ($!) 01:09:11 ? 01:09:21 hm, no 01:09:26 doesn't really work like that 01:09:30 because && is lazy 01:09:46 EVERYTHING is lazy, remember that 01:09:51 :-) 01:10:03 and just using 'seq' on your te and ve will acheive nothing 01:10:12 all that proves is that the list exists 01:10:16 (the list of pairs) 01:10:26 this is why I really don't recommend bang patterns, or seq 01:10:51 I recommend thinking of a function which by executing it obviously requires the types. 01:11:10 (well actually I recommend using a proper error signalling and not abusing error ;P) 01:11:17 even strict things are lazy! Calling them "eager" is a calumny, they're only evaluating because the runtime is breathing down their necks, and they decide it's less hassle to just play along... 01:11:39 lol 01:12:12 you can use deepSeq or rnf if you like 01:12:16 * quicksilver shrugs 01:12:19 I despise them 01:12:22 ;) 01:12:42 ok, what would be the proper error handling? using either? but then I have to either use a monad and rewrite the code into a do notation or use Either and manually pass the error message higher if it comes 01:13:22 you don't have to use do notation to use a monad 01:13:38 > Right 4 >> Right "foo" 01:13:39 Add a type signature 01:13:47 > Right 4 >> Right "foo" :: Either String String 01:13:48 Right "foo" 01:13:55 > Left "oops" >> Right "foo" :: Either String String 01:13:57 Left "oops" 01:14:01 no 'do' in sight :) 01:14:30 --- join: igel (n=igel@brsg-4db2c402.pool.einsundeins.de) joined #haskell 01:15:19 "Right" and "Left" are *terrible" names for "OK" and "Error"... 01:15:21 --- join: int-e (n=noone@td9091a30.pool.terralink.de) joined #haskell 01:15:41 I don't think they're that terrible 01:15:47 but it would be more idiomatic to write 01:15:59 > throwError "oops" >> return "foo" :: Either String String 01:16:00 Right is the right answer. :) 01:16:00 Left "oops" 01:16:17 and Left is the, er, not-right answer? 01:16:43 Mitar: to use 'rnf' from Control.Parallel.Strategies you would, I think, have to derive NFData for your type 01:16:53 Maybe Either should be changed to the Picard monad instead of Maybe. 01:17:03 Picard? 01:17:24 data Picard a b = MakeItSo a | BelayThat b 01:17:29 lol 01:18:02 hah 01:18:31 but at least that indicates some sort of Yesness and Noness, rather than 2 alternatives (which is what Either says to me) 01:18:56 Well, Either is also used to be the sum of two types, so it's got kind of a dual role. 01:19:28 It just happens that the monadic interpretation of Either is error handling. 01:20:19 Be glad they didn't use the category theory (I think) names like Coq. :) 01:20:27 you could use it for nonlocal returns of a fixed type. errors are just a special case of that. 01:20:31 data Either a b = Inl a | Inr b 01:20:40 ChilliX++ # "This is GHC after all, it tries to gently nudge you in the right direction, but if you insist, it happily let's you drill arbitrarily large holes in your foot." 01:21:03 actually I think osfameron is right 01:21:08 I think that Either is a bit generic 01:21:20 and it would make sense to have another (isomorphic) type with better constructor names 01:21:27 but I also don't think it's all that important :) 01:21:29 Yeah, it might be better if there were Error in addition to ErrorT. 01:21:51 It is of course easy enough to define your own 01:21:55 and make it an instance of MonadError 01:24:09 Mitar pasted "Either?" at http://hpaste.org/2742 01:24:25 quicksilver, but even Either is not a solution 01:24:47 Mitar: different problem, I think 01:24:53 --- quit: Itkovian () 01:24:55 Mitar: cyclicity you're going to have to check for explicitly 01:25:03 no no 01:25:03 Mitar: that's different from being too lazy about type errors 01:25:08 i check it in the newenv 01:25:26 and the problem is that because typecheck te ve (IntLit _) = Right TyInt never consultes the te and ve 01:25:32 te' and ve' are never evaluated 01:25:33 --- join: Itkovian (n=Itkovian@dragnipur.elis.UGent.be) joined #haskell 01:26:02 Mitar: the newenv needs to be in the either monad in a similar way 01:26:30 Mitar: then you do (te',ve') <- newenv (te,ve) 01:26:43 Mitar: and that forces it to be right and not left 01:28:28 Using recent ghc snapshot: Is there a easy fix for Network/Socket.hsc:1901:9: Not in scope: `openeFd'? 01:28:54 Change it to "openFd"? 01:31:39 dolio: Sorry. That has been my type. It is openFd 01:31:49 But that seems to be no longer present ? 01:31:56 Oh. I'm out of ideas, then. :) 01:32:17 MarcWeber: you may have better luck on the #ghc channel 01:32:28 MarcWeber: but maybe it's just a broken snapshot. Happens sometimes. 01:34:06 --- join: KatieHuber (n=katie@203-97-111-120.cable.telstraclear.net) joined #haskell 01:34:59 --- part: ADEpt left #haskell 01:35:31 --- join: ADEpt (n=ADEpt@jabber.hst.ru) joined #haskell 01:35:38 MarcWeber: does this help? http://www.google.com/search?hl=en&q=openfd+site%3Ahaskell.org 01:35:39 Title: openfd site:haskell.org - Google Search 01:36:21 I had a similar problem. There's a discontinuity between the POSIX lib and the Network lib. 01:37:23 Thanks! 01:38:22 --- join: qwwqe (n=fluctus@unaffiliated/fluctus) joined #haskell 01:38:22 --- join: fluctus (n=fluctus@dhcp-0-50-f2-7c-be-b7.cpe.mountaincable.net) joined #haskell 01:39:56 --- join: roman (n=shkoder@ll-226.216.82.212.sovam.net.ua) joined #haskell 01:41:49 --- quit: fax () 01:43:25 --- quit: igel ("Leaving") 01:43:46 --- quit: Saul__ (Remote closed the connection) 01:44:14 --- quit: Pupeno (Read error: 110 (Connection timed out)) 01:47:54 --- join: mauke_ (n=mauke@d83-189-123-154.cust.tele2.de) joined #haskell 01:48:09 --- join: chris2 (n=chris@p5B16C1E8.dip0.t-ipconnect.de) joined #haskell 01:50:10 --- join: Rebooted (n=opera@88-104-185-170.dynamic.dsl.as9105.com) joined #haskell 01:50:15 --- quit: QplQyer ("*poef* *roekwolk*") 01:51:14 --- join: dv^1 (i=dv@gateway/tor/x-5507f6bf451e3424) joined #haskell 01:51:26 --- part: Rebooted left #haskell 01:52:53 --- join: b_jonas (n=b_jonas@dsl51B619BC.pool.t-online.hu) joined #haskell 01:53:02 --- quit: gip ("Leaving") 01:53:41 --- join: Qerub (n=qerub@kr-lun-120-155-233-83.3.cust.bredband2.com) joined #haskell 01:53:48 --- join: patrick_ (n=patrick@88-96-27-150.dsl.zen.co.uk) joined #haskell 01:54:29 Does Haskell have any nice syntax for Map literals? Something like { "foo" => 2, "bar" => 3 }? 01:54:31 --- join: ToRA (n=tora@colorado.doc.ic.ac.uk) joined #haskell 01:55:17 I think just 01:55:20 yourmap x = case x of { "foo" -> 2; "bar" -> 3; } 01:55:28 fromList [("foo", 3), ("bar", 7)] 01:56:27 (To answer very literally, Data.Map gets no special syntactical status.) 01:57:54 Qerub: if you want some special syntax, introduce your own operators (functions + fixity decs) 01:58:14 --- part: scook0_ left #haskell 01:58:14 Examples abound, e.g. HaskellDB 01:58:36 Alright! Thanks for the answer. 01:58:39 "=>" is reserved IIRC, but you could use "==>" 01:58:42 or something 01:58:57 (k,v) ==> m = Map.insert k v m 01:59:22 k ==> v = Map.singleton k v 01:59:24 ("foo",2) ==> ("bar",3) ==> empty 01:59:41 I was thinking: fromList ["foo" ==> 3, "bar" ==> 7] 01:59:51 but taruti's idea is nice too 01:59:52 (&) = Map.union 02:00:03 x ==> y = (x,y) 02:00:04 "foo" ==> 2 & "bar" ==> 3 02:00:18 go to town :-) 02:01:33 qerub: ah sorry I totally misunderstand your question. 02:03:17 --- join: seafoodX (n=sseefrie@alphad261.lnk.telstra.net) joined #haskell 02:04:08 --- join: dibblego (n=nobody@220-245-107-64.static.tpgi.com.au) joined #haskell 02:04:46 --- quit: mauke (Read error: 110 (Connection timed out)) 02:05:02 --- quit: dv^^ (Remote closed the connection) 02:05:17 --- join: tuxplorer (i=tuxplore@nat/yahoo/x-264e8c262e363ad0) joined #haskell 02:05:24 --- quit: patrick__ (Read error: 113 (No route to host)) 02:06:04 is there a function in haskell to strip a string of all mysql non-compatible characters and to avoid SQL injection? 02:06:43 that's certainly not really a question for haskell 02:06:49 it's something you'd hope to find in the SQL libs 02:07:19 which db lib are you losing? 02:07:57 --- nick: mauke_ -> mauke 02:08:19 doestn' look like HSQL does 02:08:56 --- join: mr_tenor (n=nick@c220-239-43-146.rivrw7.nsw.optusnet.com.au) joined #haskell 02:08:59 HDBC has a sane design using parameters 02:09:04 so you don't need 'escape' 02:09:11 or that's what cosmicray claims in the docs 02:10:04 I think HDBC is a bit more shiny than HSQL, overall 02:10:07 although I've used neither 02:10:48 --- join: cognominal_ (n=cognomin@62.210.200.99) joined #haskell 02:12:52 HSQL doesn't have parameters? 02:14:20 --- join: slipstream-- (n=irssi@ppp85-140-74-51.pppoe.mtu-net.ru) joined #haskell 02:14:32 osfameron: maybe it does, I didn't look hard enough 02:14:38 osfameron: it seems to be mostly String based though 02:14:44 @paste 02:14:44 Haskell pastebin: http://hpaste.org/new 02:15:24 either way, I don't think I could use a DB system that didn't support placeholders. It's more or less insane. 02:15:45 certainly insane if you have untrusted data 02:15:49 have you looked at haskellDB? 02:15:53 that's a much more interesting approach 02:16:06 not SQL based at all; has its own ADT representation of queries 02:16:12 nope I haven't. is that the queries-as-haskell-data approach ? 02:16:17 that's right 02:16:35 like DBIx::Class in concept, but arguably it's quite a bit easier to get it looking nice in haskell 02:16:51 with a type-system and custom operators and stuff 02:17:21 true. I can vaguely imagine some goodness coming out of that :-) Will play with it at "some point" 02:17:58 --- join: roconnor (n=roconnor@vhe-540354.sshn.net) joined #haskell 02:18:14 --- quit: enolan ("Leaving") 02:18:27 hi, i've 750M tab-delimited database which has to be read in order to populate sqlite3 database. here is python script (not mine) used to grok 10M file, but it cannot handle 750M. what are the prospects of haskell handle it with hdbc-sqlite, ie. can haskell's laziness do the job? 02:18:31 gour pasted "python script" at http://hpaste.org/2744 02:18:50 --- join: njbartlett (n=njbartle@194.42.125.16) joined #haskell 02:19:23 --- join: hkBst (n=hkBst@gentoo/developer/hkbst) joined #haskell 02:20:19 gour: should be fine. it will work line by line 02:20:33 gour: the weak link will be sqlite 02:20:37 (if there is a problem) 02:20:41 not the file import 02:20:50 quicksilver: why sqlite? 02:20:50 I have successfully applied haskell to analyzing 2GB ascii files - the end result was both faster and more readable than the equivalent perl script 02:21:06 olsner: good to know. thanks 02:21:13 gour: well I don't know about sqlite's performance characteristics when you instert 750M of data 02:21:20 gour: so I can't vouch for that 02:21:24 but getting it there required a few tricks... for example, going with ByteString from the start is a good idea 02:21:37 but I *do* know that line by line processing in haskell doesn't require memory 02:21:56 I also know that lazy IO is extremely evil and you should just call hGetLine :) 02:22:00 quicksilver: well, i don't need all the 'fields' from CSV database, so the sqlite3 database will be probably much smaller 02:24:20 --- quit: prb () 02:24:37 lol 02:25:06 quicksilver: I use HSQL-MySQL lib of haskell 02:25:07 --- quit: mrsolo (Connection timed out) 02:25:30 these days I rather use ruby instead of perl for text processing unless I need some perl module (like for xml) -- ruby is not that much slower and it's easier to write programs in 02:26:41 --- quit: RogerTaylor () 02:26:50 --- join: swiert (n=wss@sneezy.cs.nott.ac.uk) joined #haskell 02:26:55 I would argue that haskell is faster then ruby and even easier to write programs in :) 02:27:08 --- quit: c9s_ ("leaving") 02:27:10 I think that ruby is mostly a clean perl5 with batteries included. More useful modules in the core 02:27:12 ruby seems to be a poor middle ground: slower AND less powerful :) 02:27:16 b_jonas: I must play with ruby some time... but Moose is quite cute and gives you some of that goodness (but with CPAN) 02:27:31 It's not relaly clean, it just has dirt in different places than perl5 02:27:43 --- quit: slipstream (Read error: 110 (Connection timed out)) 02:27:43 but yes, the core libraries are indeed more useful 02:27:50 i have to prepare that sqlite3 database for use with another gui program which will be in haskell, so ruby & co. are not alternatives ;) 02:27:58 it's not less powerfool I think 02:28:08 the syntax of reference in Perl 5 is awful 02:28:21 well speaking of power in programming languages is always a bit woolly 02:28:28 since in a technical sense, they are all the same power 02:28:31 obviously 02:28:35 as for haskell, I guess that it must be fine but the learning curve is difficult 02:28:44 when I say 'ruby is less powerful than haskell' what I'm really talking about is abstraction 02:28:48 and expressivity of abstractions 02:29:00 oh, you mean less powerful than haskell 02:29:02 I can agree that 02:29:03 yes 02:29:07 I thought you compared to perl 02:29:10 no 02:29:14 like cognominal_ 02:29:16 sorry 02:29:18 the perl comparison was the 'slower' part 02:29:29 I've done measuremens about their speed 02:29:30 I was saying ruby is slower than perl, but less powerful than haskell :) 02:29:43 which makes it a poor middle ground IMO 02:29:46 it is cute though 02:29:53 and I have no objections to it on cuteness grounds 02:30:03 --- join: tommyd (n=tkeller@85.232.10.50) joined #haskell 02:30:22 that sentence could mean that ruby is slower than perl but faster than haskell and less powerful than haskell but more powerful than perl 02:30:46 I mostly use ruby as a perl replacement with ruby threads really 02:30:52 it doesn't cover much new ground after perl 02:31:10 go python 02:31:20 arf 02:31:25 Sometimes I wish I could say 'list.sort_by { rand } 02:31:31 Whoops, hit enter. 02:31:37 anyway, the result I've got is that ruby wasn't that much slower than perl as I've expected it to be 02:31:43 In Haskell, that is. But it's a small price to pay. :) 02:31:54 * roconnor wonders what units power is measured in. 02:32:02 dolio: I have an obfuscation in Perl that does shuffle with sort thru rand 02:32:10 (why, you could just have a specific shuffle function or something instead of sort_by) 02:32:18 haskell is young.. soon enough it will be 2x as fast 02:32:19 i'm sure 02:32:29 young? 02:32:30 cognominal_: worse, I have a benchmark meditation in perl that compares shuffles 02:32:40 okay. ghc is relatively new 02:32:50 compared to other compilers 02:32:58 b_jonas: Yeah, but shuffling requires a monad for random numbers in Haskell, so it feels comparatively heavyweight. 02:33:07 --- join: Sizur (n=eugene@89.132.150.41) joined #haskell 02:34:10 sub shuffle { map { @_=sort { int (3*rand)-1 } @_ } 0..5 } 02:34:42 Yikes. :) 02:35:34 --- join: twanvl_ (n=twanvl@ip5451f037.direct-adsl.nl) joined #haskell 02:35:53 So, 'int (3*rand)' is something in {0, 1, 2} ? 02:35:57 --- join: zx]treads (n=root@83.212.84.69) joined #haskell 02:36:08 yup 02:36:16 Lovely. :) 02:36:16 b_jonas: url? 02:37:02 You can't do that with every kind of sort function. Some don't like very much rand as a sort criteria 02:37:44 we use a fisher-yates shuffle function in perl 02:38:49 --- join: b_jonas_ (n=b_jonas@dsl51B6190D.pool.t-online.hu) joined #haskell 02:40:40 --- join: LeCamarade (n=revence@217.113.73.39) joined #haskell 02:41:37 dolio: http://www.perlmonks.com/?node_id=533396 is my benchmark of shuffles in perl, it has sory_by rand variants as well 02:41:47 Title: Benchmarking perfect shuffles 02:42:01 cognomial: yeah, that one is a famously wrong shuffle in perl 02:42:20 another one is sort { rand <=> rand } 02:42:53 apart from not giving uniform probability of outputs, these can also segfault older perls that assume the compare function is transitive 02:43:07 at least so I've heared, I've never actually seen the segfault 02:43:26 dolio: could you show me your obfu with sort though? I think it could be interesting 02:43:38 Eh? 02:43:39 It could complement something like my perlmonks.com/?node=fast+japh 02:43:51 'dolio: I have an obfuscation in Perl that does shuffle with sort thru rand' 02:43:55 that one 02:44:05 b_jonas, I see that you like pentominos. Have you seen my obfu that won the tpj contest in its category : solving pentominoes with regexen? 02:44:07 That was cognominal_ 02:44:17 Presumably, the one he posted. 02:44:57 oh sorry 02:45:07 'sub shuffle { map { @_=sort { int (3*rand)-1 } @_ } 0..5 }' 02:45:20 heu it's wrong 02:45:54 --- join: obsethryl (n=lab@unaffiliated/obsethryl) joined #haskell 02:46:19 I am very proud of the tpj writeup http://www.foo.be/docs/tpj/issues/vol3_3/tpj0303-0015.html 02:46:21 Title: The 3rd Annual Obfuscated Perl Contest Victors - The Perl Journal, Fall 1999 02:46:39 First Place. Stephane Payrard's Polyominos - fitting problem solver is very beautiful - eclipsed only by the entertaining reading available in the SOLUTION file. Perhaps it's fitting that such a powerful obfuscatory statement comes from the land that bred semiotics, deconstructionism and Jean-Paul Sartre. Or maybe Stephane is just demented. 02:46:39 I was just pining for the simplicity of 'list.sort_by { rand }' from Ruby, which is commonly used to shuffle (since people probably don't care whether it's perfect or not). 02:46:48 Um ... how do I turn a, say, Char to Integer? 02:46:59 What func? 02:47:08 read maybe? 02:47:13 ord? 02:47:32 That'll give you an Int that you can turn into an Integer easily enough. 02:47:34 fromEnum ? 02:47:49 Oh. How could I forget ord????????? 02:47:58 > (fromIntegral . fromEnum) 'b' 02:47:59 98 02:48:00 fromEnum would be direct, yeah. 02:48:08 :t fromEnum 02:48:10 forall a. (Enum a) => a -> Int 02:48:16 Oh, no it wouldn't. 02:48:36 is that the polymyno puzzle quine one? 02:48:43 I think ord and chr were added to make BASIC programmers feel at home with Haskell. 02:48:54 aaim pasted "Here's another one" at http://hpaste.org/2745 02:49:07 --- quit: njbartlett () 02:49:10 dolio: that one is perfect 02:49:19 :o) 02:49:46 int-e: pascal programmers 02:49:53 basic has ASC and CHR$ not "ord" 02:50:06 b_jonas: I dont know the polyomino quine but I don't read perlmonks much anymore 02:50:15 it's not on perlmonks I think 02:50:25 --- join: SamB_XP (n=Sam@216-15-104-38.c3-0.upd-ubr7.trpr-upd.pa.cable.rcn.com) joined #haskell 02:50:26 b_jonas_: but it's funnier with basic ;) 02:50:27 I think it might not even be in perl 02:50:38 aaim annotated "Look, it does what I want, and it's easy... but isn't this built-in somewhere?" with "(no title)" at http://hpaste.org/2718#a1 02:50:47 --- quit: b_jonas (Read error: 110 (Connection timed out)) 02:51:00 10 REM DON'T LAUGH AT BASIC, OK? 02:51:00 int-e: well, perl has lots of ugly syntax originating from other languages (including sh, tchs, sed, awk) 02:51:03 b_jonas_: Is it? It's been a while since I've used Ruby. 02:51:36 LeCamarade: I'd never. I'm too young to die. 02:51:43 dolio: yes, because sort_by uses the block to calculate keys (weights) for each element and sorts "by" comparing those weights 02:51:55 the element with lower weight gets to be the first 02:52:00 :o) 02:52:24 --- join: ejt (n=ejt@85-211-14-250.dyn.gotadsl.co.uk) joined #haskell 02:52:26 the ruby method "sort" is the one that accepts a comparision function like perl's sort or c++'s sort or c's qsort 02:53:44 LeCamarade: I don't. I laugh at visual basic and esp openofficeorg basic all the stupid new oo basics, but I like the non-oo ones like old zx spectrum basic, commodore basic, gwbasic, qbasic, word2basic, corelbasic etc 02:54:07 after all, basic has one of the funniest quines in existence 02:54:09 10 LIST 02:54:14 eeek, spectrum basic with its lack of functions etc. 02:54:24 As I recall Oleg has an argument that attaching random tags to elements and sorting doesn't result in a perfect shuffle... 02:54:33 I liked bbc basic, that was a real eye opener about the relative power of programming languages... 02:54:36 functions 02:54:39 who needs functions 02:54:45 --- join: c9s (n=c9s@61-223-103-147.dynamic.hinet.net) joined #haskell 02:54:46 gosub is enough 02:55:02 dolio: it depends what kind of tags you attach 02:55:30 the Cormen book discusses that algorithm (also F-Y shuffle) 02:55:53 --- join: RogerTaylor (n=rogertay@123.20.194.118) joined #haskell 02:56:09 if there are no equal tags and they are independent with the same distrubution then it's perfect 02:56:20 (provided they are ordered completely) 02:59:22 --- join: MyCatSchemes (n=rb6822@sevkil.cs.bris.ac.uk) joined #haskell 02:59:25 I wrote buublesort in basic once 03:00:03 b_jonas_: we don't care about the O(n^2), but how *dare* you use such an evil algorithm? :) 03:01:20 --- quit: dibblego ("Leaving") 03:01:59 --- join: gip (n=gpi@SAGW-PRIMARY.ARC.COM) joined #haskell 03:02:09 MyCatSchemes: well, that was ages ago 03:02:15 I didn't know about heapsort at that time 03:02:30 and quicksort or the like is difficult to write in basic 03:02:38 --- join: JaffaCak1 (i=simonmar@nat/microsoft/x-3edf73c69ca2bf7f) joined #haskell 03:02:59 > let bubble (a:b:xs) | a > b = b:bubble (a:xs) | otherwise = a:bubble (b:xs); bubble xs = xs; sort xs = last . zipWith (flip const) xs . iterate bubble $ xs in sort [3,1,2,4,561,0,3,4] 03:03:01 [0,1,2,3,3,4,4,561] 03:03:07 otoh it takes very little code 03:03:35 looks perfectly reasonable to me, what's evil about that? ;) 03:03:39 and if I'd have memoized the result (I only used to to sort font names for a dialog box) then code size would definitely be the primary concern 03:04:10 Oh wait, I'm stupid 03:04:17 I wrote quicksort in basic another time as well 03:04:25 and in that case, speed was a concern 03:04:31 now it was bad in that case 03:04:33 but I was young 03:05:05 --- nick: b_jonas_ -> b_jonas 03:05:42 --- quit: MarcWeber (Remote closed the connection) 03:05:57 (anonymous) annotated "Look, it does what I want, and it's easy... but isn't this built-in somewhere?" with "(no title)" at http://hpaste.org/2718#a2 03:06:55 int-e: zipWith const to trim one list down to the size of another is an interesting indiom 03:09:02 :) 03:09:50 oh. but it means that the function doesn't work for empty lists. 03:10:07 that wouldn't have happened with the more obvious (!! length xs) 03:10:39 --- join: ivanm_ (n=Ivan@60-242-0-245.static.tpgi.com.au) joined #haskell 03:12:07 why wouldn't it work with an empty list? 03:12:20 > last [] 03:12:32 Exception: Prelude.last: empty list 03:13:20 but quicksilver said zipWith const 03:13:22 "the function" was the sort function above. The zipWith works just fine. 03:13:42 oh, I see 03:13:44 the bubble 03:14:58 bubblesort! 03:15:04 the king of sort routines! 03:15:09 --- join: Igloo_ (n=igloo@chaos.earth.li) joined #haskell 03:19:16 --- join: bvd (n=user@n027182.science.ru.nl) joined #haskell 03:19:39 bubblesort works locally, is therefore friendly to the cache and it is nicely parallisable. What else do you want? 03:20:27 --- quit: JaffaCake (Read error: 110 (Connection timed out)) 03:20:32 well, mergesort has those advantages as well 03:21:03 b_jonas: mergesort isn't truly local 03:21:06 oh, is a parallelised bubblesort efficient? 03:21:07 but I somehow like heapsort better, even though I know it's not good for external sort 03:21:14 b_jonas: it works back and forth between two copies 03:21:28 --- join: njbartlett (n=njbartle@cpc2-barn4-0-0-cust110.brnt.cable.ntl.com) joined #haskell 03:21:28 Mergesort requires twice as much RAM as there is data, you can't do it in-place. 03:21:34 b_jonas: and it maintains at all times two 'cursors' into the source list 03:21:44 b_jonas: so it's hitting three active memory locations (two read, one write) at a time 03:21:46 --- join: pedro_dgv (n=pedro@42.Red-217-125-2.staticIP.rima-tde.net) joined #haskell 03:21:50 which can be pretty widely distributed 03:21:56 quicksilver: it's not local if you have one tape, sure, but it's still cache-local or can be done externally with a few tapes 03:22:04 --- quit: boegel (Read error: 110 (Connection timed out)) 03:22:08 are you programming one-tape turing-machines or what? 03:22:21 no, we're programming on modern CPUs 03:22:30 but we're sorting lists so big they don't fit in the cache 03:22:34 at least, I assume that's the point :) 03:22:34 yep 03:22:46 but the cache can do two locations pretty fine 03:22:57 Modern CPUs have a megabyte of cache apiece. How often do you sort lists bigger than, say, 128x2^10 items? 03:22:57 (it's two not three but that's a minor point) 03:23:31 b_jonas: don't forget to count the stack for all those nifty recursive calls. 03:23:53 MyCatSchemes: recursive calls? you're thinking of qsort. mergesort doesn't have those. 03:24:22 non-inplace is true 03:24:25 you're right 03:24:46 I like heapsort which is inplace, but it's obviously really bad for localty 03:24:54 the traditional encoding of mergesort is recursive 03:25:17 of course it's possible to unwrap it with an extra variable for 'current sublist size' 03:25:46 MyCatSchemes: if you're not sorting something bigger than the cache, then you probably don't care about performance 03:25:50 MyCatSchemes: it will be fast anyway :) 03:27:00 --- quit: Igloo (Read error: 110 (Connection timed out)) 03:29:21 --- join: ptx (n=ptxmac@0x5550c853.adsl.cybercity.dk) joined #haskell 03:30:27 quicksilver: not with bubblesort :) 03:30:34 quicksilver: nor with bogosort. 03:31:35 I believe bubblesort is actually the sort of choice when sorting nearly-sorted data ? 03:33:22 osfameron: only if it's already almost-sorted to some ridiculous extent. And mergesort also tends towards O(n) in nearly-sorted data, too. Methinks insertion sort does as well, and that's always faster than bubble except under really contrived circumstances anyway. 03:35:24 yeah, I can imagine that 03:37:21 MyCatSchemes: merge sort generally has a really bad constant 03:37:45 MyCatSchemes: it's a very SLOW O(n log n), and it's also a SLOW O(n) on nearly-sorted data 03:37:49 but on the other hand it's stable 03:37:56 which is important for lots of applications 03:38:06 --- quit: dolio (Read error: 104 (Connection reset by peer)) 03:38:11 --- quit: njbartlett (Read error: 104 (Connection reset by peer)) 03:38:11 --- quit: petekaz (Connection timed out) 03:38:12 --- join: dolio (n=dolio@nr5-216-196-210-207.fuse.net) joined #haskell 03:38:23 insertion is fastest on nearly-sorted, isn't it? 03:38:49 and if you squint a little bit, you can see insertion on nearly-sorted data as a kind of "obvious" improvement to bubble-sort 03:39:00 "skip out of the bubble if this bit's already in the right place" 03:40:24 --- join: matt__r (n=matt__r@CPE-121-209-187-24.nsw.bigpond.net.au) joined #haskell 03:42:16 --- nick: ivanm_ -> ivan_m 03:43:04 --- nick: twanvl_ -> twanvl 03:45:57 --- quit: goalieca ("(sleepy time)") 03:48:08 --- nick: ivan_m -> ivanm 03:50:02 apart from being easy to code, quicksort has another area where it pwns all other sort kinds 03:50:59 namely when you want to partition a list of length n to the k lowest and (n-k) highest data for a given k, then a modified qsort (which is not recursive just tail recursive) wins 03:51:23 --- join: xtacy[] (n=xtacy[]@203.199.213.72) joined #haskell 03:51:37 "not recursive just tail recursive"? Do you mean the other way around? 03:51:38 similarly if you just want the k smallest elements of a list sorted for a given k that's much less than the size of list, then that qsort or a modified heapsort are the two things that win 03:51:58 I mean it's only tail recursive so doesn't need the stack 03:52:07 Ah 03:52:14 so you can very easily do it inplace 03:52:14 i.e. it doesn't need two recursions 03:52:16 yep 03:53:00 aka quickselect. 03:53:00 though there's another complicated algorithm that can do that partitioning and is deterministic 03:53:34 its the median of 5 method... very innovative :) 03:54:07 yep 03:54:11 probably called like that 03:54:30 c++ calls the task (not either algorithms just the specs) some wierder name 03:54:32 I can't remember 03:54:42 Ideally we would like to have the pivot to be the median, and order statistics (kth smallest/largest selection) can be done in O(n) . So, your recurrence relation looks neat! 03:54:44 uh huh, nth_element 03:55:17 --- join: boegel (n=boegel@konijn.elis.UGent.be) joined #haskell 03:55:17 yep, O(n) and can be done externally in that time as well 03:55:24 so it's well cache-wise 03:55:55 ? could you clarify your last statement? 03:55:55 --- quit: dolio (Read error: 104 (Connection reset by peer)) 03:56:55 --- nick: zygen_ -> Zygen 03:57:18 I mean, it's fast on modern cpus with cache, because it does ordered access to the memory not random access 03:57:32 --- nick: Zygen -> zygen 03:57:48 when I implemented the randomized one, I called the function "quantile" for that both starts with q and means what I acheive 03:57:51 --- nick: zygen -> Zygen 03:58:13 :) yeah, right. Thats why quicksort is in some sense better than heapsort! (2*i and 2*i+1 are far, compared to i) 03:58:25 quicksort is the most beautiful sort 03:58:50 bottom up merge sort is also pretty. 03:59:02 xtacy[]: for that problem yes 03:59:03 which is the sorting algorithm that is easiest to work with, for proving correctness? 03:59:16 but for partial_sort heapsort is better for it can do everything in one pass 03:59:30 --- join: Saul__ (n=Saul@10-15-ftth.onsnetstudenten.nl) joined #haskell 03:59:34 --- join: dolio (n=dolio@nr5-216-196-210-207.fuse.net) joined #haskell 03:59:39 so it's quite fast for external data if the result fits in memory 03:59:40 xtacy[]: hard to say. selection sort? 03:59:46 faster than that qselect thing 04:00:04 int-e: hmm, insertion sort too. 04:00:29 are we developing metasort here? 'my sort is bigger than your sort' 04:00:29 int-e: What could be the invariant in quicksort? hard to think of 04:00:39 Sizur++ metasort 04:01:17 xtacy: it's easy: the invariant is that qsort returns its input sorted and calls itself only for smaller arrays (so it's finite) 04:01:26 --- join: ChilliX (n=chak@c220-239-39-75.rivrw7.nsw.optusnet.com.au) joined #haskell 04:01:41 the second one is trivial and the first one you prove by induction over the size of input 04:02:59 b_jonas: in that case, this invariant holds good for merge sort too! 04:03:14 xtacy[]: yes, but it's more difficult to prove 04:03:28 here this invariant is really not an "invariant" but an "induction statement" 04:03:32 which you use in the proof 04:03:52 --- quit: gour ("Haribol-Chat") 04:04:46 --- join: gkr (n=notme@200-127-242-48.cab.prima.net.ar) joined #haskell 04:04:48 b_jonas: right, but even in insertion sort, we have "P(i): array[1..i] is sorted". So, after execution of the inner loop, "P(i) => P(i+1)". 04:04:54 --- join: radiohead (n=andreig@openbsd-box.org) joined #haskell 04:05:00 b_jonas: some form of induction :) 04:05:03 --- quit: cognominal_ (Client Quit) 04:05:07 sure 04:05:18 --- nick: pgavin-away -> pgavin 04:05:21 that sounds like a nice way to prove for mergesort 04:05:29 I didn't say qsort is the easiest to prove 04:05:31 --- nick: radiohead -> OpenBSD_ 04:05:40 --- nick: OpenBSD_ -> _OpenBSD_ 04:05:46 just answered your question about quicksort 04:05:58 b_jonas: :) 04:06:05 --- nick: _OpenBSD_ -> dnme 04:06:08 --- part: tuxplorer left #haskell 04:06:49 * xtacy[] leaves to have a cup of tea 04:08:47 --- join: njbartlett (n=njbartle@cpc2-barn4-0-0-cust110.brnt.cable.ntl.com) joined #haskell 04:08:50 --- join: EvilTerran (n=Irrel@cpc5-broo4-0-0-cust230.renf.cable.ntl.com) joined #haskell 04:11:30 @go oleg hlist 04:11:34 http://www.cwi.nl/~ralf/HList/ 04:11:34 Title: Strongly typed heterogeneous collections 04:15:12 --- quit: b_jonas ("Leaving") 04:15:24 --- quit: LeCamarade (Read error: 113 (No route to host)) 04:15:56 --- quit: KatieHuber () 04:16:54 --- join: Andris (n=Miranda@80.233.159.254) joined #haskell 04:17:35 --- quit: iblechbot (Read error: 104 (Connection reset by peer)) 04:17:42 --- quit: gkr (Read error: 104 (Connection reset by peer)) 04:18:19 hello, #haskell! looking for a little-dependencies (preferrably standard) way to load png/gif in haskell (want to play with some image processing). any pointers? 04:19:28 might be something under http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Graphics 04:19:31 http://tinyurl.com/yqov7f 04:19:55 GD? 04:20:41 --- join: mornfall_ (n=mornfall@rb4b151.net.upc.cz) joined #haskell 04:20:42 iirc, the GD binding's incomplete, but it might do what you want 04:21:04 --- join: Dybber (n=dybber@0x3e42d1c0.adsl.cybercity.dk) joined #haskell 04:21:11 EviltTerran, thanks, will check it out; I actually was working through this list already :) 04:21:37 but probably have chosen wrong evaluation strategy :) 04:22:06 --- quit: mornfall (Read error: 113 (No route to host)) 04:22:26 I believe there isn't a really good graphics loading lib yet 04:22:33 i've no experience with SDL, but that also might have something. i dunno. 04:22:34 certainly laast time I looked properly there wasn't 04:22:36 gtk2hs can do it 04:22:42 as part of a gtk application I believe 04:22:53 what's considered a good image loading lib in the C world? 04:23:00 imagemagick? 04:23:00 the trouble is, I want it clearly cut - no 3D, no windowing, just file ops and pixels 04:23:17 scook0, i think GD's fairly standard in that respect. i may be wrong, tho. 04:23:19 gd looks ok from the spec 04:23:40 * EvilTerran was thinking about writing bindings to allegro (alleg.sf.net), which he's used for image processing in C, but that's a general-purpose "game development" library 04:24:17 --- quit: ivanm (""had enough"") 04:24:36 btw, what's the modern way of installing packages under GHC? I wonder what this Cabal is about - how is it better than just grabbing the tarball? 04:25:25 it's been suggested several times that a binding to imagemagick 04:25:37 (or that fork of imagemagick) 04:25:40 woudl be a nice thing to have 04:25:46 but no one has stepped up to the plate 04:26:10 hm. what OS are you on, Andris? Cabal streamlines the build process, but it doesn't really work on windows. 04:27:38 --- join: gour (n=Gour@7-89.dsl.iskon.hr) joined #haskell 04:27:47 I am affraid it is Windows 04:28:12 well, is there any hope to manually build these Cabal distros on Windows? 04:28:50 or just untarring is enough? 04:29:16 The normal process with Cabal is untar, runhaskell Setup.hs configure, runhaskell Setup.hs build 04:29:22 (runhaskell Setup.hs install) 04:30:23 yes, it does not work... 04:30:29 i find there's usually an "autoreconf" step after "untar" -- being where windows falls down. 04:30:39 ok, will try some luck with Cygwin then 04:30:44 thanks 04:30:54 it's more likely to work on cygwin, yeah. 04:32:12 btw, what are the reasons not to have such package in pure Haskell? performance or the fact that creating a binding is faster then porting? 04:32:15 than 04:32:58 mostly the latter, I'd think 04:33:13 since it's possible to write C in Haskell if you really want to 04:33:45 Although it's rarely a good idea. :) 04:34:02 DRMacIver: well, it can beat writing C in C sometimes ;) 04:34:35 what about writing Fortran in Haskell... 04:35:01 stuff like Data Parallel Haskell maybe? 04:35:58 Andris: almost entirely the latter 04:36:05 --- join: BCoppens (n=bartcopp@kde/coppens) joined #haskell 04:36:13 Andris: it's just a lot of work has gone into (e.g.) imagemagick and it would take time to port it 04:36:41 also, a wrapper is probably easier to maintain than a library 04:36:48 assuming the underlying library is maintained 04:36:55 it's rather unusual to actually have a case where haskell performs badly and we can't fix it 04:37:00 scook0: But loses to both C and idiomatic Haskell in performance and doesn't beat writing Haskell in Haskell. :) 04:37:13 altho, once we forked all the functionality into a pure haskell version, we could then work on supplanting the original and getting the C programmers using the haskell one ;] 04:37:21 well, at the moment I just need some way to get pixels from png file into some form operable by Haskell (even [[Int]] will do) 04:38:13 * EvilTerran usually uses an existing program (IrfanView or something) to convert the image to PPM or suchlike, then manipulates the image from that 04:38:20 --- join: igel (n=igel@brsg-4db2c402.pool.einsundeins.de) joined #haskell 04:38:33 well, sounds like a plan 04:38:42 DRMacIver: true -- though one good use case for C-in-Haskell is when mucking about with FFI stuff 04:38:55 Also true. 04:39:01 in the sense that it's easier to write C-in-Haskell than Haskell-in-C (as some other FFI schemes force you to do) 04:39:09 Heh. Yes. :) 04:39:34 actually, I hear even Java has a decent (third-party) FFI these days 04:39:45 --- quit: byorgey ("Ex-Chat") 04:40:19 * EvilTerran is reminded of the pain involved in geting Tcl calling C functions 04:40:30 --- join: Saizan (i=saizan@host-84-223-133-182.cust-adsl.tiscali.it) joined #haskell 04:41:59 --- nick: pgavin -> pgavin-away 04:42:02 the haskell FFI is enviable in its simplicity 04:42:30 and Tcl boast about how easy it's meant to be to do that 04:42:40 scook0: There seem to be 3 semi-ok FFIs for Java at the moment (two open source and one not) 04:42:53 Tcl's a stupid language, anyway. i vastly prefer haskell. =] 04:42:58 I've not really used any of them though. 04:43:25 (and, for scripting, Lua, say, is eminently more sensible than Tcl) 04:43:27 quicksilver: the only problem is that it doesn't do structs (which is Hard) 04:44:09 * EvilTerran could envisage using tuples instead of structs; or record types... 04:44:27 it would be nice to have a lightweight FFI-helper library that can create struct-interfaces dynamically from a struct declaration ... 04:44:28 scook0: right 04:44:37 scook0: there are some like that I believe? 04:44:39 * EvilTerran had assumed there was some way of dealing with structs, actually 04:44:41 greencard? 04:44:42 scook0: have you seen c2hs? 04:44:45 c2hs? 04:44:50 ah, beaten to the punch 04:44:50 --- quit: zx]treads (Read error: 110 (Connection timed out)) 04:44:54 @where c2hs 04:44:54 http://www.cse.unsw.edu.au/~chak/haskell/c2hs/ 04:45:17 can any of them work at runtime? or is there always a precompilation step involved? 04:45:29 precompilation 04:46:06 it should be possible to do stuff at runtime, if you don't mind invoking GCC on the fly 04:46:25 just a matter of actually implementing it ;) 04:46:29 well i suppose you can using hs-plugins after 04:46:53 not sure what you mean by that at all? 04:47:06 presumably the C library you want to interface with you choose at compile-time 04:47:30 --- quit: mr_tenor (Remote closed the connection) 04:47:37 preprocessing adds extra complexity at build time 04:47:53 which is fine in most cases, but sucks if you're trying to do something quick-&-dirty 04:48:24 invoking gcc at runtime adds a LOT more complexity than that :) 04:48:27 IMHO 04:48:30 (my imagined use case is quick one-off bindings, when the library you want doesn't have a proper binding) 04:48:40 right, but haskell has a compilation step anyway 04:48:50 all we're saying is, shove this into the compilation step :) 04:49:00 --- join: mr_tenor (n=nick@c220-239-43-146.rivrw7.nsw.optusnet.com.au) joined #haskell 04:49:01 ok, at some level it's an extra step, because it's an external tool 04:49:11 but step back a bit and 'pretend' c2hs is just part of ghc 04:49:17 now it's just one compilation step :) 04:49:20 in my mind it makes perfect sense, but it's hard to explain adequately 04:49:30 scook0: you know, I have that experience *all* the time 04:49:36 I may have to quote you on that one, though 04:49:48 @remember scook0 in my mind it makes perfect sense, but it's hard to explain adequately 04:49:48 Done. 04:49:54 --- join: ivanm (n=ivan@60-242-0-245.static.tpgi.com.au) joined #haskell 04:50:13 --- join: xtacy[ (n=xtacy[]@203.199.213.72) joined #haskell 04:50:21 --- join: gkr (n=notme@200-127-242-48.cab.prima.net.ar) joined #haskell 04:50:34 * EvilTerran hand-writes the "foreign import" statements if he only needs a couple of functions 04:50:54 EvilTerran: yeah, that's the sort of thing I'm getting at 04:51:07 but it falls over if you want to call functions that deal in structs 04:52:09 e.g. if I want to call nice(2), that's two lines of pure Haskell FFI 04:52:16 in fact, while I'm remembering stuff 04:52:35 @remember ChilliX This is GHC after all, it tries to gently nudge you in the right direction, but if you insist, it happily lets you drill arbitrarily large holes in your foot. 04:52:35 Done. 04:53:02 but trying to call a native function that takes (say) a very simple struct argument requires much more effort 04:53:23 --- nick: JaffaCak1 -> JaffaCake 04:53:52 stuff like c2hs is too heavyweight (imo) for one-off, throwaway FFI 04:53:58 --- quit: Saizan_ (Read error: 110 (Connection timed out)) 04:54:03 --- quit: xtacy[] (Read error: 110 (Connection timed out)) 04:54:12 well it's true that it's annoying 04:54:23 so I imagine a library 04:54:23 --- join: mlesniak (n=mic@elrond.dcaiti.TU-Berlin.DE) joined #haskell 04:54:33 that takes a struct declaration 04:54:36 but a library is the wrong approach 04:54:44 you can't expect to have a header file around at runtime 04:54:53 feeds it to GCC, with some cunningly-inserted offsetof 04:54:55 you've got to fetch the struct defn at compile-time surely 04:55:03 takes the results, and dynamically does peeks/pokes 04:55:14 --- nick: slipstream-- -> slipstream 04:55:35 well, you could precompile the declaration, and just load the offsets at runtime 04:55:43 (or even bake generated offsets into your program) 04:56:13 I understand your "that's the wrong way to do it" stance 04:56:20 reimplement c2hs in TH so it's not a preprocessor?:) 04:56:29 but in my view, any "right" approach is too heavy for the use case I have in mind 04:56:58 --- part: lzfn1 left #haskell 04:58:57 there's also the issue with the runtime approach that a malicious header file could actually segfault your program :) 04:59:03 or worse, allow code injection 04:59:04 --- join: der_eq (n=eq@dslb-088-070-026-048.pools.arcor-ip.net) joined #haskell 04:59:47 you're quite right, of course 05:00:18 --- quit: mlesniak ("Verlassend") 05:00:24 --- quit: RogerTaylor (Read error: 110 (Connection timed out)) 05:01:35 --- nick: tizoc_ -> tizoc 05:03:13 --- join: alags (i=ubuntu@nat/yahoo/x-1e06d666371a7e58) joined #haskell 05:03:51 --- join: tuomov_ (n=nn@a144.adsl.tnnet.fi) joined #haskell 05:04:00 @hpaste 05:04:00 Haskell pastebin: http://hpaste.org/new 05:04:25 tuomov pasted "Bug in 6.6?" at http://hpaste.org/2746 05:04:54 that seems to work in ghc 6.4.2, but 6.6 complains of illegal instance declarations and fundep coverage conditions 05:05:10 @src Error 05:05:10 class Error a where 05:05:10 noMsg :: a 05:05:10 strMsg :: String -> a 05:05:13 known? 05:06:19 tuomov_: 6.4.2 was too liberal 05:06:38 it's insane if that's not allowed 05:06:48 fundeps are beginning to seem worthless. You can't really do anything with them 05:07:08 Little to do with insanity. More a better of when type checking become sundicidable. 05:07:17 just an academic hack that you can't use for real programming... 05:07:30 that's a strange thing 05:07:35 Or more precisely when deciding whether specific declarations guarantee decidable type checking. 05:07:47 so all these real programs out there written in haskell are actually academic hacks then? :) 05:07:53 tuomov_: you can always use -fallow-undecidable-instances 05:08:04 how's that undecidable 05:08:35 tuomov_: The compiler cannot decide whether your declarations lead to potentially non-terminating type checking. 05:08:48 that statement is a tautology 05:08:59 the instance you show for Foo is, incidentally, not relevant to the example 05:09:02 This does *not* mean that they make type checking undecidable. It *just* means the compiler cannot tell, and needs to stay on teh safe side. 05:09:13 tuomov_: which statement? 05:09:18 --- join: tizoc_ (n=user@r201-217-167-234.dialup.adsl.anteldata.net.uy) joined #haskell 05:09:31 that definition of undecidability... doesn't answer my question 05:09:31 --- quit: tizoc_ (Read error: 104 (Connection reset by peer)) 05:09:39 tuomov_: it's not a tautology; there are some programs for which the compiler *can* prove termination 05:09:47 --- join: tizoc_ (n=user@r201-217-167-234.dialup.adsl.anteldata.net.uy) joined #haskell 05:10:02 tuomov_: and the various conditions identify a conservative class of programs for which the compiler can prove it 05:10:07 the compiler fails to prove to itself that your program is decidable 05:10:10 you can turn the conditions off 05:10:17 tuomov_: quicksilver is right 05:10:25 bah, I think I'll just use C 05:10:28 this haskell is worth nothing 05:10:34 tuomov_: good idea!! 05:10:55 it supposedly has a great type system, but in the end it can't do anything 05:11:02 The compiler can't even solve the halting problem, must be worthless! 05:11:02 yeah, I love the multi-parameter type class inference algorithm in C 05:11:06 and you end up writing things as poorly typed as in C 05:11:09 --- join: jfredett (n=jfredett@EULER.WIFI.WPI.EDU) joined #haskell 05:11:13 you do? 05:11:20 i'm doing it wrong then :( 05:11:24 quicksilver: multiparameter typeclasses and fundeps are _worthless_ 05:11:31 they're of no use, because the compiler is too stupid 05:11:36 I've used them in many programs 05:11:40 so they have worth to me 05:11:43 --- quit: dbueno ("Leaving") 05:11:48 everywhere I try to use them, I run into the compiler being too stupid 05:11:49 tuomov_: we clearly must develop more intelligent compilers! 05:11:53 --- quit: gour (Read error: 110 (Connection timed out)) 05:11:55 * ChilliX 's research agenda is set! 05:12:21 it's easier to just stay away, and write poorly-typed code, like C... i.e. just write C 05:12:35 tuomov_: nah, C is for wussies, write assembly! 05:12:46 --- join: gour (n=Gour@17-100.dsl.iskon.hr) joined #haskell 05:13:01 ChilliX: but make sure you use a typed assembly language! 05:13:06 --- join: agoode (n=agoode@2001:4830:1633:0:212:3fff:fe70:6222) joined #haskell 05:13:14 scook0: hehehe 05:13:21 scook0: http://lambda-the-ultimate.org/node/2450 ? ;) 05:13:23 Title: Compositional type systems for stack-based low-level languages | Lambda the Ulti ... 05:13:35 as I understand it, you're hoping that the compiler will take context into account when resolving instances 05:13:36 * Lemmih imagines tuomov_ writing proprietary C code on Windows ME. 05:13:54 I'm not very good at expressing this, but basically contexts work in the other direction 05:14:02 they aren't used to reduce the resolution search space 05:14:20 tuomov_: incidentally, what's your issue with -fallow-undecidable-instances ? 05:14:23 --- quit: tizoc_ (Read error: 104 (Connection reset by peer)) 05:14:24 mr_tenor: more like http://www.cs.cornell.edu/talc/ perhaps 05:14:27 Title: Typed Assembly Language 05:14:33 that thing I pasted is so _trivial_ 05:14:37 --- join: tizoc_ (n=user@r201-217-167-234.dialup.adsl.anteldata.net.uy) joined #haskell 05:14:47 and yet the compiler starts complaining 05:14:48 (I remember there being a chapter on it in ATTaPL, but I don't remember any details) 05:14:59 scook0: ooo 05:15:06 tuomov_: Do you know what the first thing is that I tell my first-year students? 05:15:41 stay away from computers, they suck? 05:15:54 ChilliX: 'When someone says "I want a programming language in which I need only say what I wish done," give him a lollipop.' -- Alan Perlis ? 05:16:05 ChilliX, "Hi, I will be the teacher of this class"? 05:16:12 pejo: lol 05:16:43 Well, actually the first thing is just nonsense like "Welcome to COMPXYZV..." 05:16:47 After that!! 05:16:52 it seems basic Hindley-Milner is the best that can be had; nothing beyond it works well enough to be useful for practical programming 05:17:01 and even Hindley-Milner is a bit too limited for that 05:17:14 tuomov_: ok, I'll tell you anyway ;) 05:17:44 I tell my first-years students that they have to get over the illusion, the propaganda fed to them, that computers are smart. 05:18:14 ah, but computers indeed are as stupid as the people who created them, and people are very stupid, it seems 05:18:17 As really, computers are the most stupid, the most absolutely and incredibly dump things they'll ever come across. 05:18:32 dumb 05:18:40 Imagine a golem with a pen in its hand and a lot of paper... 05:18:51 tuomov_: you are missing the point, computers are inherently dumb (thanks mr_tenor) 05:18:52 I'd go back even further than that, if I were you. 05:19:22 Who said that computer can be not stupid? 05:19:25 ah, but the beauty of computers is that they can be stupid *millions of times a second* 05:19:34 Start from, "Computers are not magic." *Then* progress to, "Computers are not alive, smart, intelligent or sentient." 05:19:41 scook0: indeed, that's their strength 05:19:44 the sort of stupidity that causes consistent logical behavior is something i aspire to 05:20:01 --- quit: kombinator_ ("Leaving") 05:20:16 balodja: tuomov_ complained that ghc is stupid, and I tried to explain that that's less ghc's problem as that of the machine executing ghc 05:20:23 C's type system is actually more expressive, than Haskell's! 05:20:33 for my purposes anyway 05:20:48 it's also unsound 05:20:55 can't even encode the size of a low-level structure in it; C has 'sizeof' 05:21:22 Computers are overgrown calculators, for the most part. 05:21:43 you certainly can encode the size of a low-level structure in haskell 05:21:52 tuomov_: unbelievable! 05:21:59 but the details are more subtle because you're working on a more powerful system 05:22:02 tumov_:sizeof doesn't give you guarantees about anything though 05:22:18 --- join: kaol_ (n=kaol@sammakko.yok.utu.fi) joined #haskell 05:22:19 you don't normally choose to control how structures are stored in memory 05:22:24 because that's not normally useful 05:22:28 if you want to, you can, though 05:22:32 that's very useful for disk access 05:22:43 what you normally want to do, is control how they are stored in disk, or over the network 05:22:53 and that you can do very powerfully in haskell 05:22:53 haskell programs live in their small world that doesn't access the outside world, except through inefficient text streams... 05:22:58 --- part: Andris left #haskell 05:22:59 --- join: smkl_ (n=sami@glubimox.yok.utu.fi) joined #haskell 05:23:05 and that's also not true 05:23:06 (and the support for those is crappy too) 05:23:07 --- quit: alags (Connection timed out) 05:23:13 see, now you're just trolling 05:23:14 tuomov_: may be you not haskell? 05:23:18 you don't appear to know very much about haskell, I'm afraid 05:23:19 at least before you sounded credible 05:23:26 it's a common technique to have the last member in a struct as a sort of placeholder name for memory going off the end of a struct which has been cast... so the 'size" of a "structure" isn't really meaningful as part of a type system 05:23:56 a "struct" is sort of a temporary naming scheme for a random bit of memory 05:24:53 It's overused, but "You can't prove anything about a program written in C or FORTRAN. It's really just Peek and Poke with some syntactic sugar." (Bill Joy) 05:25:06 and how do you calculate the size of a structure from the sizes of the components, automatically? 05:25:10 C does that.. 05:25:24 tuomov_: because C programs care. 05:25:25 mr_tenor: lol @ peek and poke 05:25:39 tuomov_: make it an instance of Binary or Storeable 05:25:43 --- join: CosmicRay (n=jgoerzen@gatekeeper.excelhustler.com) joined #haskell 05:25:50 quicksilver: calculating sizes manually.. 05:25:51 mr_tenor: what, typedef struct { size_t size; foo* data[1]; } foolection; then later { foolection* bleargh = malloc(sizeof(foolection) + (sizeof(foo*)*(n_items_required-1)); ? 05:26:02 :t Foreign.Storable.peek 05:26:06 forall a. (Foreign.Storable.Storable a) => GHC.Ptr.Ptr a -> IO a 05:26:16 mr_tenor: and other (evil, heehee) tricks with arrays on the ends of structs? 05:26:16 :t Foreign.Storable.poke 05:26:18 forall a. (Foreign.Storable.Storable a) => GHC.Ptr.Ptr a -> a -> IO () 05:26:22 tuomov_: not if you use a deriving scheme, no 05:26:35 Clearly, Haskell is a superset of C..got peek and poke! 05:26:37 MyCatSchemes: things like that..also when people build classes andvtablesand inheritance in C :) 05:26:51 ChilliX: it 05:26:51 --- quit: tizoc (Connection timed out) 05:26:56 's true though 05:27:10 --- quit: freddyp (Connection timed out) 05:27:16 mr_tenor: building classes, vtables and inheritance in C probably usually beats the Hell out of using the ones that C++ provides at least half the time, though. ;) 05:27:22 mr_tenor: oh, I don't doubt it 05:27:35 yeah, at least there's only as much magic there as you put yourself 05:27:41 and that's dynamic calculation; so no better than C 05:27:56 --- join: fasta (n=fasta@zonnebloem.demon.nl) joined #haskell 05:28:02 tuomov_: you want to use C. nobody is stopping you. 05:28:09 tuomov_: now you're kind of talking out of you're arse here. 05:28:09 tuomov_: ok, was funny for a while, but don't you want to join #perl now? 05:28:17 I wanted to use Haskell.. but I think it was a mistake now 05:28:29 in the end, you can't express anything any better than in C 05:28:49 the C type system does not tell you anything useful, that's the problem 05:28:53 tuomov_: because if you actually care about exactly what the structures look like on disk, you have to jump through hoops to make sure you're writing the correct endianness and, Hell, integer sizes. 05:29:00 the haskell type system tells little useful 05:29:04 if you know useful things, it's due to YOU andnot the typesystem 05:29:14 --- join: cmarcelo (n=cmarcelo@200.184.118.132) joined #haskell 05:29:15 mr_tenor: it tells you "your program is written in C; it will probably segfault" ;) 05:29:21 MyCatSchemes: and I've tried to encode that in the type system... with little luck 05:29:21 --- join: ubuntu (i=ubuntu@nat/yahoo/x-ccabe33bd6685ee1) joined #haskell 05:29:40 always run into some limitation 05:29:40 tuomov_: why would you need to, realistically? 05:29:50 Is there any problem with calling runInteractive process with a combination of waitForProcess in a loop? It seems that doing it once is OK, but doing it like hundreds of times blows up. 05:29:52 to have something better than C would provide? 05:30:06 but apparently that's not possible 05:30:14 impossibility proofs are nontriial 05:30:21 --- quit: Saul__ (Remote closed the connection) 05:30:33 --- quit: Nucleo_ (Success) 05:30:44 and that's dynamic calculation; so no better than C 05:30:50 dynamic? O_O 05:31:06 tuomov_: use -fundecidable-instances. this option exists precisely because the coverage condition is known to be too strong. but there is no known simple condition on class instances that guarantees termination of type checking and type inference in the presence of functional dependencies that also allows all interesting uses of them. 05:31:17 "No dynamics? We're playing as loud as we can" 05:31:19 It seems, that you know nothing about haskell's types 05:31:43 balodja: It seems, that your comma is erronous and should be taken out and shot. :) 05:31:45 tuomov_: if you can come up with a better one I'm sure people like spj will be happy to hear about it. 05:31:55 int-e: I dont' want to use such options that could make the compiler run into trouble in other places 05:32:09 next time I'm trying to hack something, the compiler just hangs 05:32:57 --- quit: ramza3 (Read error: 104 (Connection reset by peer)) 05:33:03 --- quit: kaol (Read error: 110 (Connection timed out)) 05:33:23 --- part: ubuntu left #haskell 05:33:32 tuomov_: nah, you misunderstand 05:33:50 --- quit: JohnMeacham (Read error: 104 (Connection reset by peer)) 05:33:52 -fallow-undecidable-instances does not mean the compiler is going to loop 05:33:54 tuomov_: it doesn't run into trouble in other places 05:34:09 it just means the obligation of checking that it will not loop is on you (not the compiler) 05:34:10 MyCatSchemes: may be 05:34:17 what's it for then? 05:34:20 tuomov_: if type checking terminates the result will be correct. 05:34:35 tuomov_: for having an a priori guarantee of termination. 05:34:42 --- quit: smkl (Read error: 110 (Connection timed out)) 05:34:49 just what I said 05:34:56 the compiler may not terminate 05:35:09 * wli wonders where the video game people are. 05:35:22 wli: what video game people? 05:35:53 There's a crew of people on #haskell who at least say they want to write video games. 05:35:56 --- quit: njbartlett () 05:36:09 Maybe 2-3 people. 05:36:38 hm? 05:36:40 years ago i wanted to. somehow i ended up pricing financial instruments instead. whoops. 05:36:49 I'm certainly writing a game, for fun. 05:37:01 I probably wouldn't use the phrase 'video game' though 05:37:21 * MyCatSchemes is interested in the idea, but has no fast hardware to play with currently. 05:37:25 quicksilver: i've heard that programming the GBA can be a hoot 05:37:55 wli: I got another honours thesis student hacking Frag 05:37:57 --- join: Nucleo_ (n=Connecti@cpe-68-174-7-169.nyc.res.rr.com) joined #haskell 05:38:03 --- quit: tuomov_ ("Maybe worse (C) really is better") 05:38:04 wli: it;'s going to have an AI! 05:38:42 lambdabot? 05:38:49 mr_tenor: Frag.. 05:39:01 @where Frag 05:39:01 http://www.haskell.org/haskellwiki/Frag 05:39:24 --- join: cognominal_ (n=cognomin@138.208.64-86.rev.gaoland.net) joined #haskell 05:39:24 fasta: i know. i was suggesting that... nm. joke's ruined :( 05:39:34 sigh. in other programming languages, nonterminating compilers are the default. 05:39:43 (I mean C++) 05:39:52 int-e: yeah... 05:40:10 int-e: standard compliant compilers are not 05:40:15 int-e: (C++) 05:40:31 --- join: nomeata (i=nobody@nomeata.de) joined #haskell 05:40:51 fasta: well, anybody can put in a dynamic termination condition 05:41:04 ChilliX: ? 05:41:30 --- quit: ADEpt (Remote closed the connection) 05:41:38 fasta: AFAIK standard C++ gets around the non-termination by statically limiting the unfoldings (or similar) 05:41:49 ChilliX: Yes, I just said that. 05:41:56 I thought a standards-compliant C++ compiler has to be nonterminating (if templates is what you're refering to), whereas most compilers just make sure they run out of stack rather than looping 05:42:21 fasta: well, that's what we call a dynamic termination condition, sorry for being cryptivc 05:42:55 I call some Python program a few hundred times in a loop in Haskell. This fails when I feed ever increasing values to the Python program upto lets's say size X. But when I run the Python program from the command line I can call it with size Y >> X. 05:43:00 What's going on? 05:43:03 but that's not a solution, it's a ludge 05:43:07 kludge, even 05:43:19 ChilliX: who is "we"? 05:43:37 @index catch 05:43:37 Control.Exception, System.IO.Error, Prelude 05:43:45 @t catch 05:43:46 Maybe you meant: tell temp thank you thanks thx time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ft v 05:43:46 fasta: people like SPJ, Martin Sulzmann and me when we discuss this stuff 05:43:52 @type catch 05:43:54 I think Martin starte dusing this term 05:43:54 forall a. IO a -> (IOError -> IO a) -> IO a 05:43:54 ChilliX: there are 5 hits on Google for that phrase. 05:44:04 ChilliX: so, I don't accept that "definition". 05:44:12 ChilliX: and even less in that context 05:44:13 Okay, I see Frag. 05:44:17 fasta: something like a blocking IO / buffering issue maybe? 05:44:43 --- join: iblechbot (n=iblechbo@ppp-62-216-200-133.dynamic.mnet-online.de) joined #haskell 05:44:45 ChilliX: In fact, I think you misunderstood the concept 05:44:54 fasta: what's the nature of the "failure"? 05:45:01 --- quit: ptx (Read error: 110 (Connection timed out)) 05:45:02 * quicksilver thinks it unlikely that ChilliX misunderstood :P 05:45:02 ChilliX: I see the article where they use it, and it's not the same as you claim it to be 05:45:09 --- join: Pupeno (n=Pupeno@193.120.148.177) joined #haskell 05:45:15 ChilliX: Interesting. 05:45:18 fasta: hahaha - but then "we" write the papers about this stuff at the moment, so don't we get to define the terminology?? ;) (I am not entirely serious, in case that's not apparent) 05:45:25 --- quit: der_eq (Read error: 110 (Connection timed out)) 05:45:48 ChilliX: I was having thoughts on AI because commercial games' AI is so... retarded. 05:45:58 ChilliX: you wrote the article [PS] 05:45:59 Sound and Decidable Type Inference for Functional Dependencies? 05:46:06 wli: I agree "retraded" petty much characterises it 05:46:13 --- join: chessguy (n=chessguy@208.78.145.1) joined #haskell 05:46:14 --- join: der_eq (n=eq@dslb-088-070-025-189.pools.arcor-ip.net) joined #haskell 05:46:29 @type uncurry 05:46:31 forall a b c. (a -> b -> c) -> (a, b) -> c 05:46:34 ChilliX: I don't know your real name, so there's no way for me to know whether you know. 05:46:43 --- quit: cognominal_ (Client Quit) 05:47:00 aha, sorry, http://www.cse.unsw.edu.au/~chak/ 05:47:01 Title: Manuel M T Chakravarty 05:47:09 ChilliX: I vaguely wonder if any of those people have heard of fire and maneuver tactics or similar. 05:47:22 @src uncurry 05:47:23 uncurry f p = f (fst p) (snd p) 05:47:28 wli: which people? 05:47:38 wli: I suspect that commercial game AI isn't crap because they don't work hard on the problem 05:47:45 wli: I suspect it's crap because they have a different goal 05:47:45 ChilliX: The ones who did the AI's for commercial games. 05:47:54 quicksilver: the nature of the failure is unknown to me. I read stdout and stderr of the Python process. I write stderr to stdout to see whether the Python process halts. This does not happen. 05:48:02 wli: their goal is to make the game 'fun' and balance the difficult curve 05:48:04 @pl \f p -> f (f' p) (s p) 05:48:05 (`ap` s) . (. f') 05:48:13 wli: so they cheat without any particular ill-feeling :) 05:48:18 wli: just to get the curve feeling right 05:48:27 wli: hmm, not sure, but I think it is a hard problem (esp given the soft realtime constraints imposed by the framerate) 05:48:32 that's an intelligence of sorts :-) 05:48:46 real soldiers should also optimize for fun! 05:49:00 fasta: do you write to it and also read from it? 05:49:08 quicksilver: no 05:49:22 * quicksilver nods 05:49:26 just read from it 05:49:39 quicksilver: I just call the program and read stdout (and later also stderror) 05:49:40 quicksilver: Well, an obvious thought is to inject errors into the AI "thought process" or find tunables to create sliding scales of combat effectiveness while having tactics that don't bore the living daylights due to trivial exploitability. 05:50:00 the real problem is that a good AI is _VERY_ demanding computationally 05:50:05 wli: true. but it's easier to just cheat until the difficulty curve feels right :) 05:50:30 Sizur: have you ever seen an aimbot? 05:50:32 wli: the most important thing is that the game is easy enough for new players to play the 'first few' levels and challenging enough.. 05:50:37 quicksilver: well, but this only works in games where the human player doesn't get to reap and train much 05:50:43 --- quit: alvarezp ("Superkb 0.10 released: http://superkb.sf.net/") 05:50:45 fasta: you mean it's implementation? 05:50:52 ChilliX: reap and train? 05:50:55 --- quit: sharkk () 05:51:03 quicksilver: it depends on the game 05:51:05 --- join: JohnMeacham (n=JohnMeac@h-69-3-182-212.lsanca54.dynamic.covad.net) joined #haskell 05:51:05 --- join: mkhl (i=mkhl@200-153-181-246.dsl.telesp.net.br) joined #haskell 05:51:06 Sizur: It doesn't need to be a good AI. The tactics just need to be something less idiotic than the things walking right into your blowing them away. 05:51:07 reap = repeat 05:51:10 Creating a "fun" AI is the problem in games. 05:51:13 ChilliX: *nod* 05:51:18 Not something that can crush the human 05:51:34 quicksilver: See the above. The problem is that the AI is so phenomenally stupid it makes the game boring. 05:51:36 ChilliX: I suspect (although it depends what kind of game that we're talking about) they write the AI to make "one play-through" fun 05:51:53 quicksilver: AI that is challanging the first time around just gets rediculous once you practice a bit 05:52:01 --- join: alexeevg (n=gleb@ll-226.216.82.212.sovam.net.ua) joined #haskell 05:52:02 ChilliX: a game which people play over and over again (e.g. a network multiplayer game) ... right... what you just said 05:52:14 quicksilver: exactly 05:52:18 There are games where it's difficult to create an AI for (e.g. Go), but in most games the AI beats the best humans already. 05:52:25 well, my beef is with MMORPGs having no AI at all. that's because they design the game universe to reside on one machine 05:53:06 This isn't really an issue with the AI being super-intelligent. It's more like the AI existing in any nontrivial sense at all. 05:53:35 i.e. the enemies not being so stupid it makes the game boring. 05:53:37 --- join: timlarson_ (n=timlarso@65.116.199.19) joined #haskell 05:53:41 Hi all! I've just built lambdabot and now I'm getting 'Plugin `eval' failed with: IRCRaised Data.ByteString.last: empty ByteString'. Googling has brought only some IRC logs. How to fix it? 05:53:57 wli: you are right, but then there are time issues and pressure to push the product out of the doors 05:53:57 wli: I completely agree; hence, you hav to play humans 05:54:12 Also, when you have AI allies their stupidity really burns you up. 05:54:17 wli: true 05:54:22 wli: true, too 05:54:30 wli: commercial games have tended to focus on domains where that's not very important 05:54:31 wli: clearly you've never played online with *real* humans ;) 05:54:43 scook0: hehehe 05:54:46 scook0: I have. I get slaughtered every time. 05:54:51 wli: because the payoff for getting the AI good is not great compared to the cost 05:55:01 scook0: but the humans improve, well, at l;east some of them 05:55:13 quicksilver: 100% deathmatch with no AI involved whatsoever? 05:55:44 wli: deatchmatch is not even that demanding on an ai, try css 05:55:45 wli: I was thinking more of "adventure" games where you progress from level to level 05:55:47 Actually since I got LASIK my hand-eye coordination and reflexes have been improving wildly. 05:55:57 wli: the "AI" is normally a fixed script 05:56:00 quicksilver: Okay, wat about them? 05:56:08 wli: it's tweaked to catch you out the first time you play that level 05:56:17 wli: but once you work out what the AI is going to do, you're informed 05:56:21 --- quit: Khisanth (Read error: 104 (Connection reset by peer)) 05:56:25 wli: so it is (at worst) 'hard the first time' 05:56:38 and then it's like "well he's going to come around the left of that pillar, so I..." 05:56:42 --- join: Khisanth (n=Khisanth@pool-141-157-247-27.ny325.east.verizon.net) joined #haskell 05:56:44 quicksilver: And a sort of built-in planned obsolescence? 05:56:52 in a way, yes :) 05:57:03 the point is, they don't expect most of their customers to replay 05:57:13 quicksilver: that's current commercial definition of AI, but that's not AI really 05:57:13 so it doesn't really matter, to saleability 05:57:25 Sizur: absolutely, hence the quotes 05:57:30 Sizur: wli: the "AI" is normally a fixed script 05:57:54 wli: since they're not expecting people to replay, they don't spend (waste!) developer time on realistic AI 05:58:03 a simple scripted behaviour with perhaps a little random variation 05:58:05 well, there are AI scripts and there are scripts 05:58:10 is good enough for their customers 05:58:14 that falls under second 05:58:22 --- join: purplepenguins (n=purplepe@penguins.STUDENT.CWRU.Edu) joined #haskell 05:58:26 Sizur, there is no standard definition of AI 05:58:38 Oh, great, let's have a millionth discussion of what AI is. 05:58:42 of course, if they tried to sell a game whose success was entirely predicated on good AI 05:58:47 decision algorithm? 05:58:52 then they'd have more incentive to work on it 05:59:00 but games in that category are quite rare 05:59:06 (perhaps because they're not very good at it :) 05:59:16 AI is very hard 05:59:27 --- quit: Dybber () 05:59:27 There's a reason I don't buy many video games. 05:59:29 good AI, anyway 05:59:32 chessguy: you mean in the game-AI sense, or the AI-AI sense? 05:59:40 --- quit: rickynils ("Lämnar") 05:59:43 Or otherwise that I don't like video games. 05:59:44 wli: why play against computer anyway 06:00:07 Sizur: "why fly a kite, on your own" ? 06:00:08 scook0, uh, choose your poison, i guess 06:00:17 fair enough 06:00:20 Sizur: some activities are just fun. but it's subjective. 06:00:41 Sizur: I have a PSP I play with on the train some times. I just enjoy the games fairly shallowly at their own level :) 06:00:57 e.g., to do truly good AI even at tic-tac-toe is hard 06:01:10 Sizur: Mostly I go in for co-op multiplayer; myself and co-players goofing off playing against the computer as a team. 06:01:31 --- quit: jfredett (Connection timed out) 06:01:48 for some definition of AI which allows for the possibility of making sub-optimal moves for the purpose of tricking the opponent 06:02:05 quicksilver: i play single player only for story, like PlaneScape. the rest i play multiplayer 06:02:18 --- quit: ChilliX () 06:03:36 quicksilver: but you are right, it's alway ssubjective. i just dont see sense in playing against computer 06:04:12 --- join: anne (n=anne@194.204.127.85) joined #haskell 06:04:39 Sizur: yes. you don't play single-player to match your skill against the computer 06:04:49 Sizur: because that's not an interesting contest, in most games 06:04:49 --- quit: agoode (Read error: 60 (Operation timed out)) 06:04:58 Sizur: computer vs player is asymettric, so you play an asymmetric game 06:05:05 Sizur: or, as you said "for the story" :) 06:05:20 --- quit: mr_tenor (Remote closed the connection) 06:05:23 quicksilver: right to the point 06:05:36 which, incidentally, is why it's hard to make a game with good single- and multi-play 06:05:42 because of the asymmetry 06:06:15 yes 06:06:24 and, good games which are both, tend to actualy be different games 06:06:33 they might use the same engine, but still different games really 06:06:38 exactly 06:08:11 computer vs player works in Go (for humans who are poor go players) and chess (for humans who are good chess players) 06:08:19 but most other games are too hard 06:08:30 I'm not sure how the computer fares in poker. Probably poorly. 06:08:36 --- quit: nomeata ("Client exiting") 06:08:47 but go/chess are really more like "deathmatch with bots" than traditional single-player computer games 06:09:01 quicksilver: actually poker AI is at advantage due to lack of emotions 06:09:20 in the sense that the computer is merely substituting for another human 06:09:25 just calculate chances and approach win 06:09:59 Sizur: though you might not be able to exploit humans as well as other humans could 06:10:15 there was an article recently somewhere, talking about a competition of computer against 3 best poker players 06:10:41 --- part: anne left #haskell 06:10:42 --- join: cognominal_ (n=cognomin@138.208.64-86.rev.gaoland.net) joined #haskell 06:10:53 Sizur: but the skill in poker is in judging the other players 06:10:56 their conclusion was that poker algorithm is applicable to business negotiations 06:11:01 Sizur: and I'd think that a computer would be poor at that 06:11:15 (well obviously you do also need to calculate the chances) 06:11:49 poker isn't really a card game 06:12:50 the skill in poker is in being as accurate as you can about your odds (which the computer does really well) and in predicting accurately the times when the opponents fail to play optimally :) 06:13:28 in a sense that computer was not reading human faces for tale-tales, but human always impersonates computer so computer is again at advantage because human's emotions will be as high as against another human (especially when money is involved) 06:13:50 --- quit: seafoodX () 06:13:54 --- part: alexeevg left #haskell 06:14:30 Sizur: but my speculation would be that, in a tournament with players of a wide ability range 06:14:40 Sizur: the good humans would beat the poor humans by a larger margin 06:14:46 than the computer beats the poor humans 06:14:57 because the good humans would read when to bluff and when to call, against the poor humans 06:14:58 --- join: seafoodX (n=sseefrie@alphad261.lnk.telstra.net) joined #haskell 06:15:08 --- nick: Igloo_ -> Igloo 06:15:09 without data, i agree with you. it makes sense 06:15:14 althouhg I could believe that the computer would beat the good human head to head 06:15:23 yeah, that's what I was hinting at before 06:15:25 this is all speculation from my limited experience of poker though :) 06:15:46 (good humans can exploit bad humans better than a computer can) 06:15:54 in poker 06:15:57 What libraries are the games-in-Haskell nutters writing against, anyway? 06:16:01 i think there are two kinds of poor humans to consider: those that don't know the odds and those who are bad at reading others or masking themselves 06:16:05 and in business negotiations 06:16:17 MyCatSchemes: I'm using openGL 06:16:59 nothing stopping you from using putStrLn if you're more interested in the game than the interface 06:17:14 --- join: lasts (n=lastssel@85-218-28-130.dclient.lsne.ch) joined #haskell 06:17:19 itnerestingly, chess engine authors frequently build into their engines the ability to change their play depending on whether they're playing against a computer or a human 06:17:21 quicksilver: GLUT sounds sensible enough for graphics and for mouse and keyboard interface, but that doesn't give you any access to sound or joysticks. :/ 06:17:33 from Verbing to Scheming... that cat's upgrading 06:17:38 MyCatSchemes: I imagine if I get to that point I'll investigate SDL 06:17:39 --- join: oerjan (n=oerjan@hagbart.nvg.ntnu.no) joined #haskell 06:17:50 MyCatSchemes: but I don't care much about sound or joysticks :) 06:18:01 --- quit: Hirvinen (Read error: 110 (Connection timed out)) 06:18:30 olsner: :) 06:19:13 quicksilver: ahhh. That is slightly problematic to me, because I do. 06:19:43 gtk-GLext works 06:19:44 I have a function readu s = fst . head . readFloat $ s. It may crash on empty list, so I'd like to modify it to return Maybe.. What is the best to write this plz? 06:19:59 SDL provides sound and joystick support 06:20:15 @hoogle [a] -> Maybe a 06:20:16 Maybe.listToMaybe :: [a] -> Maybe a 06:20:16 List.find :: (a -> Bool) -> [a] -> Maybe a 06:20:21 gip: write a version of head which returns a maybe 06:20:26 gip: or, use listToMaybe 06:20:29 gip: which that is :) 06:20:34 i'm much more concerned with haskell lacking i18n and a good IDE to integrate literate, annotated, testable, interactive code 06:20:36 then change your fst to a 'fmap fst' 06:20:42 Are there Haskell bindings for SDL, I wonder? Though presumably it wouldn't be intractable to write them, I do not actually have a clue how. 06:20:42 @type listToMaybe 06:20:44 forall a. [a] -> Maybe a 06:20:46 @src listToMaybe 06:20:46 listToMaybe [] = Nothing 06:20:47 listToMaybe (a:_) = Just a 06:20:54 > let hack ~(x:y)=(x:y) in fix (show.map ord.hack) 06:20:57 "[91,57,49,44,53,55,44,52,57,44,52,52,44,53,51,44,53,53,44,52,52,44,53,50,44... 06:20:57 ugh, that's a bad name 06:20:58 gip: so it becomes fst `fmap` head . readFloat $ s 06:20:58 --- quit: chris2 ("Leaving") 06:21:02 MyCatSchemes: pretty sure there are 06:21:10 quicksilver : thanks, exactly what I need 06:21:15 @t fst `fmap` listToMaybe . readFloat $ s 06:21:15 Maybe you meant: tell temp thank you thanks thx time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ft v 06:21:19 :t fst `fmap` listToMaybe . readFloat $ s 06:21:21 precedence parsing error 06:21:21 cannot mix `fmap' [infixl 9] and `(.)' [infixr 9] in the same infix expression 06:21:24 Oh hey, hsdl.sf.net 06:21:29 Awesome. 06:21:29 :t (fmap fst) listToMaybe . readFloat $ s 06:21:31 Not in scope: `s' 06:21:32 @type fmap 06:21:34 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 06:21:38 :t \s-> (fmap fst) listToMaybe . readFloat $ s 06:21:40 Couldn't match expected type `(a, b)' 06:21:40 against inferred type `Maybe a1' 06:21:43 grr 06:21:44 I suck 06:21:49 :t \s-> (fmap fst) . listToMaybe . readFloat $ s 06:21:50 at last ? 06:21:51 forall a. (RealFrac a) => String -> Maybe a 06:21:54 yay :) 06:22:01 :) Great 06:22:01 Hmmmm. "Very incomplete", as of 2006-05-22. :/ 06:22:16 MyCatSchemes: yes, it is hsdl I was speaking of, but I wasn't sure if it was usable 06:22:28 --- quit: vincenz (Read error: 104 (Connection reset by peer)) 06:22:46 mrd: gtk-GLext is less interesting to me until gtk has native OSX support 06:22:51 mrd: although it would be an option 06:22:52 Well, my thoughts on game AI are not actually particularly advanced. Just bonehead squad tactics, simple things like peeking around corners, ec. 06:23:09 --- quit: chessguy ("Leaving") 06:23:18 First and foremost taking up positions. 06:23:41 wli: it would certainly be fun to have a system in which you could experiment 06:23:57 wli: at the moment, it's about 5 man-years of work to make a state-of-the art team FPS 06:24:07 wli: which is a long time to wait before you can try out AI experiments :) 06:24:28 quicksilver: you mean a game without graphics? 06:24:35 quicksilver: Which is why I was sort of hoping there was already a game out there. 06:24:44 fasta: I'm not sure really. Maybe simplistic graphics to represent the state of the world 06:24:55 5 man-years sounds way low 06:25:06 fasta: but with more of a focus on providing a test-bed for AI experimenation 06:25:07 wli: quake supports scription, doesnt it? 06:25:14 scripting* 06:25:16 mrd: that's what one of the unreal engine 3 devs told me 06:25:27 quicksilver: usable? In a word, "no." 06:25:28 is he counting making the engine and the art etc 06:25:33 mrd: of course man-years are a bit mythical :) 06:25:36 quicksilver: oh, building just an engine is not the most work. 06:25:45 mrd: not really sure. I think he just meant the engine and the tool suport 06:25:47 quicksilver: the short version (as opposed to the one-word version) is, "Nope, not nearly." 06:25:49 most good games have been going for years of development by many people 06:25:51 quicksilver: e.g. the Q3 engine can be used today. 06:25:54 mrd: the tools are massively important 06:26:04 --- join: jfredett (n=jfredett@wsc-209-239-198-247.worcester.edu) joined #haskell 06:26:07 fasta: that's true. But I wonder if it is a good basis for the kind of thing wli wants 06:26:09 there are excellent 3d engines already available, why build from scratch 06:26:11 fasta: (I don't know the answer) 06:26:32 like BioShock, which uses the Unreal 3 engine, but was in devel for over 2 years anyhow 06:26:45 I don't know if, for example, Q3's physics engine makes assumptions which are unhelpful 06:26:51 or uses annoying data structures 06:26:52 quicksilver: longer versions include, for example, "This HSDL thing? Not even nearly *resembling* a state of readiness. I mean, crikey on a stick, ladies and gentlemen, this thing's makefiles assume that you're on Mac OS X and using ghc 6.0.1 *exactly*." 06:27:12 MyCatSchemes: there is also HsSDL 06:27:22 MyCatSchemes: I don't know if that's any closer, or if it's further away 06:27:27 Lemmih: does HsSDL work? 06:27:38 The problem of AI is that it's not economical to build one on the short term. 06:28:01 Google doesn't have AI, they just solve one problem very good. 06:28:09 the unual solution is to create AI language for your game 06:28:11 --- join: RogerTaylor (n=rogertay@58.186.83.139) joined #haskell 06:28:12 usual* 06:28:37 The amount of hardware Google has, though (assuming low-interconnect speed) will probably be enough to build one, though. 06:29:06 MyCatSchemes: HsSDL looks much more promising to me 06:29:12 the description of the oblivion AI struck me as something pulled out of AIMA. unfortunately, it ended up kinda sucking. 06:29:31 quicksilver: thanks. :) 06:29:34 mrd why was it sucking? 06:29:39 hyped-up game AI tends to disappoint 06:29:52 mrd: i found it quite advanced 06:30:07 --- join: vincenz (n=cpoucet@134.58.253.57) joined #haskell 06:30:12 ever notice how all the NPCs walk down the same path =) 06:30:22 because the user generally never sees half the cool stuff the dev is aware of 06:30:26 it results in logjams and collisions in the imperial city 06:30:26 hyped-up anything tends to disappoint? :) 06:30:39 heh, true 06:30:43 and what's happened to oblivion for PSP? 06:30:46 * quicksilver looks impatient 06:30:50 --- join: jtoy (n=jtoy@c-65-96-150-204.hsd1.ma.comcast.net) joined #haskell 06:30:56 and all the NPCs say the same stuff 06:31:02 mind you if I'm playing PSP on the train, I'm not hacking haskell 06:31:07 oblivion on gameboy? :P 06:31:10 maybe I don't *want* oblivion for PSP 06:31:13 they go to bed at 11 am and wake up and then go right back to sleep 06:32:32 @where hssdl 06:32:33 http://darcs.haskell.org/~lemmih/hsSDL 06:32:50 mrd: you will always find things like this in any kind of AI. you simply dont have enough time to think of everything 06:33:52 Sizur: I would prefer approaches where thinking of everything is not neccessary. 06:34:04 mrd: many times i was designing "the best"(tm) framework for something, and was ending up hacking stuff just to make it work in time 06:34:21 of course, and that's what it appears happened here 06:34:34 Sizur: statistical methods - machine learning, generally. The wonderful thing about machine learning is that you don't have to teach the machine every damn little thing, just how to learn in general. ;) 06:34:52 Sizur: what you just said to mrd reminds me of http://xkcd.com/224/ 06:34:53 Title: xkcd - A webcomic of romance, sarcasm, math, and language - By Randall Munroe 06:35:02 quicksilver: thanks, man. 06:35:04 MyCatSchemes: that's impossible. you can make it learn a specific thing, but never learn in general 06:35:15 --- quit: vincenz (Remote closed the connection) 06:35:51 OCR will never talk to you for example 06:36:21 Sizur: uhhh... well, for example, let it build out state machines by generating them from a genetic algorithm, for example. In theory I bet you'd end up with ant-colony-like behavoir every time. 06:36:41 quicksilver: yeah i saw that one earlier and loved it :) 06:36:55 Sizur: oh, I'm not thinking of strong AI here, Christ no, waaaaay too much work. Just enough weak-AI-fakery that you'd be able to let it run the opposition in a video game. 06:37:36 --- quit: Shimei (Connection timed out) 06:38:26 MyCatSchemes: point is you cannot make AI that will comeup with something outside of it's domain 06:38:47 --- nick: tizoc_ -> tizo 06:38:50 --- nick: tizo -> tizoc 06:39:30 MyCatSchemes: that you you must design it to solve a specific problem you have in mind. 06:39:44 Sizur: a) that's strong-AI talk, which is to say, too damn difficult to be worth attacking directly right now and b) videogames are pretty strictly bounded. 06:40:24 oblivion is way out there 06:40:43 it's a reality simulation attempt 06:41:08 Yes, and? I'm just saying that, if your problem is, "come up with viable strategies for wiping out human opponents in videogames," something like a messy-GA to generate state machines would probably work really well. 06:41:59 It's bounded, it's feasible. It's also really really cool and it tends not to get tripped up by excessively clever players. 06:42:10 ok, but variate your path for local optimums, have a sleeping "urge", these things must be defined in the first place 06:42:15 * olsner envisions a shoot-em-up/procreation game with AI players 06:42:16 --- quit: boegel ("This computer has gone to sleep") 06:42:42 --- join: boegel (n=boegel@konijn.elis.UGent.be) joined #haskell 06:42:58 --- quit: boegel (Client Quit) 06:43:45 --- quit: RogerTaylor () 06:44:03 Sizur: I understand your point about needing to define the "urge" in the first place - in videogames you can just use the usual scoring mechanism for that, luckily enough. 06:44:06 olsner: we already have "shoot-up/procreation" AIs, but we call them pop stars 06:44:44 the reverse turing test - is it an AI or a dumb human? 06:44:46 I'm not sure I buy the "intelligence" part 06:44:47 Sizur: but what do you mean by, "variate your path for local optima"? If you're saying what I think you're saying, then that's already an intrinsic property of most heuristic searching methods anyway. 06:45:07 MyCatSchemes: my argument was aimed to explain why mrd thought oblivion's AI fell short 06:46:06 i meant in in a specific scenario as to why NPCs in Oblivion all walk seemingly similar paths leading to congestion in a populated area and why most NPCs go to sleep at specific times 06:46:13 Sizur: ah, I see. What did you mean by path variation, though? I just wanna check I wasn't misunderstanding you there. 06:46:36 not in Graph Theoretic sense 06:47:23 Ohhhhh, right. 06:47:51 simply there's no way to make any AI comeup with stuff like that on it's own 06:49:33 Well, if you attacked that specific problem - congestion - by giving each actor its own little heuristic engine for finding efficient paths simply by trying different paths sort-of-randomly to see which is most efficient, they'll tend to solve it over time, eventually. 06:50:03 yes if you have enough time to tackle that, sure 06:50:44 in a reality simulation there will always be things that are far from approximating reality. 06:50:50 Sizur: mmmhmmm. Bring thirty or fourty xboxen into your development studio and run these algorithms for a few straight days to generate the learned-data sets. 06:50:57 ai ... 06:50:58 http://www.imagination-engines.com/ 06:51:00 Title: Imagination Engines Inc. 06:51:19 Then, when you give the game to real players, it'll already have well-tuned AI pathfinding. As if by magic! ;) 06:51:53 MyCatSchemes: yes :) you will solve that problem, but there are infinite others to go 06:52:17 and the scary part: "August 19, 1997, The Creativity Machine Patent Issues the Same Day SkyNet Becomes Conscious." 06:52:35 --- quit: kpreid () 06:52:49 --- quit: Zygen () 06:52:49 puusorsa: what's that other than marketing blurb? 06:53:10 Sizur: sure there are lots, but, Hell, it's not as if you're trying to make the NPCs play Nethack or anything. The game's bounded. So is the set of actions you can perform in it, or would want to. 06:53:34 For neural networks I can read a book and see the algorithm, for this imagination engine, no. 06:53:35 --- join: kpreid (n=kpreid@cpe-24-59-154-165.twcny.res.rr.com) joined #haskell 06:53:37 I thought neural networks were a bit of an AI dead end? Have they actually had interesting results? 06:53:41 but your time and your resources are bounded more strongly ;) 06:53:42 Sizur: plus heuristics like GAs and simulated annealing and the like aren't particularly difficult to write anyway. >> 06:54:32 If this imagination engine was really so smart, why haven't they started a search companay? 06:54:36 company* 06:54:44 fasta, no idea 06:54:49 You can crush Google easily with such a device. 06:55:04 but he seems to be doing stuff for us army 06:55:09 that imagination-engine stuff seems to be very much like a scam or simply wishful thinking 06:55:16 --- join: falseep (n=boo@218.242.117.249) joined #haskell 06:55:28 puusorsa: show me the official books and I made buy it 06:55:36 osfameron: I remember once using a Half-Life bot (closed source, bleh) that apparently used neural networks to train ways of getting around the maps, obviating the need to spend bloody ages manually putting together waypoints (see: botman's bots, for example). 06:55:40 fasta, i'm not selling 06:56:06 (but you can pay me anyway) 06:56:11 puusorsa: I know, I meant "buy this crap from the website) 06:56:15 " 06:56:34 ai, they sell something too? 06:56:40 --- nick: mornfall_ -> mornfall 06:57:00 osfameron: part of the trick there was that, instead of just having the bots work on their *own* attempts and observations, they'd be building their paths by observing human players running around the map. Which means that all the sneaky places humans can get into but aren't neccessarily supposed to (and thus would never have thought to add to waypoint sets) suddenly become useful to the bots, too. :) 06:57:26 @hoogle evaluate 06:57:27 Control.Exception.evaluate :: a -> IO a 06:57:27 Test.QuickCheck.evaluate :: Testable a => a -> Gen Result 06:57:28 MyCatSchemes: cute :-) 06:57:44 --- quit: ivanm (Remote closed the connection) 06:57:58 osfameron: for very specific tasks, yes 06:58:06 osfameron: funnily anough, not really what I'd call "AI" 06:58:15 osfameron: mostly glorified fuzzy pattern recognition 06:58:16 handwriting recognition istr was one of those specific tasks wasn't it? 06:58:22 osfameron: things like OCR 06:58:43 --- join: mattrepl (n=mattrepl@pool-71-246-224-160.washdc.fios.verizon.net) joined #haskell 06:58:46 2.0 Non-Algorithmic Neural Networks (STANNOs) 06:58:49 Mitar pasted "translate to Either?" at http://hpaste.org/2748 06:58:57 Oh, cool, it's "non-algorithmic" 06:58:57 how can I translate this to Either monad? 06:59:08 how can I translate quards to monad? 06:59:30 I know that this could mean something, I just don't think it does in this context 06:59:37 --- quit: Itkovian () 06:59:58 fasta, i don't know how much that makes any sense still they seem to be doing stuff for the military 07:00:21 which doesn't prove anything of course, except maybe that their marketing works 07:00:33 Oh, quick question. How do I get ghc to search specific places inside my own home directory rather than system-wide for libraries? Is there something similar to CPATH, LD_LIBRARY_PATH, etc? 07:00:46 (Please?) 07:01:17 Mitar: change error to fail and add return to the success one 07:01:45 what about guards? 07:01:50 --- quit: dblhelix ("...") 07:02:01 --- join: njbartlett (n=njbartle@cpc2-barn4-0-0-cust110.brnt.cable.ntl.com) joined #haskell 07:02:32 Computer programming, with at least 5 years working experience with 5th generation computer languages such as C 07:02:33 Mitar: perhaps when (condition) (throwError "message") 07:02:35 Hahahaha 07:02:38 there's guard, but it doesn't include an error message 07:02:40 in a do block 07:03:18 fasta: ...5th!!!!? 07:03:30 I think throwError is what's needed 07:03:39 :i ($!) 07:03:43 you could use it to implement a generalised guard if you wanted 07:03:50 how? 07:03:52 Wow, that's nuts. 07:03:56 @src ($!) 07:03:57 Source not found. My pet ferret can type better than you! 07:04:01 MyCatSchemes: there's a flag for it, see the ghc user manual 07:04:09 guardE cond err = when cond (throwError err) 07:04:27 --- quit: gkr (Read error: 113 (No route to host)) 07:04:27 could we please get a non-offensive lambdabot in here? :) 07:04:28 (throwError is in Control.Monad.Error.Class) 07:04:30 quicksilver annotated "translate to Either?" with "(no title)" at http://hpaste.org/2748#a1 07:04:37 They do have at least one guy that published something. 07:04:39 Mitar: annotation made 07:04:56 MyCatSchemes: did you need this? http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#options-linker 07:04:56 -> http://uptr.pl/mV 07:04:58 Title: 4.10. Options related to a particular phase, http://tinyurl.com/smq5n 07:04:58 Title: 4.10. Options related to a particular phase 07:05:02 :t ($!) 07:05:07 forall a b. (a -> b) -> a -> b 07:05:19 why not use fail instead of throwError 07:05:20 ? 07:05:29 :t fail 07:05:30 forall (m :: * -> *) a. (Monad m) => String -> m a 07:05:33 :t throwError 07:05:35 forall e (m :: * -> *) a. (MonadError e m) => e -> m a 07:05:44 throwError supports custom error types 07:05:49 fail only string 07:05:51 scook0 annotated "translate to Either?" with "with guardE" at http://hpaste.org/2748#a2 07:05:52 @src ($!) 07:05:53 Source not found. Maybe if you used more than just two fingers... 07:06:02 nasty bot 07:06:38 ($!) is ($), strict in its argument, I believe 07:06:56 quicksilver annotated "translate to Either?" with "save two lines of valuable screen space!" at http://hpaste.org/2748#a3 07:06:58 \f x -> x `seq` f x 07:07:39 Sizur: I think so, but I'm unclear on whether this'll do what I'm after... 07:07:48 Mitar: slightly shorter version :) 07:08:16 --- join: gnomnain (n=gnomnain@bur91-2-82-231-159-152.fbx.proxad.net) joined #haskell 07:08:31 so if I use fail, i have to have Either String Type as a return type, where Type is my type 07:08:36 quicksilver: it's less safe! 07:08:46 I'm slightly astonished that nobody changed TyInt to TyBool :) 07:09:22 doserj: I don't think anybody bothered to read the actual code ;) 07:09:27 oerjan: changing the value of -B used? It'd work, but it doesn't really seem sane. Mind you, it'd *work*, it's just that it'd be totally evil. :/ 07:09:36 scook0: how so? 07:09:53 @src Either fail 07:09:54 fail msg = Left (strMsg msg) 07:09:58 (the mapM trick) 07:09:59 :t strMsg 07:10:01 forall a. (Error a) => String -> a 07:10:07 scook0: yes, but what about it is less safe? 07:10:15 * MyCatSchemes abuses ln -s, mwahahahaha. 07:10:31 if you screw up the number of list elements, you get a runtime error 07:10:35 MyCatSchemes: -i 07:10:38 instead of a compile-time error 07:10:53 --- quit: dnme ("[BX] Time wasted: 29 days 14 hours 29 minutes 2 seconds 22 milliseconds") 07:11:00 scook0: you mean it's "less safe to a typo" ? :P 07:11:02 ideally you'd be mapping over a 3-tuple, or a dependently-typed vector 07:11:28 scook0: it's fairly easy to inspect one line of code and verify that both lists have the same length 07:11:34 scook0: but I take your point :) 07:12:19 MyCatSchemes: oh, you mean the packages? sorry i misunderstood 07:12:21 yeah, it's more of a "don't play with knives" thing 07:12:55 scook0: maybe there should be a type class HomoTuple with instances for (a,a) and (a,a,a) etc 07:12:56 oerjan: yeah. I need to install things into ~ rather than /usr/local, but I don't have the disk space to make a complete copy of $libdir 07:13:25 quicksilver: would plain Functor work? 07:13:33 no 07:13:46 you can't 'upgrade' fmap to fmapM automatically 07:13:54 at least I don't thin so 07:13:54 yeah, I just realised that 07:13:58 you need FunctorM 07:14:13 (forgot the function was monadic, which was the whole point) 07:14:19 what's fmapM? 07:14:21 (my intention was that HomoTuple => Functor, though) 07:14:41 olsner: do you know what fmap is? 07:15:03 MyCatSchemes: GHC_PACKAGE_PATH maybe? 07:15:11 Functor f => (a -> b) -> f a -> f b? 07:15:13 how can I tell lambdabot to load some module to get more sources when I type @src ? 07:15:27 :t fmapM 07:15:28 oerjan: oooh 07:15:29 Not in scope: `fmapM' 07:15:31 @hoogle fmapM 07:15:31 Data.FunctorM.fmapM :: (FunctorM f, Monad m) => (a -> m b) -> f a -> m (f b) 07:15:31 Data.FunctorM.fmapM_ :: (FunctorM f, Monad m) => (a -> m b) -> f a -> m () 07:15:43 @hoogle length 07:15:44 Prelude.length :: [a] -> Int 07:15:44 Data.PackedString.lengthPS :: PackedString -> Int 07:15:44 Foreign.Marshal.Array.lengthArray0 :: (Storable a, Eq a) => a -> Ptr a -> IO Int 07:15:46 --- join: cjeris (n=Jeris@140.247.124.140) joined #haskell 07:16:04 :i length 07:16:18 is there something like (liftM not) ? 07:16:57 cognominal_: i don't think you can, @src is no automatically generated 07:17:01 *not 07:17:10 --- part: Sizur left #haskell 07:17:11 --- join: mvitale (n=mvitale@pool-71-240-105-119.pitt.east.verizon.net) joined #haskell 07:17:14 --- join: conal (n=user@misc-148-78-62-234.pool.starband.net) joined #haskell 07:17:31 Mitar: I don't think there's a shorter name for it, if that's what you mean 07:17:38 but nothing's stopping you from making one 07:17:42 --- join: zx]treads (n=root@83.212.84.210) joined #haskell 07:17:43 yes ... 07:17:53 but thought that there is already notM :-) 07:17:54 or not' 07:18:14 oerjan: ah, thank you, that is exactly what I needed. 07:18:16 Mitar: not <$> is slightly shorter :) 07:18:18 --- quit: matthew_- ("bye") 07:19:13 oerjan: though technically (<$>) is defined over Functor, not Monad 07:19:44 Oh weird, ghc-pkg doesn't seem to be installed here. :( 07:19:48 which would be a pain if you were trying to write code polymorphic in Monad 07:19:50 Mitar: I like to swap it around, as (not `liftM` ) 07:20:07 Mitar: or just (not `fmap`) 07:20:27 quicksilver: are you one of those crazy people who use `id` instead of ($)? ;) 07:20:49 nope 07:20:49 --- join: antisvin (n=antisvin@83.218.193.55) joined #haskell 07:20:58 but, consider the following code: 07:21:09 foo = StringType bar 07:21:18 (building a type with a constructor) 07:21:29 now suppose you refactor a bit, and bar ends up monadic 07:21:32 I prefer to then write 07:21:38 foo = StringType `fmap` bar 07:21:43 which 'looks like' what I had before 07:21:47 oh, I thought you were talking about sections 07:21:47 instead of 07:21:54 foo = fmap StringType bar 07:22:00 infix `liftM`/`fmap` is fine, imo 07:22:10 MyCatSchemes: if i read it correctly the user package database is searched first 07:22:26 but (not `fmap`) on its own is just gross 07:22:38 so you may not actually need to set it if you use the default location? 07:23:01 though if you want to write `fmap`, you might as well just use <$> 07:23:33 oerjan: dunno. ghc-pkg doesn't seem to be installed here, though, weirdly. 07:23:51 oerjan: since the usual method of creaping the user package database is to run ghc-pkg... 07:24:16 what is the point of base/GHC libraries? why are not they shoved elsewhere? 07:24:17 oh 07:24:43 there is a GHC/List and Data/List... 07:24:57 what is the point of making two librairies? 07:25:09 oerjan: wait, yes it is. It's just not in my account's PATH by default. *swings ln -s around and smites this issue* 07:25:14 scook0: yes, point 07:25:25 scook0: I think my habit dated from before Control.Applicative was in base 07:25:32 :t (<$>) 07:25:34 --- join: boegel (n=boegel@konijn.elis.UGent.be) joined #haskell 07:25:34 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 07:25:43 @index <$> 07:25:44 bzzt 07:25:47 @index (<$>) 07:25:48 bzzt 07:25:51 * quicksilver shrugs 07:25:56 @index fmap 07:25:56 I think it's defined in applicative, anyway :) 07:25:56 Control.Monad, Prelude, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Cont, Control.Monad.Error, Control.Monad.List 07:25:58 by the time I heard about `fmap`, I'd already read about <$> 07:26:14 I'd heard about <$> 07:26:16 but historically, I've always preferred fmap over liftM 07:26:17 but not with that symbol 07:26:25 however Conor draws it on paper 07:26:29 I don't remember what he uses now 07:26:40 and it wasn't in ghc 6.4, I don't think 07:27:04 --- join: Nshag (i=user@Mix-Orleans-106-2-226.w193-248.abo.wanadoo.fr) joined #haskell 07:27:16 --- join: drigz (i=drigz@bb-87-80-32-99.ukonline.co.uk) joined #haskell 07:27:53 apparently there is dual life libraries like in Perl, that live both in the core and in hackagedb 07:28:11 can someone shed the light on this ventilation of librairies? 07:28:37 --- join: malcolmw (n=malcolm@venice.cs.york.ac.uk) joined #haskell 07:28:51 cognominal_: I don't properly grok hackagedb and cabal, to my chagrin 07:29:02 cognominal_: so these issues confuse me too :) 07:29:26 --- quit: shapr (Read error: 110 (Connection timed out)) 07:29:31 --- join: Jedai (n=cfouche@slsu0-15.ens-lyon.fr) joined #haskell 07:30:50 --- join: sebell (i=sebell@nat/ibm/x-053e7759be0659a1) joined #haskell 07:32:06 --- join: aaco (n=aaco@201-13-192-220.dial-up.telesp.net.br) joined #haskell 07:33:26 --- quit: doserj ("Leaving") 07:34:39 hmm, with HPDF progressing well 07:34:51 maybe haskell might be the right language to write my iPhoto-killer in 07:35:24 I find it easy not to use iphoto by virtue of not using Mac :-) (But, seriously, cool, sounds like a fun project) 07:36:06 did this year's icfp contest come out with a top 3 as usual? 07:36:25 osfameron: the objective is to ensure that I can still access my iPhoto library if I decide not to buy a mac, next time around 07:36:32 osfameron: defeat vendor lock-in! :) 07:36:48 ah cool! is the format documented? Or just easy/possible to reverse engineer ? 07:36:51 drigz: I think the results aren't published until the conference itself 07:37:03 osfameron: it uses apple's proplist, which is documented 07:37:12 osfameron: then you just have to guess the meanings of the keys/values 07:37:15 osfameron: which is simple enough 07:37:17 Is there a plot library for Haskell? 07:37:20 (the conference is October 1-3, apparently) 07:37:21 --- join: xynn (n=james@cpe-69-205-127-65.rochester.res.rr.com) joined #haskell 07:37:34 quicksilver: oh, i see. thanks 07:37:58 fasta: plotting graphs, or vector graphics in general? 07:38:23 * oerjan suddenly imagines a library for writing fictional plots 07:38:38 * CosmicRay hands oerjan Inform 07:38:40 oerjan: I recall a macintosh application which did that, quite a few years back 07:39:02 hmm, what if === and =/= are also monadic with Either? 07:39:03 nothing new under the sun :) 07:39:12 scook0: plotting graphs 07:39:22 :t (===) 07:39:30 Not in scope: `===' 07:39:38 olsner: he invented them 07:39:47 Mitar: define your own version of when 07:39:50 :t whenM 07:39:52 Not in scope: `whenM' 07:39:58 oerjan: you could use Vladimir Propp's classifications of story types. Or something like Calvino's Tarot work. 07:40:08 ok, i am just making sure there is nothing already written 07:40:11 "standard" 07:40:38 :t when 07:40:40 forall (m :: * -> *). (Monad m) => Bool -> m () -> m () 07:40:44 :t \c -> c >>= flip when 07:40:46 forall (m :: * -> *). (Monad m) => (Bool -> m ()) -> Bool -> m () 07:40:50 fasta: for my current research stuff, I've just been generating data to pipe into gnuplot (fwiw) 07:40:51 :t \c -> c >>= when 07:40:53 forall (m :: * -> *). (Monad m) => (m () -> Bool) -> m () -> m () 07:40:53 A library for writing fictional plots sounds like Orwell's story-writing machines. 07:40:59 I don't have any better advice than that, I'm afraid 07:41:01 hmph 07:41:09 I'm being stupid I'm sure :) 07:41:39 ought to be a one-liner with 'when' and >>= 07:41:58 :t let whenM c t = do b <- c; when b t 07:42:00 --- join: drice (n=drice@adsl-76-199-103-143.dsl.pltn13.sbcglobal.net) joined #haskell 07:42:00 : 07:42:00 Could not find module `L': 07:42:01 scook0: yes, that was my plan A 07:42:04 :t let whenM c t = do b <- c; when b t in whenM 07:42:06 forall (t :: * -> *). (Monad t) => t Bool -> t () -> t () 07:42:20 quicksilver: if you're prepared to use verrrrry long lines, and { and } and ;, *any* program can be written as a one-liner. 07:42:26 :t \t r -> t >>= flip when r 07:42:29 forall (m :: * -> *). (Monad m) => m Bool -> m () -> m () 07:42:40 scook0: I just asked to see whether anything might have changed (not that likely, since I don't miss a lot that's happening here) 07:42:40 fasta: I wonder what darcs-graph (on hackage) uses? 07:42:46 :t \t -> t >>= flip when 07:42:48 forall (m :: * -> *). (Monad m) => (Bool -> m ()) -> Bool -> m () 07:42:55 Ohhhh, fuck. My university's installation of ghc is totally FUBAR. :( 07:43:01 hmph 07:43:03 MyCatSchemes: what else is new? 07:43:30 @pl \t r -> t >== flip when r 07:43:30 (. flip when) . (>==) 07:43:34 @pl \t r -> t >>= flip when r 07:43:34 (. flip when) . (>>=) 07:43:42 btw, xmonad compiled with the latest solaris sparc release segfaults 07:43:57 olsner: --> #xmonad 07:44:07 fasta: only because they couldn't be arsed to make *one* feckin' symlink. Gah. 07:44:15 @pl \r t -> t >>= flip when r 07:44:15 (=<<) . flip when 07:44:56 MyCatSchemes: what version do they have installed? 07:45:03 whenM t a = do 07:45:03 t' <- t 07:45:03 when t' a 07:45:05 fasta: 6.6 07:45:39 MyCatSchemes: my university still has 6.4 07:45:46 MyCatSchemes: (and 6.2) 07:45:48 Mitar: aww, that takes all the fun out of it! ;) 07:45:59 out of what? 07:46:02 Mitar: right. 07:46:19 Mitar: quicksilver et al. were trying to make a pointfree version 07:46:21 Mitar: I was just trying to write it stupidly shortly :) 07:46:21 fasta: when I try to "runghc Setup.hs configure" for (the stable release of) Yi, it breaks because it can't find ghc-pkg in /usr/local/bin. Which is as annoying as Hell, because ghc-pkg is right in my fuggin' $PATH, just tucked away elsewhere. 07:46:26 he he 07:46:27 :-) 07:46:50 ...how much hackery, I wonder, would it take to get around that? 07:46:55 yes ... i am not so good in this so then i do it quick like this :-) 07:47:16 MyCatSchemes: that sounds like you doing something wrong 07:47:24 writing pointfree code off the top of your head is not so good for productivity 07:47:37 better to write it out longhand first, and maybe refactor later 07:47:54 scook0: Depends whether you get fast at doing it. 07:48:22 sure, once you've messed around enough, you'll pick up real skills 07:48:34 fasta: any suggestions as to what it could be? /usr/local/bin/ghc exists, /usr/local/bin/hp2hs exists, as do a few of the other misc. binaries, but they never bothered to make ghc-pkg, runghc or runhaskell available. 07:48:38 but until then, there's no shame in writing it the long way 07:48:49 hmm that pimp recruiting for haskell quant developers works just a few hundred yards from me 07:49:00 fasta: in the face of the evidence, I'm lead to strongly doubt that *I* am in error here. 07:49:11 --- join: Cheery (n=cheery@a81-197-9-42.elisa-laajakaista.fi) joined #haskell 07:49:54 --- quit: etnt ("bye") 07:50:21 MyCatSchemes: if it's a big deal, you might try a -cafe post 07:50:34 better chance of an authoritative answer 07:51:45 If I knew numerical methods for the Malliavin calculus and stochastic diffeq's better I'd take it more seriously. 07:52:02 --- join: bluestorm_ (n=bluestor@mna75-1-81-57-39-150.fbx.proxad.net) joined #haskell 07:52:48 --- quit: amiddelk ("Cya later") 07:54:01 scook0: well, it's certainly not a bug in ghc-6.6 itself or anything, it's just this university's totally broken-ass installation of it. 07:54:30 --- join: b_jonas (n=b_jonas@dsl51B6190D.pool.t-online.hu) joined #haskell 07:54:45 sure, but you might find out whether there's a feasible workaround 07:55:18 --- join: thou (n=tsmith@67-132-99-226.dia.static.qwest.net) joined #haskell 07:56:11 --- quit: jtoy () 07:56:16 scook0: I'm scared to ask the sysadmins at uni here because I'm afraid that they might've done this on purpose. ;) 07:56:30 on balance, I suspect you have 07:56:36 you are clearly a subversive 07:56:45 your very presence in this channel makes that clear ;) 07:56:49 Interesting. I see video game physics for fixed-wing aircraft but not helicopters. 07:58:19 --- quit: hordf ("Bye") 07:58:50 --- join: sjanssen (n=sjanssen@pcp082686pcs.unl.edu) joined #haskell 07:58:51 --- join: byorgey (n=byorgey@cscwlan.csc.com) joined #haskell 07:59:37 --- quit: swiert ("leaving.") 08:00:27 --- quit: cognominal_ (Client Quit) 08:00:47 I suspect that autorotation would be pretty hard to model accurately 08:02:09 --- join: Blwood (n=Blwood@105.238-243-81.adsl-dyn.isp.belgacom.be) joined #haskell 08:02:16 --- join: Shimei (i=asumu@sr-35.srtw01.resnet.ubc.ca) joined #haskell 08:02:25 --- quit: xynn ("Leaving") 08:02:26 I would imagine it's very non-linear 08:02:47 don't know anything about fluid/aero dynamics though :) 08:02:51 MyCatSchemes: Why are you using /usr/local anyway? 08:03:06 MyCatSchemes: that's not the default installation location 08:03:14 fasta: Lord knows. 08:03:36 MyCatSchemes: Anyway, just annoy your system admins. 08:03:38 fasta: everything's installed in /usr/local/ghc66 anyway. 08:03:47 MyCatSchemes: it's their job. 08:04:00 fasta: and then a handful of things are copied out to /usr/local/bin to make them actually available, since that's in everybodies' $PATH. 08:04:36 MyCatSchemes: why not add /usr/local/ghc66 to your $PATH? 08:04:47 --- join: prb (n=prb@c-24-22-188-196.hsd1.mn.comcast.net) joined #haskell 08:04:50 MyCatSchemes: i.e. any directory with a binary 08:05:14 fasta: I *believe* it is because this version of DeadRat doesn't package anything even resembling an up-to-date version of GHC, so they've built and installed 6.6 from scratch themselves, but done it in an odd location to stop it from interacting with DeadRat's package management. 08:05:37 DeadRat? Is that RedHat? 08:05:40 Yes. :) 08:05:53 Oh, I don't have such a negative feeling about it. 08:06:06 Spiffy name, though. 08:06:14 Neither did I until, oh... today. 08:06:48 Getting things into $PATH isn't a problem. I merely swing "ln -s" about in ~/bin and that problem goes away. 08:07:17 However, Setup.hs for Yi is barfing because it's only looking in /usr/local/bin for ghc-pkg, rather than actually checking my $PATH. 08:08:23 did you check the .cabal file to see if there was something broken in it? 08:08:35 lots of times you can just manually plug in what you want 08:08:55 I take it there's no "/usr/local/bin/ghc-pkg" sitting conspicuously in the Setup.hs? 08:09:13 scook0: grepped the whole damn directory. Nope. 08:09:15 --- quit: drice ("Leaving.") 08:09:39 just double-checking the easy stuff :) 08:09:41 (And the subdirectories) 08:10:35 Methinks the search must be built into Cabal itself? I presume I'm doomed in that case. 08:10:51 --- quit: sebell ("rcirc on GNU Emacs 23.0.50.1") 08:11:00 --- quit: gwern (Remote closed the connection) 08:11:28 at this point you should probably pick either -cafe or admins (possibly both) 08:12:32 Have you seen that at least part of Google's MapReduce tutorial uses Haskell? 08:12:36 --- quit: falseep ("Leaving.") 08:12:39 http://code.google.com/edu/content/submissions/mapreduce/listing.html 08:12:41 Title: Google Code for Educators - Google: MapReduce in a Week, http://tinyurl.com/278gp4 08:12:47 See the "Functional Programming Warm-up". 08:12:56 Microschrott Windows <- another one I didn't know 08:13:07 (from the gnuplot docs) 08:13:17 ricky_clarkson: .doc? euch 08:13:27 quicksilver is allergic to .doc 08:13:53 I am allergic to everything OpenOffice doesn't open correctly. 08:14:03 --- quit: Blwood ("71 75 69 74") 08:14:03 ricky_clarkson: does indeed look like haskell although it's hard to be sure 08:14:05 Openoffice seems to work fine for this. 08:14:15 quicksilver: It's easy to be sure, because the doc says it's Haskell. 08:14:16 ricky_clarkson: it's simple enough and a number of languages look like that :) 08:14:22 fasta: I am allergic to OpenOffice. 08:14:22 MyCatSchemes, isn't it the "getLibDir" that does it for you? It runs ghc --print-libdir. 08:14:35 --- join: mfunebre (i=mfunebre@71.231.2.6) joined #haskell 08:14:37 ricky_clarkson: oh yes, I didn't spot that :) 08:14:37 MyCatSchemes: why? 08:14:43 ricky_clarkson: except the desired output for question 2 is not well-typed 08:14:48 fasta: slow. Abiword FTW. ^^ 08:15:00 MyCatSchemes: i think cabal looks for a ghc-pkg in the same directory where it finds ghc hoping that in this way it's using the right ghc-pkg and not one of a different installation of ghc 08:15:05 fasta: (though I like the feature proliferation - equation typesetting and the like) 08:15:10 hmm, it does say its Haskell though 08:15:19 byorgey: just a typo, I think 08:15:25 byorgey: someof the [] are supposed to be () 08:15:31 quicksilver: you're right, they used [] for () 08:15:32 right 08:15:33 byorgey: (k1,[a,c,d]) et al 08:16:12 --- quit: boegel ("Leaving") 08:16:17 BTW it's easy to make a game where the AI is the point even with low-quality AI. 08:16:44 MyCatSchemes: you can give configure a speficic path with --with-hc-pkg= 08:17:01 I hear that most people just go around running over pedestrians and shooting at cops instead of playing missions (if they even notice there are missions). 08:17:10 That is, in the GTA games. 08:17:35 So delete the missions, beef up the AI, let people screw around like they do there. 08:18:54 wli: That's probably why none of the pedestrians are children or old people. 08:19:48 --- join: shapr (i=shae@94-102.101-97.bham.res.rr.com) joined #haskell 08:20:20 Oh, yeah, speaking of fashion design bits, GTA:SA (and possibly earlier) have changeable wardrobes, so there's plenty of futzing with the clothes you can expand on as well. ;) 08:21:22 That reminds me of my brother spending all his time making cars look good in racing games, but he was crap at the actual game. 08:21:46 --- quit: seafoodX () 08:22:32 --- quit: unmarshal (Remote closed the connection) 08:22:32 --- quit: olsner (Remote closed the connection) 08:22:37 Yeah, more car mods and fancy pimpmobiles, too. 08:22:49 --- join: olsner (n=salparot@cust.fiber-lan.vnet.lk.85.194.50.194.stunet.se) joined #haskell 08:23:05 --- join: CRathman (n=chatzill@216.140.54.104) joined #haskell 08:23:12 --- part: smithzv left #haskell 08:24:07 Throw in house, boat, airplane, and helicopter mods, too, while you're at it. 08:24:55 --- quit: Tac-Tics ("Leaving.") 08:27:58 --- quit: augustss (Read error: 110 (Connection timed out)) 08:29:16 --- join: mbrandt (n=mbrandt@207-114-255-242.static.twtelecom.net) joined #haskell 08:29:27 hey all 08:30:10 I was just trying to compile greencard so I could interface to a C lib and found that it won't compile with newer compilers. 08:30:16 --- join: LeCamarade (n=revence@217.113.73.39) joined #haskell 08:30:27 seems to want to reference some deprecated stuf 08:30:47 I think it's essentially deprecated 08:30:49 greencard 08:30:56 I believe c2hs is now preferred 08:31:00 @dcos Ord 08:31:01 Ord not available 08:31:07 @dcos Ordering 08:31:07 Ordering not available 08:31:08 bah 08:31:19 I'll have a look at c2hs. Thanks 08:32:21 Which is the 32-bit type, again? 08:33:03 Word32? 08:33:09 Int32? 08:33:12 depending which you want 08:33:17 Saizan: (sorry for the slow response) --with-hc-pkg= being given to which tool, sorry? 08:33:47 MyCatSchemes: to runghc Setup configure, if the problem was with it 08:34:52 @docs Data.Ord 08:34:53 Data.Ord not available 08:35:09 sheesh 08:35:30 --- quit: jbauman (Read error: 110 (Connection timed out)) 08:35:51 @docs Control.Monad.State 08:35:52 http://haskell.org/ghc/docs/latest/html/libraries/mtl/Control-Monad-State.html 08:37:24 --- join: dons (n=dons@c-24-22-19-90.hsd1.mn.comcast.net) joined #haskell 08:37:40 --- join: Blwood (n=Blwood@105.238-243-81.adsl-dyn.isp.belgacom.be) joined #haskell 08:38:08 int-e: ping 08:38:16 Saizan: thank you, that works. 08:39:06 --- quit: sior|sleep () 08:39:28 --- nick: tmoertel_away -> tmoertel 08:40:07 MyCatSchemes: good :), --help lists more options like this, btw 08:40:32 --- quit: tommyd (Read error: 104 (Connection reset by peer)) 08:43:51 olsner: did you report the segfault on the sparc? 08:45:21 yeah, that was me... I'm thinking it's probably something with the compiler setup though... had to hack -fasm to -fvia-C in the cabal files to get X11-extras and xmonad to compile 08:46:31 does it work now? 08:46:39 --- quit: mbrandt ("Leaving") 08:46:43 it could be bugs in the ffi binding, or ghc bugs, or ... 08:47:42 olsner: when did xmonad crash? 08:48:02 olsner: would it be too much trouble to attach gdb and get a backtrace? 08:48:11 I more or less gave it up since it didn't work... I have no solaris/sparc systems at home, only at school, so my testing abilities are limited 08:48:39 I did that, got stginit_something->stginit_something->??? 08:49:11 olsner: so it crashed immediately after startup? 08:49:20 Is it possible to write an if function (that works properly) in a strict language 08:49:40 yeah, it didn't produce any noticable output or anything 08:50:12 olsner: okay, thanks. Seems likely that it's a GHC bug 08:50:21 beelsebob_: yeah 08:50:35 move the branches under a lambda, and apply the branch to () once the branch is chosen 08:50:54 ah, that makes sense 08:51:08 (anonymous) pasted "(no title)" at http://hpaste.org/2750 08:51:11 oops 08:51:12 of course that has to be done at the call site 08:51:15 didn't mean to announce that 08:51:17 so it's a bit less modular 08:51:31 if_ !b !(\_ -> e1) !(\_ -> e2) = if b then e1 () else e2 () 08:51:34 dons: that was what I was doing, and causing explosions (because mod gets evaluated forever) 08:51:35 --- quit: mfunebre () 08:51:38 yeah, or macros or something 08:52:15 * beelsebob_ decided to fix the language instead of the if though 08:52:21 some otherwise strict languages allows call-by-name arguments 08:52:30 like Scala 08:52:33 Mitar pasted "compile error" at http://hpaste.org/2751 08:53:04 --- quit: Tigge (Read error: 104 (Connection reset by peer)) 08:53:11 --- quit: dons ("-> work") 08:53:19 what means No instance for (Monad (Either String)) error? 08:53:28 --- quit: xtacy[ ("Leaving") 08:53:29 how can Either be of type just (Either String) 08:53:40 Mitar: you need import Control.Monad.Error 08:54:15 --- quit: MyCatSchemes ("Swim, swim, hungry!") 08:54:16 Mitar: (Either String) is a partially applied type 08:54:16 aaa 08:54:19 Mitar: Monad is a constructor class -- it takes a type constructor that takes a type to produce a type 08:54:22 @kind Either 08:54:27 * -> * -> * 08:54:28 because monads have kind * -> *, so you leave out the last type argument 08:54:28 @kind Either String 08:54:30 * -> * 08:54:31 Mitar: consider, 'Maybe Int' is not a Monad 08:54:37 Mitar: 'Maybe' is a Monad 08:54:50 Mitar: you must always have one parameter "waiting" for a Monad 08:55:02 as oerjan says, this is because Monads are of kind * -> * 08:55:10 ok, but i do not understant why should i import Control.Monad.Error? 08:55:21 Either is not defined as a monad otherwise? 08:55:23 because that is the file which contains the Monad defition for Either 08:55:56 the monad definition for Either is not int he standard prelude because it isn't haskell98 compliant 08:56:01 it requires MPTC and fundeps 08:56:10 --- quit: Ben` ("leaving") 08:56:55 it _could_ have been in the standard prelude 08:57:06 --- join: _lapthrick (n=mathrick@users.kollegienet.dk) joined #haskell 08:57:14 it's the MonadError stuff that cannot 08:57:26 --- join: Tigge (n=tigge@bacchus.olf.sgsnet.se) joined #haskell 08:57:58 oerjan: you could make Either String a monad, in the standard prelude 08:58:08 oerjan: but it would be hard to give the general instance 08:58:41 oh right 08:58:58 if I have isvalue :: Type -> Bool 08:59:05 and make 08:59:05 isvalueM = liftM isvalue 08:59:16 what type should isvalueM be 08:59:20 to be in Either monad? 08:59:25 m Type -> m Bool 08:59:42 Either String Type -> Either String Bool 09:01:21 --- join: lelf (n=lelf@195.74.84.41) joined #haskell 09:02:50 --- quit: _lapthrick ("HULK ANGRY! HULK DISCONNECT!") 09:03:36 and whenM? 09:03:39 whenM :: Monad m => m Bool -> m a -> m a 09:03:39 ? 09:03:44 (it is not correct) 09:04:48 --- join: dje (n=dje@S0106000d9324c457.vc.shawcable.net) joined #haskell 09:04:48 --- quit: shapr (Read error: 104 (Connection reset by peer)) 09:05:49 Mitar: are you having a problem with some particular code? 09:06:14 just warnings now ... 09:06:20 i declared whenM t a = do 09:06:20 t' <- t 09:06:20 when t' a 09:06:43 --- quit: LeCamarade (":-o") 09:07:29 @type when 09:07:39 forall (m :: * -> *). (Monad m) => Bool -> m () -> m () 09:07:40 --- quit: bvd (Remote closed the connection) 09:08:07 Mitar: m Bool -> m() -> m() 09:08:31 Mitar: it can't return any value "a" because the code might not be executed 09:09:22 finally ... now it works ... no more laziness :-) 09:09:28 (I pass errors with either) 09:09:33 --- quit: bos (Read error: 113 (No route to host)) 09:09:54 woot 09:10:00 and as a bonus, you've learn all about monads and stuff :) 09:10:03 --- quit: roman ("Leaving.") 09:10:11 great :-))) 09:10:20 i just spend 6 hours on that ... 09:11:47 ahh, not yet finished ... 09:11:48 --- nick: tmoertel -> tmoertel_away 09:11:49 :-( 09:13:19 --- quit: Blwood ("71 75 69 74") 09:13:40 --- join: _lapthrick (n=mathrick@users.kollegienet.dk) joined #haskell 09:14:38 is there a monadic version of foldl? 09:14:41 --- quit: _lapthrick (Read error: 104 (Connection reset by peer)) 09:14:50 ?type foldM 09:14:56 forall a b (m :: * -> *). (Monad m) => (a -> b -> m a) -> a -> [b] -> m a 09:15:00 Mitar: foldM . reverse, probably 09:15:05 ?src foldM 09:15:05 foldM _ a [] = return a 09:15:05 foldM f a (x:xs) = f a x >>= \fax -> foldM f fax xs 09:15:17 nah, foldM is a left fold 09:15:18 err, plus another reverse 09:15:20 ?src foldl 09:15:21 foldl f z xs = lgo z xs 09:15:21 where lgo z [] = z 09:15:21 lgo z (x:xs) = lgo (f z x) xs 09:15:27 --- join: bos (n=bos@adsl-69-107-52-84.dsl.pltn13.pacbell.net) joined #haskell 09:15:51 pjd: plus a flip :) 09:15:55 guten morgen 09:16:01 liftM foldl 09:16:23 foldl f = reverse . foldr (flip f) . reverse 09:16:24 I think 09:17:15 @seen int-e 09:17:15 int-e is in ##logic, #ghc, #haskell-overflow and #haskell. I last heard int-e speak 1h 56m 40s ago. 09:17:18 what's wrong with liftM 09:17:18 Mitar: that's a bit different 09:17:29 nothing's wrong with liftM 09:17:35 but it's something different :) 09:17:51 will not work? 09:18:03 depends what you're trying to do 09:18:43 foldM is for folding a serious of monadic calculations through a list 09:18:53 Mitar: actually, what exactly did you mean with "monadic version of foldl"? 09:18:56 --- join: xynn (n=james@cpe-69-205-127-65.rochester.res.rr.com) joined #haskell 09:19:01 :t foldM 09:19:03 forall a b (m :: * -> *). (Monad m) => (a -> b -> m a) -> a -> [b] -> m a 09:19:40 if you just want to use foldl on a list produced in a monad, liftM will do fine 09:19:43 foldM is like foldr where the result of the function is monadic 09:19:58 i have functional code, where i used error for exiting when there was an error 09:20:18 now i am porting it to Either 09:20:19 --- quit: mkhl (Client Quit) 09:20:37 we need to know the types involved :) 09:20:43 which bits are monadic and which bits aren't 09:20:47 and you want to exit in the middle of the folding? 09:20:49 what is your binary function, for example? 09:20:52 > x 09:20:53 pjd: why do you say that's like foldr? the function is called with the accumulator so far not with the result of the recursive call 09:20:53 1 09:21:10 deccheck :: (TypeEnv,VarEnv) -> [Dec] -> Either String (TypeEnv,VarEnv) 09:21:24 (after porting to Either) 09:21:36 yes, you want foldM 09:22:02 --- join: mrsolo (n=mrsolo@dsl092-025-194.sfo1.dsl.speakeasy.net) joined #haskell 09:22:03 you run that over a [[Dec]] ? 09:22:07 --- quit: c9s ("leaving") 09:23:12 > do not `want` cheezburger 09:23:13 Nothing 09:23:18 Saizan: sorry, had it the wrong way around 09:23:31 bos: heresy! 09:23:34 o_O 09:23:38 Mitar pasted "types types" at http://hpaste.org/2752 09:23:57 > want 09:23:58 Add a type signature 09:24:18 > cheezburger 09:24:19 Nothing 09:24:20 Mitar: yes. looks like foldM to me 09:24:20 > [want,True] 09:24:21 Couldn't match expected type `(a -> b) -> f a -> f b' 09:24:44 > [cheezburger,True] 09:24:45 Couldn't match expected type `Maybe a' against inferred type `Bool' 09:25:15 --- quit: sad0ur (Read error: 110 (Connection timed out)) 09:25:25 > do not `want` Just cheezburger 09:25:25 Couldn't match expected type `Bool' against inferred type `Maybe a' 09:26:01 but, is not foldl and foldM going in the same dirrection? 09:26:10 why should I use reverse and all that stuff? 09:26:14 you don't need to 09:26:16 pjd was swrong 09:26:20 foldM is left-based 09:26:22 sure, but foldl cannot do monadic actions _during_ the folding, like exiting 09:26:32 hmm.. @type doesn't react to @let variables, it seems 09:26:38 :t cheezburger 09:26:40 Not in scope: `cheezburger' 09:26:47 :t L.cheezburger 09:26:48 Couldn't find qualified module. 09:26:51 olsner: why do you think i used that trick? :) 09:27:11 ok, so I just replace foldl with foldM if I see correctly 09:27:16 --- join: glen_quagmire (n=glen_qua@pool-71-249-60-100.nycmny.east.verizon.net) joined #haskell 09:27:23 --- join: jbauman (i=jbauman@JBAUMAN.WV.CC.cmu.edu) joined #haskell 09:27:28 yeah, but this is #haskell, where trickery needs no reason 09:27:44 Mitar: I believe so 09:27:51 > let i=5 in let has=elem in let cheezburgr=5 in let can=id in can i `has` [cheezburgr] 09:27:51 indeed 09:27:52 True 09:28:05 @pl \x -> (f x, g x) 09:28:06 liftM2 (,) f g 09:28:14 @remember ricky_clarkson> let i=5 in let has=elem in let cheezburgr=5 in let can=id in can i `has` [cheezburgr] 09:28:15 Done. 09:28:43 is there a predefined max function which can take a compare function? 09:28:53 :t maximumBy 09:28:56 forall a. (a -> a -> Ordering) -> [a] -> a 09:29:26 thanks oerjan 09:29:33 @karma+ oerjan 09:29:33 oerjan's karma raised to 7. 09:29:35 dcoutts: ? 09:29:44 Mitar: yeah, sorry about that :) 09:29:50 no problem ... 09:30:04 thanks for help ... 09:30:05 int-e: actually I was just misunderstanding your patch, but it's all ok now. I've applied and pushed it. 09:30:18 ah nice. 09:30:24 this will really be a great compiler 09:30:54 --- quit: oerjan ("Supper") 09:31:50 @quote trickery 09:31:50 No quotes match. Have you considered trying to match wits with a rutabaga? 09:32:00 @remember olsner yeah, but this is #haskell, where trickery needs no reason 09:32:01 Done. 09:32:22 ;-) 09:32:26 @quote ricky_clarkson 09:32:26 ricky_clarkson says: Is Haskell an interface between programming languages and academics? 09:32:32 @quote ricky_clarkson 09:32:32 ricky_clarkson says: Is Haskell an interface between programming languages and academics? 09:32:34 @quote quicksilver 09:32:35 quicksilver says: someone with artistic talent should do a drawing entitled unsafePerformMetamorphosis 09:32:39 @quote quicksilver 09:32:40 quicksilver says: learning from other people's mistakes is so web 1.0 09:32:44 @quote quicksilver 09:32:44 quicksilver says: learning from other people's mistakes is so web 1.0 09:32:56 @quote ricky_clarkson> 09:32:56 ricky_clarkson> says: let i=5 in let has=elem in let cheezburgr=5 in let can=id in can i `has` [cheezburgr] 09:32:56 --- join: lelf` (n=lelf@195.74.84.43) joined #haskell 09:33:05 @quote olsner 09:33:05 olsner says: yeah, but this is #haskell, where trickery needs no reason 09:33:22 what is this, Quote Yourself Day? =) 09:33:56 --- join: Blwood (n=Blwood@247.236-242-81.adsl-dyn.isp.belgacom.be) joined #haskell 09:33:59 @quote sjanssen 09:33:59 sjanssen says: @djinn Haskell -> Curry 09:34:17 --- join: shapr (i=shae@94-102.101-97.bham.res.rr.com) joined #haskell 09:35:06 how should I write \(a,b,v) -> v instead? 09:35:17 --- join: koxinga (n=koxinga@orbi.polytechnique.fr) joined #haskell 09:35:22 What's going on? 09:35:23 hkBst: that is the only way 09:35:26 (\a,b,v->v) 09:35:32 > (\a,b,v->v) 1 2 3 09:35:32 Parse error 09:35:33 hkBst: that is my preferred way to write it 09:35:37 > (\a, b, v -> v) 1 2 3 09:35:37 Parse error 09:35:39 hkBst: well, almost 09:35:39 .. 09:35:41 darn 09:35:45 koxinga: \(_,_,v) -> v 09:35:46 oklopol: those commas are illegal syntax 09:35:50 hkBst: that was for you 09:35:55 > (\a b v -> v) 1 2 3 09:35:56 3 09:36:01 heh 09:36:03 copypaste :D 09:36:07 i do know that 09:36:16 hkBst: just give the function a reasonable name (like third, or something) 09:36:21 hmm 09:36:22 --- quit: obsethryl (Read error: 104 (Connection reset by peer)) 09:36:41 > 1,2 09:36:42 parse error on input `,' 09:36:48 or thrd, to be consistent with fst and snd =) 09:36:52 oh nm 09:36:55 * idnar misread 09:37:07 > (1,2) 09:37:09 (1,2) 09:37:13 you also need a fst3 and a snd3 and then a thd3 09:37:14 hkBst pasted "parse error on input `\'" at http://hpaste.org/2753 09:37:41 quicksilver, sjanssen: perhaps I misunderstood the error in the above then... 09:37:45 > fst (1,2,3) 09:37:45 Couldn't match expected type `(a, b)' 09:37:45 sjanssen: I think that \(_,_,v) -> v is more pleasant on the eyes than thd 09:37:50 > fst (1,(2,3)) 09:37:51 1 09:38:04 sjanssen: it doesn't take up much space, and it does what it says on the tin 09:38:07 quicksilver: depends on how often you use it, I suppose 09:38:11 hkBst: you need parentheses around the function, I think 09:38:20 I hearby christen \(_,_,v) -> v "the Ronseal function" 09:38:21 hmm, interesting security issue with darcs... if all the processing is done client side, surely this opens a repo up to being tampered with by a malicious client (and rigged files inserted into the repo) 09:38:23 i.e. comparing (\(a,b,v) -> v) 09:38:29 > (fst . snd) $ (1,(2,3)) 09:38:31 2 09:38:33 we should invent first-class pattern matching 09:39:03 --- quit: lelf (Read error: 104 (Connection reset by peer)) 09:39:07 Why aren't n-tuples made of pairs? 09:39:21 HList is just that. 09:39:33 ricky_clarkson: those are called lists =) 09:39:41 Lists are homogenous. 09:39:48 ricky_clarkson: performance reasons, most likely 09:39:52 oh, I see, good point 09:40:10 ricky_clarkson: Another reason is that a tuple is a type, so (Int,Int,Int) and (Int,Int) are different types. 09:40:16 sjanssen: That sounds bogus. You could uncurry Haskell for that kind of performance reason. 09:40:33 shapr: Sure, but (Int,(Int,Int)) and (Int,Int,Int) could be the same. 09:40:41 shapr: yes, but equally (Int, (Int,Int)) is different from (Int,Int) 09:40:42 ricky_clarkson: currying has performance problems? 09:40:48 do I have to import something to get `maximumBy'? ghci complains Not in scope: `maximumBy'... 09:40:53 sjanssen: No. Does the above? 09:41:03 ricky_clarkson: But that's pretty much a list. 09:41:08 you really don't want ((Int, Int), Int) to be the same as (Int, (Int, Int)) 09:41:19 it wouldn't be... 09:41:32 hkBst: yes, Data.List 09:41:34 shapr: A heterogenous list. 09:41:38 ricky_clarkson: it is moderately bogus, but it is true that there is no existing Haskell compiler that can represent (a, (b, (c, (d, ())))) as efficiently as (a, b, c, d) 09:41:54 hkBst: Hoogle may be useful for this kind of question 09:42:02 sjanssen: It doesn't need to be preserved as that at runtime. 09:42:06 ricky_clarkson: HList is a heterogenous list type, and it uses (a,(b,(c,d))) 09:42:22 shapr: Ah. I didn't realise you were talking to me when you mentioned it earlier. 09:42:50 you can't represent them the same because the former holds more information, no? 09:43:39 ah, sclv has a very good point 09:43:52 yes 09:43:58 contrary to what ricky_clarkson said 09:44:09 (I,(I,I)) is not isomorphic to (I,I,I) 09:44:15 the former has one more bottom 09:44:16 so to speak :) 09:44:25 Ok, I want to have a physical meeting of Haskellers for/in the USA, possibly just the SouthEast USA. 09:44:27 ricky_clarkson: ^^^ is probably the real reason 09:44:34 shapr: In Austin! :) 09:44:36 So, who's showing up? 09:44:40 Nafai: Maybe 09:44:57 I'd like to come up with a list of attendees and then pick a major city at the average of their locations. 09:45:22 sjanssen: I see. Bottom irritates me. 09:45:29 --- join: essiene (n=essiene@196-220-27-98.netcomng.com) joined #haskell 09:45:30 * ricky_clarkson goes to get some pile cream for Haskell. 09:45:30 hkBst annotated "parse error on input `\'" with "Exception: stack overflow" at http://hpaste.org/2753#a1 09:45:45 ricky_clarkson: hah! 09:45:57 ricky_clarkson: of course the efficiency reason is related to the _|_ issue 09:46:15 shapr: I'm interested! 09:46:29 shapr: I'm interested, depending on location/time 09:46:48 byorgey: Where are you? 09:46:59 i could move the convention to see by coming from finland. 09:47:01 shapr: Washington, DC 09:47:02 *Äsea 09:47:03 *sea 09:47:11 if it's the average 09:47:40 hkBst: did you try compiling it with -O2 ? 09:48:17 quicksilver: no, I didn't try compiling at all. 09:48:36 hkBst: try that, the strictness analyser can solve certain types of stack overflow 09:49:00 --- join: ddarius (n=derek@74.197.10.104) joined #haskell 09:49:04 byorgey: Sounds good 09:50:44 --- join: QplQyer (n=jeroen@dD5E09C4F.access.telenet.be) joined #haskell 09:51:58 --- join: LPhas (n=Phas@ppp-27-207.21-151.libero.it) joined #haskell 09:52:42 --- quit: [TWiSTED] (No route to host) 09:53:00 quicksilver: I used "ghc -O2 problem27.hs -o problem27", is that right? It says "compilation IS NOT required" but still produces an executable... 8-/ which still overflows its stack. 09:53:04 frag is awesome 09:53:05 --- join: jtoy (n=jtoy@mail.backchannelmedia.com) joined #haskell 09:53:16 --- join: LeCamarade (n=revence@217.113.73.39) joined #haskell 09:54:02 How to know your Ruby has been improved by your Haskell: 09:54:13 def each() 09:54:18 hkBst: just to make sure, you may want to try deleting the executable and any .o or .hi files, and re-compiling 09:54:22 (0 ... self.length).to_a.map! {|x| yield(self[x])} 09:54:25 --- quit: ddarius ("Leaving") 09:54:35 --- join: ddarius (n=derek@74.197.10.104) joined #haskell 09:54:35 end 09:54:44 hkBst: the recompilation checker is beating you, use -no-recomp 09:54:50 byorgey: ah, right. I missed those 09:55:05 Just had to spread the smile. :o) 09:55:08 --- quit: LeCamarade (Client Quit) 09:55:26 I've never understood why you use "-no-recomp" when you DO want it to recompile 09:55:36 yay, it worked :) 09:55:41 hooray! 09:55:56 hkBst: you can also use 'touch problem27.hs' to make it think that you have changed the source 09:56:01 hkBst: I usually keep my flags in an OPTIONS_GHC pragma, so the recompilation checker will automatically pick up changes in the flags 09:56:16 hkBst: unrelatedly, if you use --make, then you don't need -o problem27 09:57:10 sjanssen: mm, cabal should track that too when we do dep tracking, ie changes to options in the .cabal file 09:57:35 thanks for the tips, drigz, sjanssen :) 09:57:35 --- quit: Kahdloc (No route to host) 09:57:44 dcoutts: that'd be neat 09:58:22 dcoutts: what is the status of dep tracking? Is there code in the head yet? 09:58:28 sjanssen: not yet 09:58:31 pgavin-away: ping 09:58:41 sjanssen: are you coming to the hackathon? 09:59:09 I want to hack on cabal dep tracking at the hackathon 09:59:15 dcoutts: nah, Freiburg is a bit far for me 09:59:26 sjanssen: ok, perhaps via irc that week? :-) 09:59:44 dcoutts: sure 09:59:49 well, 3 days 09:59:51 sjanssen: cool 10:00:04 --- join: c9s (n=c9s@61-223-103-147.dynamic.hinet.net) joined #haskell 10:00:10 @localtime sjanssen 10:00:11 Local time for sjanssen is Fri Sep 14 11:57:58 2007 10:00:25 sjanssen: what're you interested in joining in on? I'm planning to look at cabal dep tracking and other cabal refactoring 10:01:25 byorgey: Ok, add yourself: http://www.haskell.org/haskellwiki/AmeroHaskell 10:01:26 Title: AmeroHaskell - HaskellWiki 10:01:39 shapr: will do 10:01:42 --- join: JBGood (n=jbauman@JBAUMAN.RES.cmu.edu) joined #haskell 10:01:53 --- join: rickynils (n=rickynil@asimov.ros.sgsnet.se) joined #haskell 10:02:06 --- join: dons (n=dons@gw-1.galois.com) joined #haskell 10:02:16 dcoutts: I'm not sure 10:02:20 Nafai: Add yourself to AmeroHaskell! 10:02:28 * Nafai obeys 10:02:32 g'morning dons 10:02:36 @localtime dons 10:02:39 Local time for dons is Fri Sep 14 10:00:51 2007 10:02:45 hey 10:03:33 --- join: augustss (n=Lennart@host86-132-102-171.range86-132.btcentralplus.com) joined #haskell 10:04:20 --- join: gwern (i=gwern@gateway/tor/x-e3d1d35f0d107cf7) joined #haskell 10:04:20 --- quit: jbauman (Read error: 110 (Connection timed out)) 10:04:29 Wait, what is this AmeroHaskell thing? 10:04:39 ddarius: It's a Haskell gathering for the SouthEastern USA. 10:04:43 --- join: dfranke_ (i=dfranke@140.247.249.218) joined #haskell 10:04:43 --- part: Qerub left #haskell 10:05:01 ddarius: The idea was put into motion about ten minutes ago. 10:05:03 --- join: LPhas_ (n=Phas@ppp-27-207.21-151.libero.it) joined #haskell 10:05:07 --- quit: dfranke_ (Remote closed the connection) 10:05:24 @src elem 10:05:24 elem x = any (== x) 10:05:45 Any other USA located Haskellers willing to show up in the Southeast USA to meet and code? 10:06:02 shapr: is there a web page? 10:06:08 shapr: I'd consider it, depends on the location 10:06:13 There's a HaskellWiki page. 10:06:18 shapr: I may well be depending primarily on when and how long and a bit on where. 10:06:31 ddarius: You're in TX also, yes? 10:06:48 we need one for North and West , as well as South and East :) 10:06:52 shapr: Added! 10:06:57 dons: Do it! 10:07:03 though might be a good excuse to travel around the country... 10:07:12 sjanssen: maybe we could have an xmonad hackathon. 10:07:17 shapr: what kind of location where you thinking of? 10:07:26 --- join: norgul (n=joakim@dhcp-232-56.romerikebb.no) joined #haskell 10:07:37 dons: Some major city in the southeast. 10:07:54 shapr: is it more like a sprint than anglohaskell? 10:07:55 in a hotel or uni or something? 10:08:00 Hopefully someplace where enough attendees have apartments/etc for others to sleep there :-) 10:08:06 * sjanssen points out that his city is the average of "North and West" and "South and East" :) 10:08:18 yeah, bang in the middle might be convenient 10:08:23 and with university access 10:08:33 dons: I'd rather have it in a uni, since that's more conducive to coding and zero admission costs, but a hotel would work if actual money is charged. 10:08:40 sjanssen: Which city? 10:08:55 do we have a google maps for USAsian haskellers yet? 10:09:01 No, but we need it. 10:09:05 I don't think Lincoln is a particularly good location though, it has a small airport, and very few Haskellers in the area 10:09:10 shapr: Lincoln, NE 10:09:20 Is there any way to adjust the style of documentation that Haddock outputs? 10:09:54 --- join: loud- (n=e@ip-209-134-172-172.iss.net) joined #haskell 10:10:01 beelsebob_: you can provide a custom CSS file 10:10:17 shapr: Yes, I'm in Texas. 10:10:33 byorgey: oh, duh... I never even thought it would be that simple 10:11:13 @wiki Haskell user locations 10:11:13 http://www.haskell.org/haskellwiki/Haskell_user_locations 10:11:17 arse 10:11:19 it's all table based 10:11:28 so no rearanging the page for me :( 10:12:01 beelsebob_: ah yes, now that you mention it, I recall someone else complaining about that recently on -cafe 10:12:20 byorgey: yeh, was just searching archives for such stuff 10:12:24 --- join: [TWiSTED] (n=twisted1@210-84-21-141.dyn.iinet.net.au) joined #haskell 10:12:26 neil was poking simon about it 10:12:37 --- join: Esteth (n=esteth@77-100-220-13.cable.ubr01.glen.blueyonder.co.uk) joined #haskell 10:12:41 indeed 10:13:10 --- quit: malcolmw ("got to go...") 10:13:18 oh well, I guess I don't add an me too to it, I think neil seems to have covered everything 10:13:37 is there a quick way to get these latitude/longitude coordinates on to a Google map? 10:13:44 --- quit: LPhas (Read error: 110 (Connection timed out)) 10:14:04 --- join: poh (n=patrick@cpe-72-226-98-241.nycap.res.rr.com) joined #haskell 10:14:05 --- quit: jtoy () 10:14:16 anyone familiar with the google maps api these days? the simple api? 10:14:28 sjanssen: click link, i think they're in there 10:14:33 --- quit: c9s ("leaving") 10:14:38 @src nub 10:14:38 nub = nubBy (==) 10:14:51 hkBst: cunning, no? :) 10:14:58 ?src group 10:14:59 group = groupBy (==) 10:15:04 dons: very :) Does it work on unsorted lists? 10:15:05 HOF FTW! 10:15:14 > nub "haskell" 10:15:16 "haskel" 10:15:19 > nub "haskell haskell" 10:15:21 "haskel " 10:15:21 --- quit: ejt (Read error: 113 (No route to host)) 10:15:31 :) brilliant 10:15:39 hkBst: it runs in O(n^2) though 10:15:46 because: 10:15:48 @type nub 10:15:50 forall a. (Eq a) => [a] -> [a] 10:16:00 --- join: jtoy (n=jtoy@mail.backchannelmedia.com) joined #haskell 10:16:30 @type (map head . group . sort) 10:16:32 forall a. (Ord a) => [a] -> [a] 10:16:46 I don't think it follows from that type alone. But handling unsorted lists will do that. 10:16:59 hkBst: Yes, actually, it does. 10:17:31 Well, I guess if nub did assume the lists were sorted... 10:17:50 then you could have O(n), of course. 10:17:52 But then it would have a different specification. 10:18:14 --- join: nostrademons (n=Jonathan@pool-71-248-160-35.bstnma.fios.verizon.net) joined #haskell 10:18:23 ?users 10:18:24 Maximum users seen in #haskell: 407, currently: 388 (95.3%), active: 16 (4.1%) 10:18:52 ddarius: like what? 10:19:13 hkBst: ? 10:19:34 ddarius: what different specification would it have? 10:19:58 --- join: salparot (n=salparot@cust.fiber-lan.vnet.lk.85.194.50.194.stunet.se) joined #haskell 10:19:58 hkBst: it would say that it removed consecutive duplicate elements 10:20:01 you could have O(n*log n) on unsorted lists too, assuming that you took an Ord 10:20:05 hkBst: It would require sorted lists, or alternatively it would have the behavior of map head . group 10:20:27 sclv: Of course, but the type of nub explicitly makes that impossible. 10:20:29 or approx O(n) with a decent hash 10:20:51 you could have O(n) with type (Ix a, Bounded a) => [a] -> [a] 10:21:04 --- quit: zx]treads (Read error: 104 (Connection reset by peer)) 10:21:11 or right, the Id hash 10:21:25 --- join: gogonkt- (i=gogonkt@220.192.41.11) joined #haskell 10:21:36 --- quit: jtoy () 10:21:56 drigz: assuming there's enough memory... 10:22:33 Accessing the disk has constant time complexity... 10:23:28 no stray magnets come near the hard drive... 10:23:53 byorgey: you can say the same for almost any implementation :p 10:24:58 drigz: well, my first comment was serious. =) For example we have Ix Int and Bounded Int but I don't think you'd want to create an array of 2^32 elements just to compute nub in "O(n)" time 10:25:27 byorgey: i know, my last comment was not serious 10:25:35 it has a very bad memory complexity 10:25:52 It has constant memory complexity! 10:25:54 > length $ nub [ a^b | a <- [2..100], b <- [2..100] ] 10:26:04 ddarius: for a given type 10:26:04 hehe 10:26:07 9183 10:26:53 so, such an implementation would be a big win if you wanted to find the nub of a list of 500 quadrillion Ints =) 10:27:08 wow, that was fast for O(100,000,000) computations 10:27:44 O(100,000,000) = O(1) 10:27:49 in fact, given that some of the numbers were 200 digits long 10:28:10 --- quit: DNNX (Client Quit) 10:28:26 roconnor: yeah, i wasn't sure how to express that 10:28:30 roconnor: do you know what i meant? 10:28:50 drigz: I think you use a little o to express that. 10:29:32 --- quit: loud- ("[BX] Dr. Kavorkian would KILL to use BitchX. Shouldn't you?") 10:29:40 how do I get rid of the "main = " boilerplate? 10:29:53 --- quit: Jedai ("Ex-Chat") 10:30:06 --- join: jtoy (n=jtoy@mail.backchannelmedia.com) joined #haskell 10:30:16 --- join: jjore-w (n=jbenjore@c-24-16-241-176.hsd1.mn.comcast.net) joined #haskell 10:30:21 > length "main = " -- boilerplate? 10:30:22 > length [1..1000000] 10:30:22 --- quit: roconnor (Read error: 104 (Connection reset by peer)) 10:30:22 7 10:30:24 1000000 10:30:30 > length [1..1000000000] 10:30:33 Terminated 10:30:36 > length [1..100000000] 10:30:40 Terminated 10:30:41 > length [1..10000000] 10:30:45 Terminated 10:30:55 > length [1..5000000] -- i'll find it 10:30:58 5000000 10:31:01 --- join: Spockz|Workstati (n=info@ip91353ad7.speed.planet.nl) joined #haskell 10:31:05 > length [1..7000000] -- gettin gcloser 10:31:10 Terminated 10:31:10 evening 10:31:14 > length [1..6000000] 10:31:17 Terminated 10:31:19 hi Spockz|Workstati 10:31:19 oklopol: who said it was a constant? :) 10:31:33 --- quit: ToRA (Read error: 110 (Connection timed out)) 10:31:35 hkBst: i'm pretty sure it doesn't change that much... 10:31:36 > length [1..6000000] 10:31:40 Terminated 10:31:46 > length [1..5500000] 10:31:50 5500000 10:31:54 oklopol: the computations in the nub were (==) :: Integer -> Integer -> Bool, which should be a lot slower than tail 10:31:58 i can find the range if it changes 10:32:23 in the... nub? 10:32:26 --- quit: Averell (Connection timed out) 10:32:28 > length [1..5800000] 10:32:31 5800000 10:32:35 > length [1..5900000] 10:32:39 Terminated 10:32:42 --- quit: lapthrick (Read error: 110 (Connection timed out)) 10:32:42 > length [1..5850000] 10:32:46 Terminated 10:32:49 > length [1..5830000] 10:32:50 oklopol: that's getting somewhat annoying =P 10:32:53 Terminated 10:32:56 i realize that :) 10:32:58 oklopol: are you doing that to investigate why nub of 10000 elements is so fast? 10:32:59 oklopol: /query 10:33:11 oklopol: /msg lambdabot > ... 10:33:12 oh 10:33:17 i'll do that 10:33:24 didn't realize 10:33:30 oklopol: and can i recommend a binary search :D 10:33:44 i'm doing that already 10:33:46 well... 10:33:49 not exactly 10:33:50 --- join: MarcWeber (n=marc@pD9E09F58.dip.t-dialin.net) joined #haskell 10:33:55 but almost 10:34:14 oklopol: sorry, my mind told me you'd been doing it a lot longer than you had 10:34:17 i'm not sure why... 10:34:26 --- join: roconnor (n=roconnor@vhe-540354.sshn.net) joined #haskell 10:34:34 because it was annoying even in small portions? 10:35:00 --- join: Averell (n=averell@p3m/member/Averell) joined #haskell 10:35:46 --- join: obsethryl (n=lab@unaffiliated/obsethryl) joined #haskell 10:37:12 (20:35:58) (oklopol) > length [1..5823811] 10:37:12 (20:36:02) (lambdabot) 5823811 10:37:12 (20:36:04) (oklopol) > length [1..5823812] 10:37:12 (20:36:08) (lambdabot) Terminated 10:37:18 because i'm sure everyone is interested :P 10:37:28 that is pretty constant, too 10:38:21 --- join: loud- (n=e@ip-209-134-172-172.iss.net) joined #haskell 10:40:29 > length $ nub [ a^b | a <- [2..100], b <- [2..100] ] 10:40:31 > length [1..5823811] 10:40:36 9183 10:40:37 5823811 10:40:40 :( 10:40:59 that's weird: O 10:41:13 any standard way for finding out if there are any duplicates in a unordered list? 10:41:37 nub xs == xs 10:41:49 --- quit: gip (Read error: 110 (Connection timed out)) 10:41:57 okay... you can flood that like 10 times and the result is the same 10:42:28 5823811 works, 5823812 not... i wonder what the real value is :) 10:43:04 --- quit: ddarius (Read error: 110 (Connection timed out)) 10:43:12 on my local ghci, legth [1..58...] takes 0.54 seconds, the nub takes 1.28 seconds 10:43:47 however, the length allocates 236mb, the nub only allocates 13mb 10:44:26 what's it like in a file with main = print $ nub ... ; compiled with -O2 ? 10:44:53 Saizan: (map head . group . sort) xs == sort xs would be faster, right? 10:44:56 --- join: doserj (n=doserj@109.141.77.83.cust.bluewin.ch) joined #haskell 10:45:01 --- quit: rickynils ("Lämnar") 10:46:09 hkBst: you probably want to do something like let sxs = sort xs in (map head . group) sxs == sxs 10:46:19 hkBst: just to make sure xs isn't sorted twice 10:46:22 hkBst: i'm not sure, because sort will make it stricter 10:46:50 it will? 10:47:05 byorgey: yeah, wouldn't want that 10:47:48 hkBst: In theory the compiler should be able to do CSE there, but I don't trust it =) 10:48:18 --- quit: Pupeno (Connection timed out) 10:48:48 --- quit: koxinga (Remote closed the connection) 10:50:36 --- join: gpi5 (i=Gil@cpc5-hem15-0-0-cust774.lutn.cable.ntl.com) joined #haskell 10:51:39 hkBst: uncurry (==) . ((map head . group) &&& id) . sort 10:51:40 --- join: Itkovian (n=Itkovian@d54C4B834.access.telenet.be) joined #haskell 10:51:54 you can probably drop some parens 10:52:03 and i'm not sure if &&& is what i want 10:52:11 --- quit: xynn ("Leaving") 10:53:05 heh, cool drigz, didn't know that &&& could do that 10:53:13 @src &&& 10:53:14 f &&& g = arr (\b -> (b,b)) >>> f *** g 10:53:52 @src >>> 10:53:52 Source not found. I've seen penguins that can type better than that. 10:54:02 @src *** 10:54:02 f *** g = first f >>> second g 10:55:40 @type (>>>) 10:55:42 forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a c d -> a b d 10:55:51 hkBst: essentially, f &&& g == \f g x -> (f x, g x) 10:56:14 hkBst: it works for general Arrows, but what I wrote above is the function instance 10:56:42 > ((+2) &&& (*5)) 10 10:56:44 (12,50) 10:57:53 @instance Arrow 10:57:53 Maybe you meant: instances instances-importing 10:57:57 @instances Arrow 10:57:58 (->), Kleisli m 10:58:27 @source first 10:58:27 first not available 10:58:31 @src first 10:58:32 Source not found. Your mind just hasn't been the same since the electro-shock, has it? 10:58:47 first is one of the functions in the Arrow class. 10:58:58 i.e. every instance of Arrow must define first. 10:59:09 byorgey: that makes sense 10:59:12 --- nick: sm -> sm-afk 10:59:13 @type first 10:59:16 forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a (b, d) (c, d) 10:59:23 can lambdabot get the source of an instance? 10:59:40 @src (->) first 10:59:42 first f = f *** id 11:00:08 --- join: cjeris_ (n=Jeris@140.247.124.140) joined #haskell 11:00:20 --- quit: oklopol (Read error: 104 (Connection reset by peer)) 11:00:23 which is the same as \(a,b) -> (f a, b) 11:00:26 --- join: oklopol (i=oko@194.251.101.183) joined #haskell 11:00:56 --- quit: Poeir (Remote closed the connection) 11:02:46 --- join: lapthrick (n=mathrick@users.kollegienet.dk) joined #haskell 11:04:34 --- quit: progexp (Read error: 104 (Connection reset by peer)) 11:04:56 --- quit: hkBst ("Konversation terminated!") 11:05:53 --- join: LunohoD_ (n=alex@e180075075.adsl.alicedsl.de) joined #haskell 11:08:00 --- join: Poeir (n=Poeir@74-136-213-220.dhcp.insightbb.com) joined #haskell 11:08:55 Hi.. I would like to rewrite the following using >>= (but as 'you' is used twice I don't know how to do). Thanks. main = do {you <- getLine; putStr ("You are "++you); putStr (" -- Hello "++you) } 11:09:57 getLine >>= \you -> (putStr ("You are " ++ you) >> putStr (" -- Hello " ++ you)) 11:09:59 @unfo do {you <- getLine; putStr ("You are "++you); putStr (" -- Hello "++you) } 11:09:59 (getLine >>= \ you -> putStr ("You are " ++ you) >> putStr (" -- Hello " ++ you)) 11:10:12 @pl (getLine >>= \ you -> putStr ("You are " ++ you) >> putStr (" -- Hello " ++ you)) 11:10:12 ap ((>>) . putStr . ("You are " ++)) (putStr . (" -- Hello " ++)) =<< getLine 11:11:44 @type ap 11:11:47 forall (m :: * -> *) a b. (Monad m) => m (a -> b) -> m a -> m b 11:12:00 @index ap 11:12:01 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, Data.Graph. 11:12:01 Inductive.Query.ArtPoint, Data.Graph.Inductive.Query, Data.Graph.Inductive 11:12:13 --- quit: CRathman ("ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]") 11:12:17 --- quit: QplQyer ("*poef* *roekwolk*") 11:12:18 gpi5: don't use ap 11:12:34 gpi5: I mean, not for this =) 11:13:00 --- quit: roconnor (Read error: 104 (Connection reset by peer)) 11:13:48 --- join: roconnor (n=roconnor@vhe-540354.sshn.net) joined #haskell 11:14:03 --- join: crazy_coder (n=Anand@125.99.112.117) joined #haskell 11:14:09 byorgey: ok :) Just trying to understand. 11:14:10 --- join: coffeemug (n=coffeemu@pool-70-107-4-128.ny325.east.verizon.net) joined #haskell 11:14:29 ap is one of those functions that pl uses a lot where you wouldn't expect it 11:14:32 gpi5: sure, nothing wrong with that 11:14:52 along with other monad convenience functions, e.g.: 11:14:54 @pl concat 11:14:54 join 11:15:10 (ap .) . flip flip ap . (((ap .) .) .) . ap 11:15:26 @unpl (ap .) . flip flip ap . (((ap .) .) .) . ap 11:15:26 (\ m au r -> (\ bd aj -> ((m >>= \ am -> au >>= \ al -> return (am al)) (\ z aa -> z >>= \ x -> aa >>= \ w -> return (x w)) bd) >>= \ ag -> aj >>= \ af -> return (ag af)) >>= \ o -> r >>= \ n -> 11:15:26 return (o n)) 11:16:04 drigz: I made that up, "in the style of" @pl =) 11:16:17 byorgey: i guessed from the type :p 11:16:22 hehe 11:16:29 @type (ap .) . flip flip ap . (((ap .) .) .) . ap 11:16:31 forall (m :: * -> *) a b (m1 :: * -> *) a1 b1 a2 a3. (Monad m, Monad m1) => ((m (a -> b) -> m a -> m b) -> a3 -> a2 -> m1 (a1 -> b1)) -> ((m (a -> b) -> m a -> m b) -> a3) -> (a2 -> m1 a1) -> a2 -> 11:16:31 m1 b1 11:17:06 what, you can't understand that type? 11:18:02 One question: given 1 monad a of type IO String and 2 monads b and c of type String-> IO(). How do I apply the result of a to b and c? 11:18:06 it's clearly equivalent via Curry-Howard to the proof of coadjacency for covariant isometric functoids. 11:18:41 (Without do notation plz) 11:18:53 --- quit: cjeris (Read error: 110 (Connection timed out)) 11:19:33 a >>= \x -> b a >> b c 11:19:49 gpi5: write it in do notation and then use @undo 11:19:49 er, no. a >>= \x -> b x >> b x 11:20:18 e.g. @undo do {x <- a; b x; c x} 11:20:23 @undo do {x <- a; b x; c x} 11:20:23 (a >>= \ x -> b x >> c x) 11:20:34 @undo do { s<-a; b s; c s} 11:20:35 (a >>= \ s -> b s >> c s) 11:20:38 http://www.stormingmedia.us/65/6517/A651704.html 11:20:46 @pl \a b c -> (a >>= \ x -> b x >> c x) 11:20:47 (. liftM2 (>>)) . (.) . (>>=) 11:21:04 --- quit: njbartlett (Read error: 110 (Connection timed out)) 11:21:38 @undo do { s<-a; b s; c s; d s} 11:21:38 (a >>= \ s -> b s >> c s >> d s) 11:21:54 --- join: sfultong (n=sfultong@c-71-232-76-253.hsd1.ma.comcast.net) joined #haskell 11:23:20 --- quit: LunohoD (Read error: 113 (No route to host)) 11:23:57 --- join: jgracin (n=gracin@82.193.209.190) joined #haskell 11:24:09 --- join: arjanb (i=borganis@borganism.student.utwente.nl) joined #haskell 11:25:47 --- join: monochrom (n=trebla@toronto-hs-216-138-220-146.s-ip.magma.ca) joined #haskell 11:29:00 --- quit: seancorfield (Read error: 110 (Connection timed out)) 11:29:12 if I'm looking to make a State a (), is it really State I want? Maybe something else? Maybe an Arrow? 11:29:29 --- quit: olsner () 11:30:41 sfultong: so you want to isolate state operations with a certain state type? 11:30:51 sfultong: it's perfectly okay to use the State monad only for the state 11:30:56 that's why you have execstate 11:31:34 type MyState a = State a () 11:31:49 --- quit: drrho (Read error: 104 (Connection reset by peer)) 11:31:51 sfultong: you could >> get to return the state instead of () 11:32:14 --- quit: Itkovian () 11:32:45 ah, thanks 11:32:59 --- quit: Nucleo_ (Read error: 110 (Connection timed out)) 11:34:08 :t runState (modify (+5)) 9 11:34:16 forall s. (Num s) => ((), s) 11:34:17 :type runState (modify (+5)) 9 11:34:19 ah. 11:34:23 :type runState (modify (+5) >> get) 9 11:34:29 @undo do { s<-a; do {ss<- e; f ss}; b s; c s; d s} 11:34:30 (a >>= \ s -> e >>= \ ss -> f ss >> b s >> c s >> d s) 11:34:34 :t runState (modify (+5) >> get) 9 11:34:36 forall s. (Num s) => (s, s) 11:34:41 \bot is feeling sluggish today 11:35:05 @undo do { s<-a; when test do {ss<- e; f ss}; b s; c s; d s} 11:35:05 ParseFailed (SrcLoc {srcFilename = "", srcLine = 1, srcColumn = 50}) "Parse error" 11:35:06 huh, I didn't know there was an @undo command 11:35:12 @undo do { s<-a; when test (do {ss<- e; f ss}); b s; c s; d s} 11:35:12 (a >>= \ s -> when test (e >>= \ ss -> f ss) >> b s >> c s >> d s) 11:35:12 Sorry, was at a party last night. 11:35:18 sfultong: alterantively you wan use execstate to just get the state 11:35:25 @src execState 11:35:25 Source not found. Your mind just hasn't been the same since the electro-shock, has it? 11:35:40 *can 11:35:43 runState? 11:36:08 it runs a computation in the State s a monad 11:36:13 http://programming.reddit.com/info/2pjok/details 11:36:14 Title: Johan Jeuring on Generic Haskell :: Video (reddit.com) 11:36:17 more videos! 11:36:26 * ari watches 11:37:36 Wait, I thought continentals didn't do Haskell :/ 11:38:06 europeans? that's haskell central, just about it. 11:38:15 I resent that remark! 11:38:20 'cept .fr of course ;) 11:39:11 uh oh, he's looking for students :) 11:39:11 has fr been consumed with O'Caml? 11:39:19 --- join: Pupeno (n=Pupeno@dsl-37-170.dsl.netsource.ie) joined #haskell 11:40:27 --- join: njbartlett (n=njbartle@cpc2-barn4-0-0-cust110.brnt.cable.ntl.com) joined #haskell 11:41:12 --- quit: jfredett (Read error: 110 (Connection timed out)) 11:41:34 dons: Heh, it's just that I kinda got the idea that there's a lot of Brits doing Haskell from LHUG and AngloHaskell, and since the Brits never do things the same way as the continentals (and vice versa) I derived that there can be no German Haskellers ;) 11:42:00 ari: It seems, sadly, that all the Brit Haskellers are from the south. 11:42:15 oh, I think there's a fair few German haskellers 11:42:17 --- join: ADEpt (n=ADEpt@jabber.hst.ru) joined #haskell 11:42:41 dons, bummer - all the other talks are in german. 11:43:18 pejo: time to learn german :) 11:43:19 Would you say that (*) 2 is a result of automatic currying, or an example of a section? 11:43:24 ari, Peter Thiemann, Ralf Hinze, Ralf Lämmel (?). 11:43:46 one's in english 11:43:47 Does the term ``immediate value'' mean anything to you guys? 11:44:00 as in, we apply f to all immediate values: C t1 t2 ... tn becomes C (f t1) (f t2) ... (f tn) 11:44:57 intermediate? 11:45:46 no. immediate 11:45:47 ricky_clarkson: (*) 2 is currying, (*2) is a section. 11:45:58 I would say "(direct) children" 11:46:08 --- part: GeoBes1 left #haskell 11:46:16 (*) 2 is partial application 11:46:19 Botje: I struggle to see the difference. 11:46:40 Except that (*2) provides the 2nd arg to *. 11:47:27 I meant (2*), yes 11:47:38 "immediate value" sounds like assembly 11:47:51 --- join: dv^^ (i=dv@gateway/tor/x-bb2673496270e7f1) joined #haskell 11:48:41 monochrom: in this case, I think it means that f is not applied recursively 11:48:43 --- quit: augustss () 11:48:52 ricky_clarkson: if you were mapping over a list, sections allow you to write "map (+5) list" instead of "map ((+) 5) list" 11:49:10 that's .. pretty much their raison d'etre :) 11:49:26 --- quit: beelsebob_ () 11:49:44 I mean, other than the syntax, I can't see what the difference is. 11:50:22 --- join: kep (n=const@dma.org.ua) joined #haskell 11:50:41 This is from a generic programming paper. The example actually uses a type representation C (f rt1 t1)... 11:51:04 so I think it means, apply it to the current level/type, but not recursively. 11:51:12 ricky_clarkson: there isn't. sections are syntactic sugar 11:51:30 --- quit: sjanssen ("Konversation terminated!") 11:51:58 @seen SyntaxNinja 11:51:58 I saw SyntaxNinja leaving #haskell-soc, #haskell-blah and #haskell 1d 18h 36m 17s ago, and . 11:52:12 libcurl3 is broken in debian/unstable, and I want my darcs! 11:52:23 ricky_clarkson: sections are syntactic sugar for partial application. 11:52:37 Thanks. 11:52:43 @tell SyntaxNinja libcurl3 is broken in debian/unstable, and I want to install darcs! 11:52:43 Consider it noted. 11:53:59 conal pasted "mulitple monad transfo lifters. does this exist already?" at http://hpaste.org/2754 11:54:05 --- join: viblo (n=hejsan@88.25.95.91.static.ras.siw.siwnet.net) joined #haskell 11:54:12 shapr: does Isaac maintain libcurl3? 11:54:13 --- join: unmarshal (n=mbeddoe@dsl093-079-146.sfo1.dsl.speakeasy.net) joined #haskell 11:54:32 i can tell him if you like, he's sitting next to me if its important 11:55:00 --- join: sioraiocht (n=rtharper@cpe-74-79-41-65.twcny.res.rr.com) joined #haskell 11:55:32 dons: I don't know if there's anything he can do about libcurl3 being broken, but I would like to install/use darcs. 11:56:10 shapr: Maybe you should grab a copy of our autobuilder and build your own. 11:57:08 thetallguy: I tried to build my own. libcurl3 wants libssh2-0, but only libssh2-1 is available. So I hacked the debian/control build-deps and ran debuild, but I got linker errors. I suspect that libssh2-1 has a slightly different API. 11:57:35 thetallguy: I would like to package the Freespire Haskell tools for debian though :-) 11:57:42 Hmm. Helicopter aerodynamics is complicated (and controls don't look terribly obvious either). NFI how simulators like video games even manage to cheat for standard helicopters, never mind tiltrotors et al. 11:57:48 is there already a way to lift through any number of layers of monad transformers (in mtl) (see paste) 11:58:04 --- join: pastorn (n=pastorn@dhcp-243-16.nomad.chalmers.se) joined #haskell 11:58:58 wli: Helicopter controls are unintuitive because you have to manually correct for rotor torque. It could be done automatically these days, but all pilots have the old way built into their cerebellum. 12:00:01 shapr: are you a debian developer? They are already debianized. They just need a sponsor, really. 12:00:16 thetallguy: I am not a DD, but I know a bunch from #haskell 12:00:19 two pedals for controlling the force of the counter-rotor-whatchamacallit, one lever for controlling force (main rotor blade tilt?) and a joystick for tilting the rotor... it's only like 4-dimensional ;-) 12:00:22 I would like to become a DD. 12:00:45 * wli just went emeritus. 12:00:52 shapr: That's a tricky problem you've got. I know the theoretical answer 12:00:56 salparot: Ah, but pulling up on the rotor tilt lever increases rotor torque, and you have to correct with the foot pedals. 12:01:01 thetallguy: eheh 12:01:04 --- quit: dv^1 (Remote closed the connection) 12:01:31 thetallguy: Theoretically, it's easy to become a DD. Practically, you better know one or more influentials DDs to get anywhere. 12:01:41 I should have done it in y2k when it was easy. 12:01:48 shapr: NixOS uses the right solution, specifying a list of all source packages down to the version, then building the entire OS and installing it. 12:02:05 --- join: jfredett (n=jfredett@68-187-225-45.static.oxfr.ma.charter.com) joined #haskell 12:02:05 Oh, that problem. 12:02:21 shapr: our autobuilder doesn't quite do that yet, because I didn't communicate the design to David correctly 12:02:26 --- quit: JBGood (Read error: 110 (Connection timed out)) 12:02:36 shapr: the problem of becoming a DD is way beyond my skill level. 12:02:48 heh 12:02:50 Who's David? 12:02:55 I'm David. 12:02:59 Oh that David. 12:03:04 David Fox, another former Linspire guy 12:03:17 How many Haskellers do you have at Linspire? 12:03:24 stepcut, David and I were it 12:03:28 Oh well. My day will come. 12:03:31 only stepcut remains 12:03:36 sorry lemmih 12:03:41 oh, I see.. so you would have a computer keeping the helicopter at balance, and then something like a twistable joystick to rotate left and right... downside is, anyone learning to fly a new one won't be able to fly anything else 12:03:45 thetallguy: You're not at Linspire? 12:03:47 --- nick: salparot -> olsner 12:03:56 shapr: no, recently departed 12:04:02 thetallguy: What are you doing now? 12:04:08 If you don't mind me asking :-) 12:04:43 shapr: starting a company. going to tackle teaching math skills to kids 12:04:52 olsner: Well, I can't use VMS or Fortran... not sure I'm missing anything :-) I'd rather have an intuitive helicopter interface so that emergency pilots can always handle it. 12:04:55 thetallguy: Sounds cool! 12:04:59 shapr: on the web, of course, via games 12:05:14 shapr: stepcut is working on haskell -> flash compiler 12:05:21 shapr: Well, the point of all this seems to be that there's not much info about helicopter dynamics simulation out there partly because it appears that it looks like a hard problem in general. 12:05:48 shapr: Yeah, should be fun. Lots of graphics, UI, Haskell. 12:05:54 --- quit: bluestorm_ ("Konversation terminated!") 12:06:10 --- quit: essiene (Read error: 110 (Connection timed out)) 12:06:11 --- quit: prb () 12:06:19 wli: Wouldn't dual counter-rotating props be simplest to simulate? 12:06:34 thetallguy: Cool, server from Haskell to flash? 12:06:38 shapr: And that's for normal helicopters; for weird things like the V-22 and V-44 look like total nightmares to simulate. 12:07:08 shapr: No idea, really. Aren't those mostly Russian? 12:07:18 shapr: I don't understand. 12:07:59 shapr: the goal is to make a DSEL that we can call flash libraries and which gets compiled down to flash bytecode 12:08:11 shapr: does that answer your question? 12:08:27 are the 6.8 snapshots reasonably usable? 12:08:29 --- join: fax (n=pacman@amcant.demon.co.uk) joined #haskell 12:08:33 hiya 12:08:59 thetallguy: yes 12:09:06 btw, my university has a research project on a UAV helicopter... helicopter dynamics must've been an issue at some point, I wonder if there's any meaty published on that 12:09:15 --- join: moonlite (n=moonlite@90-224-120-80-no119.tbcn.telia.com) joined #haskell 12:09:17 hi fax 12:09:26 Heffalump: I'd wait for the next one 12:09:53 Igloo: just got Linker.c to build on the amd64/openbsd btw. 12:09:56 will have a patch later today 12:10:11 dons: Great, thanks! 12:10:13 linux-specific x86_64 syms used in linker calls 12:10:33 shapr: of course, there will be issues of how to do the server side handling of communication, running it inside HAppS, etc. 12:10:44 ok, ta 12:10:46 --- join: progexp (i=progexp@gateway/tor/x-0fcfa7c1668eafe2) joined #haskell 12:10:47 thetallguy: Ah, you'll be using HAppS? 12:10:49 Igloo: do you know where we test for #defines for Linker.c now? 12:11:00 thetallguy: I'll be able to help :-) 12:11:02 --- join: scv (i=cf91f058@gateway/web/cgi-irc/ircatwork.com/x-7dc16747347d4a7c) joined #haskell 12:11:07 or do we just go with !defined(openbsd_HOST_OS) ? 12:12:24 --- join: piggybox_ (n=piggybox@modemcable235.32-130-66.mc.videotron.ca) joined #haskell 12:12:52 shapr: That's the plan. We'll see what happens when the rubber meets the road. 12:13:01 shapr: will you be in Freiburg? 12:13:18 thetallguy: Nope, too poor. 12:13:26 thetallguy: But I'll be at AmeroHaskell, will you be there? 12:13:55 dons: Can't you use #if defined(the_define)? 12:14:09 thetallguy: Looking for co-founders/partners/employees? 12:14:36 thetallguy: Yeah, if you're looking for workers, I'm interested! 12:15:27 AmeroHaskell? 12:15:44 dino-: C'mon, it's been around for more than an hour and you haven't heard of it? ;-) 12:15:45 lemmih, shapr: we are full up for now 12:15:58 shapr: Been busy installing happs 0.9.1 12:16:27 lemmih, shapr: but will certainly be coming to this community for help if we succeed 12:16:31 spiffy 12:16:35 shapr: where is AmeroHaskell 12:16:37 ? 12:16:37 dino-: How do you like it? 12:16:42 when/where? 12:16:49 shapr: Don't know yet, still darcs getting and building stuff. 12:16:50 thetallguy: Both of those depends on the attendees. 12:17:02 dino-: The install order: Util, Data, IxSet, State, Server, Begin 12:17:07 shapr: okay, where is the signup page? 12:17:12 @wiki AmeroHaskell 12:17:12 http://www.haskell.org/haskellwiki/AmeroHaskell 12:17:32 shapr: Yeah. Should change the order of those lines in the page. 12:17:36 dino-: Or: SearchPath, Begin 12:18:15 shapr: so just in the conceptual stage 12:18:28 where will ICFP 2008 be? 12:18:34 SE US? When do we want to do this? 12:19:00 thetallguy: Yeah, but going from concept to reality doesn't take long. EuroHaskell was disorganized about .. three weeks? ahead of time, and AngloHaskell was more like two weeks. 12:19:26 dino-: I'd like to do it soon. 12:19:29 Much like Haskell itself. 12:19:34 --- join: cognominal_ (n=cognomin@cac94-1-82-67-232-89.fbx.proxad.net) joined #haskell 12:19:40 Week of Oct 13-20 is out for me. Family visiting. 12:19:51 From far away, flying in. 12:20:04 shapr: AH benefitted from it being 2 months out this time round, IMO 12:20:13 dino-: Add yourself to the wikipage, along with your location, and times you'd prefer. 12:21:37 @where pandoc 12:21:37 http://sophos.berkeley.edu/macfarlane/pandoc/ 12:22:40 --- quit: jtoy () 12:23:46 --- join: clanehin (n=clanehin@cpe-069-134-066-130.nc.res.rr.com) joined #haskell 12:24:16 --- join: seancorfield (n=seancorf@c-67-160-202-22.hsd1.ca.comcast.net) joined #haskell 12:24:18 --- quit: Plareplane (Read error: 104 (Connection reset by peer)) 12:25:04 --- join: ToRA (n=tora@colorado.doc.ic.ac.uk) joined #haskell 12:25:17 shapr: Ok, done 12:25:31 spiffy 12:26:24 --- join: jtoy (n=jtoy@mail.backchannelmedia.com) joined #haskell 12:26:56 Are the pandoc developers on #haskell? 12:27:08 * shapr found bugs 12:27:41 It really sucks that darcs doesn't work :-( 12:28:19 Has anyone else tried to install libcurl3 on debian/unstable? Am I making a mistake? 12:28:25 shapr: yes, it does 12:28:39 shapr: The first thing I tried darcs on was the Linux kernel. I'm used to that by now. 12:28:44 shapr: oh, you mean when it doesn't install. Yes, that sucks too 12:29:40 --- quit: piggybox (Connection timed out) 12:29:45 darcs usually works fine for me, I don't use repos the size of the Linux kernel. 12:30:08 --- join: Pupeno- (n=Pupeno@dsl-37-170.dsl.netsource.ie) joined #haskell 12:31:17 shapr: The Linux kernel is the only thing where I need revision control. 12:33:09 --- join: oerjan (n=oerjan@hagbart.nvg.ntnu.no) joined #haskell 12:35:26 --- quit: kep ("leaving") 12:44:03 --- quit: Pupeno (Read error: 110 (Connection timed out)) 12:44:59 --- quit: EvilTerran () 12:45:08 --- join: Saul__ (n=Saul@s5593c8c6.adsl.wanadoo.nl) joined #haskell 12:45:16 shapr: What's the purpose of the SearchPath part of starting the happs? Is it required? 12:45:32 dino-: It's not required. 12:45:47 I looked at the page, but am kind of confused about what it's for. 12:45:50 But the purpose is to automatically download all the files you need and build the app. 12:46:12 Also, relying on magic download for start.. makes me nervous. :D 12:46:28 In 'liftM2 (,) succ pred', /which/ monad is being invoked? 12:46:36 I'd rather know what's needed, get it, be totally clear about it. 12:46:37 Cabal does not support downloading packages from the internet, and cabal-install only supports the one hackage server. 12:46:48 Baughn: e -> 12:47:03 succ and pred are elements of the monad 12:47:21 Good point. I'm really going to have to read about the -> monad now. 12:47:45 liftM2 c f g x == f x `c` g x 12:49:06 :t liftM2 (,) succ pred 12:49:08 forall a. (Enum a) => a -> (a, a) 12:49:16 :t succ &&& pred 12:49:18 forall a. (Enum a) => a -> (a, a) 12:49:34 :t (&&&) 12:49:36 forall (a :: * -> * -> *) b c c'. (Arrow a) => a b c -> a b c' -> a b (c, c') 12:49:40 shapr: thank you 12:49:49 that's the -> arrow :) 12:50:26 mauke: Arrows and such are a part of haskell I've been putting off learning. I've looked for a book that describes them, but without much luck - any suggestions? 12:50:42 sorry, I don't understand arrows either 12:50:59 mmm arrows 12:51:12 @go arrows site:haskell.org/haskellwiki 12:51:15 http://www.haskell.org/haskellwiki/Research_papers/Monads_and_arrows 12:51:15 Title: Research papers/Monads and arrows - HaskellWiki 12:52:01 http://www.haskell.org/haskellwiki/Arrows -- testing 12:52:02 Title: Arrows - HaskellWiki 12:52:26 Research papers aren't quite what I'm looking for, but if that's what there is, I'll read them. Thanks. 12:53:03 --- quit: Blwood ("71 75 69 74") 12:53:30 oh wait, false alarm 12:53:53 http://www.haskell.org/haskellwiki/Arrow 12:53:54 Title: Arrow - HaskellWiki 12:53:56 apparently it is not that easy to find out if a wiki page exists... 12:54:03 I would think arrows are easier to understand than monads, since arrows are much closer to side-effectful functions than monads are. 12:55:15 I think arrows are easier to understand than monads. 12:55:38 good for you 12:55:43 you're both crazy 12:55:50 --- quit: Pupeno- (Read error: 104 (Connection reset by peer)) 12:55:55 --- join: erg0t (n=ergot@r190-64-203-174.dialup.adsl.anteldata.net.uy) joined #haskell 12:55:57 they're way more complicated, the notation is much more complicated with a non-local desugaring 12:57:05 I didn't say they were simpler, I said they're easier to understand. 12:57:08 shapr: heh, I hope that's true about arrows. 12:57:59 http://www.haskell.org/haskellwiki/Arrow_tutorial 12:58:01 Title: Arrow tutorial - HaskellWiki 12:58:01 I like the arrows as monoids paper - http://lambda-the-ultimate.org/node/1750 12:58:02 Title: Arrows, like Monads, are Monoids | Lambda the Ultimate 12:58:03 Messing with HXT, it seemed like something was simpler. It's all like data types in, data types out. Chain them together by matching types. 12:58:15 Yeah, first class transformers... 12:58:35 --- join: alexj (n=chatzill@209-204-189-215.dsl.static.sonic.net) joined #haskell 12:58:36 lego functions 12:58:41 --- join: Pupeno- (n=Pupeno@dsl-37-170.dsl.netsource.ie) joined #haskell 12:58:56 The >>> operator is just glorified function composition. Or unix piping. Whereas the >>= operator is more subtle. 12:59:12 --- join: sjanssen (n=sjanssen@pcp082686pcs.unl.edu) joined #haskell 12:59:23 Heffalump: not everyone considers understanding haskell's arrow sugar part of understanding arrows :-) 12:59:26 So, someone on the c.l.functional newsgroup asked why currying was any good, and I posted a response talking about how it encourages function definition by composition/etc. of partially applied functions, which can be nice... 12:59:33 --- join: gkr (n=notme@200-127-242-48.cab.prima.net.ar) joined #haskell 12:59:35 I don't get yet why the pairs of things are so important, what's the signficance. 12:59:55 --- join: sorear (n=stefan@ip68-6-133-142.sd.sd.cox.net) joined #haskell 12:59:57 And he sent me an e-mail response saying: "Wow, I can now see how alot of abstractions in the OO world can berepresented as partially evaluated functions." 13:00:03 Is that sarcasm? I can't tell. 13:00:16 probably not 13:00:19 If you don't have currying, you need pairing. The arrow story doesn't offer currying. So it has to offer pairing. 13:00:29 closures are a poor man's objects, objects are a poor man's closures 13:00:45 When you create a new object, before calling one of its functions.. in a loooong stretch you could consider that partial application 13:00:53 er methods, not functions 13:01:05 right, arrows actively avoid higher-order computations (ArrowApply aside) because otherwise they'd be monads 13:01:18 (or at least isomorphic to monads) 13:01:31 arrow code without arrow notation is pretty hard to read 13:01:49 I suppose that's true. I just thought it was a wild jump from what I actually talked about. :) 13:02:03 Also, I look forward to when there are speakable names for these functions like (>>>) and (***) etc.. 13:02:14 there are already 13:02:31 "compose", "fan in/out" etc etc 13:02:43 >>> is compostion, clearly. *** is like tupling of functions. 13:03:03 http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html 13:03:07 they're in one or more of the papers 13:03:08 Title: RE: What's so cool about Scheme?, http://tinyurl.com/25ejt3 13:03:55 --- join: binary42 (n=binary42@pool-72-85-210-146.bstnma.east.verizon.net) joined #haskell 13:03:55 . 13:05:45 a useful operator indeed. 13:06:20 fax: that's a not uncommon pattern in Python 13:06:35 --- quit: lelf` ("`,'sleep!") 13:06:38 --- quit: glen_quagmire ("leaving") 13:06:53 Oh I see. If you have been programming pointful all your life (basing yourself on function application), you will understand monads easier, since >>= is glorified function application. If you have been programming pointfree all your life (basing yourself on function composition), you understand arrows easier, since >>> is glorified composition. 13:07:32 So arrows are easier for APL programmers? 13:07:39 --- quit: jfredett (Read error: 110 (Connection timed out)) 13:07:51 @remember monochrom Oh I see. If you have been programming pointful all your life (basing yourself on function application), you will understand monads easier, since >>= is glorified function application. If you have been programming pointfree all your life (basing yourself on function composition), you understand arrows easier, since >>> is glorified composition. 13:07:52 Done. 13:07:55 --- join: snearch (n=snearch@e178028193.adsl.alicedsl.de) joined #haskell 13:08:14 function composition or unix piping. For example unix sysadmins who pipe all the time understand arrows easier. 13:09:28 --- quit: Fractal (Read error: 110 (Connection timed out)) 13:09:33 as long as they don't loop back to themselves 13:09:38 Take for example *** and &&&. A pointful programmer may go like, what's the big fuzz, just write (f x, f y) or something. Ah, but if you go pointfree, you can't do that, you need a helper operator. 13:10:57 I have both HAppS 0.9.1 and 0.8.8 now and am getting compile complaints. Is it as simple as just ghc-pkg unregister to deal with this? 13:10:57 --- join: cinema (n=cinema@AMontsouris-151-1-83-121.w83-202.abo.wanadoo.fr) joined #haskell 13:11:14 (assumign I don't mind ditching the 0.8.8, of course) 13:11:30 dino-: GHC should use 0.9.1 by default. 13:11:44 :/ 13:12:01 Could not find module `HAppS': it was found in multiple packages: HAppS-Server-0.9.1 HAppS-0.8.8 13:12:30 dino-: Oh right. Yeah, just unregister HAppS. 13:12:58 dino, you may find it easier to use searchpath and avoid package manager weirdness. 13:13:48 alexj: So that does more than just download things needed? 13:14:21 --- quit: b_jonas ("Leaving") 13:14:48 it does module chasing accross the internet, puts all the modules you need in .haskell-cache and adds the correct -i.haskell-cache/... to your command line so everything just works properly. 13:14:48 --- quit: IvdSangen (Read error: 110 (Connection timed out)) 13:15:01 --- quit: dje (Read error: 104 (Connection reset by peer)) 13:15:02 I need to read about it more. At the risk of sounding paranoid, I don't like things that Just Work necessarily until I know what they're doing. 13:15:19 the searchpatch code is pretty short. 13:15:42 --- quit: gnomnain ("Konversation terminated!") 13:16:00 it looks at the module you pass on the command line, finds its import statements, looks up the urls for those modules on the modulemaps, downloads the modules, looks up those imports etc. 13:16:19 it uses curl to retrieve the modules from the internet. 13:16:54 --- join: jmelesky (n=jmelesky@72.14.229.1) joined #haskell 13:17:48 And then keep these things in ~/.haskell-cache/ It sounds nifty. Thank you for explaining. 13:18:39 also, you can add your own module maps if you don't like mine. 13:18:50 no problem. 13:18:58 alexj: Like if you maybe want to pin something to a specific version? 13:19:03 yeah. 13:19:06 --- quit: gkr (Connection timed out) 13:19:27 or you have your own version of some public lib. 13:19:43 you can pass as many module maps on the command line as you like. 13:20:04 Well, I've never seen anything like that. Not with CPAN or whatever. 13:21:23 I could see it being used by a company to point all developers to the 'approved' modules. Interesting. 13:21:54 Could this become part of Cabal behavior? Or does that not make sense? 13:22:09 perhaps it could. I don't really like the concept of packages. 13:22:31 you need packages only when you have to compile C and link to it. 13:22:48 even then you don't 13:22:51 if you are doing that, you should have special functionality for that specific thing. otherwise modules describe dependencies well enough. 13:22:59 I guess so far I mainly use Cabal myself as a build system to avoid icky Makefiles. 13:23:08 nothing stops GHC from supporting inline C in haskell code with -fvia-C, for instance 13:23:13 ghc --make ftw 13:23:15 --- quit: unmarshal ("leaving") 13:23:43 dino, you can emulate the described behaviour by setting an environment variable for your users. PERL5LIB iirc. 13:23:44 http://search.cpan.org/~adamk/Acme-Everything-1.00/lib/Acme/Everything.pm 13:23:47 Title: Acme::Everything - Effectively loads every class in CPAN - search.cpan.org, http://tinyurl.com/2skopr 13:23:50 --- join: dje_ (n=dje@S0106000d9324c457.vc.shawcable.net) joined #haskell 13:24:06 woah :D 13:24:27 --- quit: EliasAmaral (Connection timed out) 13:25:30 works perfectly until it suddenly drops an anvil on you? 13:26:00 you seem to be unfamiliar with the Acme:: namespace 13:26:53 would _you_ trust something named Acme? :D 13:27:06 http://search.cpan.org/~asavige/Acme-EyeDrops-1.51/lib/Acme/EyeDrops.pm 13:27:09 Title: Acme::EyeDrops - Visual Programming in Perl - search.cpan.org, http://tinyurl.com/z5y6n 13:27:31 alexj: what does searchpath do about versioning? 13:27:49 use urls to point to the version you want. 13:28:28 shapr: added my name to the AmeroHaskell page, fixed up my wiki account to be current. 13:28:43 thetallguy: spiffy! 13:29:16 AmeroHaskell eh? 13:29:36 I can confirm I'm not going. 13:29:44 --- quit: timlarson_ ("Leaving") 13:30:31 --- join: jatqceer (n=user@dyn-pupin-171-226.dyn.columbia.edu) joined #haskell 13:31:02 ?wiki AmeroHaskell 13:31:02 http://www.haskell.org/haskellwiki/AmeroHaskell 13:31:27 mauke: wow, even Befunge is more readable than that 13:31:33 alexj: is that compositional? My program depends on third party module Foo, and Foo only works with a certain version of yet another module Bar 13:32:10 alexj: do I have to know all the details of Foo's version dependencies to use it? 13:32:12 Didn't a Haskell programmer trump all in terms of unreadability with a whitespace-only language? 13:32:14 That is my objection to version system in cabal 13:32:20 has anyone written some functional matrix inversion code? 13:32:36 Matrix inversion is almost universally a numerically bad idea. 13:32:37 --- quit: dje_ (Read error: 104 (Connection reset by peer)) 13:32:45 wli: edwinb *created* whitespace, but that's a whole new language 13:32:50 since you can only have one version of a particular package/module in a particular program, you can only have one map. 13:32:53 wli: this code is apparently valid Perl 13:32:56 whitespace only? no problem: http://search.cpan.org/~dconway/Acme-Bleach-1.12/lib/Acme/Bleach.pm 13:32:59 Title: Acme::Bleach - For really clean programs - search.cpan.org, http://tinyurl.com/28xpr 13:33:01 one ovverall map. 13:33:01 --- join: dje (n=dje@S0106000d9324c457.vc.shawcable.net) joined #haskell 13:33:06 alexj: eh? 13:33:10 that map is determined by the top level program. 13:33:16 alexj: you can have as many map's as you want... 13:33:24 specifically LU decomposition with partial pivoting? 13:33:49 sorear: there is only one module/package namespace and that is determined by the set of maps you pass to searchpath. 13:34:08 alexj: they fixed that recentlyish in GHC *fetches commit message* 13:34:19 --- quit: Trixsey (Remote closed the connection) 13:34:27 alexj: Are you saying, the ghc registration system only allows you to have one ver, but perhaps projects on the one system need different versions of some lib? 13:34:27 tHmm... we should have that or something similar (AmeroHaskell) on the west coast.. I recommend san fransisco. 13:34:46 Like I just had here, sure I can get rid of 0.8.8, but what if that was inconvenient. 13:34:47 sorear: symbols have contained the package name and version since 6.6 IIRC 13:34:49 JohnMeacham: San Francisco I can make it to. 13:34:59 sjanssen: right 13:35:04 JohnMeacham: I am in sanfracisco, so I would suport that. 13:35:09 sjanssen: 6.6 is within my recentlyish 13:35:12 I won't set foot in red states. 13:35:21 dino-: you can probably lift that restriction using -package flags or Cabal 13:35:34 wli: Yeah, there are a lot of people up and down the west coast. I am in los angeles (pasadena actually) but can travel to san fran on 6 hours notice. 13:35:34 dino: I am saying that each project should be able to determine what packages it wants. a global package system does not make sense. 13:35:37 sjanssen: could I have kept both.. ok, was just going to ask about specifying in the .cabal file. 13:35:45 every project has its own .haskell-cache. 13:35:51 wli: How about a blue city in a red state? 13:35:53 wli: are you serious? That's really ridiculous 13:35:57 JohnMeacham: Similar here. 13:36:04 alexj: a global DNS makes even less sense 13:36:17 alexj: but every .cabal can specify which version it wants from the ones available 13:36:35 which is red and which is blue? 13:36:39 Saizan: thats wonderful until you have conflicting dependencies in the cabal files. 13:36:41 sjanssen: I may be completely out of my mind, but I'm not suicidal, hence, no setting foot in red states. 13:36:42 --- quit: Spockz|Workstati (Read error: 110 (Connection timed out)) 13:36:46 Don't know, don't care 13:37:01 wli: I find that opinion a bit offensive 13:37:07 alexj: why? 13:37:16 wli: closed minded even 13:37:37 my program depends on Package Foo v1.2 and package Goo v2.4. 13:37:47 Package Goo updates and now depends on Foo v1.1.... 13:37:50 sjanssen: That's fine. You can be offended. I'll stay alive. 13:37:56 --- quit: Cheery (Remote closed the connection) 13:37:57 blah 13:38:01 alexj: cabal/GHC can handle that just fine 13:38:06 alexj: you just need to install Foo 1.1 too 13:38:18 so now your program uses both Foo 1.2 and Foo 1.1? 13:38:35 yep. 13:38:39 wli: you think someone will kill you in eg. Nebraska? 13:39:00 so the error message blah blah in Foo.Bar applies to which module? 13:39:17 alexj: that's when you're not using cabal, but just --make 13:39:18 But wait, in this one project, with both foo-1.2 and foo-1.1 in the depends, presuming both.. yeah, the import statement. 13:39:21 I really wish there would be Numerical Recipes in Haskell. 13:39:50 sjanssen: Yes. 13:39:51 Saizan: my point is that Cabal just invites confusion about the meaning of import statements. 13:40:00 --- join: ddarius (n=derek@74.197.10.104) joined #haskell 13:40:03 dino-: Goo will have 1.1, and your project will use 1.2, no conflict there 13:40:20 * Nafai boggles at wli 13:40:29 goo that lispy language? 13:40:30 Saizan: I see. But if your actual source code requires both. Which probably makes no sense. 13:40:34 maybe he owes money :p 13:40:42 alexj: moreso than Haskell invites confusion about the meaning of unqualified identifiers? 13:40:47 Nafai: careful, one time i boggled so hard, i got a hernia 13:40:52 Or at least could be fixed in YOUR source. 13:40:56 Mr_Awesome: Heh. Those aren't fun. 13:41:09 --- quit: progexp (Read error: 104 (Connection reset by peer)) 13:41:14 wli: what if I were to say "I refuse to step foot in a blue state, they might force me into a same-sex marriage"? 13:41:17 indeed not 13:41:17 Saizan: module namespace is global. 13:41:21 wli: doesn't that sound ridiculous to your ears? 13:41:24 dino-: i don't think that can be solved even with searchpath if you want the same module from both 13:41:41 alexj: no it's not 13:41:50 alexj: it depends on exposed modules 13:41:55 --- nick: c -> carmen 13:42:02 alexj: no, because you can hide packages 13:42:07 sjanssen: a better parallel might be "I might see a same-sex marriage" 13:42:16 alexj: with -hide-all-packages -package goo-1.1, Foo.Bar refers to goo-1.1:Foo.Bar 13:42:23 alexj: with -hide-all-packages -package goo-1.2, Foo.Bar refers to goo-1.2:Foo.Bar 13:42:34 in the same program? 13:42:37 sjanssen, you can't reason someone out of opinions that were not formed by reasoning. 13:42:48 module namespace is global within a particular program. 13:42:58 I don't see a problem with not wanting to visit any particular state for any arbitrary reason. I will never visit New York City because I hate cement buildings. 13:43:00 --- part: jmelesky left #haskell 13:43:26 Heffalump: seeing a same-sex doesn't nearly approach being killed, no matter how closed-minded you are -- just trying to come up with an equal-but-opposite ;) 13:43:40 can we push the political conversation to a different channel. Red/Blue blah does not affect whether my program compiles. 13:43:46 being forced into one seems rather less likely than being killed, though 13:44:07 * Heffalump --> #haskell-blah 13:44:15 mauke++ 13:44:24 * sjanssen apologizes 13:44:25 dylan: Aw, NYC is so full of stuff to do. 13:45:00 sorear: does my correction make sense: module namespace is global within a particular program? 13:45:09 And food! Constantly assaulting you from every direction. :D 13:45:09 There are other considerations that make it impossible for people to attend conferences in particular countries. For example, security experts that do any sort of published penetration analysis are essentially prosecutable in the US, so they can't go to conferences here. 13:45:11 dino-: It needs to be terraformed into a liveable environment. Also I have issues that the land would be better suited to the production of food... 13:45:32 --- quit: jtoy () 13:45:37 alexj: one side or the other might outlaw open source if left in power for long enough :-) 13:45:59 wli, you are on crack. Has Blackhat been shut down and nobody told me? 13:46:04 * dino- pouts 13:46:04 alexj: yes, s/program/compilation unit/; but foo and goo are different compilation units (in Cabal), so it doesn't hurt 13:46:25 Has anyone here a copy of Algorithms: A Functional Programming Approach? 13:46:32 hmph. My bytestring program can either use 250M of RAM and take about 7 seconds, or about 45MB and take about 20 seconds. 13:46:38 (and if so, is it worth $100 US? ) 13:46:52 so that means that I can't use an XML datatype I get from Goo in my program because Data.Foo.Xml means something different. 13:47:04 Adamant: No, I'm not. There is a cadre of programmers who do security work on Linux who refuse to enter the US or US-controlled territory on account of this. 13:47:28 Goo's documents tell me that some function returns a Data.Foo.Xml, I should be able to use it. 13:47:39 --- join: jtoy (n=jtoy@mail.backchannelmedia.com) joined #haskell 13:47:43 the US certainly strikes me as a dangerous environment for some security research 13:47:46 wli, they can believe whatever they want. There are security conferences held every year with American and foriegn researchers 13:47:48 Now you are telling me that I have two different Data.Foo.Xml in my program. 13:48:35 jesus h, Germany just outright banned hacking tools. Guess where a lot of their projects are ending up. Hint - US 13:48:40 Adamant: This is in fact so significant it has affected the location of certain Linux-related conferences. 13:48:52 Adamant: Dmitry Sklyarov http://en.wikipedia.org/wiki/Dmitry_Sklyarov 13:48:54 Title: Dmitry Sklyarov - Wikipedia, the free encyclopedia 13:49:06 --- quit: LPhas_ (Remote closed the connection) 13:49:14 wli: does this discussion have anything to do with Haskell? 13:49:37 Adamant: I've not followed this topic closely. It has merely made it a major PITA for me to attend certain conferences because foreign travel vs. corporate expenses is painful. 13:49:49 wli: please talk elsewhere about this e.g blah 13:50:01 Yeah, all this stuff to -blah 13:50:03 alexj: Conference locations. 13:50:08 --- part: gour left #haskell 13:50:46 wli: I think about haskell sometimes when I take showers. That does not mean it makes sense to open up a discussion about bathroom fixtures here. 13:51:22 alternatively keep your paranoia to yourself :P 13:51:58 --- join: Pupeno_ (n=Pupeno@dsl-37-170.dsl.netsource.ie) joined #haskell 13:51:59 sorear: I don't want to different versions of Data.Foo.Xml in my programs. 13:52:28 In conclusion, I cast my vote in favor of San Francisco. 13:52:39 mainstream languages are like bar soap. haskell is like body wash gel. 13:53:03 :t foldr1 13:53:09 forall a. (a -> a -> a) -> [a] -> a 13:53:09 with haskell, my code is already clean! 13:53:15 Well, I don't know that I can go to SF. Been on a few trips lately and just lost my job. 13:53:43 * ddarius prefers bar soap... 13:54:11 huh 13:54:20 ?pl /f g h a -> f (g a) (h a) 13:54:21 (line 1, column 1): 13:54:21 unexpected "/" 13:54:21 expecting white space, natural, identifier, lambda abstraction or expression 13:54:29 ?pl \f g h a -> f (g a) (h a) 13:54:30 liftM2 13:54:30 other slash? 13:54:38 So succint! 13:54:56 alexj: I see this as a problem with Haskell's type system, since it affects far more than just Cabal. In particular, all dynamic code loading systems are segfault-prone because dynamism and nominal type equality, are just plain incompatible. 13:55:29 alexj: I'll say this, coming from many (dreary) years working in Java, I sometimes felt like it would be nice to be able to include something just for this project (like you can in Java with jar files) as opposed to system-wide. SearchPath reminds me of that. 13:57:48 sorear, there's a guy on LtU that want's to implement a PL where types are normalized 13:58:08 --- quit: nostrademons (Read error: 104 (Connection reset by peer)) 13:58:16 --- quit: loud- ("loud- has no reason") 13:58:17 sorear, even, e.g., [Bool] ~~ Integer 13:58:32 --- join: urkud (n=urkud@81.13.117.15) joined #haskell 13:59:21 --- join: progexp (i=progexp@gateway/tor/x-ed0d4899d5e9fd82) joined #haskell 13:59:45 however, considering how complicated equi-recursive types are compared to iso-recursive, i'm not so sure that will ever work out 13:59:54 dino: yes. I like having everything specific to my project. I don't see value in global packages except saving disk space which is very cheap. 14:00:09 it's also a management issue 14:00:13 easier to update one central thing 14:00:24 sorear: since we don't really have dynamism anyway, I like having nominal type equality. 14:00:44 Heffalump: you can always use the same module maps. 14:01:06 but with searchpath, you can also add a modulemap that takes precedence that is specific for your project. 14:01:22 alexj: so, how is sp better? From what I've seen so far, it sounds like it will fail just as hard (ghc: module Data.Foo found in multiple directories) 14:02:06 I think GHC just grabs the first matching module in the set of -i directories passed. 14:02:44 well, they must have changed the version number for a reason; won't some of your code break? 14:02:49 each module map get converted into a directory. you control the order of module maps and hence implicit predence on the command line. 14:03:36 --- quit: Pupeno- (Read error: 110 (Connection timed out)) 14:03:38 sorear: yes. the underlying problem is real. my point is that it is real with cabal or searchpath. but searchpath is otherwise much more convenient to use. 14:04:02 cabal-install could have the same convenience though. 14:04:12 yes, we're working on that 14:04:21 I would like to know how to use fps not from base. 14:04:34 if packages require cabal-1.2 they're just grab it from hackage 14:04:35 Heffalump: you need a ghc head version of base 14:04:36 short of -i'ing the source 14:04:42 then grab bytestring from d.h.o 14:04:44 oh, has it been removed again? 14:04:46 otherwise, an older version is used 14:04:50 it has been, yep. 14:04:56 so its only in base for the 6.6 series 14:04:58 ok, so the answer is "wait for 6.8"? 14:05:04 array isn't even in base now 14:05:09 --- quit: cmhh () 14:05:09 yeah, or grab a snapshot 14:05:22 --- quit: doserj ("Verlassend") 14:05:22 I plan to, but Igloo recommended against the current one :-) 14:06:07 Call it the self-containment factor. 14:07:11 alexj: how does sp cope with separate compilation? happs takes what feels like 15 minutes to build; if I compile twenty small HAppS programs will I have to wait five hours? 14:08:45 --- quit: coffeemug (Remote closed the connection) 14:08:51 they're just linking against the lib though 14:08:58 hpaste compiles pretty fast 14:09:21 sorear: you can always share the same .haskell-cache if you want. .haskell-cache path is a command line option. 14:10:27 --- join: JBGood (i=jbauman@JBAUMAN.RES.cmu.edu) joined #haskell 14:10:31 --- quit: tessier (Read error: 104 (Connection reset by peer)) 14:10:42 thinking about it further, if package Foo 1.1 has a problem, I want to use Foo 1.2 and if package Goo can't work with Foo1.2 I should get a compiler error. I don't want versioning to cause Goo to silently use a known bad version of package Foo. 14:11:57 searchpath gives an error message. automated cabal will silently do the wrong thing, I think. 14:12:21 --- quit: Mr_Awesome (Read error: 110 (Connection timed out)) 14:12:58 --- quit: cjeris_ (Read error: 104 (Connection reset by peer)) 14:13:04 What if the cabal file has Foo >= 1.2 ? 14:13:43 --- join: Itkovian (n=Itkovian@d54C4B834.access.telenet.be) joined #haskell 14:14:08 --- quit: Cale (Read error: 104 (Connection reset by peer)) 14:14:51 --- join: tessier__ (n=treed@207.158.40.201) joined #haskell 14:15:05 --- join: Cale (n=cale@74.122.44.191) joined #haskell 14:16:04 --- quit: snearch ("Nettalk6 - www.ntalk.de") 14:16:32 shapr: Fundamentally, having multiple versions of the same package in the same program is a recipe for trouble. The issue comes up only when there are actual conflicts. By default searchpath is using the latest version of packages because it is pointing at some darcs repo. 14:16:36 --- quit: CosmicRay ("Client exiting") 14:16:36 --- join: Eelis_ (n=Eelis@o-o.xs4all.nl) joined #haskell 14:16:38 --- nick: pgavin-away -> pgavin 14:17:34 alexj: Yeah, using multiple versions of something at the same time will cause problems. 14:17:40 interestingly, there are dependency situations that Cabal can compile, but searchpath can't 14:17:56 --- join: arguile (n=arguile@KTNRON06-1242488957.sdsl.bell.ca) joined #haskell 14:18:00 really? 14:18:30 --- join: gkr (n=notme@200-127-242-48.cab.prima.net.ar) joined #haskell 14:19:22 Igloo: is there something other than EXTRA_CC/HC_OPTS for propagating -I/usr/local/include through the build system? 14:19:30 yes, consider Foo depends on Bar and Baz, Bar depends on Ouch==1.0, Baz depends on Ouch==2.0 14:19:45 i'm getting failures building cbits in base with ghc-inplace, not picking up HC or CC opts 14:20:21 To be fair to both these pieces of software, these are historically crazy nuts to crack in general in our biz. 14:20:47 I wonder if there are packages that sp can build that Cabal can't 14:20:58 --- join: DukeDave (n=dave@host86-146-185-116.range86-146.btcentralplus.com) joined #haskell 14:21:43 sjanssen: I don't want that to build. I want only one version of a package/module in my program. Having two versions of Ouch is an error IMHO. 14:21:54 --- join: crabstick_ (n=dustbust@dan0218.urh.uiuc.edu) joined #haskell 14:22:10 but Bar and Baz's dependencies should be opaque to users 14:22:26 otherwise Baz is inhibited from upgrading until Bar does 14:22:41 alexj: even if the dependency on Ouch isn't exposed in the API of Foo? 14:23:54 --- quit: byorgey ("Back to the real world...") 14:24:32 If cabal made sure that I don't end up with two different versions of Data.Ouch.Xml then I guess that would be ok. But that is a bad smell. Baz can upgrade and your package can use the current version of Baz until Bar upgrades as well. 14:25:23 --- quit: jtoy () 14:25:27 --- join: arag0rn (n=arag0rn@61.2.59.133) joined #haskell 14:25:37 --- join: Fractal (i=jah@hcsw.org) joined #haskell 14:25:49 If Bar is no longer maintained then again you probably don't want to be using that code. 14:26:30 well, in practice these things sometimes happen 14:26:39 maintainers are slow, or you need bleeding edge features, etc 14:27:06 Does anyone know a simple canonical example of a haskell program using multiple files? 14:27:25 (I want to look at one that's done right so I know what to do) 14:27:48 heffalump: you can always create your own repo of Bar that does the right thing. 14:27:58 fax: xmonad? 14:27:59 fax: xmonad? 14:28:06 alright, thanks :D 14:28:30 I'm still thinking I'd like to see these things work together. I rely on Cabal to do the configure, build, test, install, clean stuff. But would be cool to be able to mix in this SP behavior if desired. 14:28:48 heffalump: Does cabal actually enforce that you don't end up with functions that return two different versions of Data.Ouch.Xml in your code? 14:28:57 alexj: no, it doesn't 14:29:21 --- quit: Eelis (Read error: 110 (Connection timed out)) 14:29:31 that would actually be a nice feature 14:29:39 It seems like we can do dependency gymnastics and break just about any system there is. 14:30:00 Coming up with situations that are possibly ill-advised. 14:31:04 dino: my general belief is that if you are in a situation where you depend on two different versions of Ouch, your code is probably unreliable and not ready fo release either. 14:31:28 but if Ouch is just a string library, that doesn't really follow 14:31:33 alexj: when that happens, you're in one of two situations: 1) the packages are fundamentally compatible, or 2) you need to recompile a package against new dependencies 14:31:43 1) is unavoidable in any packaging system 14:32:03 2) sucks 14:32:21 s/fundamentally compatible/fundamentally incompatible 14:32:55 alexj: and even if you don't want to release it like that, you can't work with it either 14:32:57 --- quit: rretzbach (Remote closed the connection) 14:32:59 sjanssen: if you have two fundamentally incompatible packages, perhaps they should have different names rather than different version numbers. 14:33:08 in fact, is 2 only a byproduct of GHC's compilation model? 14:33:30 --- join: rretzbach (n=robert@dslb-084-062-001-137.pools.arcor-ip.net) joined #haskell 14:33:37 --- quit: aaco ("Leaving") 14:34:02 does anyone know if any progress has been made on PIC in GHC? 14:34:25 alexj: incrementing the version number is the popular thing to do -- don't HAppS 0.8 and 0.9 have fundamentally different APIs? 14:34:28 sjanssen: I don't want "import Data.Ouch.Xml" to mean different things in different places. Similarly, I don't want a domain name system where http://haskell.org goes to a different location depending on the linking context. 14:34:29 Title: Haskell - HaskellWiki 14:35:19 sjanssen: yes, but I am not worried about people trying to use both in the same program. 14:36:02 Time for me to brave the rainy weather and go home. See you guys later. 14:36:13 --- join: stepcut (n=user@gateway.linspire.com) joined #haskell 14:36:24 bye 14:36:27 is there a function in the ghc libraries like mkstemp, but for directories ? 14:37:02 --- quit: crabstick_ () 14:37:18 --- quit: roconnor (Read error: 104 (Connection reset by peer)) 14:37:31 --- quit: crabstick (Read error: 110 (Connection timed out)) 14:38:19 Igloo: we have GHC_CC_OPTS now as well? 14:39:36 --- join: vincenz (n=vincenz@b9-233.xan.duth.gr) joined #haskell 14:40:26 dons: I think it's a bug that libraries/*/GNUmakefile doesn't use EXTRA_CC_OPTS 14:40:36 dons: is your unsw email still active? 14:41:14 yeah, but the new one is preferred 14:41:29 dons: ah, because on the HAC II page, it showed your unsw one 14:41:41 my build error with -I/usr/local/include isn't propagated by the usual means 14:41:54 since we now have this GHC_* thing 14:42:04 --- join: jtoy (n=jtoy@c-24-91-181-24.hsd1.ma.comcast.net) joined #haskell 14:42:08 * vincenz hopes you got his registration email 14:42:19 vincenz: yeah, you're all registered 14:42:24 you've found a hotel? 14:42:36 dons: not yet, but I'm most likely getting funding for the trip to go attend ICFP 14:42:38 dons: Right, there should be an equivalent of "GHC_OPTS += $(EXTRA_HC_OPTS)" for GHC_CC_OPTS 14:42:39 so they'll deal with that 14:44:55 --- part: urkud left #haskell 14:47:39 --- quit: shapr (Read error: 104 (Connection reset by peer)) 14:48:02 --- join: mr_tenor (n=nick@c220-239-43-146.rivrw7.nsw.optusnet.com.au) joined #haskell 14:48:14 Igloo: looks like similar issues for hsc2hs ? 14:48:57 --- quit: vincenz ("Sleep") 14:50:22 :t (.|.) 14:50:24 forall a. (Bits a) => a -> a -> a 14:52:15 --- quit: jtoy () 14:53:02 Igloo: also, is cabal now building libs with -O (or -O2 on) ? 14:53:11 we don't want to be distributing unoptimised libs 14:53:50 dons: It is, yup 14:54:51 how do I get an -I/path through to the hsc2hs used in the hpc lib? 14:55:08 --- quit: Itkovian () 14:55:29 EXTRA_HSC2HS_OPTS doesn't cut it 14:56:50 --- quit: sjanssen ("Konversation terminated!") 14:59:45 --- join: Manyfold (n=mw@dslb-084-060-018-071.pools.arcor-ip.net) joined #haskell 15:00:32 --- part: ADEpt left #haskell 15:03:11 --- join: glguy (n=emertens@unaffiliated/glguy) joined #haskell 15:04:02 dcoutts: any thoughts on how hard it would be to roll a gtk2hs app for editing values in xmonad's Config.hs ? 15:04:20 basically, the tool would constrain inputs to each config file based on the type 15:04:29 and you'd just enter values into the gui, which writes your Config.hs 15:04:30 --- nick: pgavin -> pgavin-away 15:04:45 @go fetchmailconf 15:04:47 http://linux.die.net/man/1/fetchmailconf 15:04:47 Title: fetchmailconf(1): fetch mail from POP, IMAP ... - Linux man page 15:04:53 ^^^ model 15:05:49 nice reference, thanks 15:06:49 --- join: AtnNn_ (n=welcome@modemcable085.68-56-74.mc.videotron.ca) joined #haskell 15:06:51 --- quit: AtnNn (Read error: 104 (Connection reset by peer)) 15:07:28 --- quit: scv ("CGI:IRC") 15:07:57 --- join: nachof (n=nacho@r190-64-38-113.dialup.adsl.anteldata.net.uy) joined #haskell 15:08:20 --- quit: viblo ("quit message") 15:09:03 --- quit: igel ("Leaving") 15:13:07 --- join: reilly (n=rfh@70.133.191.46) joined #haskell 15:13:10 dons: That could be a nice general tool (if it was general enough a tool). 15:13:11 --- join: heisenbug (n=ggreif@p54944D01.dip.t-dialin.net) joined #haskell 15:13:37 --- quit: therp (Read error: 110 (Connection timed out)) 15:13:45 has anybody every done a haskell subset to c++ template language translator? 15:14:12 it's high on the list of very wrong but amusing projects 15:15:15 --- quit: Saul__ (Remote closed the connection) 15:15:29 it may be do-able with "boost". 15:15:51 oh, i'm sure it's doable 15:16:03 sorry, I haven't done it. :) 15:16:31 reilly: That's one of the first programs I wrote in Haskell. 15:16:35 i'm having to hack boost metaprogramming templates and i'd really rather do it in haskell first 15:17:20 (did lisp though) 15:17:34 i actually can't imagine trying to do template programming in c++ without already knowing Haskell or ML 15:18:08 ddarius: seriously? how reasonable a subset did you get? 15:18:39 my intent is to sidestep much of the template debuggery in C++ 15:19:30 anyway, C++ has associated type synonyms and type-level functions :-) 15:19:37 yeah, i know 15:20:08 reilly: I believe it would translate simple (recursive) functions using pattern matching on integers and "calls" to other "functions" and primitives. 15:20:27 I could write factorial in it exactly as you would write it in Haskell. 15:20:40 that's pretty cool 15:20:40 * heisenbug once implemented the cata/anamorphism stuff that is in the "bananas" paper in C++ 15:20:46 I think it could do higher-order functions too, I don't remember if I did make a map or some such. 15:20:56 > product [1..10000] 15:20:58 2846259680917054518906413212119868890148051401702799230794179994274411340003... 15:21:12 --- join: doctormach (n=Doc_Mach@pcp093393pcs.unl.edu) joined #haskell 15:21:23 --- quit: doctormach (Client Quit) 15:21:24 i really wish you could specify constraints on template type parameters in C++ :( 15:21:34 :t product 15:21:36 forall a. (Num a) => [a] -> a 15:21:59 Igloo: yeah, EXTRA_HC_OPTS seems to be a bit inconsistently applied, so i've got gcc, hsc, ghc and ghc-inplace failing to set flags to find gmp in /usr/local 15:22:03 without lots of file editing 15:22:17 eg. 15:22:17 compiler/Makefile 15:22:27 has 15:22:28 $(HC) -cpp -optc-DGHC_PATH=$(DQ)$(GHC_PATH)$(DQ) -optc-DTOP_ABS=$(DQ)$(FPTOOLS_TOP_ABS)$(DQ) $(INPLACE_EXTRA_FLAGS) $< -o $@ 15:24:36 fax pasted "xay parsing" at http://hpaste.org/2755 15:24:53 mm I wanted to just ask is this really bad? 15:24:54 --- quit: obsethryl (Read error: 104 (Connection reset by peer)) 15:25:22 --- join: LunohoD (n=alex@e180065033.adsl.alicedsl.de) joined #haskell 15:25:28 I'm not sure how else to do this though 15:25:41 --- join: KatieHuber (n=katie@203-97-111-120.cable.telstraclear.net) joined #haskell 15:26:09 do char 'x'; as <- many (char 'a'); char 'y'; return (length as) 15:26:35 --- join: sjanssen (n=sjanssen@CPE-76-84-191-66.neb.res.rr.com) joined #haskell 15:26:47 mr_tenor: C++0x will have those constraints 15:27:12 liftM length . between (char 'x') (char 'y') . many . char $ 'a' 15:27:46 char 'x' >> liftM length (many $ char 'a') << char 'y' 15:28:04 huh? 15:28:13 heisenbug: seriously? Great! It's just so ambiguous at the moment.. like "Guess what sort of class goes here... maybe you won't get a compileerror if you read my mind" ;) 15:28:15 :t << 15:28:17 parse error on input `<<' 15:28:19 :t (<<) 15:28:21 oerjan: doesn't exist 15:28:22 Not in scope: `<<' 15:28:27 --- part: pedro_dgv left #haskell 15:28:29 oh 15:28:33 a << b = do { x <- a; b; return x } 15:28:42 :t (*<) 15:28:44 Not in scope: `*<' 15:28:47 :t (<*) 15:28:50 forall (f :: * -> *) a b. (Applicative f) => f a -> f b -> f a 15:28:57 :t flip (>>) 15:28:59 forall (m :: * -> *) a b. (Monad m) => m b -> m a -> m b 15:29:04 mr_tenor: google for C++ concepts 15:29:31 Which Module do you need for all this? 15:29:31 --- join: dbueno (n=dbueno@cpe-69-202-89-145.twcny.res.rr.com) joined #haskell 15:29:39 idnar: That would execute in the wrong order. 15:29:44 oh true 15:29:53 Text.ParserCombinators.Parsec 15:30:01 and Control.Monad 15:30:12 --- join: jao_ (n=jao@216.239.33.8) joined #haskell 15:30:14 ohh 15:30:18 ok well what do you think of this, 15:30:29 --- join: agoode (n=agoode@2001:4830:1633:0:212:3fff:fe70:6222) joined #haskell 15:30:31 I parse text into tokens with Parsec.. Then use Parsec again to parse tokens into an AST 15:30:41 heisenbug: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1886.pdf ? sounds interesting... thanks :) 15:30:48 @let a << b = do { x <- a; b; return x } 15:30:49 fax: Why? 15:30:52 Defined. 15:31:02 --- quit: norgul (Remote closed the connection) 15:31:05 :t (<<) 15:31:07 Not in scope: `<<' 15:31:11 ag 15:31:14 :t (>>) 15:31:16 forall (m :: * -> *) a b. (Monad m) => m a -> m b -> m b 15:31:34 idnar: Only @run and @let see those bindings. 15:31:37 mr_tenor: C++ is sailing in the keelwater of Haskell ;-) 15:31:52 ddarius: I meant to do >> not << 15:32:01 but I guess my fingers didn't want to cooperate ;) 15:32:04 ddarius: actually there was one more, i don't remember which 15:32:07 > [1,2] << [3,4,5] 15:32:09 [1,1,1,2,2,2] 15:32:22 what? 15:32:27 heh 15:32:37 I don't understand that at all :p 15:32:43 fax: The [] monad. 15:32:43 --- join: ergot (n=ergot@r190-64-196-15.dialup.adsl.anteldata.net.uy) joined #haskell 15:32:45 --- quit: dje (Read error: 104 (Connection reset by peer)) 15:32:46 > [3,4,5] >> [1,2] 15:32:48 [1,2,1,2,1,2] 15:32:55 not a very useful thing to do, mind you 15:33:03 > [3,5] >> [1,2] 15:33:04 [1,2,1,2] 15:33:13 fax: it's equivalent to [x| x <- [1,2], _ <- [3,4,5]] 15:33:16 > [(),(),()] >> "butter" 15:33:17 "butterbutterbutter" 15:33:23 > [x | x <- [1,2], _ <- [3,4,5]] -- equivalent. 15:33:24 > "abc" >> [1,2,3] 15:33:25 [1,1,1,2,2,2] 15:33:26 [1,2,3,1,2,3,1,2,3] 15:33:30 ok 15:33:37 --- join: norgul (n=joakim@dhcp-232-56.romerikebb.no) joined #haskell 15:33:45 for _ in "abc": return [1,2,3] 15:33:59 @help run 15:33:59 --- quit: iblechbot (Read error: 113 (No route to host)) 15:33:59 run . You have Haskell, 3 seconds and no IO. Go nuts! 15:34:02 @list run 15:34:03 eval provides: run let undefine 15:34:03 fax: For [], return is (:[]) and (>>=) is (flip concatMap). 15:34:31 --- join: Blwood (n=Blwood@247.236-242-81.adsl-dyn.isp.belgacom.be) joined #haskell 15:36:32 --- join: delamon (n=mon@X10.D-IP06.lipetsk.ru) joined #haskell 15:36:32 --- join: spoop (n=spoop@c-67-186-191-64.hsd1.ct.comcast.net) joined #haskell 15:39:40 --- quit: cinema ("Ex-Chat") 15:41:00 --- quit: LunohoD_ (Read error: 110 (Connection timed out)) 15:42:04 If you use data Tok = TokX | TokA | TokY instead of strings.. 15:42:16 can you still use parsec? 15:43:05 Yes, with a pedantic correction. 15:44:18 ahh ok, great 15:44:28 using tokenPrim 15:44:33 --- join: CosmicRay (n=jgoerzen@63-245-179-205.kitusa.com) joined #haskell 15:45:08 does anyone know how to raise the stack size in hugs? 15:45:12 Igloo: final link fails on amd64/openbsd with: 15:45:13 /home/dons/src/ghc-6.7.20070911/libraries/unix/dist/build/libHSunix-2.0.a(SharedMem.o)(.text+0x26d): In function `unixzm2zi0_SystemziPosixziSharedMem_zdwa_info': 15:45:13 foldl keeps crashing it under quickcheck 15:45:16 : undefined reference to `shm_unlink' 15:45:40 with a control stack overflow message 15:46:23 --- quit: delamon ("WeeChat 0.2.1") 15:47:15 uhm... 15:47:18 dons: Do you have a C shm_unlink function? 15:47:26 Hugs> foldl (+) 0 [1..100000] 15:47:26 Segmentation fault (core dumped) 15:47:26 stefan@stefans:/usr/src/bsdgames-nonfree-2.17/rogue$ 15:47:30 Igloo: i suspect not, checking.. 15:47:51 sorear: Stack overflows in hugs can cause C stack overflows, and thus segfaults 15:48:05 dons: Thanks for all the feedback, BTW 15:48:20 CosmicRay: use foldl' not foldl for starters :) 15:48:35 Igloo: i'm getting some patches together. just letting you know where things go wrong, so we can double check them before the release 15:48:38 dons: BTW, you don't also get an error for shm_open, right? 15:48:42 --- join: urkud (n=urkud@81.13.117.15) joined #haskell 15:48:45 --- quit: nachof ("pija culo teta") 15:48:47 dons: Excellent, thanks! 15:49:14 In function `s1ik_info': 15:49:14 : undefined reference to `shm_open' 15:49:17 also shm_open 15:49:28 Ah, OK, if you don't have either then that makes much more sense 15:49:29 $ man -k shm 15:49:30 shmat, shmdt (2) - map/unmap shared memory 15:49:30 shmctl (2) - shared memory control operations 15:49:30 shmget (2) - get shared memory area identifier 15:49:40 that's it 15:50:31 OK, so in the short term we'll probably just have to ifdef out all the code when it isn't supported. I got sidetracked from sorting out the unix package, unfortunately 15:50:37 --- quit: jgracin (Read error: 110 (Connection timed out)) 15:50:43 yep 15:52:33 --- quit: erg0t (Connection timed out) 15:52:54 Hm. So I need some sort of immutable tree structure in which the leaves are changed often and closer to the root is changed rarely. I'm thinking of storing this in an inverted manner where children reference parents rather than the other way around and only building the normal tree structure lazily on need. Does this sound sane, and is there any particular sort of structure I should look at? 15:53:00 Hm. 15:53:05 Actually this is basically a tree zipper, isn't it? 15:53:16 well, hmm. maybe a finger tree? 15:53:28 No, the tree has a specific and important structure. 15:53:41 (It's a quadtree) 15:53:44 yeah, a zipper 15:54:11 it sounds zipperish, but with multiple cursors? 15:54:31 --- quit: cmarcelo ("Leaving") 15:55:41 Basically it's a tree which represents a spatial region, with each node representing a square of space. The leaves are just sets of points, and earlier branches are regions subdivided into four quadrants. 15:56:13 I need to be able to move points around and split/merge nodes without having to rebuild large chunks of the structure. 15:56:20 Boy, why would anyone explain local variables in terms of function definition and application, when they could, much more simply, explain it in terms of the low-level implementation details on a modern PC? :) 15:56:37 Igloo: yeah, looks like that whole System.Posix.SharedMem needs to be commented out 15:56:41 the question is, do you change many leaves simultaneously? 15:56:49 Yes 15:57:00 Hi... I'm running into a problem with ghc in the link phase, missing symbols like "_HTTPzm2006zi7zi7_NetworkziHTTP_GET_closure". This code runs fine in ghci, so I'm not sure why the link fails or what I might need to do to fix it. 15:57:03 (It's for a particle simulation) 15:57:14 --make 15:57:18 --- join: mordaunt (n=mordaunt@unaffiliated/mordaunt) joined #haskell 15:57:44 kscaldef: ghci defaults to chasing dependancies, ghc oppositely. you can tell ghc to chase deps with --make 15:57:58 I see 15:58:05 okay, that seems to work 15:58:10 thanks! 15:58:13 --- quit: gpi5 (Read error: 110 (Connection timed out)) 15:58:17 --- join: MP0 (n=MP0@206.104.6.26) joined #haskell 15:58:32 Igloo: any particular reason we don't make this the default in the non--c case? a lot of people seem to trip over it... 15:58:37 I'm vaguely tempted to do this as a mutable structure. 15:59:00 well multiple changes in zippers is oleg stuff 15:59:03 iiuc 15:59:36 it's all very simple when you have only one cursor 16:00:03 sorear: Not sure; maybe to make GHC H98-only by default 16:00:07 sorear: it is not just --make, right? He'll also need the -package or -l for that library 16:00:20 -package likely 16:00:22 oerjan: Well there's no reason in principle the zipper couldn't just run over all the points in order. 16:00:22 The thing is, with multiple cursors, you have to decide how you want the cursors to interact with each other. And some modes of interaction are more difficult to do than others. 16:00:36 --- join: dje (n=dje@S0106000d9324c457.vc.shawcable.net) joined #haskell 16:00:42 So I mean I guess it depends what you mean by 'simultaneously' 16:00:42 CosmicRay: No, --make will link against the right package automagically 16:00:44 but it is odd that ghc will happily import the module at compile time but not find it at link time 16:00:46 --- part: urkud left #haskell 16:00:50 Igloo: doesn't quite make sense, because h98 requires --make or -package haskell98 for nontrivial programs :) 16:01:01 sorear: Too late for proposing changing it for 6.8, anyway 16:01:11 sorear: No, it links to haskell98 by default 16:01:12 agreed - just asking. 16:01:21 Igloo: even if one of the packages requires a C library? 16:01:36 well, Data.Array.Unboxed is hardly 'h98 only' 16:01:49 heh 16:02:01 CosmicRay: If a package requires it, yes, as it'll use the link flags for the library in the package database 16:02:32 CosmicRay: If it's only a C library, without an accompanying Haskell package, then no, there's no way it could know what to link against 16:02:55 DRMacIver: but if you have only one cursor, updating several places means moving the cursor, which reconstructs everything on the path between the points 16:03:15 can someone point me to an example of using runSTUArray? 16:03:24 oerjan: Ah, hmm. Yes. 16:03:45 sorear: It's actually a pain, because the only reason we actually need to build a handful of bootlibs is so that the haskell98 stuff (that people arguably shouldn't be using) works 16:03:48 and if you often go through the root, this is just as expensive as not using a zipper, i think 16:04:22 dons: hey, while you're here, do you have any idea why ByteStream's foldl would cause hugs to crash with a stack overflow under QuickCheck, but Data.List.foldl is fine? (and both are find under GHC) 16:04:44 --- quit: rretzbach (Read error: 113 (No route to host)) 16:05:16 because at the point you pass the root you _are_ reconstructing the whole tree 16:05:47 Yeah 16:06:39 CosmicRay: ByteStream? 16:06:53 you mean Data.Stream.foldl ? 16:07:49 no, Data.ByteStream.foldl 16:07:57 Hm. I suppose one way to do this would be to keep the tree as a normal order immutable structure and only have the attached points reverse the index. 16:08:02 * CosmicRay didn't know about Data.Stream 16:08:05 CosmicRay: ByteString ? 16:08:12 As the expected use case is to really be moving things about on the leaves more than it is adding or removing leaves. 16:08:28 :t Data.ByteString.foldl -- this one? 16:08:30 oh. 16:08:32 jatqceer: You just give it an ST computation which builds an STUArray, and it gives you back a UArray by running the computation 16:08:33 braino 16:08:36 yes, of course 16:08:37 forall a. (a -> Word8 -> a) -> a -> Data.ByteString.Base.ByteString -> a 16:08:39 sigh 16:08:50 there's a stream fusion list library , called Data.Stream 16:08:56 which is why I was confused 16:09:03 I was even looking at the Data.ByteString page in firefox, and still typed ByteStream 16:09:13 anyhow, that thing you wrote ;-) 16:09:47 hugs oddly also crashes when running foldl over [Char] but not over [Int], so it may not necessarily be a ByteString problem 16:11:10 DRMacIver: i guess this depends a lot on how "dense" the particles are in the tree. if there are only relatively few giving each a cursor might be worthwhile. but this is just my vague intuition, since i haven't actually looked at multiple cursor implementations. 16:11:32 > runSTArray (newListArray (1, 10) [1..] :: ST s (STArray s Int Int)) 16:11:33 Not in scope: type constructor or class `STArray' 16:11:34 * edwinb feels his ears burning 16:11:44 whitespace is completely readable! If you add comments... 16:11:54 haha 16:12:00 --- join: Plareplane (n=Plarepla@216-197-152-148.sktn.hsdb.sasknet.sk.ca) joined #haskell 16:12:07 --- quit: Jaak ("Lost terminal") 16:12:23 oerjan: There's a fixed maximum number of particles per leaf with the leaves bifurcating into four when it gets too dense. 16:12:46 oerjan: So they're expected to be deep in the tree rather than dense per leaf. 16:13:00 I found out it claims type error if I put a `$' after the runSTArray, how come? 16:13:35 jatqceer: ghc's type system has problems 16:13:57 sorear: I like this excuse 16:14:03 jatqceer: impredicativity only works with a ton of type signatures 16:14:31 the simple answer is, just stick to parens with runST* 16:14:36 I was trying to figure what exactly was wrong with my code and finally found out it's just a problem of `$' 16:14:57 jatqceer: (($) :: ((forall s. ST s a) -> a) -> (forall s. ST s a) -> a)) runST (return 2) should work 16:14:58 DRMacIver: but _each_ leaf is updated each iteration or so? in that case the overhead from rebuilding the tree would be negligible, wouldn't it? 16:15:19 * sorear plugs MLF 16:15:33 sorear: impressive 16:15:58 --- quit: Esteth ("Leaving.") 16:16:19 actually, Simon put in a semi-hack to make $ work with rank-2 types at least, in development? 16:16:31 left-to-right impredicative instantiation 16:16:50 mrd: i wouldn't call it a SEMI hack... :) also, it was so horrible it got reverted 16:17:02 --- join: jtoy (n=jtoy@c-24-91-181-24.hsd1.ma.comcast.net) joined #haskell 16:17:18 blah 16:17:38 oerjan: Well, each point is updated (at least to first order). But I guess you're right that the size of the tree is probably only contributing an extra log(n) factor to that. 16:18:46 --- quit: binary42 () 16:18:52 sorear: i had this strange idea the other day - isn't the problem somehow the order the type inference goes through terms? and this is essentially unification, and i recall Mercury uses a mode system to schedule the data flow for this... 16:19:22 --- join: falseep (n=boo@218.242.117.249) joined #haskell 16:19:38 --- join: ramza3 (n=Berlin@c-24-98-96-151.hsd1.ga.comcast.net) joined #haskell 16:19:53 DRMacIver: that's what i was thinking 16:20:13 oerjan: I don't follow. 16:20:17 especially if the computation at each leaf is a bit expensive 16:20:29 @go Adding Qualified Types to MLF 16:20:31 --- quit: jtoy (Client Quit) 16:20:37 http://portal.acm.org/ft_gateway.cfm?id=1086385&type=pdf 16:21:18 oerjan: Although "only an extra factor of log(n)" is still noticable for the target sample size. 16:21:26 sorear: it was just a weird idea - has anyone thought of using something similar to Mercury's mode system to schedule the order in which types are inferenced... 16:21:46 oerjan: no idea :( 16:22:40 is there a free version of that paper? 16:23:02 yes 16:23:11 @go daan leijen qualified MLF 16:23:14 http://portal.acm.org/citation.cfm?id=1086385 16:23:14 Title: Qualified types for MLF 16:23:16 @go daan leijen qualified MLF site:edu 16:23:19 http://lists.seas.upenn.edu/pipermail/types-list/2005/000785.html 16:23:19 Title: [TYPES] ICFP 2005 - Accepted papers 16:23:44 @go qualified typed for mlf 16:23:46 http://research.microsoft.com/users/daan/pubs.html 16:23:47 Title: Publications 16:23:51 there 16:24:32 --- quit: Laney (Connection timed out) 16:24:48 thanks 16:24:58 sorear++ 16:26:10 Actually, you should probably read the original MLF paper first. But that one is significant because for a long time the story was "MLF? Sure, it's cute in theory, but since it cannot be extended with qualified types it's useless in our context." 16:27:00 oh 16:27:10 --- join: OceanSpray (n=Shinku@cpe-76-169-78-244.socal.res.rr.com) joined #haskell 16:31:39 this one i take? http://citeseer.ist.psu.edu/lebotlan03raising.html 16:31:40 Title: Raising ML to the Power of System F - Le Botlan, emy (ResearchIndex) 16:31:50 yes 16:32:51 citeseer++ 16:33:33 there was a similar paper in JFP Jan/07 16:33:42 --- join: vrv (n=Miranda@78-106-72-87.broadband.corbina.ru) joined #haskell 16:34:01 type inference of rank-n (with local declarations) 16:34:18 --- join: glen_quagmire (n=glen_qua@pool-71-247-33-232.nycmny.east.verizon.net) joined #haskell 16:34:57 --- quit: dmwit (Remote closed the connection) 16:35:09 --- join: augustss (n=Lennart@host86-132-102-171.range86-132.btcentralplus.com) joined #haskell 16:35:26 --- quit: norgul (Remote closed the connection) 16:37:06 --- quit: pastorn ("Leaving") 16:40:05 --- quit: progexp (Read error: 104 (Connection reset by peer)) 16:40:18 hey you know deriving Eq 16:40:33 where is the code for that? 16:40:51 GHC sources? 16:41:17 It's inside the compilers 16:41:21 ok 16:41:40 so you can't implement deriving if it wasn't already around? 16:41:50 without editing the compiler that is 16:41:54 fax: No. 16:41:59 hmm ok 16:42:06 fax: For example, they had to edit the sources to add deriving Data/Typeable. 16:42:19 Data.Derive can also derive Eq 16:42:20 There's libraries like Data.Derive around, though, that can do the job using different language features 16:42:23 You might be interested in the Scrap Your Boilerplate papers if you want to do that sort of thing 16:42:28 @where SYB 16:42:29 http://www.cs.vu.nl/boilerplate 16:42:29 There are preprocessors like Derive that can do it 16:43:02 Derive doesn't do as good a job though, since it can't infer contexts 16:43:48 I basically wanna make some new Eq type thing (for a single data type definition) where ThisThing 4 == ThisThing 3 16:44:12 As in an instance of Eq? 16:44:29 instance Eq Thing where a == b = True 16:44:50 --- join: binary42 (n=binary42@pool-72-85-210-146.bstnma.east.verizon.net) joined #haskell 16:44:57 actually no, not an instance of Eq 16:45:03 --- quit: Lunchy (Read error: 104 (Connection reset by peer)) 16:45:03 ari: I think he means a new type class that isn't Eqq 16:45:05 *Eq 16:45:17 fax: just define your own instance Eq 16:45:40 fax: you won't break anything as long as (==) is still reflexive, transitive, and symmetric 16:45:53 --- nick: pgavin-away -> pgavin 16:52:28 --- quit: ToRA (Read error: 110 (Connection timed out)) 16:55:06 --- quit: FMota () 16:55:23 fax pasted "tokens and ~~" at http://hpaste.org/2756 16:55:48 so this works.. but is it the right way to do this? 16:56:04 --- join: fnord123 (n=fnord123@80.5.94.124) joined #haskell 16:56:45 fax: do you have a use for the ordinary Eq on this type? 16:56:52 yes 16:57:19 --- quit: BMeph ("ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]") 16:57:35 well not yet 16:57:39 but I think I will at some point 16:58:03 iiuc you are simply comparing the constructor names everywhere? 16:58:09 yeah 16:58:25 ignoring any parameters they take, so (IntToken 3 ~~ IntToken 4 = True) 16:58:29 :t toConstr 16:58:31 Not in scope: `toConstr' 16:59:17 :t G.toConstr 16:59:18 Couldn't find qualified module. 16:59:25 :t Data.Generics.toConstr 16:59:27 forall a. (Data.Generics.Basics.Data a) => a -> Data.Generics.Basics.Constr 16:59:40 > Data.Generics.toConstr (Left 1 :: Either Int Int) 16:59:42 Left 17:00:07 so 'deriving Data' gets you that 17:00:17 @instances-importing Data.Generics Eq 17:00:18 (), All, Any, Bool, Char, Constr, ConstrRep, DataRep, Double, Either a b, Fixity, Float, Int, Integer, Maybe a, Ordering, Product a, Sum a, [a] 17:00:26 > (Data.Generics.toConstr (Just 5)) == (Data.Generics.toConstr (Just 6)) 17:00:27 True 17:00:32 yay :D 17:00:35 Thanks very much 17:00:49 (==) `on` Data.Generics.toConstr 17:01:03 twanvl annotated "tokens and ~~" with "You only need different behaviour for the constructors with arity>0" at http://hpaste.org/2756#a1 17:01:03 > Just 6 ((==) `on` Data.Generics.toConstr) Just 7 17:01:04 Couldn't match expected type `(t1 -> t1 -> Bool) 17:01:40 twanvl: ahh true.. thanks 17:01:43 > ((==) `on` Data.Generics.toConstr) (Just 6) (Just 7) 17:01:44 > ((==) `on` Data.Generics.toConstr) (Just 6) (Just 7) 17:01:45 True 17:01:46 True 17:01:48 not infix 17:01:50 ((==) `on` Data.Generics.toConstr) (Just 6) (Just 7) 17:01:52 oops 17:01:53 > ((==) `on` Data.Generics.toConstr) (Just 6) (Just 7) 17:01:54 True 17:02:02 @let (-:) = flip ($) 17:02:05 Defined. 17:02:11 oops 17:02:12 --- quit: falseep (Read error: 110 (Connection timed out)) 17:02:17 @let (-|) = flip ($) 17:02:20 Defined. 17:02:24 @let (|-) = id 17:02:27 Defined. 17:02:36 > |- 1 17:02:37 parse error on input `|-' 17:02:49 :t |- 17:02:51 parse error on input `|-' 17:02:51 > Just 3 -| (==) `on` Data.Generics.toConstr |- Just 4 17:02:52 Terminated 17:03:04 God knows how that parsed. 17:03:13 > Just 3 -| ((==) `on` Data.Generics.toConstr) |- Just 4 17:03:14 Terminated 17:03:34 > 3 17:03:35 3 17:03:47 > (Just 3) -| ((==) `on` Data.Generics.toConstr) |- (Just 4) 17:03:48 @hoogle on 17:03:48 Terminated 17:03:48 Test.QuickCheck.oneof :: [Gen a] -> Gen a 17:03:48 System.Console.Readline.onNewLine :: IO () 17:03:48 Text.ParserCombinators.Parsec.Char.oneOf :: [Char] -> CharParser st Char 17:04:02 @hoogle (on) 17:04:03 Did you mean: On 17:04:03 Prelude.undefined :: a 17:04:03 Control.Monad.Reader.ask :: MonadReader r m => m r 17:04:07 ?type on 17:04:09 Not in scope: `on' 17:04:14 > 3 -| (+) |- 4 17:04:15 Terminated 17:04:15 --- join: falseep (n=boo@218.242.117.249) joined #haskell 17:04:21 > id |- 3 17:04:22 3 17:04:29 > 3 -| id 17:04:30 Terminated 17:04:35 :t \ f p x y -> f (p x) (p y) 17:04:37 forall t t1 t2. (t1 -> t1 -> t2) -> (t -> t1) -> t -> t -> t2 17:04:57 :t (on) 17:04:59 Not in scope: `on' 17:05:00 on :: (b -> b -> c) -> (a -> b) -> (a -> a -> c) -- I think 17:05:09 @pl \f p x y -> f (p x) (p y) 17:05:09 join . ((flip . ((.) .)) .) . (.) 17:05:14 > flip ($) 3 id 17:05:16 3 17:05:43 > 3 -: id 17:05:44 3 17:05:46 :t let (-|) = flip ($) in 3 -| id 17:05:48 forall t. (Num t) => t 17:05:54 > Just 3 -: ((==) `on` Data.Generics.toConstr) |- Just 4 17:05:56 True 17:06:03 > Just 3 -: (==) `on` Data.Generics.toConstr |- Just 4 17:06:04 Couldn't match expected type `Maybe t -> t2' 17:06:22 There might be another definition of -| (?) 17:06:31 > -| 17:06:32 parse error on input `-|' 17:06:36 > (-|) 17:06:37 Terminated 17:06:49 :t (-|) 17:06:51 forall a b c. (a -> b) -> Strategy b -> (b -> c) -> a -> c 17:06:53 > \x -> (-|) 17:06:54 Terminated 17:07:15 --- quit: BCoppens ("Konversation terminated!") 17:07:17 When'd that grow out of something? 17:07:17 --- join: progexp (i=progexp@gateway/tor/x-5c754bbf4eb68b35) joined #haskell 17:07:18 so it has something to do with strategies... 17:07:21 > (L.-|) 17:07:22 Add a type signature 17:07:51 strange that it doesn't complain about ambiguous import? 17:08:11 > [(L.-|),()] 17:08:12 Couldn't match expected type `a -> (a -> b) -> b' 17:08:44 --- quit: int-e ("leaving") 17:09:52 --- join: tizoc_ (n=user@r190-0-156-40.dialup.adsl.anteldata.net.uy) joined #haskell 17:11:49 --- quit: twanvl ("Good night") 17:12:42 --- quit: tizoc (Nick collision from services.) 17:12:43 --- nick: tizoc_ -> tizoc 17:13:27 --- join: Mr_Awesome (n=eric@par0396.urh.uiuc.edu) joined #haskell 17:14:45 --- quit: dbueno ("Leaving") 17:16:51 :t (&&&) 17:16:56 DukeDave: don't do it 17:16:59 forall (a :: * -> * -> *) b c c'. (Arrow a) => a b c -> a b c' -> a b (c, c') 17:17:22 sorear: Don't ask for the type of (&&&) ? 17:17:56 DukeDave: Correct... it has a way of making people collapse in gibbering insanity 17:18:05 I only did because Hoogle couldn't find it :o 17:18:16 --- quit: conal (Remote closed the connection) 17:18:33 Lol, I'm intrigued.. Didn't know it was Arrow related, just spotted it used in Dons latest Blog 17:19:29 --- join: enolan (n=hellish@c-24-22-123-71.hsd1.or.comcast.net) joined #haskell 17:20:26 DukeDave: There is nothing particularly Arrowish about it. 17:20:44 ... except the Arrow a constraint in the type? 17:23:25 :t (&&&).(id.) 17:23:27 forall c' b a. (a -> b) -> (a -> c') -> a -> (b, c') 17:23:39 a beautiful type 17:24:09 --- quit: dons ("home") 17:24:27 :t uncurory ((&&&).(id.)) 17:24:29 Not in scope: `uncurory' 17:24:30 :t uncurry ((&&&).(id.)) 17:24:32 forall c' b a. (a -> b, a -> c') -> a -> (b, c') 17:24:36 --- quit: gwern (Remote closed the connection) 17:25:04 :t (***).(id.) 17:25:06 forall b' c' b a. (a -> b) -> (b' -> c') -> (a, b') -> (b, c') 17:25:21 oerjan++ 17:25:29 The types of the arrow stuff actually make sense with that 17:26:24 --- join: beelsebob (n=tatd2@91.84.210.102) joined #haskell 17:26:39 @type ((***) :: (Arrow (~>)) => (b ~> c) -> (b ~> c') -> (b ~> (c, c'))) 17:26:40 Couldn't match expected type `b' (a rigid variable) 17:26:41 against inferred type `(b, b)' 17:26:41 --- quit: glguy ("leaving") 17:26:54 @type ((&&&) :: (Arrow (~>)) => (b ~> c) -> (b ~> c') -> (b ~> (c, c'))) 17:26:56 forall (~> :: * -> * -> *) b c c'. (Arrow ~>) => ~> b c -> ~> b c' -> ~> b (c, c') 17:27:06 Meh. 17:27:39 that's just not _right_ O_O 17:29:11 what is ~> ? 17:29:27 A name. 17:29:34 @hoogle a ~> b 17:29:35 Hoogle Error: Parse Error: Unexpected character '~> b' 17:29:46 oh ok 17:29:51 I see 17:29:59 It's an infix type variable. 17:30:29 Ideally. 17:32:01 --- join: Kahdloc (i=Coldhak@c-75-66-221-181.hsd1.tn.comcast.net) joined #haskell 17:32:43 It's also a Glasgow extension. 17:32:48 --- join: conal (n=user@misc-148-78-62-234.pool.starband.net) joined #haskell 17:33:46 Yeah, one that's not displaying correctly. Maybe @type doesn't run with the right combination of magic flags. 17:35:05 Or maybe not. I guess the pretty printer is just screwy. 17:35:17 --- join: dino-_ (n=dmorelli@adsl-072-148-044-011.sip.rmo.bellsouth.net) joined #haskell 17:35:30 well, it did accept it on input 17:42:42 everyone freaks out when someone goes @type (&&&) 17:42:57 someone needs to edit lambdabot so it explains what the concept behind it is, rather than printing the type ;) 17:43:31 what, the type explains the concept perfectly ;) 17:47:05 --- join: nostrademons (n=Jonathan@pool-96-233-42-39.bstnma.fios.verizon.net) joined #haskell 17:47:17 --- join: __nasa__ (n=nasa@pool-70-109-160-216.cncdnh.east.verizon.net) joined #haskell 17:47:53 --- quit: mr_tenor (Remote closed the connection) 17:48:53 oh, I understand, from reading the type... so why the freakout? 17:49:15 ?? 17:49:17 > (length &&& head) [1, 2, 3] 17:49:18 (3,1) 17:49:42 i would hazard a guess that someone was joking :) 17:49:46 lol 17:49:55 --- quit: dino- (Read error: 113 (No route to host)) 17:50:02 not the first time it's happened though 17:50:18 like, when I did it the first time someone mentioned it, I got the same reaction... 17:50:30 > (map (+1) &&& map (*2)) [1..5] 17:50:32 ([2,3,4,5,6],[2,4,6,8,10]) 17:50:36 KatieHuber: It's a running joke. 17:51:08 @check \n -> if n > 0 then uncurry (==) . (length &&& last) . fromEnum 1 $ n else True 17:51:09 Couldn't match expected type `a -> [a1]' 17:51:26 > (length &&& head) 17:51:28 Add a type signature 17:51:44 @check \n -> if n > 0 then uncurry (==) . (length &&& last) . fromEnumTo 1 $ n else True 17:51:46 Not in scope: `fromEnumTo' 17:51:58 enumFromTo ? 17:52:09 [1..10] 17:52:12 @check \n -> if n > 0 then uncurry (==) . (length &&& last) . enumFromTo 1 $ n else True 17:52:13 enumFromTo 1 10 17:52:14 OK, passed 500 tests. 17:52:17 [x..y] === enumFromTo x y 17:52:57 @pointless (\x y->[x..y]) 17:52:58 enumFromTo 17:53:00 :t ==> 17:53:02 parse error on input `==>' 17:53:12 :t (==>) 17:53:14 Not in scope: `==>' 17:53:33 <__nasa__> Has anybody here written code using the Apple Remote? 17:53:42 @check (==>) 17:53:43 Add a type signature 17:53:59 @check [(==>),()] 17:54:00 Couldn't match expected type `Bool -> a -> Property' 17:54:49 :t (Test.QuickCheck.==>) 17:54:51 forall a. (Test.QuickCheck.Testable a) => Bool -> a -> Test.QuickCheck.Property 17:56:39 --- quit: OceanSpray ("Leaving") 17:58:49 --- quit: stepcut ("home") 18:02:02 --- quit: monochrom ("Ex-Chat") 18:02:18 --- quit: qwwqe (Read error: 110 (Connection timed out)) 18:03:22 --- quit: bos (Read error: 110 (Connection timed out)) 18:09:41 --- quit: vrv ("Miranda IM! Smaller, Faster, Easier. http://miranda-im.org") 18:10:49 --- quit: Pupeno_ (Read error: 104 (Connection reset by peer)) 18:12:32 --- quit: reilly (Read error: 110 (Connection timed out)) 18:13:23 --- quit: geezusfreeek ("Leaving") 18:13:46 --- join: Pupeno_ (n=Pupeno@dsl-37-170.dsl.netsource.ie) joined #haskell 18:15:01 --- quit: der_eq (Remote closed the connection) 18:15:27 --- quit: gkr (Read error: 104 (Connection reset by peer)) 18:15:40 --- join: nich (n=nich@unaffiliated/nich) joined #haskell 18:17:22 --- join: seafoodX (n=sseefrie@alphad261.lnk.telstra.net) joined #haskell 18:17:27 --- quit: mrsolo (Read error: 110 (Connection timed out)) 18:17:31 --- join: drice (n=drice@adsl-76-199-103-143.dsl.pltn13.sbcglobal.net) joined #haskell 18:19:00 --- join: monochrom (n=trebla@toronto-hs-216-138-220-146.s-ip.magma.ca) joined #haskell 18:19:54 --- nick: drice -> [azoic] 18:21:09 --- join: dons (n=dons@c-24-22-19-90.hsd1.or.comcast.net) joined #haskell 18:22:12 --- quit: enolan ("Leaving") 18:24:10 --- quit: kpreid () 18:24:24 --- join: jcreigh (n=jason@72-160-47-60.dyn.centurytel.net) joined #haskell 18:28:16 --- join: gwern (i=gwern@wikipedia/Gwern) joined #haskell 18:28:18 --- quit: arag0rn (Read error: 113 (No route to host)) 18:31:17 --- join: qwwqe (n=fluctus@unaffiliated/fluctus) joined #haskell 18:33:33 --- quit: arjanoosting (Read error: 104 (Connection reset by peer)) 18:33:35 --- join: arjanoosting (n=arjan@wc-250.r-195-85-180.atwork.nl) joined #haskell 18:34:02 --- quit: Pupeno_ (Read error: 110 (Connection timed out)) 18:37:22 --- join: chessguy (n=chessguy@ip68-227-196-130.dc.dc.cox.net) joined #haskell 18:45:46 --- join: ToRA (n=tora@colorado.doc.ic.ac.uk) joined #haskell 18:47:28 --- join: beelsebob_ (n=tatd2@91.84.210.102) joined #haskell 18:54:43 --- quit: beelsebob (Read error: 110 (Connection timed out)) 18:56:35 --- join: jtoy (n=jtoy@c-65-96-150-204.hsd1.ma.comcast.net) joined #haskell 18:58:51 --- join: FMota (n=FMota@dhcp-36-203-57-69.cf-res.cfu.net) joined #haskell 18:59:38 --- quit: arjanoosting (Read error: 110 (Connection timed out)) 19:05:10 is it safe to upgrade to GHC 6.8 ? 19:05:59 No. 19:06:12 The pre-release doesn't even compile. 19:06:25 It's supposedly fixed in darcs, but no new RC has been published. 19:06:43 * sorear goes and upgrades to GHC 6.9 19:10:01 --- join: mudge (n=mudge@c-24-7-167-34.hsd1.ca.comcast.net) joined #haskell 19:10:14 --- quit: moonlite (Read error: 110 (Connection timed out)) 19:10:18 anyone here go to the san francisco meeting? 19:10:32 --- quit: lasts ("[TalkSoup] Get it today: http://talksoup.aeruder.net") 19:11:12 6.9 is vapourware! 19:13:59 --- join: reilly (n=rfh@netblock-66-159-231-18.dslextreme.com) joined #haskell 19:14:15 n.k where k `mod` 2 == 1 is vapourware :( 19:14:45 huh? 19:15:00 untrue. 6.7 is no longer vapourware. just betaware. :) 19:15:13 beware the betaware... 19:15:28 ari: odd k 19:15:34 dunno why I said that. Just thought it was cool. 19:15:42 It is. :) 19:15:50 * oerjan tries to stay a bit aware 19:15:52 :) 19:15:54 mauke: Haskell is too big for my brain :( 19:16:01 βware :) 19:16:02 --- quit: sjanssen ("Konversation terminated!") 19:16:11 that's nice ;) 19:16:29 could be a software company 19:16:36 or a middleman for beta testing. 19:16:58 H4SK3LL- INCREAS YOUR BRAIN SIZE!! ORDER NOW 19:17:44 mauke: You have to be very diligent and follow all the steps. After a few months, it should be bigger. 19:17:58 er, ari: 19:18:15 we sell monad pills for free 19:18:16 you need the new HaSkull 19:18:39 --- quit: seafoodX () 19:18:39 otherwise your brain won't fit 19:18:49 --- quit: Manyfold (Remote closed the connection) 19:18:54 :) 19:18:57 does skype run on debian? 19:19:07 probably 19:19:07 oh, sorry wrong channel 19:19:08 well 19:19:26 harder on debian. And yes, that is viciously offtopic. 19:19:47 mudge: but yes, it does =p 19:19:54 http://www.skype.com/intl/en/download/skype/linux/ 19:19:56 Title: Download Skype for Linux 19:20:17 mauke: 1337-speak is deprecated, u can has lolcat haskellz now. 19:20:17 * sioraiocht can't recall a time offtopicness DIDN'T occur in #haskell 19:20:28 @quote degree 19:20:28 Miod says: [On the vax] How many processors come with a built-in instruction which computes polynomials of degrees up to 31? 19:20:30 sioraiocht: sweet, thanks 19:20:43 that for example 19:21:27 lambdabot / Miod: 1. 19:21:27 :o 19:21:44 (I should think. Or something is very wrong with the world). 19:21:52 with hindsight, it'd be more thrilling if vax came with a built-in instruction for generic catamorphisms. 19:21:55 Er, nvm. Something is very wrong with the world regardless. 19:22:06 @users 19:22:06 Maximum users seen in #haskell: 407, currently: 364 (89.4%), active: 12 (3.3%) 19:22:20 vax should come with built-in haskell-style pattern-matching. 19:22:25 * sioraiocht doesn't understand morphisms 19:22:29 there are processors with built-in "interpret forth bytecode" instructions 19:22:40 sorear: that is very cool. 19:22:42 sioraiocht: CT or vanilla 19:22:43 I'm not altogether sure the vax didn't 19:22:49 sorear: CT 19:23:10 sioraiocht: don't. they are a primitive notion; it's like asking what the elements of a group are 19:23:10 how do i rename the type `ST s (STUArray s Int Double)' to something like `Vector'? 19:23:16 type Vector = 19:23:17 forth bytecode??? 19:23:23 type Vector = ST s (STUArray s Int Double) 19:23:24 real forth doesn't have bytecode 19:23:37 sorear: that makes me cry. I can't help but try and think of them as functions, and I get yelled at every time I do 19:23:50 Error: s does not appear on the left side 19:23:51 compiled forth code is just a bunch of indirect jumps with the jmp opcode elided 19:24:02 sorear: that would result in "Not in scope: type variable `s'" 19:24:08 I think of them as functions. No one yells at me. The trick is I do it secretly. 19:24:14 jatqceer: type Vector s = maybe? 19:24:25 allbery_b: in DTC models, yes 19:24:31 allbery_b: I was however misremembering 19:24:41 sioraiocht: They're functions (or something like them) a lot, but not always. 19:24:55 dolio: they are mappings from one category to another, right? 19:24:55 sioraiocht: Like, if you category is just some directed graph. 19:24:57 allbery_b: the processor in question only had dtc primops, not a bytecode interp 19:25:14 * sioraiocht is taking Category Theory starting this term 19:25:26 * sioraiocht fears it. 19:25:30 On the other hand, in some cases, not all functions are morphisms. 19:25:32 sioraiocht: Then the objects of the category are the nodes, and the morphisms are directed edges. 19:25:35 sorear: that works. somehow the ST makes me use an `s' that i never touch it in my code 19:25:44 allbery_b: maybe (real) mips is good for strangness? iirc it has multiply-loop-iteration opcodes that you have to repeat 32 times to get a proper multiply 19:26:03 dolio: and can you describe a case where this ISN'T true? 19:26:11 yeh, but that's RISC taken to its (illogical) conclusion 19:26:17 Where what isn't true? 19:26:34 Mappings between categories are functors. 19:26:38 that's one of the reasons RISC kinda died out, with the few useful aspects being absorbed into the mainstream 19:26:40 jatqceer: that s is magical 19:26:54 it makes ST inescapable 19:27:30 do you think i should actually use IOArray instead? 19:28:13 dolio: how...? 19:28:16 Unless you're talking about the category of (small) categories, or something, in which case the morphisms are functors, I guess. 19:28:28 in that case i need to use another black magic `unsafePerformIO'... 19:29:09 jatqceer: hold your nose and ignore the s-es 19:29:13 the ST magic is safe, the unsafePerformIO magic obviously isn't... 19:30:02 sioraiocht: Maybe you're using the terminology differently than I'm familiar with. 19:30:20 dolio: no, I'm juust retarded 19:30:33 so a functor is some..transformation...from one cateogry to the other? 19:30:35 sorear: i just don't like those s's floating around like ghosts 19:30:48 but ghosts are what they are. don't worry about them 19:31:12 they only bite when you try to inappropriately pull something outside of ST 19:31:18 phantom types are your friends :) 19:31:22 sioraiocht: a functor is to CT what a homomorphism is to group theory or a continuous function is to topology or a monotonic function is to order theory 19:32:05 Yeah. So, you might have a functor F that takes a category C to a category FC, and there's a mapping from each object o in C to an object Fo in FC, or something like that. 19:32:17 --- quit: l_a_m (Remote closed the connection) 19:32:20 And for each morphism f in C to a morphism Ff in FC. 19:32:20 hrm, i know what homomorphism is... 19:32:31 And it satisfies certain laws. 19:32:38 okay, so how does that translate to when I define a functor in haskell? 19:32:48 why is a list a functor, and why does that make it mappable? 19:33:27 a list is not a functor. I mean bad wording. 19:33:45 [] is a functor that takes objects A in the category of haskell types to objects [A] in the category of haskell list types, or something like that. 19:34:43 And it comes with an operation fmap that takes a morphism (a -> b) in the former category to a morphism [a] -> [b] in the latter category. 19:34:43 okay... 19:34:45 the latter category is a subcategory of the first 19:34:49 The mapping that maps type X to type [X], function X->Y to [X]->[Y] (and I omit what that function does), that is a functor. 19:35:17 shouldn't it be X->Y to [X->Y]? 19:35:38 :t fmap -- no! 19:35:40 No. Seriously no. 19:35:43 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 19:35:44 :t fmap 19:35:46 forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b 19:35:51 ohh, okay 19:35:56 I was thinking of pure 19:35:57 :t pure 19:35:59 Ambiguous occurrence `pure' 19:35:59 It could refer to either `pure', imported from Control.Applicative 19:36:11 :t Control.Applicative.pure 19:36:14 forall a (f :: * -> *). (Applicative f) => a -> f a 19:36:29 :t Control.Arrow.pure 19:36:32 forall b c (a :: * -> * -> *). (Arrow a) => (b -> c) -> a b c 19:37:03 :t (id.).Control.Arrow.pure 19:37:05 forall b c. (b -> c) -> b -> c 19:37:26 nah 19:38:35 okay 19:38:37 that makes sense 19:39:36 --- join: pastorn (n=pastorn@193.11.217.176) joined #haskell 19:39:59 there's an Add, Compare and Branch instruction in Vax 19:40:50 how do you test code using STArray in ghci? say, I want to see the result of getBounds acting on a `ST s (STUArray s Int Double)' 19:41:02 --- quit: __nasa__ () 19:42:25 --- quit: Nshag (Read error: 110 (Connection timed out)) 19:43:06 --- quit: Cale (Remote closed the connection) 19:43:43 --- quit: jtoy () 19:48:09 --- quit: monochrom ("Ex-Chat") 19:48:28 runST (getBounds teh_array) 19:49:37 :o 19:50:34 I just created a simple program in Sei (could easily be rewritten in Haskell) in 50 lines, but it took me about 500 lines to do the same in Ada. 19:50:37 :t ap 19:50:39 forall (m :: * -> *) a b. (Monad m) => m (a -> b) -> m a -> m b 19:51:11 ap also has the nice type of 19:51:50 (a -> b -> c) -> (a -> b) -> a -> c 19:52:46 > ap (\ a b -> "c") (\ a -> "b") "a" 19:52:49 "c" 19:52:51 --- quit: reilly () 19:53:08 mauke: no, that doesn't work 19:53:25 oh, right. you can't have a freestanding STArray 19:53:49 runST ( do a <- (newArray :: (Int,Int) -> Double -> ST s (STUArray s Int Double)) (2, 4) 123.0; getBounds a ) 19:55:12 Yay, CT rumblings. 19:55:55 Guys, I have a situation where an instance of some class does not provide an implementation function of a function in said class. However no complaint is made when I make a reference to this unimplemented function; is there some switch to force GHC to check? 19:55:55 --- quit: dolio (Read error: 104 (Connection reset by peer)) 19:56:01 If that makes sense :) 19:56:26 I imagine -Wall will do that. 19:56:46 mauke: thanks 19:57:48 --- quit: nich (Read error: 110 (Connection timed out)) 20:00:00 --- join: dolio (n=dolio@nr5-216-196-210-207.fuse.net) joined #haskell 20:01:15 :t ap.(id.) -- never change a winning team 20:01:23 forall a b a1. (a1 -> a -> b) -> (a1 -> a) -> a1 -> b 20:02:26 --- join: Paczesiowa (n=kvirc@awc227.neoplus.adsl.tpnet.pl) joined #haskell 20:03:39 --- join: piggybox (n=piggybox@modemcable235.32-130-66.mc.videotron.ca) joined #haskell 20:03:46 --- join: Cale (n=cale@74.122.44.191) joined #haskell 20:04:36 did anyone succeded with hxt's reading documents in iso-8859-X encodings? 20:05:38 my gramma sucks:/ 20:05:45 --- quit: mvitale ("Leaving") 20:05:46 ddarius: Still only get warnings 20:06:04 "only"? 20:06:10 DukeDave: Oh, you wanted errors? Then just -Werror. 20:06:19 As in the computation doesn't fail 20:06:22 --- join: jtoy (n=jtoy@c-65-96-150-204.hsd1.ma.comcast.net) joined #haskell 20:06:24 *compilation 20:06:41 --- join: LunohoD_ (n=alex@e180065108.adsl.alicedsl.de) joined #haskell 20:06:45 --- join: grnman (n=grnman@c-76-110-165-179.hsd1.fl.comcast.net) joined #haskell 20:07:13 Ah didn't know that one ddarius, cheers. 20:07:19 --- quit: tessier__ (Read error: 104 (Connection reset by peer)) 20:09:00 --- quit: jtoy (Client Quit) 20:09:31 --- join: tessier__ (n=treed@207.158.40.201) joined #haskell 20:12:24 --- quit: oerjan ("leaving") 20:18:28 --- join: unmarshal (n=mbeddoe@c-67-169-180-141.hsd1.ca.comcast.net) joined #haskell 20:18:45 --- quit: LunohoD (Read error: 110 (Connection timed out)) 20:19:04 --- quit: gogonkt- (Read error: 113 (No route to host)) 20:19:59 --- quit: piggybox_ (Read error: 110 (Connection timed out)) 20:20:30 --- join: falconair (n=shahbazc@c-68-37-205-177.hsd1.nj.comcast.net) joined #haskell 20:20:31 --- quit: glen_quagmire ("leaving") 20:22:25 --- join: Sgeo (n=Sgeo@ool-18bf68ca.dyn.optonline.net) joined #haskell 20:23:07 --- join: reilly (n=rfh@netblock-66-159-231-18.dslextreme.com) joined #haskell 20:24:03 --- quit: Paczesiowa ("KVIrc 3.2.6 Anomalies http://www.kvirc.net/") 20:25:18 --- quit: jao_ () 20:25:48 --- quit: reilly (Client Quit) 20:28:05 --- quit: agoode (Read error: 60 (Operation timed out)) 20:31:34 --- quit: CosmicRay ("Leaving") 20:33:06 --- nick: dino-_ -> dino- 20:34:36 One time in class my professor said that it's remarkable how close the languages of Java and Scheme are. I didn't agree with her then, but now I've seen the light: 20:34:36 11545 DrScheme 0.0% 8:16.84 6 99 4029 150M 13.9M 145M 573M 20:34:43 ? 20:35:01 all 573 MB of light. 20:35:08 A little virtual memory never killed anyone. 20:35:35 145MB of real memory is more than my web browser uses. 20:36:00 MP0: DrScheme isn't a Scheme implementation (it contains on, but it isn't one) 20:36:30 --- part: jatqceer left #haskell 20:36:44 It's written in scheme, just like java programs are written in java. Therefore, I think the comparison is apt. 20:37:26 MP0: are you sure it's WRITTEN in scheme? 20:37:48 hmm, you're right, I can't prove that. I just looked at the source files and assumed it was. 20:38:06 oh 20:38:09 see I didn't know 20:38:12 that's why i was asking 20:38:12 lol 20:38:17 there's no reason to be snippy 20:38:45 I wasn't being sarcastic... I can't prove that the LISP-like syntax is indeed scheme... it's an assumption on my part. 20:39:11 scheme doesn't look much like LISP 20:39:20 sorry, S-Expression based 20:39:24 it does relatvely. 20:39:34 DrScheme aint written in scheme 20:39:37 anyway 20:39:40 How much memory does visual studio use these days? 20:39:44 Does LISP mean Common Lisp? I'm not accustomed to what it means when all capitalised. 20:39:44 It's mostly C++ 20:39:49 Many programs in Java are fat and they don't have to have knowledge of an entire set of standard and semi-standard libraries for at least two languages. 20:40:46 LISP is kinda a language family 20:41:01 or in this context maybe more of a szyntactic family 20:41:07 *syntactic 20:41:22 I normally think of generic references to lisp as clisp 20:41:44 clisp is a Common Lisp implementation, and reportedly not a particularly good one. 20:41:48 Usually, Common Lisp is abbreviated CL. 20:41:56 oh oops 20:41:57 lol 20:42:47 ricky_clarkson: As I understand it, Lisp is ambiguous (sometimes Common Lisp), and LISP is any language in that family (including Common Lisp, Scheme, etc.) 20:42:48 --- quit: seancorfield () 20:43:06 LISP is the old old version of Lisp 20:43:14 where they (USE,CAPS,AND,COMMAS) 20:43:51 Is #haskell-blah still populated or has it all migrated elsewhere? 20:44:02 wli: it's still populated 20:44:08 wli: It seems to be populated. 20:44:17 LISP is Sun's next stock ticker. 20:44:21 @users #haskell-blah 20:44:21 Maximum users seen in #haskell-blah: 60, currently: 44 (73.3%), active: 6 (13.6%) 20:44:56 ddarius: CL can also mean "Combinatory Logic". 20:45:26 shachaf: Only to NERDs...oh wait.. 20:45:56 shachaf: It's also the stock market symbol for Colgate Palmolive 20:46:04 I guess that would apply to Common Lisp, too 20:46:05 lol 20:46:28 ddarius: Yes, but there's hardly ever an ambiguity there. :-) 20:46:30 http://acronyms.thefreedictionary.com/cl 20:48:23 @lazyk 20:48:23 Unknown command, try @list 20:48:27 :-( 20:48:49 @unlambda but no lazyk (and not really unlambda either) 20:48:49 fd:22: hClose: resource vanished (Broken pipe) 20:49:00 @help bf 20:49:00 bf . Evaluate a bainf*ck expression 20:49:07 Which also doesn't work. 20:49:14 * sioraiocht has a bf interpreter.. 20:49:20 Luckily, we have @let 20:49:37 @let bf = ... 20:49:50 @help let 20:49:50 let = . Add a binding 20:49:53 oh yeah 20:49:58 @let s x y z = x z (y z); k x y = x; i x = x 20:50:02 can you do a bf eval in < 512 lines? :D 20:50:02 Defined. 20:50:09 fax: Yes. 20:50:17 yes 20:50:28 fax: my interpreter was 80 lines long, and I think it's too long 20:50:35 oops 20:50:37 I meant 512 chars 20:50:56 fax: Most probably. 20:50:58 IRC message length 20:50:59 sioraiocht: There must be a paucity of primops. 20:51:21 wli: there's 8 20:51:24 iirc 20:51:46 Primop tables are pretty much where the bulk of interpreters for toy languages comes from. 8 primops is vaguely preposterous. 20:51:53 LOL 20:52:00 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 20:52:14 > repeat 'b' 20:52:14 gesundheit 20:52:15 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb... 20:52:32 @pl \x y z -> x z (y z) 20:52:32 ap 20:52:40 > let _ = 5 20:52:40 --- quit: dons (Connection timed out) 20:52:40 Parse error 20:52:48 --- quit: fnord123 (Read error: 110 (Connection timed out)) 20:52:49 aww, I can't bind _ 20:52:55 sioraiocht: What are these primops? I'm speaking of things like integer arithmetic, floating point arithmetic, primitive data type conversions, etc. 20:52:58 > let _ = 5 in _ 20:52:58 Parse error in expression 20:52:59 > let _ = 5 in 3 20:53:00 3 20:53:06 @let _ = 5 20:53:08 Defined. 20:53:14 @let _ = 3 20:53:17 Defined. 20:53:20 err, yeah... that's what I meant 20:53:20 @let _ = _ 20:53:20 Parse error in expression 20:53:27 wli: in bf there's only integers and one pointer 20:53:41 --- quit: chessguy ("Leaving") 20:53:43 wli: integers can be implicitly convert to chars, and vice versa 20:53:57 sioraiocht: Okay, that's below the level of a toy language and going into pathology. 20:54:02 yes 20:54:02 > _ 20:54:03 Parse error in expression 20:54:09 wli: The goal of brainfuck was to be a Turing complete language with the smallest implementations possible. 20:54:17 > _ == True 20:54:17 Parse error in expression 20:54:22 I've seen smaller than mine in haskell, but they cheated 20:54:51 > chr 32 20:54:52 ' ' 20:54:59 I can't see why that's an interesting goal. 20:54:59 Unlambda doesn't even have integers. :-) 20:55:03 lol 20:56:01 Numbers are but a convenience 20:56:02 wli: perhaps we could understand more about the nature of computation from finding the most minimally complete definition? 20:56:08 --- quit: antisvin (Success) 20:56:35 * sfultong thinks it would be interesting to make a TC language smaller than BF= 20:56:40 surely unlambda wins there? 20:56:54 pretty much. 20:56:58 hm, actually I'm not sure if unlambda is TC 20:57:04 Unlambda has various extras. 20:57:04 I think it is 20:57:07 allbery_b: It is. 20:57:16 sfultong: http://scienceblogs.com/goodmath/goodmath/programming/pathological_programming/ 20:57:18 Title: Good Math, Bad Math, http://tinyurl.com/2zs4o2 20:57:21 Lazy K is, too. 20:57:27 Iota is smaller 20:57:40 --- join: P_D (n=Administ@adsl-69-232-235-170.dsl.pltn13.pacbell.net) joined #haskell 20:58:00 http://ling.ucsd.edu/~barker/Iota/ 20:58:02 fax: What do you mean by smaller? 20:58:03 http://scienceblogs.com/goodmath/goodmath/programming/pathological_programming/ 20:58:05 Title: Good Math, Bad Math, http://tinyurl.com/2zs4o2 20:58:13 fax: Fewer primitives? 20:58:17 that link its to the one instruction set computer 20:58:38 it's very likely turing complete 20:59:02 @let x a = a s k 20:59:03 :16:0: Multiple declarations of `L.x' Declared at: :6:0... 20:59:16 @undefine 20:59:19 Undefined. 20:59:19 sioraiocht: this I find interesting 20:59:23 @let on f g x y = g x `f` g y 20:59:25 Defined. 20:59:27 --- join: mr_tenor (n=nick@c220-239-43-146.rivrw7.nsw.optusnet.com.au) joined #haskell 20:59:27 @pointless (\x y-> chr (x !! y)) 20:59:28 (chr .) . (!!) 20:59:38 @let s x y z = x z (y z); k x y = x; i x = x 20:59:40 Defined. 20:59:42 @let x a = a s k 20:59:43 sfultong: I had a class where I had to implement interpreters for some of these in haskell, was fun 20:59:45 Defined. 20:59:48 @let (_,_,_) = (1,2,3) 20:59:51 Defined. 21:00:00 check out the programming language NULL 21:00:07 you realize that's a pointless binding, right? 21:00:16 a program consists of a number, it's prime factorisation determines execution 21:00:37 allbery_b: it's a statement on the futility of life 21:00:50 sortle does look brilliantly insane 21:00:53 --- quit: crazy_coder (Read error: 110 (Connection timed out)) 21:01:02 sioraiocht: that's scary 21:01:04 sioraiocht: Like Gödel numbering? 21:01:17 Indeed, Goedel was doing that in the twenties 21:01:55 anyone ever think that perhaps our universe is modeled in 1 dimensional cellular atomata? 21:02:31 similar, the VM i believe deterministically decides a specific factoring scheme, and the emerging factor determines the next instruction 21:02:33 sfultong: Perhaps. The most significant person with views closest to that would be Stephen Wolfram. 21:03:00 isn't godel numbering where you do log in base p for each prime and the exponents determine the instruction? 21:03:15 you know v 21:03:16 let f (x:y) = ... 21:03:29 can you do let f (x:y) = ... [] = somehow? 21:03:39 ddarius: yeah, that's how I know of cellular atomata. I'm not as crazy about it as Wolfram, but I think it's possible it could be useful 21:03:51 fax: What do you mean? 21:04:01 sfultong: Cellular automata are clearly useful. 21:04:06 hm wanted to define the two cases.. I guess it would be better to just use case 21:04:23 > let f (x:xs) = [x]; f [] = [] in f "foo" 21:04:24 "f" 21:04:26 * sioraiocht repressed the class in which he learned about Cellular Automata...for unrelated reasons. 21:04:30 ahh cool thanks 21:04:33 --- quit: alexj (Read error: 110 (Connection timed out)) 21:04:38 --- join: bos (n=bos@hierophant.serpentine.com) joined #haskell 21:04:45 You want to type f's name just once? 21:04:51 Oh. 21:06:05 sioraiocht: how come? were you taught through sexual torture? 21:06:53 sfultong: no, the prof was just a PSYCHO. the class was entitled computability theory, no students from different semesters have ever described the same topics being taught in their version of the class 21:06:59 the mid-term was three weeks before the final 21:07:25 there was a take home portion to the final..due after the in class portion but assigned before it...the proof due for the take home was given for the question in the class 21:07:31 @pointless (\x -> take 2 x ++ [1+(x!!2)] ++ drop 3 x) 21:07:32 ap ((++) . take 2) (ap ((++) . return . (1 +) . (!! 2)) (drop 3)) 21:07:39 ugh.. is there a better way? 21:07:47 go from [1,2,3,4,5] to [1,2,4,4,5] 21:07:48 I know people that were given the WRONG final, i.e. one designed for a different clss 21:08:01 --- quit: mattrepl ("This computer has gone to sleep") 21:08:05 where was this? 21:08:14 Syracuse University 21:08:39 hmmm... i've heard stories about crazy computability theory classes from schools everywhere now 21:08:43 LOL 21:08:56 fax: would using splitAt help? 21:09:00 the only other class this guy taught to undergrads was titled "Chaos and Dynamical Systems" 21:09:02 eh, just another bit of fodder for my argument against formal education 21:09:08 i had a guy who used to digress about ancient greek theories of the afterlife and try to relate this to chomskyian grammars 21:09:16 * sioraiocht shudders. 21:09:37 i.e. splitAt 2, duplicate the head of the tail of the second list, then glue them back together 21:09:38 let (x,y) = splitAt 2 [1,2,3,4,5] in x ++ [1+y!!0] ++ y 21:09:40 sfultong: formal education is the foundation upon which society progresses nowadays...imo 21:09:41 sounds like he had quite a handle on chaos 21:09:45 It's about as long :( 21:10:04 you're golfing? 21:10:20 write short functions that do bits and pieces, reuse short functions later 21:10:24 I'm failing to gold 21:10:26 golf 21:10:28 * dolio was taught chaos theory as part of his freshman physics course. 21:10:43 --- quit: sclv () 21:10:48 sioraiocht: you'd be hard-pressed to make me believe that 21:10:57 * sioraiocht took freshman physics his senior year, and passed without ever attending class after the first exam 21:11:10 Heh. 21:11:15 * allbery_b has done pretty well with very little formal education, he thinks 21:11:33 what is this "golf" of which people speak? 21:11:34 allbery_b: in individual cases that can be true, but the theory often doesn't generalise 21:11:43 golf = SATAN 21:11:52 sfultong: code golfing 21:12:03 @go "code golfing" 21:12:06 http://bogojoker.com/weblog/2007/03/18/code-golf/ 21:12:06 Title: bogojoker » Blog Archive » Code Golf 21:12:10 ah, thanks 21:12:47 sioraiocht: perhaps teaching could be done in a distributed system where the brightest were taught by professors, and some tree structure taught the rest? 21:13:05 > let (x, e:y) = splitAt 2 [1..5] in x ++ (1+e) : y 21:13:12 sfultong: the trickle down theory didn't work economically, I don't think it's gonna work pedagogically either 21:13:14 [1,2,4,4,5] 21:13:18 that is, where taught == tutored 21:13:42 > (uncurry (++)) . (id *** ((:) =<< head) . tail) . (splitAt 2) $ [1..5] -- it's not golf, but I like it ;) 21:13:43 Unbalanced parenthesis 21:13:51 > (uncurry (++)) . (id *** ((:) =<< head) . tail) . (splitAt 2) $ [1..5] -- it's not golf, but I like it ; 21:13:52 [1,2,4,4,5] 21:14:15 sfultong: arguably that's how it works now. how many of you had TAs instead f profs? 21:14:18 (id ***) = second? 21:14:37 allbery_b: good point, but there should be more tiers 21:14:41 allbery_b: I never had a TA teach a class, and only 2 adjuncts. There was one class that was going to be TA taught and a dropped it =p 21:14:51 *and I dropped it* 21:14:58 and e dropped it! 21:15:01 a is phonetically appropriate 21:15:13 shachaf: true, I'm not in the habit of using first/second 21:15:37 lol not for my diction, it's not 21:16:01 though I'm sure I have some weird ones, being from the Left Coast 21:16:07 well who needs a consistent diction? 21:16:09 :-P 21:16:28 --- join: laziest (n=abhay@pratapgad.unipune.ernet.in) joined #haskell 21:16:42 Heh, left 21:18:44 --- quit: clanehin (Remote closed the connection) 21:19:14 * sioraiocht will come back from the UK with some effed up half-British diction 21:19:28 --- join: agoode (n=agoode@2001:4830:1633:0:212:3fff:fe70:6222) joined #haskell 21:20:11 I don't think "diction" is quite the word that you want. 21:20:23 * sfultong spent a year when he was 5-6 years of age in Britain, and it never impressed upon his diction 21:20:23 Though your statement likely stands. 21:20:55 --- quit: Sgeo (Read error: 104 (Connection reset by peer)) 21:21:20 ddarius: perhaps pronunciation 21:21:21 You haven't been referring to people as "gov'ner" ever since? 21:21:37 --- nick: carmen -> c 21:21:54 dolio: haha no, although when drunk I tend to pick up accents stronger..it hasn't been remarked upon yet but I'm hoping no one refers to me as that "American douchebag" 21:21:59 sioraiocht: Yes, that would be more appropriate, or perhaps "dialect", or "accent", or "ideolect" 21:22:14 ddarius: the problem with ALL of those words is that they cover multiple meanings, lol 21:22:55 when really i just meant I'll probably pronounce stuff all messed up, lol 21:23:04 sioraiocht: Yes. It would do little for me to list synonyms. 21:23:21 "diction" is word choice 21:23:42 ddarius: it can also refer to enunciation in the context of spoken language 21:23:59 heh, enunciation is really the best word for it 21:24:16 --- quit: calvins ("Bye...") 21:24:26 sioraiocht: You are correct, and I didn't know that. 21:24:39 * ddarius has never seen it used that way. 21:24:39 * sioraiocht <------- did a stint as a linguistics major 21:24:46 how do you find the first 'x' in a string before index 5 ? ":/ 21:24:48 * sioraiocht <--------- did little more than pick up esoteric bits 21:25:03 sioraiocht: lojban? :) 21:25:16 fax: Find its index? 21:25:24 yeah 21:25:28 :t index 21:25:32 Ah, it's a "secondary" meaning. 21:25:37 forall a. (Ix a) => (a, a) -> a -> Int 21:26:10 (at least according to wikipedia, and wordnet seems to be the only other thing that gives it that definition according to Googling "define:diction") 21:26:21 haha 21:26:22 'x' `elemIndex` take 5 xs? 21:26:37 THAT's the function i was thinking of, elemIndex 21:27:32 ahh neat 21:28:00 is there a way to pass ghci a string that's a haskell program and have it print the answer and exit? 21:28:21 fax: Or you could use elemIndex and then check the value. 21:28:27 sioraiocht: -e. 21:28:30 thanks 21:28:38 sioraiocht: That won't work with :m and friends, though. 21:28:45 shachaf: right 21:28:55 just actual haskell code 21:28:55 sioraiocht: It works with ghc, too; no need for --interactive. 21:30:15 --- quit: robreim (Read error: 110 (Connection timed out)) 21:30:15 w00t, thanks 21:34:19 --- join: mrsolo (n=mrsolo@adsl-68-126-178-239.dsl.pltn13.pacbell.net) joined #haskell 21:39:23 --- quit: idnar (Nick collision from services.) 21:39:25 --- join: idnar_ (i=mithrand@unaffiliated/idnar) joined #haskell 21:40:24 --- quit: unmarshal (Remote closed the connection) 21:41:31 --- join: vigilant (i=vigilant@unaffiliated/vigilant) joined #haskell 21:47:06 > (\x->case x of "+-"->1;'_'->0) "+-_" 21:47:10 Couldn't match expected type `[Char]' against inferred type `Char' 21:47:14 :| 21:47:24 isn't it possible to have mutliple things in a case 21:47:43 match '+' or '-' 21:47:43 "+-" is a string, '_' a char 21:48:01 well ocaml has a | b -> 21:48:05 and you separate the clauses with | 21:48:11 Not like OCaml 21:48:31 Er scratch that. 21:48:46 good to know 21:48:47 * ddarius should probably go to sleep. 21:50:36 --- join: sjanssen (n=sjanssen@CPE-76-84-191-66.neb.res.rr.com) joined #haskell 21:50:57 night ddarius 21:51:53 --- join: OceanSpray (n=Shinku@cpe-76-169-78-244.socal.res.rr.com) joined #haskell 21:51:57 > let ev ctx i prog j=let f n=ev(let(x,y:z)=splitAt i ctx in x++[y+n]++z)i prog(j+1)in(case (drop j prog) of[]->[];p:rog->(case p of '>'->ev ctx(1+i)prog(j+1);'<'->ev ctx(i-1)prog(j+1);'+'->f 1;'-'->f (-1);'.'->(Char.chr(ctx!!i)):ev ctx i prog(j+1);']'->ev ctx i prog(if((ctx!!i)==0)then j+1 else(\(Just x)->x)$List.elemIndex '['$(take j prog));_->ev ctx i prog(j+1)))in ev(repeat 0)0"++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<++++++ 21:51:57 Improperly terminated string 21:52:07 lies! 21:52:18 ah damn its too long 21:52:20 that's quite something 21:52:26 yeah, probably got cut off 21:54:11 @let bf = let ev ctx i j prog=let f n=ev(let(x,y:z)=splitAt i ctx in x++[y+n]++z)i(j+1)prog in(case (drop j prog) of[]->[];p:rog->(case p of '>'->ev ctx(1+i)(j+1)prog;'<'->ev ctx(i-1)(j+1)prog;'+'->f 1;'-'->f (-1);'.'->(Char.chr(ctx!!i)):ev ctx i(j+1)prog;']'->ev ctx i(if((ctx!!i)==0)then j+1 else(\(Just x)->x)$List.elemIndex '['$(take j prog))prog;_->ev ctx i(j+1)prog))in ev(repeat 0)0 0 21:54:19 Defined. 21:54:29 > bf "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." 21:54:31 "Hello World!\n" 21:54:34 yay :D 21:54:38 fax++ 21:54:52 fax: you could also use the built-in @bf :) 21:54:52 woah 21:54:56 @bf 21:54:57 Done. 21:54:57 bf interpreter? 21:54:59 jcreigh: No, it's broken. 21:55:01 what! 21:55:03 @bf ++ 21:55:03 shachaf: oh? 21:55:03 fd:22: hClose: resource vanished (Broken pipe) 21:55:04 oh *phew* 21:55:07 I feel like SUCH a douche 21:55:07 I thought it was broken :p 21:55:14 jcreigh: As is @unlambda. 21:55:23 @bf ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>. 21:55:23 fd:22: hClose: resource vanished (Broken pipe) 21:55:27 ah, brokenness is news to me. 21:55:37 It's been that way for quite a while. :-( 21:55:38 how would you model quantum entanglement in Haskell? 21:55:54 .. model? 21:55:54 --- quit: dolio (Read error: 104 (Connection reset by peer)) 21:56:08 Excedrin: You do the math. 21:56:28 it's just linear algebra 21:56:45 --- quit: gwern (Remote closed the connection) 21:56:53 Excedrin: represent the state as a list of coefficients (just as P_D said)? 21:59:51 --- join: dolio (n=dolio@nr5-216-196-210-207.fuse.net) joined #haskell 22:00:36 --- join: coffeemug (n=coffeemu@pool-68-237-17-220.ny325.east.verizon.net) joined #haskell 22:02:23 --- quit: agoode (Read error: 60 (Operation timed out)) 22:03:14 Oh gosh, I have a really good quote.. 22:03:21 hm, I'm not sure how to express my question: (a,b) <- makeQEPair; print a; ...; print b, outputs either 1 0 or 0 1, something like that 22:03:25 FMota: display it here 22:03:50 @quote FMota 22:03:50 FMota says: Haskell's cryptic form \n is natural to some folks \n and so is Haiku's 22:03:51 well, without IO 22:04:06 you're trying to sample a distribution? 22:04:44 oh I see 22:05:05 it's a reasonable question right? 22:05:07 "It seems to me that Ada was invented by someone who was trying to learn C and decided to take out all of complicated parts, and then made a bunch of shortcuts to make up for the lack of features." 22:05:11 yes, you want to sample it and collapse the rest of the state appropriately 22:05:47 FMota: s/C/assembly and s/Ada/Algol 22:06:03 I thought Ada was for people who want to write High Assurance Software, or something like that. 22:06:16 not directly related to Haskell, unless you consider English to be related to a Native American tongue. 22:06:42 Ada is terrible :/ 22:06:53 ignoring the actual math, it seems straight forward. you have a state S and a function f which measures the state and a function g which takes that measurement and updates the state 22:06:56 (for writing anything useful in) 22:06:57 Ehud Lamm is rather fond of Ada. 22:07:05 --- join: stepcut (n=user@ip68-107-72-71.sd.sd.cox.net) joined #haskell 22:07:05 So I gathered from your order-of-magnitude-more-code comment earlier. :) 22:07:07 use the state monad or whatever to store the state 22:07:09 Who 22:07:16 *who's Ehud Lamm? 22:07:32 Founder of Lambda the Ultimate. 22:07:41 mk 22:08:00 * dolio used to have Ada on his list of languages to learn, but has heard many negative reviews since then. 22:08:07 @go lambda the ultimate 22:08:09 http://lambda-the-ultimate.org/ 22:08:09 my problem with Ada is not so much the language, but the teacher 22:08:09 Title: Lambda the Ultimate | Programming Languages Weblog 22:08:24 Ada Lovelace was soo snooty. 22:08:40 * allbery_b once had ada on his list of languages to learn... then he tried learning it and was repulsed 22:08:46 although I wouldn't be caught dead doing anything useful with the language. 22:08:48 Heh. 22:08:58 allbery_b: That's how tensor analysis was for me. 22:09:06 XD 22:10:19 --- quit: OceanSpray (Read error: 104 (Connection reset by peer)) 22:13:14 --- quit: binary42 () 22:18:45 ... 22:18:47 for example 22:18:48 http://pastebin.com/d7c6aa432 22:18:56 this was my assignment 22:19:05 I've written it in python in 17 lines. 22:19:13 in Ada, I had over 200 lines. 22:19:36 I spent roughly 4 hours on it 22:19:40 ...while getting ill 22:19:41 :/ 22:27:13 anyway 22:27:14 bed time 22:27:16 gnight folks 22:27:21 see you... probably on monday 22:27:31 --- nick: FMota -> FMotAFK 22:27:36 --- join: Kwanun (n=Kwanun@cm97.epsilon105.maxonline.com.sg) joined #haskell 22:27:42 --- part: Kwanun left #haskell 22:28:02 --- join: goalieca (n=ryan@S010600134649440f.vf.shawcable.net) joined #haskell 22:28:33 > 1/1.03 22:28:35 0.970873786407767 22:29:47 --- join: straszhm (n=straszhm@pa-pub.umd.edu) joined #haskell 22:29:53 > 1 / 0.970873786407767 22:29:55 1.03 22:30:36 --- join: sclv (n=sclv@c-24-0-152-164.hsd1.nj.comcast.net) joined #haskell 22:30:40 --- join: OceanSpray (n=Shinku@cpe-76-169-78-244.socal.res.rr.com) joined #haskell 22:30:57 that's where the cdn dollar hit 22:33:36 I wonder if the usd won't crash... either way, it should be interesting 22:35:33 hm 22:35:34 --- quit: ddarius (Read error: 110 (Connection timed out)) 22:35:41 cost of living in the us is very low 22:35:49 --- join: omniscientIdiot (n=omniscie@node18.35.251.72.1dial.com) joined #haskell 22:35:54 it's nice for Europeans who can't afford to live at home. 22:36:08 * sjanssen doesn't like "interesting" applied to the currency that all his money is in 22:36:31 sjanssen: convert your currency to something on the rise. 22:36:33 now. 22:36:37 er, *money 22:36:47 meh, it's not like I have much 22:37:04 :/ 22:37:15 you'll have much less if the crisis goes on. 22:40:23 --- quit: TwigEther (Read error: 113 (No route to host)) 22:42:33 canadian dollar is expected to break even 22:42:41 but we're not exactly rising compared to other markets 22:42:46 just the US 22:42:55 --- join: CRathman (n=chatzill@cpe-76-185-186-143.tx.res.rr.com) joined #haskell 22:45:31 Amazing novel: http://www.lulu.com/browse/preview.php?fCID=1197639 22:45:31 Title: Lorem Ipsum - The Novel by Matthew Greenwald (Book) 22:45:49 --- quit: nostrademons (Read error: 110 (Connection timed out)) 22:46:04 --- quit: laziest (Remote closed the connection) 22:46:24 I was expecting an entire book of "lorem ipsum ..." text 22:46:33 * fax disappointed 22:46:42 ;) 22:50:58 --- join: gour (n=Gour@17-100.dsl.iskon.hr) joined #haskell 22:56:21 i've got this type: 22:56:25 data Assignment = forall value domain. (Show value, Show domain) => value := domain 22:56:39 and want to construct a little function that pulls the value out, 22:56:45 getvalue (b := _) = b 22:57:15 so the signature would be, getvalue :: Assignment -> ?? 22:57:36 --- join: mfunebre (i=mfunebre@71.231.2.6) joined #haskell 22:57:50 another forall doesn't seem to do it, and it seems that that would be too general anyhow 22:57:50 I think the existential makes it impossible to pull out like that 22:58:03 ah 22:58:06 your result is forall a. a 22:58:08 --- quit: arjanb ("bbl") 22:58:18 and the only possibel value is therefore _|_ 22:58:58 (well, forall a. Show a => a, so in fact you could pull a value out by calling show on it 22:59:21 getvalue :: Assignment => String; getvalue (b := _) = show b 22:59:37 s/=>/->/ 22:59:45 sorry, typo 22:59:47 yah 22:59:56 you may have noticed I typo a lot 23:00:21 yah that compiles. hm. 23:00:31 anyway, you can't extract an existential type easily 23:00:43 --- quit: P_D ("leaving") 23:01:10 --- part: conal left #haskell 23:02:08 When you pass values to the (:=) constructor, you get a value of type Assignment, losing any indication of the underlying type. 23:02:25 yep 23:02:28 ah ok. 23:02:33 so it is like it looks like. 23:02:49 if you want to be able to manipulate it, you need to lose the forall and use a type which you can deconstruct later 23:03:08 ok 23:03:13 This is too funny: "Invisible Pink Unicorns are beings of awesome mystical power. We know this because they manage to be invisible and pink at the same time. Like all religions, the Faith of the Invisible Pink Unicorns is based upon both logic and faith. We have faith that they are pink; we logically know that they are invisible because we can't see them" ~ Steve Eley 23:03:19 Anyway, I'm really going now. 23:03:20 Ciao 23:03:36 and if i don't want to limit that to a particular type 23:03:39 e.g. data Value = ... -- definitions for your various value types, which give you constructors and deconstructors 23:03:47 i limit to a type class 23:04:00 data Value = Str String | Num Int | ... -- for example 23:04:08 yah, that's what i just finished factoring out 23:04:27 trying to do a little constraint satisfaction thing 23:04:41 where the inputs are e.g. 23:04:55 data AuState = WA | NT | SA | Q | NSW | V | T deriving (Show, Eq, Ord, Enum, Bounded) 23:05:04 data Color = Red | Green | Blue deriving (Show, Eq, Ord, Enum, Bounded) 23:05:12 and an adjacency graph 23:05:17 (map coloring) 23:05:46 ah. 23:06:42 --- quit: sfultong (Remote closed the connection) 23:06:52 so instead of saying 'forall', it's "Show, Enum, Bounded", etc. 23:07:18 forall creates a box that you can't look inside except under very limited conditions 23:07:23 --- quit: ttmrichter (Connection timed out) 23:07:29 is the random class in the stdlib not a monad? 23:07:48 no 23:08:20 it's designed so you can easily schlep around a seed in state, and you can get an initial random seed in IO 23:08:30 but you don't *need* to use a monad with it 23:08:36 but i dont want to use IO with it 23:08:59 so you can hardcode a seed 23:09:04 @wiki New Monads 23:09:04 http://www.haskell.org/haskellwiki/New_Monads 23:09:13 you can use the State StdGen monad for you random bits, use runState to supply it with a StdGen either from mkStdGen or newStdGen (in IO). 23:09:14 Damn. 23:09:41 ah i see 23:09:49 --- join: dons (n=dons@c-24-22-19-90.hsd1.or.comcast.net) joined #haskell 23:09:56 ?yow 23:09:56 Somewhere in suburban Honolulu, an unemployed bellhop is whipping up a 23:09:56 batch of illegal psilocybin chop suey!! 23:10:04 @wiki New_Monads/MonadRandom 23:10:04 http://www.haskell.org/haskellwiki/New_Monads/MonadRandom 23:10:09 @type do {x <- State (randomR (0,10)); return (x * 2)} 23:10:12 forall t s. (Random t, RandomGen s, Num t) => State s t 23:10:17 mmm, interesting spam: 23:10:17 Subject: [SPAM] Are there any side effects? 23:10:18 100% Safe To Take, With NO Side Effects. 23:10:26 could describe haskell... :) 23:10:32 lol Haskell spam 23:10:42 > do {x <- State (randomR (0,10)); return (x * 2)} $ mkStdGen 42 23:10:43 Couldn't match expected type `a -> t' 23:11:08 > runState (do {x <- State (randomR (0,10)); return (x * 2)}) (mkStdGen 42) 23:11:09 (8,1720602 40692) 23:11:37 --- mode: ChanServ set +o dons 23:11:42 --- topic: set to '["The Haskell programming language: 100% safe to take, with NO side effects!","Home: http://haskell.org ","Paste: http://hpaste.org ","Logs: http://tunes.org/~nef/logs/haskell/ ","The language of ICFP winners 3 years running"]' by dons 23:11:47 --- mode: ChanServ set -o dons 23:11:48 :) 23:12:14 the best medicine is purely functional 23:12:53 what's imperative medicine, like cupping and leeches and stuff? 23:12:57 hehe 23:13:04 dons: reffie 23:13:05 re 23:13:25 yo yo what's up sjw! 23:13:49 --- quit: ToRA (Read error: 110 (Connection timed out)) 23:14:07 --- nick: straszhm -> straszheim 23:14:16 dons: plantin' time 23:14:17 straszhm: well, some kind of strange treatment: it might work, or it might not: we don't understand it, and it might also kill you 23:14:26 but how about functional food, where the whole point is in side effects 23:14:40 sjw, planting your crops, eh? 23:14:46 food consumption is clearly monadic 23:14:46 ah, spring in the air? 23:15:02 nutrients >>= me 23:15:07 sjanssen: or hmm, a fold of some sort 23:15:10 and we're the accumulator 23:15:32 foldl (\food me -> me $ food) empty [food..] 23:15:33 --- join: seancorfield (n=seancorf@c-67-160-202-22.hsd1.ca.comcast.net) joined #haskell 23:15:36 krebs cycle as state monad? 23:16:40 --- join: ski__ (n=slj@c-4110e055.1149-1-64736c10.cust.bredbandsbolaget.se) joined #haskell 23:16:42 dons: yeah, basil (managed to completely kill my other stuff :), tomatoes, and hopefully some companion flowers 23:16:55 --- quit: ski (Read error: 104 (Connection reset by peer)) 23:17:12 sjanssen: Iavor Diatchki reports that xmonad doesn't unset funny border widths and other state when exiting. we knew that, did'nt we/ 23:17:12 not quite sure if I should stick the flowers in the same pot tho 23:17:19 what do i import to get the state monad? 23:17:31 --- join: crocodile (n=root@220.248.150.127) joined #haskell 23:17:32 sjw, oh, one big pot of herbs and things 23:17:43 Mr_Awesome: import Control.Monad.State 23:17:57 in the `mtl' library 23:17:59 dons: is he rebooting into another WM? 23:18:02 yeah 23:18:27 hmm, ghcxmake isnt finding it 23:18:30 it was funny, since i'd just given the talk about testing and eliminating bugs, then he finds `bug' related to setting state in the X server 23:18:51 never leave state in the X server :) 23:19:08 dons: yeah, not sure if they will fight or not 23:19:17 sjw, so you going to come over here to hack Isabelle and haskell for a living yet? :) 23:19:23 we have an espresso machine... 23:19:39 dons: I can't say that I've considered the problem before, but it makes sense 23:19:39 What kinds of things are you doing with Isabelle? 23:20:08 provin' stuff :) 23:20:29 sjanssen: well, didn't we have a rule not to leave state in the X server/ 23:20:38 since its so easy to forget to set and unset it 23:20:50 we don't really have a choice with window borders 23:20:55 no, i know. 23:20:58 --- part: [azoic] left #haskell 23:20:59 it's write-only, residual state 23:21:00 but do we care enough to reset them? 23:21:16 maybe we don't care enough -- they shouldn't be using other window managers anyway :) 23:21:43 perhaps, especially if somebody can show us that it's wrong 23:22:07 which WM was Iavor booting into? 23:24:27 hmm. something on ubuntu. 23:24:53 one of the fairly default ones. i can ask him on monday -- but its probably not too important 23:25:08 did you have that future directions plan sorted ? 23:25:27 i should have some time this weekend to think about what other things we should do. 23:25:33 no, I got side tracked 23:25:51 * dons votes for X monad checking stuff 23:26:10 my main points were to make a shorter release cycle (a month or so), and to certainly get window rules/hooks done 23:26:33 shorter release cycles seem like a good idea 23:26:41 maybe we can just get a fixed release set. 23:26:46 always freeze in the last week 23:26:53 only add a few things in the first week after release 23:27:28 so, say, window rules this week, and maybe one other feature. then just bug fix / test for a couple of weeks. 23:28:16 i installed the mtl library but still no State, just ST 23:29:00 in ghci, you should be able to: :m + Control.Monad.State 23:29:04 if you've installed mtl correctly 23:29:10 ghc-pkg list mtl to double check its installed 23:29:19 :t liftM2 23:29:21 forall a1 a2 r (m :: * -> *). (Monad m) => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r 23:30:55 --- join: prb (n=prb@c-24-22-188-196.hsd1.mn.comcast.net) joined #haskell 23:32:44 @hoogle (Monad m) => (a -> b -> c) -> m a -> m b -> m c 23:32:45 Prelude.flip :: (a -> b -> c) -> b -> a -> c 23:32:51 --- quit: crocodile (Remote closed the connection) 23:33:21 --- join: crocodile (n=user@220.248.150.127) joined #haskell 23:33:27 --- quit: dje () 23:33:29 dons: apparently its installed, but in a strange place 23:33:32 @hoogle help 23:33:33 Distribution.Setup.HelpCmd :: Action 23:33:43 @hoogle ? 23:33:43 Test.HUnit.Base.( 23:33:43 Test.HUnit.Base.( 23:33:43 Test.HUnit.Base.(~=?) :: (Eq a, Show a) => a -> a -> Test 23:33:51 @help hoogle 23:33:52 hoogle . Haskell API Search for either names, or types. 23:34:21 Thanks but I was wondering how to get hoogle to tell me I needed liftM2 23:36:20 it doesn't seem to understand type constraints very well 23:36:35 :t ap 23:36:37 forall (m :: * -> *) a b. (Monad m) => m (a -> b) -> m a -> m b 23:36:42 --- quit: ergot ("Konversation terminated!") 23:36:48 --- quit: crocodile (Read error: 104 (Connection reset by peer)) 23:37:29 --- join: erg0t (n=ergot@r190-64-196-15.dialup.adsl.anteldata.net.uy) joined #haskell 23:37:35 ah, i needed to add -package mtl to the command line 23:37:37 --- join: roconnor (n=roconnor@vhe-540354.sshn.net) joined #haskell 23:37:39 > liftM2 (Just [1, 2, 3]) (Just [4, 5, 6]) 23:37:40 Couldn't match expected type `a1 -> a2 -> r' 23:37:52 > liftM2 [1, 2, 3] [4, 5, 6] 23:37:52 Couldn't match expected type `a1 -> a2 -> r' 23:37:55 :P 23:38:08 i didn't guess what that does :< 23:38:21 > liftM2 (+) [1, 2, 3] [4, 5, 6] 23:38:22 [5,6,7,6,7,8,7,8,9] 23:38:31 hmm 23:38:39 cartesian product + apply the function to the pairs? 23:38:50 > liftM2 (,) [1, 2, 3] [4, 5, 6] 23:38:51 [(1,4),(1,5),(1,6),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6)] 23:39:09 --- join: takamura (n=takamura@173.Red-83-45-231.dynamicIP.rima-tde.net) joined #haskell 23:39:12 yeah, seems so 23:39:12 oklopol: in the list monad, yes 23:39:25 liftM2 (like all Monad library functions) is based on (>>=) and return, which are concatMap and (:[]) in the list monad respectively 23:39:36 oerjan said something about a monad regarding that function, which was why i tried using an arbitrary monad :P 23:39:43 (flip concatMap to be precise) 23:39:47 hmm... actually i'm not sure if Maybe is a monad... 23:39:59 @src Maybe (>>=) 23:39:59 (Just x) >>= k = k x 23:39:59 Nothing >>= _ = Nothing 23:40:02 it is :) 23:40:50 maybe is pretty much the simplest useful monad 23:40:56 > Just 4 >>= (\x->10*x) 23:40:57 add an instance declaration for (Num (Maybe b)) 23:40:57 In the expression: 10 *... 23:41:02 To say that a type "is a Monad" is to assert that there exist (>>=) and return functions that satisfy the monad laws. 23:42:04 > (Just 4) >>= (\x->10*x) -- i guess i misunderstood the "= x" part in "(Just x) >>= k = k x"? 23:42:05 add an instance declaration for (Num (Maybe b)) 23:42:05 In the expression: 10 *... 23:42:21 > (Just (4 :: Int)) >>= (\x -> 10 * x) -- i guess i misunderstood the "= x" part in "(Just x) >>= k = k x"? 23:42:22 Couldn't match expected type `Maybe b' against inferred type `Int' 23:42:32 oklopol: k must have type a -> Maybe b 23:42:32 (>>=)'s second argument needs to return back into the monad, add a Just in your lambda 23:42:39 oh 23:42:56 > (Just (4 :: Int)) >>= (\x -> Just $ 10 * x) 23:42:57 Just 40 23:43:19 why do you have to get back in the monad? 23:43:26 and can you get back to a different on e? 23:43:28 @type (>>=) 23:43:29 *one 23:43:30 @type (>>=) 23:43:30 forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b 23:43:32 forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b 23:43:40 oklopol: the type says so 23:43:47 no to the second question :) 23:44:02 you know you're asking noob stuff when every question is answered twice identically withina few seconds :P 23:44:04 --- nick: ski__ -> ski 23:44:09 *within a 23:44:13 @quote stereo 23:44:14 dolio says: fasta: At least the 'stereo' quote is no longer in lambdabot. That was _way_ overused. 23:44:19 lol 23:44:30 Yep. 23:44:38 hehe 23:45:05 what did it do? 23:45:15 But it was so true :( 23:45:20 oh cool i just got the Maybe monad and why it does a generic error propagation 23:45:25 i think 23:45:38 something like, "Welcome to #haskell, where your questions are answered in glorious stereo!" 23:45:45 Nothing >>= _ = Nothing <<< error propagation 23:45:55 precisely 23:46:00 --- quit: OceanSpray (Read error: 104 (Connection reset by peer)) 23:46:01 majestic stereo 23:46:16 @src Maybe (>>=) 23:46:17 (Just x) >>= k = k x 23:46:17 Nothing >>= _ = Nothing 23:46:32 @src Maybe (>>) 23:46:33 (Just _) >> k = k 23:46:33 Nothing >> _ = Nothing 23:46:48 >> is unconditional discard or..? 23:46:49 @seen cosmicray 23:46:50 I saw cosmicray leaving #haskell-blah, #darcs and #haskell 3h 15m 15s ago, and . 23:46:57 @src IO (>>) 23:46:57 m >> k = m >>= \ _ -> k 23:47:08 i don't get that... 23:47:12 hmm 23:47:42 @src IO (>>=) 23:47:43 m >>= k = bindIO m k 23:47:47 it was majestetic stereo 23:47:51 oklopol: m >> n is generally, execute 'm' for it's effects, then execute n 23:48:14 oklopol: for the Maybe monad, the effect is potentially failing the whole computation with Nothing 23:48:17 --- join: therp (n=nil@chello080108077214.34.11.tuwien.teleweb.at) joined #haskell 23:48:17 okay, and the IO monad is something magical is why that looks more complicated? 23:48:45 oklopol: yeah, IO is special because the semantics are wired in to the compiler 23:49:07 s/semantics/implementation 23:49:31 >>= used to be called bind many years ago 23:49:36 hmm... i don't know how haskell does Monads, actually, although i'm pretty sure i've grasped them during my idling here 23:49:39 * sjw goes to buy hoegaarden + soil 23:49:43 i mean, the concept 23:49:45 oklopol: defining the meaning for (>>) in IO is like defining the meaning of ; in C 23:49:56 yeah 23:50:19 hmm... actually, that example was a pretty close one 23:50:27 i mean, >> == ; :P 23:51:22 --- quit: njbartlett () 23:51:22 oklopol: Monad is a typeclass. Types which belong to the Monad class must supply (>>=) and return functions such that the monad laws hold ((>>=) is associative, return is (>>=)'s unit). That's all there is to it. 23:51:57 Though, admittedly, this is very abstract and doesn't provide much of an intuition. 23:52:19 --- join: ADEpt (n=ADEpt@jabber.hst.ru) joined #haskell 23:52:19 --- join: OceanSpray (n=Shinku@cpe-76-169-78-244.socal.res.rr.com) joined #haskell 23:53:05 > return Just 23:53:06 > return Just 3 23:53:13 Add a type signature 23:53:13 add an instance declaration for (Show (m (a -> Maybe a))) 23:53:19 > return Just 3 23:53:20 Add a type signature 23:53:23 hmm 23:53:23 None of these computer theorem proving systems have been bootstrapped yet have they? 23:53:29 > return (Just 3) 23:53:30 add an instance declaration for (Show (m (Maybe t))) 23:53:35 which monad are you returning the Just function into? :) 23:53:45 oh 23:53:51 > return (Just 3) :: [Maybe Int] 23:53:56 [Just 3] 23:53:57 sorry, i guess i forgot what return is... 23:54:11 is there a prelude function that removes all duplicates in a list? 23:54:14 (forgot... guessed wrong that is) 23:54:18 nub 23:54:22 damn 23:54:30 > nub "funnybunnies" 23:54:32 "funybies" 23:54:55 I always preferred unit - I'm not sure why it got renamed return 23:55:27 omniscientIdiot: how do you do side-effects with that? 23:55:38 that's what i don't really see