Experimental IRC log haskell-2007-04-05

Available formats: content-negotiated html turtle (see SIOC for the vocabulary)

Back to channel and daily index: content-negotiated html turtle

These logs are provided as an experiment in indexing discussions using IRCHub.py, Irc2RDF.hs, and SIOC.

00:00:15<sorear>How do I do that?
00:00:31<sorear>I thought that fell under the capacity of "never ask for power"
00:00:50<sorear>you see, I'm so helpless in lift I have to actually READ netiquette guides :)
00:00:54<sorear>s/lift/life
00:01:42<dons>its ok being helpless in the lift. trained emergency staff will be there shortly to assist.
00:03:09<sorear>If I'm in a lift I'm already hundreds (thousands?) of miles from home... will they help me get back?
00:04:15<dons>they will do their best. our trained response team will help you catch a bus.
00:04:33<dons>you don't have lifts in california?
00:04:41<sjanssen>elevators.
00:05:06<dons>ah, of course!
00:05:29<dons>and you live in apartments, not flats, I presume? :-)
00:05:35<sjanssen>naturally
00:05:46<sorear>What are the naming conventions for trac user names?
00:05:54<dons>i'm 'dons' on trac.
00:06:25<sorear>that only makes is more confusing, since they have a PhilippaCowderoy
00:06:45<dons>jcreigh: your window border patch cleans things up nicely for me.
00:06:46<sjanssen>choose whatever makes you happy
00:06:51<ddarius>Several thousands.
00:06:53<sjanssen>I'm sjanssen
00:06:58<dons>jcreigh: want to see whether we can make the border colour a config setting?
00:07:38<ddarius>Wie geht's, ekidd?
00:08:05<ekidd>ddarius: Hello! I'm in the process of replacing my iBook battery.
00:08:14<sorear>sjanssen: I don't want a repeat of the Haskell Wiki, where I registered 'Stefan' than discovered of Ljungstrand, Monnier, Holdermanns, ... the next day :)
00:09:03<ddarius>So use sorear.
00:09:24<ddarius>ekidd: Sounds like fun for the whole family.
00:10:26<ekidd>ddarius: If all goes according to plan, this should boost my battery life from 1.5 to ~8 hours. More Haskell hacking!
00:15:22<procyon112>Why don't my debug traces finish printing? Is there a way to flush them?
00:17:13<dons>hFlush stderr
00:17:39<sjanssen>or hSetBuffering stderr NoBuffering
00:17:41<dons>or set hSetBuffering on stderr to HotFlushes , sorry, unbuffered, at the start
00:18:35<procyon112>?hoogle hFlush
00:18:35<lambdabot>IO.hFlush :: Handle -> IO ()
00:19:22<sorear>procyon112: did you get my reply?
00:21:08<procyon112>yes
00:22:11<procyon112>hmm... shouldn't "trace (show bigList) (seq (hFlush stderr) doInfiniteLoop)" flush the bigList before looping?
00:22:35<sjanssen>no
00:22:42<sorear>seq (hFlush stderr) x === x
00:23:01<sorear>since hFlush stderr is a partially applied function, thus in WHNF
00:23:28<sorear>you need to pass it a State# RealWorld for the action to occur
00:23:44<sorear>the portable way of doing that is unsafePerformIO
00:23:59<SamB_XP>hooray dangerous portability!
00:24:16<sorear>unsafePerformIO is actually pretty portable.
00:24:16<procyon112>I'm debugging, so I'm not worried about portability :)
00:24:38<sjanssen>procyon112: just do hSetBuffering stderr NoBuffering as the first step in your main
00:24:45<sorear>SamB_XP: unsafePerformIO has been formally adopted by the haskell-98 committee. Hierarchal modules haven't.
00:24:59<SamB_XP>sorear: oh?
00:25:20<dons>sorear: hmm?
00:25:25<sjanssen>I've always wondered about that. Why hasn't it been accepted
00:25:27<SamB_XP>there is a non-hierarchical FFI API?
00:25:29<sorear>SamB_XP: you need unsafePerformIO to make good interfaces to most foreign functions, so they rolled unsafePerformIO into the FFI spec
00:25:30<dons>sorear: usafePerformIO is part of the FFI standard.
00:25:39<procyon112>sorear: I'm not convinced that redirecting the arrow's left and right hand sides to a map lookup will solve the infinite loop... It seems it would just make it faster...
00:25:40<dons>hier modules are part of the hier modules (draft) standard
00:25:42<sorear>SamB_XP: yeah, import Foreign
00:25:55<SamB_XP>sjanssen: I though the reason was "because there is no Haskell 98 committee"
00:25:58<sorear>FFI is an accepted addendum iirc.
00:26:00<dons>its not really anything to do with the h98 comittee, which doesn't exist.
00:26:21<dons>ffi and hier modules are the only accepted addendums :-)
00:27:00<sorear>procyon112: it lets you notice when you are revisiting visited nodes, which you'll do infinitely often in a cyclic graph
00:28:26<dons>sorear: so do you have any patches to commit back into the binary builder code?
00:28:37<dons>dcoutts and I were pondering your discoveries yesterday.
00:28:44<dons>some quite interesting ideas there.
00:28:48<dcoutts>ah yes
00:30:02<procyon112>hmm. even with hSetBuffering stderr NoBuffering, I only get a partial list printout.
00:31:49<procyon112>sorear: where am I revisiting nodes though? I'm not seeing the line where that can happen.
00:32:02<kolmodin>dons: try 'runGet getWord8 empty'
00:32:27<dons>it fails, doesn't it?
00:32:33<dons>since that's unchecked?
00:32:37<kolmodin>dons: so hard you c'n belive it
00:32:39<kolmodin>segfault
00:32:44<kolmodin>aye
00:32:53<dons>so that's a little surprising
00:32:53<kolmodin>got a patch about it earlier today
00:32:57<dons>cool
00:33:05<kolmodin>yeah, but the patch suprised me
00:33:12<dons>oh?
00:33:18<kolmodin>- when (B.length now < n) $
00:33:19<kolmodin>- fail "too few bytes"
00:33:19<kolmodin>+ () <- when (B.length now < n) $
00:33:20<kolmodin>+ fail "too few bytes"
00:33:25<kolmodin>wtf?
00:33:32<dons>hmm?
00:33:43<dons>someone trying to force evaluation?
00:33:56<procyon112>sorear: unify [] = []. unify ((t1 t2):cs) | t1==t2 = unify cs... no revisits there.
00:34:14<kolmodin>dons: yes
00:34:18<dons>kolmodin: you should just fix it to do this test once at the start.
00:34:27<kolmodin>dons: the weird part is that it worked
00:34:36<dons>hmm.
00:34:45<dons>lazy monads eh?
00:35:13<kolmodin>something like that. my world was rocked a bit
00:36:02<dons>ah well, better now than during the haskell workshop ;-)
00:36:06<dons>(can you add a test for this too?)
00:36:09<kolmodin>I really didn't they it'd make a difference
00:36:25<kolmodin>dons: sure, I'll add one the next days
00:37:18<procyon112>sorear: I may have just pegged it.
00:38:07<kolmodin>the patch I got did enforce 'fail' on another place too, but I don't see how that's required
00:38:10<kolmodin>this was on getBytes
00:38:39<sorear>back.
00:39:58<procyon112>sorear: nope. I made it halting.. but incorrect :P
00:40:22<sorear>procyon112: remember == probably doesn't do what you think it does
00:40:25<kolmodin>dons: I'll look more into it when I'm more.. um... never mind
00:40:30<kolmodin>?localtime kolmodin
00:40:33<lambdabot>Local time for kolmodin is Thu Apr 5 02:40:31 2007
00:40:35<sorear>> let x = [0..] in x == x -- this is true, right?
00:40:40<lambdabot>Terminated
00:40:44<kolmodin>(shit!)
00:41:07<procyon112>sorear: oh.... that would be bad
00:41:57<sorear>dons: that [patching builder] would be in direct conflict with my sinister plans. Why speed binary when you can give a bigger number for Text.PrettyPrint.Leijen_FPS_CPS is x% faster than Data.Binary? (kidding of course) :)
00:43:14<dons>heh
00:44:17<dcoutts>dons: you'll not make it in by 11... ;-)
00:44:30<dons>grr.
00:44:35<dons>ghc had to be restarted.
00:44:41<dcoutts>:-(
00:44:50<sjanssen>dcoutts the slave driver?
00:44:52<dcoutts>you can let it build while you're on the train
00:44:54<dons>(-O2 is not good for partial builds getting restarted)
00:44:54<dcoutts>@yarr!
00:44:55<lambdabot>Swab the deck!
00:45:00<dons>dcoutts: indeed
00:45:11<dcoutts>sjanssen: I'm the paper driver apparently
00:45:22<dcoutts>ChilliX told me so :-)
00:45:26<dons>dcoutts: go chase rl to write section 3.
00:45:31<dons>yes, dcoutts is the official paper driver.
00:45:39<dcoutts>dons: I will as soon as he gets in!
00:45:41<sorear>you can't just build with: ssh serenety.cse.unsw.edu.au ghc --make -j20 ? :)
00:45:46<dons>ACTION is merely a bulid slave.
00:45:50<sorear>that would be fast!
00:46:14<sorear>(too bad we don't have -j)
00:46:31<sjanssen>sorear: there's always ghc -M
00:47:01<dons>yeah, ghc -j could just be a wrapper that dumps ghc -M and calls gnu make.
00:47:03<sorear>The bad news is file-at-a-time is twice as slow as --make
00:47:10<dons>hmm?
00:47:18<sorear>the good news is it uses sixteen times as many cores!
00:47:28<dons>it should be a bit faster, since the compiler space doesn't grow so badly
00:47:31<procyon112>sorear: just fixing the == guard by expressing it with explicit pattern matches did not change anything.
00:47:51<sorear><*procyon112> sorear: unify [] = []. unify ((t1 t2):cs) | t1==t2 = unify
00:48:07<sorear>if t1 and t2 are infinite, and the same, that guard will diverge
00:48:13<sorear>> [0..] == [0..]
00:48:17<lambdabot>Terminated
00:48:58<sorear>ghc does NOT take advantage of pointer equality in ==
00:49:28<sjanssen>that'd be evil evil evli
00:49:44<procyon112>sorear: right. I got rid of the guard and replaced it with ((TVar, x):rest) | x==TVar = unify rest and ((TInt,TInt):rest) = unify rest
00:50:11<resiak>sjanssen: why would it be so bad?
00:50:19<sorear>procyon112: you need more than one TVar, else it's hardly a type system
00:50:40<procyon112>sorear: I do :P I was being concise
00:50:59<sjanssen>resiak: because "let x = [0..] in x == x" and "[0..] == [0..]" should be the same thing
00:52:00<sorear>procyon112: the fundamental problem is that you aren't checking for revisiting nodes
00:52:22<sorear>if you try to unify (a -> a)@a and (b -> b)@b
00:52:30<sorear>it sees that -> == ->
00:52:34<dons>resiak: yeah, it would make equational reasoning much harder, since you can't just replace variable names with their definitions
00:52:53<sorear>then it has ( (a -> a)@a, (b -> b)@b ) ( (a -> a)@a, (b -> b)@b )
00:52:57<sorear>then it has ( (a -> a)@a, (b -> b)@b ) ( (a -> a)@a, (b -> b)@b ) ( (a -> a)@a, (b -> b)@b )
00:53:06<sorear>then it has ( (a -> a)@a, (b -> b)@b ) ( (a -> a)@a, (b -> b)@b ) ( (a -> a)@a, (b -> b)@b ) ( (a -> a)@a, (b -> b)@b )
00:53:16<sorear>and so on ad infinitum
00:53:22<resiak>sjanssen, dons: doh, yeah, that makes sense
00:54:56<procyon112>sorear: what does @ mean in (a->a)@a?
00:55:34<sorear>I'm alluding to as-pattens
00:55:42<sorear>(a -> a) @ a is:
00:56:37<sorear> lhs /-\
00:56:37<sorear> | V
00:56:37<sorear>ROOT => FUN
00:56:37<sorear> | ^
00:56:40<sorear> rhs \-/
00:56:48<sorear>get the picture? :)
00:57:17<QtPlatypus>ACTION doesn't.
00:57:57<Lemmih>Is it some sort of rocket?
00:58:01<QtPlatypus>How would I read "@"
00:58:09<procyon112>sorear: yes
00:58:16<procyon112>sorear: but then, shouldn't
00:58:20<sorear>alternatively, M.fromList [(0, 0 :-> 0)]
00:58:20<mauke>"as"
00:58:37<sorear>procyon112: shouldn't?
00:58:53<procyon112>Here's a constraint set then, that should send my unifier into non-halting:
00:59:22<procyon112>[(a,a->a),(b,b->b),(a,b)]
00:59:33<procyon112>But it doesn't... It's well behaved.
00:59:35<sorear>let anInfiniteType = anInfiniteType :-> anInfiniteType in [(anInfiniteType , anInfiniteType)] -- should do it
00:59:43<sorear>ACTION resolves
01:00:34<procyon112>sorear: express that as a list of constraints... my solver doesn't do lets ;)
01:01:41<procyon112>sorear: or native lists
01:03:13<procyon112>sorear: got one that does it
01:03:28<sorear>cool
01:04:13<procyon112>unify [(a,b),(b,a),(a,a->a),(b,a->b)]
01:04:33<procyon112>I'll try to diagnose that
01:04:55<sorear>your checker has a very interesting approach ... not like mine in some important ways
01:05:15<procyon112>sorear: Mine is pretty much straight out of TAPL chapter 22.
01:05:48<sorear>Oh. Don't have that :)
01:05:53<procyon112>Great book.
01:06:05<sorear>and I've yet to understand a single description of a type inference algorithm
01:06:13<procyon112>^^ the (b,a) constraint is not needed to make it blow stack.
01:06:15<sorear>I've invented plenty tough
01:07:15<procyon112>sorear: TAPL makes it quite simple... It's not *easy*, but it's the best book/paper I've seen to explain all things type related.
01:08:12<procyon112>I figure once I get through "The Art of Prolog" with TAPL under my belt, I will be ready to change my name to Oleg :)
01:11:19<procyon112>Hmmm... [(a,a->a),(b,b->b),(a,b)] unifies, but if I move (a,b) to the head, it blows the stack....
01:12:05<sorear>[(a,a->a),(a,a->a)] does NOT
01:14:05<procyon112>sorear: does NOT unify you mean
01:14:22<procyon112>sorear: cuz it *does* blow the stack ;)
01:14:30<sorear>right :)
01:14:53<sorear>it steps to [(a->a, (a->a)->(a->a)]
01:15:06<sorear>which steps (by decomposition) to
01:15:20<sorear>[(a,a->a),(a,a->a)]
01:15:25<sorear>look familiar? :)
01:15:40<procyon112>yes
01:19:05<sorear>how hard is TAPL? harder than the implementation of functional programming languages?
01:20:19<procyon112>sorear: Implementation of PL: a tutorial, or his other implementation of programming languages that has type inferrence?
01:20:46<sorear>his other implementation of functional programming languages
01:20:52<sorear>the 500 page one
01:22:01<procyon112>easier than the 500 page one.. harder than the 300 page one ;)
01:22:35<procyon112>(the 300 page one, IFPL:A Tutorial doesn't deal with type inference)
01:23:14<procyon112>TAPL is a gentler learning curve, and MUCH more comprehensive when it comes to type issues.
01:24:31<procyon112>And covers Existential, dependant, subtyping, sum types, product types, F, Fc, Fw, and more. With implementation code in OCaml
01:25:58<sorear>Fc?!
01:26:10<sorear>that's a bit new
01:26:13<sorear>>2000 iirc
01:26:18<sorear>isn't tapl 1996?
01:26:55<procyon112>er.. not Fc. and no, it'
01:26:59<procyon112>it's 2002
01:27:18<procyon112>F, Fw, F<: and F<:w
01:28:21<procyon112>Where F<:w has <: as a subscript and w as a superscript to F :)
01:29:27<Pseudonym>@yow
01:29:28<lambdabot>My CODE of ETHICS is vacationing at famed SCHROON LAKE in upstate New
01:29:28<lambdabot>York!!
01:29:35<Pseudonym>IRC + typography don't mix.
01:30:01<sorear>well, it's a book on types, so...
01:30:02<mwc>Pseudonym, use the latex notation
01:31:37<sjanssen>> null [undefined :: Integer ..]
01:31:39<lambdabot> False
01:32:56<sjanssen>> null [undefined :: Int ..]
01:32:58<lambdabot> Undefined
01:34:09<sjanssen>@tell dcoutts how does the new list stuff handle enumFrom undefined, where undefined is Int or Integer?
01:34:10<lambdabot>Consider it noted.
01:34:50<Pseudonym>> [ 2^31-2::Int ..]
01:34:52<lambdabot> [2147483646,2147483647]
01:35:06<Pseudonym>sjanssen: Does that answer your question?
01:35:33<sjanssen>Pseudonym: yes, I understand why Int is that way
01:35:51<Pseudonym>And you understand why Integer isn't.
01:35:51<sjanssen>I'm wondering whether it's reasonable to give Integer the same strictness
01:36:29<sjanssen>making enumFrom :: Integer -> [Integer] lazy is just a space leak waiting to happen
01:36:34<mwc>Hmmm, Haskell is 17 now?
01:36:39<sorear>No, it happened.
01:36:58<sorear>I used last [0..] as a do-nothing-in-constand-space-forever op.
01:37:07<sorear>Kaboom.
01:37:28<sjanssen>I've seen it before, for what it's worth
01:37:39<dcoutts>sjanssen: you mean is it strict or not?
01:37:39<lambdabot>dcoutts: You have 1 new message. '/msg lambdabot @messages' to read it.
01:38:05<sjanssen>dcoutts: yes, is enumFrom :: Integer -> [Integer] strict?
01:39:57<beelsebob>====================================================================================================================================================================================================================================================================================================================================================================================================================================================
01:40:02<dcoutts>sjanssen: the current base definitions are strict for Int, our stuff doesn't change that but we coulld do easily
01:40:49<Pseudonym>Honestly, though. Generally, if you use an enumFrom* operation, it's generally because you want the elements in the list.
01:40:53<sjanssen>dcoutts: yes, Int should be strict. But what about Integer (note that base makes it lazy)?
01:41:06<Pseudonym>I don't see any advantage to making it strict.
01:41:09<dcoutts>sjanssen: technically it should be non-strict for Int too
01:41:16<dcoutts>Pseudonym: makes it a tad quicker
01:41:30<Pseudonym>dcoutts: I guess.
01:41:30<dcoutts>Pseudonym: for Int at least since it can be unboxed
01:41:36<sjanssen>dcoutts: I don't see how that is possible, remember it has to do bounds checking
01:41:41<Pseudonym>OK, exercise:
01:41:41<dcoutts>for Integer there is no such advantage
01:41:54<Pseudonym>Come up with an Enum type for which it doesn't make sense to make enumFrom* strict.
01:41:58<bd_>dcoutts, there's a reason for it to be strict
01:41:58<dcoutts>since it's not unboxable
01:42:09<bd_>> enumFrom 1 !! 1000000 :: Integer
01:42:11<lambdabot> Exception: stack overflow
01:42:14<bd_>> enumFrom 1 !! 1000000 :: Int
01:42:16<lambdabot> 1000001
01:42:25<Pseudonym>bd_: If you write that, you deserve what you get.
01:42:26<sjanssen>dcoutts: not unboxable today. It might be unboxable in the future
01:42:34<dcoutts>sjanssen: true
01:42:40<bd_>Pseudonym: True, but people have been surprised in the past
01:42:45<sorear>dcoutts: Integer *can* be unboxed
01:42:54<sorear>not automatically
01:43:03<sjanssen>as far as I can tell Integer is the *only* Enum instance where enumFrom isn't strict
01:43:12<bd_>sjanssen: Also Double I think
01:43:15<bd_>> enumFrom 1 !! 1000000 :: Double
01:43:17<Pseudonym>bd_: Remember this only came up when sjanssen wanted a constant-space infinite loop, and was surprised when that didn't happen.
01:43:17<lambdabot> Exception: stack overflow
01:43:27<bd_>heh
01:43:30<sorear>Pseudonym: actually sorear
01:43:33<sjanssen>> null [undefined :: Double ..]
01:43:34<lambdabot> False
01:43:35<Pseudonym>Ah, yes.
01:43:37<dcoutts>sjanssen: anything that doesn't override the enumFromTo but uses the default will be lazy
01:43:41<Pseudonym>Sorry.
01:43:48<dcoutts>since the Enum default impl is lazy
01:44:02<Pseudonym>OK, I got one.
01:44:08<Pseudonym>data Peano = Zero | Succ Peano
01:44:09<sjanssen>dcoutts: I think you're incorrect. derived instances of Enum do bounds checking
01:44:15<Pseudonym>Define the "obvious" enum instance.
01:44:38<Pseudonym>It doesn't always make sense for enumFrom* to be lazy on Peano.
01:44:39<dcoutts>sjanssen: hmm ok, I'd have to look in more detail
01:44:48<sjanssen>> null [undefined :: Bool ..] -- proof for dcoutts
01:44:49<lambdabot> Undefined
01:44:50<Pseudonym>Because you can peel off Succs from an undefined just fine.
01:45:41<dcoutts>sjanssen: ah, that's because they're defined in terms of enumFromTo for Int, and that is strict
01:46:05<sjanssen>dcoutts: they have to be strict, otherwise they wouldn't work
01:46:13<sorear>dcoutts:
01:46:13<sorear>enumFromLargeInteger :: Int# -> ByteArray# -> [Integer]
01:46:13<sorear>enumFromLargeInteger l# ba# = case int2Integer# 1# of (# l2#, ba2 #) -> J# l# ba# : (case plusInteger# l# ba# l2# ba2# of (# l3#, ba3# #) -> enumFromLargeInteger l3# ba3#
01:46:33<dcoutts>sjanssen: I don't see why
01:47:36<sjanssen>dcoutts: enumFrom terminates after the largest element, how can you do this lazily?
01:47:59<sjanssen>well, I guess the implementation could always yield at least one cons cell, but that is pretty useless
01:50:35<sjanssen>enumFrom x = x : if isMaxValue x then [] else enumFrom (succ x) -- is a lazier option
01:51:20<dcoutts>sjanssen: hmm, good point
01:52:04<dcoutts>yeah so it only need to check for the max bound when it increments
01:52:07<sjanssen>that extra laziness is worthless though
01:52:23<dcoutts>I'm not sure what the h98 report specifies for the strictness of enumFromTo
01:52:38<dcoutts>the base has a note that the Int instance is indeed to strict
01:52:54<procyon112>sorear: I think I've got it!
01:54:41<procyon112>sorear: The occurs check needs to stay, but instead of failing, if moves the constraint to the end of the list. This makes the constraint still available for substitutions, but doesn't force it to traverse the constraint indefinitely.
01:54:55<procyon112>sorear: so the guard becomes:
01:55:47<procyon112>| tyX `occursIn` tyS = fmap (++[(tyX,tyS)]) $ unify rest
01:56:57<sjanssen>dcoutts: the report says (referring to Int, Integer, Float, Double) "For all four of these Prelude numeric types, all of the enumFrom family of functions are strict in all their arguments"
01:57:14<sjanssen>ACTION goes to report the bug and write a patch
01:58:22<dcoutts>sjanssen: ah ok, good
01:58:33<sjanssen>yikes, Hugs is even worse. null [undefined :: Int ..] == False in Hugs
01:59:27<procyon112>sorear: yes.. this appears to be testing ok for everything I throw at it.
02:18:31<sorear>ACTION 's brain fills with swirling pointers...
02:22:31<procyon112>night all
02:32:51<sorear>@spell Patterson
02:32:52<lambdabot>Patterson
02:32:54<sorear>@spell Paterson
02:32:54<lambdabot>Paterson
02:33:00<sorear>aww, both valid
02:33:44<sorear>ok, Paterson it is
02:35:02<sjanssen>@spell Janssen
02:35:02<lambdabot>Jansen Jensen Kansan Hansen Jasen
02:35:11<sjanssen>I hate you
02:35:47<dons>hehe.
02:35:58<dons>@spell Spencer
02:35:58<lambdabot>Spencer
02:36:06<dons>Spencer Kansan, I like it!
02:37:03<sorear>The algorithm intro I'm writing for my uber-fast pretty printing lib is start to sound a bit ... papery
02:38:23<dons>sorear: you'll be pleased to know, one of the nobench programs now runs 159x faster with a new ghc optimisation rl added.
02:38:33<sorear>nice.
02:38:33<kc5tja_>@spell supercalifragilisticexpialidocious.
02:38:56<sorear>dons: is this like a RULESy thing?
02:39:08<dons>nah, static argument transformation
02:39:16<sorear>nice
02:39:23<sorear>will that fold 2^26?
02:39:26<dons>fixes the 'atom' benchmark, which ghc has been losing to hugs on for 20 years.
02:39:53<sorear>so when was this added?
02:40:02<sorear>ACTION intents to read the patch long description
02:40:05<dons>its in our stream fusion branch of ghc.
02:40:13<dons>so you'll have to wait to till the paper is done
02:40:24<sorear>ouch, you branched all of gcc? not just base?
02:40:36<sorear>what did you have to change in the compiler proper?
02:41:12<dons>too busy right now. deadline in 30 hours. read the paper to find out ;-)
02:41:25<dons>new optimisations, in ghc. stuff in base too.
02:42:38<sorear>so how badly do we want general computation and guards in rules?
02:43:31<dons>not really. lightweight term rewriting does 98% of things we need.
02:44:25<sjanssen>hmm, where might Hugs define instance Enum Integer?
02:44:26<sorear>ACTION also has an idea for adding inline C to GHC
02:44:33<sorear>Hugs.Prelude maybe?
02:44:59<sjanssen>oh, that isn't in base?
02:45:08<kc5tja_>You creates of sheep! Everyone knows, BCPL is the language of the future! :D
02:45:15<sorear>grep saves the day!
02:45:17<sorear>/usr/src/hugs98-98.200503.08/libraries/hugsbase/Hugs/Prelude.hs:instance Enum Integer where
02:45:24<sjanssen>please don't tell me I have to use CVS to fix this simple patch...
02:45:29<sjanssen>s/patch/bug
02:45:58<sjanssen>@google hugsbase
02:46:01<lambdabot>http://osdir.com/ml/lang.haskell.cvs.hugs/2005-04/msg00000.html
02:46:01<lambdabot>Title: cvs commit: hugs98/libraries/hugsbase/Hugs Array.hs Int.hs Prelude.hs Wo
02:46:14<dons>yeah, there's a few other strictness bugs floating around
02:46:25<dons>since StrictCheck et al are fairly new.
02:47:30<dons>sjanssen: i note that tiled xmonad is perfect for doing 3 or 4 simultaneous ghc builds , and observing their progress
02:48:02<sjanssen>:)
02:48:04<c>or compiling dwm with different settings (say if youre on an 8086 and it takes 12 seconds)
02:48:49<sjanssen>pssh, why would you build dwm if you've already got xmonad?
02:49:05<c>does xmonad run on win32 yet?
02:49:12<c>im longing for a proper wm on win32
02:49:25<c>bblean can mostly be hacked to work like dwm, but its tiling plugin sucks
02:49:35<dons>are there any unixy window managers that run on windows?
02:49:36<sjanssen>xmonad would probably run on one of those X servers in windows
02:50:30<glguy>you can use nearly any window manager with cygwin/X
02:50:37<glguy>or do you mean directly instead of explorer?
02:51:03<c>i mean i dont know the goals of xmonad
02:51:11<sorear>I'd like to hack yi to use the xmonad/dwm layout algorith.
02:51:13<c>but , it seems it could be abstracted away from X to work on win32, plan9, osux
02:51:21<sorear>would anyone hurt me if I did that?
02:51:22<dons>its a dwm clone, with some nicer features, in 400 lines.
02:51:23<c>that is, if theres alternate WMs on osux and an API for them , besids X. (afaik there isnt, is there?)
02:52:15<sjanssen>xmonad (and every X window manager, I imagine) is very X specific
02:54:51<sjanssen>ARG talked about an API for window management on the dwm list recently
02:56:34<sorear>does anyone but arg know the suckless wiki password?
02:57:00<kc5tja_>sorear: only those with 80x25 screens. ;D
02:57:25<sorear>Oh well. my screen is 128x48
02:57:44<sjanssen>sorear: 128 still seems a bit tight
02:57:57<kc5tja_>With the font that I use at work, it's 262x100 something.
02:58:06<kc5tja_>People are always like, "How can you SEE anything?!"
02:58:25<sorear>No, I care about legibility.
02:58:36<sorear>I use the linux console because fixed is ugly
02:58:41<kc5tja_>So do I. I just happen to be able to read a 5x8 pixel font just fine.
02:58:54<sorear>much, much, much, uglier than the intel rom font
02:59:18<kc5tja_>I disagree, personally, but then, I did come up with my own 8x8 font that I'd like to expand to 8x16 for the PC.
02:59:46<kc5tja_>I could write it in Forth in about a couple hours, but I am thinking of using Haskell for the practice.
03:00:12<sorear>oh this sounds really easy
03:00:14<sorear>ACTION man psf
03:00:22<sorear>just a little list processing
03:00:37<kc5tja_>Nothing appropriate.
03:00:56<kc5tja_>Is that the console font format, or the X11 format?
03:01:03<sorear>fst
03:01:19<sorear>and it turns out there's no manpage
03:01:21<allbery_b>grah. still can't solve my gtk2hs right-justified label issue
03:01:27<sorear>ACTION mg /usr/share/doc/console-tools/file-formats/psf
03:01:31<kc5tja_>sorear: OK, I'm confused. What are you talking about?
03:01:36<kc5tja_>Oh, OK, just making sure. :)
03:01:41<kc5tja_>There is no list processing involved.
03:02:04<allbery_b>okay, maybe I could use a textview... after figuring out how to make it match everything else in that part of the window instead of a white background, and using the rather more complicated API (since it's really an embedded editor window)
03:02:05<kc5tja_>ACTION was going to read in the full 2KB binary image that I used for the Kestrel, scan double it, then spit it back out in the PSF.
03:02:33<sorear>exactly - list processing.
03:02:43<dcoutts>allbery_b: single line or multi-line ? have you used the x-align?
03:02:44<kc5tja_>Well, more like ByteString processing. :)
03:02:50<sorear>[Word8]
03:02:51<allbery_b>single line
03:03:05<sorear>bytestrings are slower than strings when you have that little data
03:03:08<allbery_b>I'm putting a number in it, I want it to be up to 5 digits and right-justified
03:03:32<allbery_b>the justification attribute doesn't apply to single line labels; the x-align aligns the *widget* but not the text within it
03:03:33<dcoutts>allbery_b: and have you set the packing so your label expand to fill the space available?
03:03:39<jcreigh>dons: what, you don't like red? :)
03:03:42<kc5tja_>sorear: Believe me, speed isn't the issue.
03:03:55<allbery_b>as far as I can tell, gtk2 formats the next into a "box" whose alignment you cannot specify
03:03:57<kc5tja_>For that little data, on an 800MHz box, even if it takes one second, I'm still happy.
03:04:08<dcoutts>allbery_b: you can see how it all works interactively if you try it in glade
03:04:29<allbery_b>I can right-justify the text that gets formatted into that "box", or the label that holds the "box", but the "box" itself is always left-justified
03:04:29<sorear>ok, I just finished writing the scan doubler
03:04:31<sorear>in haskell
03:04:41<allbery_b>and yes, I've been mucking with this in glade as well
03:04:44<kc5tja_>You don't even know the source image format.
03:04:52<sorear>it's not psf?
03:05:00<kc5tja_>No, it's for my Kestrel.
03:05:02<sorear>if it was: interact (\(0x36:0x04:0:8:xs) -> 0x36:0x04:0:16:(xs >>= replicate 2))
03:05:04<kc5tja_>I want to move it to the PC though.
03:05:09<sorear>standard formats ftw!
03:05:34<sorear>given that you're copying the nicities off it, does this mean the kestrel project is dead?
03:05:36<kc5tja_>sorear: The format is pretty standard -- it's a raw, uncompressed, 2048x8 bitmap.
03:05:39<sorear>would be a shame
03:06:11<sorear>kc5tja_: so <data for char0> <data for char1> ...
03:06:12<kc5tja_>sorear: No. Quite the contrary; the whole reason I'm moving the font onto the PC is precisely because I *LIKE* the Kestrel's font.
03:06:32<sorear>kc5tja_: where the data for each character is stored left-right top-bottom?
03:06:54<dcoutts>allbery_b: your label needs to "expand" and "fill" and the x-align needs to be 1.
03:06:55<kc5tja_>Right; take a 2048 pixel wide bitmap, draw all 256 characters onto it, then save it as a bitmap.
03:07:11<kc5tja_>PSF is column-major in comparison.
03:07:48<dons>woot,! http://www.haskell.org/pipermail/haskell-cafe/2007-April/024127.html
03:07:49<lambdabot>Title: [Haskell-cafe] 25k lines of ASP to 4.2k lines of Haskell, with considerably more ..., http://tinyurl.com/yporof
03:07:49<kc5tja_>(the reason this layout was chosen is because it's the most natural font format for use in the ROM's drawing routines)
03:07:51<sorear>no, psf is left-right-top-bottom too
03:07:56<dons>jcreigh: i guess red is ok.
03:08:15<jcreigh>dons: I gues circular dependencies are out, huh?
03:08:16<sorear>so kestrel is column major?
03:08:27<sorear>psf is row major
03:08:33<sjanssen>jcreigh: yes
03:08:41<allbery_b>dcoutts: did all three. the 0 that is specified as the default text in glade is still left-justified; likewise the actual data when I run the program
03:09:16<sjanssen>jcreigh: I've noticed this annoying issue too. It seems like every config (even the static stuff) has to be in XState, which is getting bloated
03:09:54<dons>mod up! http://programming.reddit.com/info/1fh3p/comments
03:09:55<lambdabot>Title: Haskell in the real world: building a commercial website in Haskell with WASH (r ...
03:10:03<dons>(its been a while, and reddit has been sucking muchly)
03:10:18<dcoutts>allbery_b: so you can see in glade that the label widget is wider than the text, the x-align is 1.0 and it still is at the far left of it's allocated space ?
03:10:36<dcoutts>allbery_b: I tried what I said a second ago in glade and it works, I'm not sure what's going on
03:11:00<kc5tja_>sorear: Dude, I just cannot find the format for this file.
03:11:12<sorear>@remember AdamPeacock Once I looked at the source code, 25000 lines of ASP, I reckoned it would be easier to rewrite it in a real language.
03:11:12<lambdabot>Done.
03:11:22<allbery_b>the label widget has a width of 5 characters, this is visible in the window view. the content "0" i left-justified
03:12:35<jcreigh>sjanssen: is defaultLayoutDesc the only one like that, or are there others?
03:12:41<sorear>kc5tja_: if it is 2048 bytes and uncompressed, there isn't much flexibility. try my script (assumes char/row/col ordering, but that's the natural thing for a row-major display), if your screen is garbled then try the 5 other permutations
03:12:42<allbery_b>http://www.ece.cmu.edu/~allbery/hwatchmwp.glade (hwatchmwp.gladep is also there if it matters)
03:13:01<allbery_b>it's possible the installed version of glade here is buggy, but it looks like I set everything right
03:13:30<sorear>display tubes have are row-major in a tradition that goes back to the days of Farnsworth
03:14:23<sjanssen>jcreigh: defaultLayoutDesc is the only one right now
03:14:36<jcreigh>everything was fine when you just had to edit Main.hs :)
03:14:39<jcreigh>hmm.
03:15:01<sjanssen>jcreigh: but grabkeys is stuck in Main.hs because it uses several variables in Config.hs
03:15:03<dcoutts>allbery_b: I can't reproduce that, if the packing were wrong you'd end up with centered text, not left aligned
03:15:26<kc5tja_>sorear: The Kestrel's ROM expects a 2Kx8 bitmap -- period. It doesn't need flexibility, because it's not a full-on GUI.
03:15:27<allbery_b>hrm. I have another one that actually works correctly, but it's in a table instead of an hbox
03:15:28<sorear>Hmm. Haskell-mode seems to think ^#define .... is a comment
03:15:53<allbery_b>yeh, I noticed it thinks # is a comment character
03:15:57<sorear>kc5tja_: Does the kestral have a row-major display bitmap?
03:16:04<allbery_b>{-# ... #-} also messes it up
03:16:06<kc5tja_>sorear: that's all it has.
03:16:27<kc5tja_>no text mode; the ROM blits text to the screen in using a row-major blitting operation.
03:16:41<sorear>kc5tja_: ok, then, unless your display rom programmer was intoxicated you are storing fonts row-major
03:17:03<sorear>kc5tja_: the only question is whether the data for characters is interleaved
03:17:10<allbery_b>guess I'll try reimplementing that part of the gui as a table instead and see if it obeys the x-align
03:17:46<sorear>a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7 ... vs
03:18:06<sorear>... a0 b0 ... a1 b1 ... a2 b2 ... a3 b3 ... a4 b4 ...a5 b5
03:18:23<sorear>both would be about equally easy to implement I think
03:18:54<sorear>I think the former would be ever-so-slightly simpler still, which would be Very Good since that's the psf order
03:19:06<sorear>in which case you can just double bytes
03:20:03<sorear>@botsnack
03:20:03<lambdabot>:)
03:20:10<kc5tja_>sorear: It's stored like a normal 2048 pixel by 8 pixel bitmap would be (like a graphic image). So it's a0 b0 c0 ... a1 b1 c1 ... etc.
03:20:18<kc5tja_>256 bytes of raster 0 data, 256 bytes of raster 1 data, etc.
03:20:46<sorear>ah, ok
03:20:54<sorear>sounds like a job for transpose!
03:21:03<sorear>@type transpose
03:21:05<lambdabot>forall a. [[a]] -> [[a]]
03:21:35<kc5tja_>ACTION was just going to read in 8 chunks of 256 bytes, then zip8 them. :)
03:22:36<sorear>@ty let chunk k [] = [] ; chunk k l = take k l : chunk k (drop k l) in interact $ (++) [0x36,4,0,16] . concat . transpose . chunk 256
03:22:38<lambdabot> No instance for (Num Char)
03:22:39<lambdabot> arising from the literal `54' at <interactive>:1:84-87
03:23:08<sorear>@ty let chunk k [] = [] ; chunk k l = take k l : chunk k (drop k l) in interact $ (++) "\54\4\0\16" . concat . transpose . chunk 256
03:23:10<lambdabot>IO ()
03:23:17<sorear>is that a forth oneliner too? :)
03:24:43<allbery_b>okay, that's got it, if not quite the way I want the spacing
03:25:23<allbery_b>I killed the internal boxes and the field widths (which caused centering instead of right justification!)
03:26:06<allbery_b>the result is somewhat wider than I wanted but I don't think there's a way to tell it to shrink the middle column of the table
03:28:34<kc5tja_>sorear: If I had concat, transpose, and all its dependent words in the dictionary already, YES.
03:28:52<kc5tja_>ACTION doesn't like these chest-beating contests with respect to languages. >:(
03:29:12<kc5tja_>ACTION sighs -- I'm just so not intended for this world.
03:29:35<jcreigh>kc5tja_: which world?
03:29:42<kc5tja_>_This_ world.
03:29:50<kc5tja_>Sol 3
03:29:53<jcreigh>oh.
03:29:56<kc5tja_>circa 21st century.
03:30:17<jcreigh>sorry, but there's not another one within convienent range WRT time or space.
03:30:31<kc5tja_>I doubt it'd help.
03:30:36<SamB_XP>kc5tja: that is not particularly precise
03:30:53<kc5tja_>SamB_XP: What isn't?
03:30:59<SamB_XP>that designation
03:31:03<chessguy>hi haskellers
03:31:04<kc5tja_>So what?
03:31:06<kc5tja_>Who cares?
03:31:08<SamB_XP>"circa 21st century"?
03:31:10<kc5tja_>It's precise enough.
03:31:23<jcreigh>chessguy: hey
03:31:34<SamB_XP>that includes the world after 90 years have passed!
03:31:47<chessguy>jcreigh: how goes the chess engine?
03:32:03<jcreigh>chessguy: oh, haven't touched it. :)
03:32:08<chessguy>awww
03:32:09<kc5tja_>Do you REALLY think that we're going to be that different in 90 years, given 6000 years of known, recorded history of war and unnecessary competition?
03:32:18<jcreigh>been busy with other stuff.
03:32:28<chessguy>i know how that goes
03:33:07<SamB_XP>kc5tja: what about computers!
03:33:10<chessguy>i haven't done much with mine lately either
03:33:27<SamB_XP>computers are very upsetting
03:33:38<chessguy>@quote computer
03:33:39<lambdabot>dons says: Welcome to computer science, we count from 0.
03:34:46<SamB_XP>@quote computer
03:34:46<lambdabot>conal says: monochrom: maybe that's only because computers program people as much as vice versa.
03:34:52<SamB_XP>@quote computer
03:34:53<lambdabot>Makali says: Whenever a programmer thinks, "Hey, skins, what a cool idea", their computer's speakers should create some sort of cock-shaped soundwave and plunge it repeatedly through their skulls.
03:34:59<sorear>Oh, I think in 20 years computers will replace us, and in 90 years nobody will be able to tell the difference
03:35:06<sorear>they'll be as dumb as we are
03:35:22<chessguy>sorear: like animal farm?
03:35:34<kc5tja_>@hoogle transpose
03:35:35<lambdabot>List.transpose :: [[a]] -> [[a]]
03:35:35<jcreigh>sorear: you're saying that someday computers will program in PHP? :)
03:35:35<lambdabot>Data.Graph.transposeG :: Graph -> Graph
03:35:39<sorear>more intellectual maybe, but if 5 billion years of evolotion are any guide..
03:35:44<SamB_XP>gotta love the retirement plan!
03:35:48<sorear>chessguy: yeah!
03:36:30<sorear>chessguy: thank you for pointing out the reference!
03:36:39<sorear>Computers are the new proletariat.
03:36:49<chessguy>i haven't actually read the book, but i'd like to
03:37:19<jcreigh>chessguy: you should. it's a fun read
03:37:25<chessguy>i bet
03:39:03<dmwit>Could somebody take a look at http://hpaste.org/1248? I don't understand the meaning of the error message.
03:39:32<kc5tja_>sorear: Your code won't compile in GHCI.
03:39:40<sorear>why has hpaste stopped answeing?
03:39:55<kc5tja_>"Main.hs:xx:0: parse error on input `module'"
03:40:03<kc5tja_>And I'm not sure why. No useful error is given.
03:40:07<sjanssen>sorear: works for me
03:40:12<sorear>kc5tja_: Nice one!
03:40:31<kc5tja_>xx is 12 on my box, but that's only because I put in a comment.
03:40:36<sorear>kc5tja_: it errored on the auto-inserted module t
03:40:39<sorear>oh, sorry
03:40:47<sorear>I thought it said xx :)
03:41:01<chessguy>?hoogle printName
03:41:02<lambdabot>No matches found
03:41:10<kc5tja_>module FontVerter where chunk k [] = [] chunk k l = take k l : chunk k (drop k l)
03:41:15<kc5tja_>doggone irssi.
03:41:17<sorear>?hoogle pprName
03:41:17<lambdabot>Language.Haskell.TH.PprLib.pprName :: Name -> Doc
03:41:25<dmwit>printName x = widgetGetName x >>= putStrLn
03:41:32<MarcWeber>dmwit: GHC doesn't know which type to choose for a (line 6)
03:41:41<sorear>kc5tja_: there needs to be a ; between the defns for chunk
03:41:53<kc5tja_>sorear: Not when they're on separate lines.
03:41:54<MarcWeber>So using (printName :: WidgetClass -> IO ()) should fix it
03:41:54<sorear>no idea why it said module
03:42:02<dmwit>MarcWeber: But, why should it need to? The widgetGetName function is defined for all WidgetClass instances...
03:42:07<kc5tja_>module FontVerter where
03:42:09<kc5tja_> chunk k [] = []
03:42:11<kc5tja_> chunk k l = take k l : chunk k (drop k l)
03:42:13<kc5tja_>...etc...
03:42:18<dmwit>Wait, really?
03:42:21<kc5tja_>(hand pasted)
03:42:29<chessguy>kc5tja: that's what hpaste is for
03:42:43<kc5tja_>C'mon it's only 3 lines here. But I digress.
03:43:31<sorear>kc5tja_: and module is the first line in the file?
03:43:40<kc5tja_>MUST it be the first line?
03:43:48<kc5tja_>If so, that's contradictory with my CUT sources.
03:43:55<sorear>no, whitespace can precede it
03:44:04<sorear>incl. comments and pragmas
03:44:07<dmwit>MarcWeber: No, WidgetClass is a class, not a type...
03:44:24<kc5tja_>OK, I figured it out.
03:44:30<kc5tja_>I had the import preceding the module.
03:44:32<kc5tja_>Thanks.
03:44:39<chessguy>it would have to be (printName :: WidgetClass w => w -> IO ())
03:44:49<chessguy>which is a mouthful
03:44:54<MarcWeber>dmwit: Have look at the definition of windowNew. See which type it returns
03:45:10<chessguy>?hoogle windowNew
03:45:11<lambdabot>No matches found
03:45:47<dmwit>MarcWeber: IO Window, but why? I want this to work on the button/entry widgets, too.
03:46:14<MarcWeber>dmwit: Then you need existantial types.
03:46:53<dmwit>chessguy: Sorry, I missed the meaning of your comment that starts, "it would have to be..."
03:47:02<dmwit>?go existential types
03:47:03<lambdabot>http://www.cs.washington.edu/homes/djg/papers/exists_imp.pdf
03:47:39<chessguy>dmwit: oh, instead of MarcWeber's (printName :: WidgetClass -> IO ())
03:48:00<dmwit>chessguy: Oh, okay, yeah. What you wrote is what I currently have.
03:48:28<MarcWeber>dmwit: Sorry, can't test it now. Have to reinstall gtk2hs
03:48:30<chessguy>oh, so it is
03:49:10<kc5tja_>ACTION sighs
03:49:15<kc5tja_>Now ghc isn't building the code.
03:49:15<dmwit>?go existential types haskell
03:49:17<lambdabot>http://en.wikibooks.org/wiki/Haskell/Existentially_quantified_types
03:49:17<lambdabot>Title: Haskell/Existentially quantified types - Wikibooks, collection of open-content t ...
03:49:53<kc5tja_>ghc -o fontverter --make Main.hs ==> no Main module.
03:49:58<sjanssen>dmwit: I think you want to give the parameter the type Widget
03:50:05<kc5tja_>ghc --make Main.hs ==> compiles to .o file, but no binary.
03:50:05<MarcWeber>dmwit: Just try (printName :: Window -> IO ())
03:50:16<kc5tja_>module has been adjusted to expose main.
03:50:24<dmwit>MarcWeber: That crashes if you ever focus on any widget other than the main window. ;-)
03:50:26<kc5tja_>Haskell just isn't being my friend. :(
03:50:30<dmwit>sjanssen: Okay, I'll try it.
03:50:54<chessguy>dmead_: oh weird. i get a different error from that code than what you did
03:51:04<MarcWeber>dmwit: No because you register that handler only for the window widget: onSetFocus window (printName)
03:51:34<dmwit>MarcWeber: Empirically false. =P
03:51:35<kc5tja_>n/m -- I got it.
03:51:44<sjanssen>dmwit: gtk2hs simulates OO subtyping with typeclasses and data types. 'Widget' is the supertype of everything in WidgetClass
03:53:27<dmwit>Okay, I'm still getting crashes, but it is less often, and I think I can take it from here.
03:53:28<dmwit>Thanks all.
03:54:15<chessguy>well, i got up to the point where it says (GtkTest:4268): libglade-WARNING **: could not find glade file 'hworld.glade'
03:54:20<chessguy>which is expected
03:54:25<dmwit>Heh, oh.
03:54:30<dmwit>Should I hpaste it for you?
03:54:35<chessguy>if you want
03:55:05<chessguy>i'd kind of like to learn some gtk2hs stuff too, so i wouldn't mind playing around with it
03:55:22<hpaste> dmwit annotated "gtk2hs: ambiguous type error" with "hworld.glade" at http://hpaste.org/1248#a1
03:56:42<dmwit>On a side note, urxvt doesn't really play nice with xmonad. =(
03:56:44<chessguy>ok, the program runs for me now, but at the end, when i quit, it gives me a segmentation fault
03:57:14<dmwit>!
03:57:27<dino->So I wrote a small command-line utility in Haskell recently: http://ui3.info/d/proj/storylen.html
03:57:29<lambdabot>Title: storylen - story word count and categorization
03:57:57<dino->And I followed the How to write a Haskell program page closely, doing as many of the steps as seem relevant for this project.
03:58:04<hpaste> chessguy annotated "gtk2hs: ambiguous type error" with "my session" at http://hpaste.org/1248#a2
03:58:18<dino->It's under darcs, it's got the right file structure, it's cabalized. It has a web page.
03:58:19<chessguy>all i did was click ok and then click close
03:58:44<dons>dino-: nice. does it use bytestrings?
03:58:46<dons>dmwit: oh?
03:59:06<dino->dons: It does indeed.
03:59:08<dmwit>dons: It doesn't repaint properly when it resizes.
03:59:23<dino->And before it used ByteString, it was ridiculous slow.
04:00:12<dino->So, my question is: is this suitable for announcing on haskell@haskell.org?
04:00:33<dons>dino-: sure, or drop it by haskell-cafe@
04:00:41<dino->It's so.. not a Functional Graph Library, or an XML toolkit or even a Gameboy emulator.
04:00:50<sorear>dons: nice. I just discovered another advantage of my mutable-byte-array state-block approach (cf builder hacking results, parameter reduction) - it allows highly efficient mon{a,oi}d transformers
04:01:19<chessguy>dino-: it seems pretty specific to your needs. i don't know that many people will use it, but it could be an interesting project for people to read through
04:01:35<dmwit>chessguy: Yes, I can replicate the problem. (It's 100% reproducible -- pressing close always triggers a problem, no matter what happened before.)
04:01:46<dmwit>I just don't know enough to say waht it is yet... =)
04:01:52<kc5tja_>@type replicate
04:01:54<lambdabot>forall a. Int -> a -> [a]
04:01:58<dino->chessguy: Perhaps gathering an all plain text library of books will become a trend. :)
04:02:45<chessguy>dmwit: hmm, i wonder if the onClick event for close is getting captured before the printName
04:03:05<chessguy>dmwit: and then by the time the printName executes, the window is already destroyed
04:03:30<dmwit>Well, commenting out the printName line seems to fix it, so...
04:03:42<chessguy>hmm. all thought just tabbing around the window is enough to give a segmentation fault too
04:03:48<chessguy>s/thought/though/
04:03:55<dmwit>Yeah, that's why I was saying it still crashed sometimes.
04:04:09<dmwit>Specifically, tabbing past "OK" or shift-tabbing before the entry box will do it.
04:04:15<chessguy>yes
04:04:18<chessguy>interesting
04:04:32<jcreigh>type ReadS a = String -> [(a,String)] -- okay, but what should I return as the String?
04:04:37<chessguy>you might want to chat with dcoutts about this, he knows a lot about gtk2hs
04:04:41<dcoutts>@arr
04:04:42<lambdabot>Drink up, me 'earties
04:04:43<abz>yeah dons, thanks for the reddit.
04:04:55<chessguy>speaking of which :)
04:04:56<dmwit>Hi dcoutts!
04:04:57<jcreigh>I'm trying to declare an instace of Read...
04:05:04<dcoutts>abz: looks good!
04:05:12<abz>thanks.
04:05:18<dcoutts>abz: nice success story too :-)
04:05:36<dcoutts>abz: I wonder if this'll motivate anyone to clean up wash
04:05:54<abz>it needs it, i've got a good list of TODOs for wash
04:05:58<chessguy>?src Read
04:05:59<lambdabot>class Read a where
04:05:59<lambdabot> readsPrec :: Int -> ReadS a
04:05:59<lambdabot> readList :: ReadS [a]
04:05:59<lambdabot> readPrec :: ReadPrec a
04:05:59<lambdabot> readListPrec :: ReadPrec [a]
04:06:07<dons>abz, yeah, great work.
04:06:15<dcoutts>abz: heh, I bet. #1 make it build in less than 2 hours ;-)
04:07:03<abz>fast_cgi is the most needed thing. atm it just exitWith Success after each page...
04:07:09<dmwit>dcoutts: I'm playing with gtk2hs, and found a few ways to make it send makeNewGObject a NULL pointer. Do you want/have time to educate me? =)
04:07:51<abz>which means that you have to do everything (like send emails) before rendering the page.
04:07:52<dcoutts>abz: I suggest you post your wash todo list as a follow up to the mailing list and/or your general development experiences with it, I'm sure people will be interested
04:08:40<dcoutts>abz: you've seen Happs to of course, I wonder if any integration between the two would help since wash is mainly about front end and happs mainly about back end
04:08:50<abz>dcoutts: good thought, will do.
04:09:01<dino->Speaking of ByteString, I was having performance problems until someone told me to use -O2. And dcoutts emailed about the inlining: http://www.haskell.org/pipermail/haskell-cafe/2007-March/024027.html
04:09:03<lambdabot>Title: [Haskell-cafe] Data.ByteStream.Char8.words performance, http://tinyurl.com/yrqe5b
04:09:09<dino->But the discussion never went further.
04:09:28<MarcWeber>abz Where can I read about the success story? Do you want to join web-devel@haskell.org ?
04:09:37<dcoutts>dmwit: if you can give makeNewGObject a NULL pointer it's a bug and we'd apreciate if you report how to reproduce it
04:09:39<abz>dcoutts: yes, I've seen Happs.
04:09:50<kc5tja_>Awesome. I now have 8x8 and 8x16 console fonts.
04:10:00<abz>http://article.gmane.org/gmane.comp.lang.haskell.cafe/21159
04:10:03<lambdabot>Title: Gmane -- Mail To News And Back Again
04:10:10<kc5tja_>sorear: However, you ruined it for me; I was going to try and do this myself for practice. But, still, it's done.
04:10:38<abz>I was thinking of posting it to web-devel, but I didn't know that it had enough readers...
04:11:08<chessguy>probably most web-devel readers are on -cafe and/or haskell@
04:11:13<dcoutts>abz: yeah, -cafe has a bigger readership, web-devel is probably a good place for more detailed discussions
04:11:20<dmwit>dcoutts: Okay, I'll make a minimal test-case and forward it to the dev list.
04:11:28<glguy>Is there a reasonably efficient method of altering a doubly linked list without assignments?
04:11:47<sorear>use finger trees instead? :)
04:11:48<dcoutts>dmwit: cheers
04:11:49<glguy>I'm assuming you'd have to rebuild the whole skeleton
04:12:12<glguy>sorear, that's not a bad suggestion... maybe I'm just looking at this wrong..
04:12:24<dcoutts>glguy: aye, modifying a circularly linked data structure requires rebuilding the whole thing
04:13:42<glguy>I'm trying to figure out how I might store the equivalent of a doubly-connected edge list in a functional data structure
04:13:59<glguy>and have a more efficient way to update it than copy it
04:14:49<dcoutts>dmwit: btw did you figure out the type error?
04:15:01<dcoutts>dmwit: it's just like the error you get if you (read . show)
04:15:12<dmwit>dcoutts: Yes, sjanssen told me I could use Widget instead of (Widgetclass a) => a.
04:15:36<dcoutts>right otherwise it has no idea which Widgetclass instance you mean
04:15:55<dmwit>I'm still not sure I understand why it should care, though.
04:15:57<SamB_XP>little does it know that it *doesn't really matter*...
04:16:05<MarcWeber>abz: We have 9 subscribers
04:16:11<SamB_XP>dmwit: it doesn't know any better than to care!
04:16:16<dmwit>I mean, widgetGetName is part of the API for WidgetClass...
04:16:36<dmwit>All instances of it have to provide that function!
04:16:47<dcoutts>dmwit: but the result might depend on which instance it is
04:17:07<dmwit>ACTION blinks
04:17:19<abz>marcweber: will join
04:17:22<abz>brb
04:17:40<dcoutts>dmwit: suppose the WidgetClass provided a method to get the type name as a string and widgetGetName used it? then it'd depend on which instance it is
04:17:54<MarcWeber>abz: I'm interested in adding fastcgi support, too. But I'm still struggling with WASH source code...
04:18:06<dcoutts>dmwit: of course in this case it doesn't actually matter, but there's no way from the outside to see that
04:18:14<dcoutts>ACTION -> lunch
04:18:16<dmwit>So there's no dynamic dispatch?
04:18:21<dmwit>Okay, I guess that makes sense.
04:24:26<jcreigh>lol...I was wondering why my chess engine was so slow after a minor refactor. turns out that runghc isn't as fast as ghc -O... :)
04:24:29<MarcWeber>ACTION has to checkfs his disks
04:27:21<SamB_XP>dmwit: well there is dynamic dispatch
04:27:29<SamB_XP>but the Haskell compiler knows nothing of that
04:27:48<dmwit>hm?
04:27:54<SamB_XP>it happens in C land
04:28:05<dmwit>Now I'm confused again.
04:28:35<dmwit>If there's definitely enough information at runtime to do the calculation, and it is easy to see at compile time that there will be enough information at runtime, why should the compile fail?
04:28:45<SamB_XP>you aren't familiar with the object oriented language known as C?
04:29:11<dmwit>Wait, are you saying that there is dynamic dispatch, but only in other languages?
04:29:29<SamB_XP>well, the Haskell compiler doesn't know anything about this, and anyway the typesystem doesn't allow it ;-)
04:30:10<dmwit>So, let me say more specifically that I was asking whether *Haskell* has dynamic dispatch.
04:30:34<SamB_XP>nope
04:30:43<dmwit>ok
04:30:49<SamB_XP>C doesn't have it either, though ;-P
04:31:15<dmwit>Well, it does if it's hand-crafted. ;-)
04:31:23<SamB_XP>yeah ;-)
04:32:32<dmwit>This reminds me of that joke where in the punchline, the guy says,
04:32:46<dmwit>You must be a mathematician, because what you said is completely true, but totally unhelpful.
04:32:50<dmwit>=P
04:33:52<SamB_XP>well, I can't help it if I see a false statement and try and correct it!
04:34:01<dmwit>=D
04:41:51<SamB_XP>at least I try to restrain myself during classes
04:42:18<dmwit>Heh, yeah, the person who corrects the prof always looks sort of silly.
04:42:47<dmwit>Plus, if you hold back, you get to feel superior! "I figured that mistake out ages before the other guy." =)
04:43:21<SamB_XP>I find that my lab group doesn't like it so much ;-)
04:43:53<SamB_XP>(when I refrain from pointing out mistakes)
04:45:10<sorear>There's a certain satisfaction to be had from correctly correcting the prof.
04:45:21<SamB_XP>yeah.
04:45:24<SamB_XP>but it can take time
04:45:35<SamB_XP>so it is best to save it for break and/or after class ;-)
04:46:13<dmwit>It is a delicate art.
04:46:28<dmwit>I find that "clarifying" certain points is an effective form of correction.
04:46:51<SamB_XP>another way to do it is to say that you are confused
04:54:00<glguy>ACTION wonders what blue cheese would smell like when it goes bad
04:56:08<glguy>and furthermore :) who looked at this stuff and said "hmm, that dairy product looks moldy enough, I'll try eating it
04:56:49<abz>MarcWeber: joined
04:57:33<dino->glguy: Oh come on now, the bleu-class cheeses are delicious.
04:57:55<glguy>dino-, I'm not sitting here eating blue cheese on crackers because I like punishment :)
04:57:56<dino->I actually did have a Roquefort go bad recently. It smelled foul in a way that was unlike its normal foulness.
04:58:25<dino->There was mucus.
04:58:55<glguy>maybe you'd just discovered a new cheese?
04:59:26<dino->heh, that could be
05:01:02<sorear>Muahahaha.
05:02:06<allbery_b>remember that italian cheese with worm in it
05:02:09<allbery_b>worms
05:02:15<dino->Ok, that's nasty.
05:02:29<sorear>Why isn't : newtype Foo# = Foo# Int# : legal?
05:02:30<allbery_b>you can't eat it until you've left it in a paper bag for a day so the worms come out
05:02:45<glguy>why does the paper bag drive them out?
05:02:48<sorear>it seems like it should define a new type of kind #
05:03:05<allbery_b>ACTION doesn't know and isn't sure he wants to know
05:04:05<allbery_b>as to cheese in general (and I say this as a cheese lover) I have to assume someone got desperate when their milk went bad
05:07:38<glguy>ugh, I hate when minesweeper forces you to guess
05:07:48<glguy>especially at the end of a large level
05:09:35<jcreigh>well, it is NP-complete and all
05:10:08<glguy>sure, but so is sudoku
05:10:33<jcreigh>you have to backtrack to solve sudoku as well.
05:10:37<glguy>and sudoku puzzles that require guessing are considered malformed by many :)
05:10:53<glguy>well... I consider minesweeper in the same sense
05:11:26<sorear>glguy: look at simon tatham's puzzle collection
05:11:47<sorear>glguy: portable, has minesweeper and a couple gazillon others
05:12:05<sorear>and an option to never generate puzzles that require backtracking
05:12:15<sorear>unfortunately it requires a GUI :(
05:12:18<glguy>heh
05:12:35<jcreigh>whoa, author of putty?
05:12:36<sorear>http://chiark.greenend.ac.uk/~sgtatham/
05:12:41<jcreigh>SimonTatham++
05:12:43<sorear>jcreigh: yerp
05:13:26<sorear>@flush
05:14:45<sorear>ACTION obsessivly checks #haskell stats
05:15:47<Heffalump>ACTION used to work with him
05:16:12<sorear>cool!
05:16:18<sorear>dons: ping
05:26:52<dons>this is rather nice, http://programming.reddit.com/info/1fh8x/comments
05:26:53<lambdabot>Title: What Haskell teaches us about writing Enterprise-scale software (reddit.com)
05:43:02<sorear>nice. on my system unaligned word writes are twice as slow as aligned (256k buffer). still 25% faster than byte writes though
05:44:07<dcoutts>that makes sense
05:44:23<dcoutts>since for an unaligned access the cpu needs to do two aligned accesses
05:44:50<sorear>OTOH, the breaking is done in hardware (i386).
05:45:18<dcoutts>so an unaligned word read/write primitive would want to use byte reads/writes on hardware that doesn't allow unaligned access and on system that do allow it then use it
05:45:29<dcoutts>sorear: breaking?
05:45:39<sorear>into two accesses
05:45:45<dcoutts>right
05:45:48<narain>if i want to make a data type which combines two things of different types, is it more idiomatic to make it a record type or simply a pair?
05:45:56<dcoutts>hence faster than doing it manually in code
05:46:15<dcoutts>narain: depends how much you need to use it
05:46:32<dcoutts>for a one off I'd use a pair
05:46:32<sorear>also, the p4 manual says that unaligned writes are much slower on the p4 than previous processors, since they eliminated the integer-unit shifter
05:46:52<narain>dcoutts: almost all the time
05:47:09<sorear>so that 33% faster includes the time needed to send the data all the way from the store unit to the mmx unit and back
05:47:17<dcoutts>sorear: still it's probably quicker than using multiple instructions to do byte reads/writes
05:47:25<dcoutts>right
05:47:42<sorear>dcoutts: plus, I'm benchmarking on a p4 :)
05:47:46<narain>dcoutts: i take it you would recommend a record in that case?
05:47:53<sorear>unfortunately we still don't have unaligned access primops
05:47:57<dcoutts>narain: aye
05:48:03<dcoutts>sorear: you could write one for us ;-)
05:48:11<narain>dcoutts: ok, thanks!
05:48:36<sorear>perhaps even in big/little/host endian versions!
05:48:44<dcoutts>go for it
05:48:51<sorear>i386 has an opcode for byteswapping
05:48:54<dcoutts>narain: there's no hard and fast rule, just go for whichever feels nicer
05:49:15<dcoutts>sorear: I'm not suggesting going that low level
05:49:33<dcoutts>unless you want to pattern match that case in the x86 NCG
05:49:56<narain>dcoutts: i usually do, but my gut instinct wasn't telling me anything in this case
05:50:14<narain>so i thought i'd rely on received wisdom and do whatever was more idiomatic
05:50:39<sorear>heh. no, i don't think I'm going to mess with the NCG as my first hacking in ghc, sounds way too easy to introduce subtle codegen bugs
05:51:14<sorear>ACTION is probably over-estimating the fragility of ghc
06:01:09<narain>hmm... when defining a monad, i can't just supply my own definition of join directly, can i?
06:01:17<narain>:t join
06:01:19<lambdabot>forall (m :: * -> *) a. (Monad m) => m (m a) -> m a
06:02:57<sorear>right.
06:03:09<sorear>join is outside the class, stupidly.
06:03:31<narain>that's a little annoying, because i'm thinking of my monad in terms of fmap and join
06:04:43<narain>so i'll define >>= using join but have to tuck join into a where clause
06:05:04<sjanssen>the default definitions would probably be cyclic if join was in the class
06:05:52<narain>but that would be ok because of laziness, right? :)
06:05:59<sorear>sjanssen: Eq
06:06:05<sorear>@src (==)
06:06:06<lambdabot>x == y = not (x /= y)
06:06:09<sorear>@src (/=)
06:06:09<lambdabot>x /= y = not (x == y)
06:06:36<sorear>@src compare
06:06:36<lambdabot>compare x y | x == y = EQ
06:06:37<lambdabot> | x <= y = LT
06:06:37<lambdabot> | otherwise = GT
06:06:39<sorear>@src <=
06:06:39<lambdabot>x <= y = case compare x y of { GT -> False; _other -> True }
06:06:42<sjanssen>yeah, Ord too
06:06:48<narain>i remembered seeing that and convincing myself it was ok
06:06:48<sorear>@src show
06:06:49<lambdabot>show x = shows x ""
06:06:51<sjanssen>I guess it's not a big deal then :)
06:06:51<sorear>@src shows
06:06:52<lambdabot>Source not found. Just what do you think you're doing Dave?
06:06:55<sorear>@src showsPrec
06:06:56<lambdabot>showsPrec _ x s = show x ++ s
06:07:03<sorear>show is cyclic too!
06:07:30<sorear>@src (-)
06:07:30<lambdabot>x - y = x + negate y
06:07:33<sorear>@src negate
06:07:34<lambdabot>negate x = 0 - x
06:07:39<sorear>ACTION stops
06:07:44<sjanssen>bah, those are all over
06:08:06<sjanssen>and they're really not very nice -- there's no way for the compiler to give good warnings
06:08:26<sorear>there is imo
06:08:27<sjanssen>and the runtime behavior is just an infinite loop
06:08:34<narain>ah, #haskell, when you can ask a simple question and be taken on a whirlwind tour of the unique corners of the language
06:08:46<sorear>we can for each class infer a default method dependency graph
06:08:49<sjanssen>yeah, we could add a pragma or something that shows the dependency graph
06:09:07<sjanssen>sorear: but sometimes the cycles are intentional
06:09:11<sorear>then for each instance we create a pruned graph with the overriden methods removed
06:09:29<sorear>then for each instance, we warn if the pruned graph is still cyclic
06:09:35<sjanssen>or could theoretically be cyclic
06:09:49<sorear>sjanssen: emphasis on 'sometimes'
06:10:06<sorear>sjanssen: ndm is the only one here who complains about -Wincomplete-cases
06:10:21<sjanssen>why does ndm complain?
06:10:23<sorear>and he probably wouldn't if his thesis wasn't about improving it
06:10:26<sorear>catch?
06:10:54<sjanssen>oh right, the incomplete case checker is broken
06:11:24<sjanssen>I've seen those bugs before
06:15:58<narain>:t join . fmap
06:16:00<lambdabot> Occurs check: cannot construct the infinite type: f = (->) (f a)
06:16:00<lambdabot> Probable cause: `fmap' is applied to too many arguments
06:16:04<dmwit>?remember narain ah, #haskell, where you can ask a simple question and be taken on a whirlwind tour of the unique corners of the language
06:16:04<lambdabot>Done.
06:16:07<narain>:t (join .) . fmap
06:16:09<lambdabot>forall a a1 (f :: * -> *). (Monad f, Functor f) => (a1 -> f a) -> f a1 -> f a
06:16:19<narain>:t (>>=)
06:16:21<lambdabot>forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b
06:16:39<narain>hmm, almost
06:16:58<dmwit>?unpl (join .) . fmap
06:16:58<lambdabot>(\ d i -> (fmap d i) >>= \ e -> e)
06:17:07<Cheery>today I get radical and remove all the unnecessary declaration choices and ugly possible values from cascading style sheets
06:17:08<dmwit>... =(
06:17:09<narain>?pl \m f -> join (fmap f m)
06:17:09<lambdabot>(join .) . flip fmap
06:17:34<Cheery>die shitty w3c!
06:17:50<dmwit>Yay!
06:19:28<narain>Cheery: what's this about, if i may ask?
06:19:50<Cheery>yesterday's thing
06:20:06<narain>Cheery: i wasn't there
06:21:57<Cheery>I'm writing a css generator, yesterday decided to remove all which shouldn't be there
06:23:21<narain>css... *generator*? i wouldn't think generating output in a language would send you into ugly corners of the spec
06:23:35<narain>that usually happens when trying to parse, not generate... ?
06:23:54<Cheery>so, this looks even more uglier when parsed?
06:24:11<narain>i wouldn't know
06:24:25<narain>i was speaking about languages in general
06:25:21<narain>i never found css ugly myself though
06:25:39<narain>offtopic: what's the syntax for single-line comments in haskell?
06:25:51<Cheery>well, css problems are that there are some things which are obsolete / horrible in practise / available by other means
06:26:07<Cheery>this is your code -- this is your comment
06:26:14<narain>oh right thanks
06:26:23<Cheery>multiline is {- COMMENT -}
06:27:09<Cheery>another css problem is that each property accepts totally different set of values, while they accept same sort of values
06:28:01<narain>hmm
06:28:33<Cheery>good example is font-size
06:29:03<narain>..., x-small, small, um medium?, large, x-large, ...
06:29:10<Cheery>there's xx-small, x-small, small, medium, large, x-large xx-large smaller, and in the end you can just give a length or percents
06:29:29<narain>are there smaller and larger also?
06:29:36<narain>i forget
06:30:48<Cheery>font-weight is ridiculous in kind
06:31:05<Cheery>normal bold bolder light 100 200 300 400 500 600 700 800 900
06:31:32<narain>well, they tried to keep to what the standard was in typography
06:31:57<narain>it's not like they could make up their own measures of typeface weight
06:32:16<narain>(i assume this is what they did, at least)
06:33:04<narain>to what purpose are you generating css? are you trying to cover all possible cases?
06:33:05<Cheery>I think they could have, anyways, the cascading style sheet is used mainly with web sites, not for typography
06:33:48<narain>well (1) it can be used in print (2) it's supposed to be used also by designers
06:33:57<Cheery>nah, I tried that, I think I'm fed up with it, now things are going to fly and bend
06:34:59<Cheery>what's the role of visibility and display -properties?
06:35:03<narain>what's your css generator for, anyway? if you don't need to cover all cases you could just pick the bits which are easy to generate and/or of interest to you and generate those
06:35:20<narain>visibility hides an element but it still takes up space
06:35:25<narain>display eliminates it completely
06:35:38<sorear>@users
06:35:38<lambdabot>Maximum users seen in #haskell: 336, currently: 273 (81.3%), active: 20 (7.3%)
06:35:51<Cheery>my target is just web sites
06:35:58<narain>display also changes other things
06:36:09<Cheery>narain: so, what's the point of an element if it is hidden?
06:36:09<narain>like you could make a list display inline instead of as a block
06:36:26<Cheery>ie. why leave the blank space in those cases?
06:37:01<narain>hmm i feel like i used it once but i can't recall why
06:37:36<narain>doesn't the spec suggest any uses?
06:38:09<hyrax42>aren't there non-standard selectors for hover &c.?
06:38:19<allbery_b>ACTION curses sorear --- he's wasted the last 45 minutes playing those puzzles instead of going to bed :)
06:38:23<hyrax42>they can change the visibility
06:38:34<sorear>muahahaha!
06:38:39<hyrax42>also I believe I've seen hidden used for browser warnings
06:38:49<narain>hyrax42: hover is a standard selector
06:38:52<hyrax42>serve the same HTML, different CSS based on user agen
06:39:08<hyrax42>so a warning can be hidden and shown for NS 4.7 or something
06:39:32<sorear>a lot of hidden's raison d'etre is that it can be set from javascript
06:39:54<hyrax42>and you get all these "pure CSS dropdowns" that I assume use hover and hidden for magic
06:40:34<narain>i think the question is why would you ever want to use hidden instead of display:none
06:40:57<narain>if you have something hidden, it still takes up space if it's in the normal flow
06:41:18<hyrax42>oh I confused them
06:41:25<narain>which you would often not want because it would look like empty space sitting there for no reason
06:41:26<hyrax42>narain: for really annoying link-stles
06:41:29<hyrax42>tyles
06:41:32<hyrax42>styles
06:42:25<narain>yeah, the only reason i can think of is if you have something in the normal flow which is revealed interactively and you don't want the following text to jump around
06:42:43<Cheery>I've already removed all related to background images because they indicate immature style and are the easiest thing to make web pages hyper unreadable
06:42:45<narain>like awful link styles, as you said
06:42:57<hyrax42>speakng of jumping around, I hate it when people change the typeface on hover for links
06:43:07<narain>background images ... indicate immature style? :)
06:43:12<hyrax42>I'd actually rather the text disappear than have it get reflowed
06:43:19<narain>often... but not necessarily always
06:43:27<Cheery>hmm, I wonder whether I could find some sites with background images
06:43:36<Cheery>I think they all suck
06:43:42<hyrax42>myspace.com
06:43:55<narain>http://www.squidfingers.com/patterns/
06:43:56<lambdabot>Title: Squidfingers / Patterns
06:44:17<narain>stylish tileable pixel backgrounds
06:44:20<Cheery>http://users.nac.net/falken/annoying/backgrounds.html
06:44:21<lambdabot>Title: Background Images
06:44:24<narain>never used them personally
06:44:38<narain>Cheery: hahaha
06:45:18<narain>Cheery: good use of background images: http://www.cameronmoll.com/
06:45:19<lambdabot>Title: Authentic Boredom ~ Delivered weekly by Cameron Moll
06:48:04<narain>what's -fallow-undecidable-instances all about?
06:48:13<Cheery>narain: those squidfinger patterns would be mostly annoying, I think
06:48:52<sorear>narain: it allows instances even when the compiler can't decide them
06:48:53<narain>well i certainly don't advocate putting them everywhere
06:49:28<sorear>narain: so that option gives GHC licence to crash when a type error occurs
06:49:41<narain>hmm, i don't like the sound of that
06:49:46<sorear>narain: but if you don't mess up, it gives you much more oleg-power
06:49:53<sorear>crash means infinite loop here
06:50:32<sorear>you can set it on a module-by-module basis, which lets oleg write his modules without making your code unsafe
06:50:33<narain>i'm having trouble with a mptc and ghc's telling me i might want to use that flag
06:50:45<sorear>coverage condition?
06:50:45<Cheery>lol
06:50:47<Cheery>http://users.nac.net/falken/annoying/main.html
06:50:48<lambdabot>Title: How to make an Annoying Web Page
06:51:15<sorear>class Foo a b | a -> b instance Foo a b => Foo (X a) (X b) -- something like this, narain?
06:51:47<sorear>the compiler doesn't normally look at fundeps on the left of => to decide if the fundeps on the right are satisfied
06:51:56<narain>no, i'm not using fundeps
06:51:59<sorear>so that example, while perfectly safe, needs -fallow-undecidable-instances
06:52:09<narain>class Foo a b where bar :: a -> a -> a
06:52:23<sorear>er, why don't you use b?
06:52:31<sorear>in the type
06:52:40<narain>well, there are other things in the class
06:52:46<narain>one of them happens to not need b
06:53:00<sorear>what kind of class is this?
06:53:05<sorear>the affine space?
06:53:21<sorear>the usual fix for this is fundeps
06:53:22<narain>a class of linear transformations, yes
06:53:40<narain>hmm, ok i'll try that
06:53:47<sorear>class LinTrans pointy veccy | pointy -> veccy, veccy -> pointy
06:54:06<narain>no that's not exactly what it is but i'll try it out anyway
06:54:12<narain>fundeps i mean
06:55:44<narain>it worked!
06:55:45<Cin>hello. I'm trying to understand the following code: parseNumber :: Parser LispVal (new line) parseNumber = liftM (Number . read) $ many1 digit
06:55:49<Cin>is this defining a monad?
06:55:59<sorear>no
06:56:03<sorear>that's a value
06:56:08<sorear>all monads are types
06:56:21<Cin>oh I see
06:56:24<sorear>monad operations are used to construct the value however
06:56:35<Cin>so its -type- is a monad, but it is a value
06:56:45<sorear>like foo = 2 + 2 doesn't define a kind of number even though it uses +
06:56:46<sorear>yes
06:56:47<Cin>okay
06:57:00<narain>sorear: i'm not sure i wanted the fundep though
06:57:29<narain>i can think of theoretical cases where a may not imply b
06:57:32<sorear>narain: what are the types a and b?
06:58:19<narain>a is a spatial transformation type and b is a vector type
06:58:43<sorear>like rotate, reflect, etc?
06:59:00<narain>class Transform t v where
06:59:03<narain>ident :: t
06:59:10<narain>apply :: t -> v -> v
06:59:17<narain>compose :: t -> t -> t
06:59:21<narain>inv :: t -> t
06:59:23<narain>you get the idea
06:59:31<sorear>you can think of t as being analagous to (v -> v)
06:59:33<Cin>so, (many1 digit) collects digits into a string?
06:59:37<narain>sorear, yes
06:59:48<sorear>so any given monotype t only works on one kind of v
07:00:01<sorear>just as any monotyped function only works on one type of argument
07:00:06<narain>well i could have different implementations of vectors... no?
07:00:15<narain>(in theory)
07:00:34<sorear>In that case, the usual approach is to split the class.
07:01:13<sorear>class Transform t where
07:01:13<sorear> ident :: t
07:01:13<sorear> compose :: t -> t -> t
07:01:13<sorear> inv :: t -> t
07:01:16<sorear>class Transform t => Transform2 t v where
07:01:19<sorear> apply :: t -> v -> v
07:01:40<sorear>but it will be harder to use that way - more ambiguity errors
07:01:54<narain>hmm, i see, that seems to make sense
07:03:13<narain>i probably could have avoided all this trouble by not using MPTCs in the first place, but i felt like making all my types instances of type classes :)
07:03:28<sorear>hehe.
07:04:31<narain>well, thanks a lot sorear, you really helped clarify all this
07:04:36<sorear>yw
07:05:41<narain>at this rate i'll keep playing with the type system and never get anything implemented :(
07:06:11<narain>*at the rate i'm going
07:13:46<Cin>parseNumber = liftM (Number . read) $ many1 digit -- so this grabs all the digits from a string to a string, then converts that string to an number, and that is then converted to a Number...?
07:14:02<sorear>precisely.
07:14:33<Cin>bare with me
07:15:23<Cheery>what is the point of separated-borders?
07:15:24<Cin>so far, that's defining operations. but we want parseNumber to return an actual Number so liftM is used? :
07:15:49<Cheery>or wait, border-collaps
07:16:24<sorear>yes.
07:16:37<sjanssen>Cin: liftM "lifts" a normal function into a monadic one
07:16:41<sjanssen>@hoogle liftM
07:16:42<lambdabot>Monad.liftM :: Monad a => (b -> c) -> a b -> a c
07:16:42<lambdabot>Control.Monad.liftM :: Monad m => (a1 -> r) -> m a1 -> m r
07:16:42<lambdabot>Monad.liftM2 :: Monad a => (b -> c -> d) -> a b -> a c -> a d
07:17:03<Cin>yes, I found that confusig
07:18:29<sjanssen>"liftM :: Monad m => (a -> b) -> (m a -> m b)" takes a function from a's to b's, and creates a new function that takes a's wrapped in m and yields b's wrapped in m
07:20:09<Cin>sjanssen, takes a function from a's what?
07:20:46<sjanssen>I mean that it is a function that takes an a and yields a b
07:20:52<sorear>ooh, nice, first reply to my perf post was direct SPJ
07:21:22<sjanssen>I mean that it is a function that takes an 'a' and yields a 'b' (single quotes around type variables to eliminate ambiguity)
07:23:29<sjanssen>let's look at your example. "Number . read" has type "String -> Expr"
07:23:59<sjanssen>and "many1 digit" has type "Parser String"
07:24:17<Cin>okay
07:24:34<sjanssen>so in the example code, liftM has the type "(String -> Expr) -> (Parser String -> Parser Expr)"
07:25:02<Cin>I see
07:25:47<sjanssen>in English, you could say: given a transformation from Strings to Exprs, we have a transformation from Parsers of Strings to Parsers of Exprs
07:26:23<Bourbaki>does anyone know this book? "The Haskell Road to Logic, Maths and Programming" and if so is it any good?
07:27:52<Cin>sjanssen: hm, right. I think I'll read more of A Gentle Introduction to Haskell
07:28:04<osfameron>"Gentle"!
07:28:43<Cin>hehe
07:29:27<osfameron>all the online haskell tutorials terrify me. I am just about able to read the School of Expression without turning into a gibbering Cthulhu cultist however
07:29:38<Cin>haha
07:29:53<sjanssen>osfameron: I've heard that YAHT isn't so bad
07:30:14<osfameron>the writing and explanations of YAHT are poor, but the exercises are well chosen.
07:30:30<sorear>night all.
07:30:39<sjanssen>goodnight sorear
07:30:44<osfameron>nighty
07:31:27<Cin>I'm doing Write Yourself a Scheme in 4 Hours, but I find myself wondering about most of it.
07:31:56<sjanssen>Write Yourself a Scheme isn't exactly introductory material
07:32:09<osfameron>it seems to help if you already know both scheme and haskell
07:32:39<Cin>oh, okay
07:32:46<Cin>A Gentle Introduction is the way to go?
07:33:05<sjanssen>Cin: have you done some sort of functional programming before?
07:33:35<Cin>sjanssen, not really. I have been doing Common Lisp for a few months, but it's been mainly in an imperative style
07:34:13<osfameron>the "Gentle" of the Gentle introduction is a little bit like the sadistic mocking "We're not going to hurt you" of Mafia hitmen
07:35:25<Cin>it seemed quite acceptable of what I'd read of it. but I got a little bored because I wasn't taking anything in. if I sat writing up my own examples with a compiler, I think that would work quite well as a way of learning
07:35:43<sjanssen>Cin: try the gentle intro, just remember that there are other resources that are actually gentle, if you get stuck
07:36:18<sjanssen>YAHT and the wiki book are what most people recommend
07:36:37<Cin>sjanssen, okay, thanks. I'll have a look at those too
07:38:46<osfameron>actually... the gentle introduction looks less scary now after having read some other stuff - looks like a good reference
07:41:12<Cheery>ok, now I removed the most useless css -stuff
07:41:27<Cheery>now there's about 35 or 40
07:42:28<_roconnor>@docs System
07:42:29<lambdabot>System not available
07:42:34<_roconnor>@hoogle system
07:42:35<lambdabot>System.system :: String -> IO ExitCode
07:42:35<lambdabot>System :: module
07:42:35<lambdabot>System.Win32.Info.SystemColor :: type SystemColor
07:42:46<_roconnor>@docs System.system
07:42:47<lambdabot>System.system not available
07:48:48<_roconnor>@type when
07:48:50<lambdabot>forall (m :: * -> *). (Monad m) => Bool -> m () -> m ()
07:49:18<_roconnor>@type (\x -> x >> return ())
07:49:20<lambdabot>forall (m :: * -> *) a. (Monad m) => m a -> m ()
07:53:57<andersca>hello
07:54:30<bdash>andersca: hi!
07:54:48<andersca>bdash: hah! didn't expect to see you here! :)
07:59:21<joelr1>good morning!
08:00:25<dons>hey joelr1 , you might be interested in today's good news story, http://article.gmane.org/gmane.comp.lang.haskell.cafe/21159
08:00:26<lambdabot>Title: Gmane -- Mail To News And Back Again
08:01:09<joelr1>dons: the one you posted? i have reddit in my google reader ;)
08:01:21<dons>hah
08:01:32<joelr1>dons: thanks for the tip, though. it was a welcome email when i received it on haskell this morning
08:02:02<joelr1>dons: i plan to do something similar but using happs. no particular reason apart from alex's goals towards amazon ec2 and s3
08:02:29<joelr1>dons: plan = do it before the end of the month
08:03:55<joelr1>dons: mine is supposed to be a money-making haskell web app of my own
08:06:41<dons>wonderful. i wish you success and may your lambdas always beta reduce.
08:07:06<joelr1>dons: i'm translating from a custom trading systems programming language to c# and plan to sell translations on the web
08:08:05<olliej>dons: my thesis is finally had its final submission (about 10 months after the original submission -- grumble)
08:08:26<joelr1>dons: i wrote a working translator in ocaml in about a month, learning ocaml included. then had conceptual trouble deploying it on the web. i thought about ruby + ocaml, etc. then remembered the warn and fuzzy haskell feelings and started a rewrite.
08:09:05<dons>congratulations olliej !
08:09:25<olliej>dons: soon the pain than is my writing will be recorded forever
08:09:40<dons>ACTION disappears to finish two icfp papers in two days... WRITE WRITE WRITE!
08:09:48<Syzygy->Go dons, go!
08:10:01<Syzygy->olliej: http://www.phdcomics.com/comics/archive.php?comicid=844
08:10:02<lambdabot>Title: Piled Higher and Deeper
08:12:11<olliej>Syzygy-: mines's a real degree dammit -- it's only being mailed to me because i'm no longer in the country :D
08:12:21<olliej>... it better be a real degree anyway
08:12:24<olliej>:D
08:12:30<alec>:)
08:12:38<Syzygy->olliej: You're not familiar with phdcomics, I hear....
08:12:39<robreim>I'm trying to build/install the network library with hugs using cabal. I did 'runhugs -98 ./Setup.hs configure', but 'runhugs -98 ./Setup.hs build' returns the error message 'ERROR "dist/build/Network/BSD.hs" - Can't find imported module "GHC.IOBase"'. I'm guessing there's some sort of hsc2hs or cpphs trick I need?
08:13:01<Syzygy->ACTION linked it for the empty feeling of "Well, that was the thesis .. now what...", not for the mailing quip.
08:13:52<olliej>Syzygy-: hehe
08:14:11<olliej>Syzygy-: i slept for a whlie
08:14:16<olliej>*while even
08:14:28<Syzygy->In the storyline, the guy handing in there really is a PhD at a regular university; not a customer at some scheme...
08:14:40<Syzygy->Go read the comic though - if you're doing academia it's well worth it.
08:14:50<olliej>Syzygy-: i've escaped academia
08:14:55<alec>robreim: did you get it from darcs, hackage, or somewhere else?
08:14:59<olliej>i dno't feel like inflicting a phd upon myself
08:15:02<Syzygy->Ok, then for the nostalgia of it. ;)
08:15:04<robreim>alec: darcs
08:15:06<olliej>heh
08:15:25<alec>robreim: sounds like either the preprocessor isn't picking up hugs or the darcs version is broken for hugs because of a ghc dependency
08:16:32<alec>robreim: did you try passing the '--hugs' flag to the configure step?
08:16:42<robreim>Nope, I'll try that.
08:17:24<robreim>No difference.
08:18:16<alec>robreim: that's the extent of my hugs experience, I won't be of much further help
08:18:44<robreim>thanks for your help
08:21:23<robreim>I do have cpphs-hugs and hsc2hs-hugs installed on my computer (running debian with the 'experimental' distribution of hugs) but using the --with-(cpphs|hsc2hs) flags set to those different commands doesn't seem to make any difference.
08:23:06<sjanssen>@remember dons i wish you success and may your lambdas always beta reduce.
08:23:06<lambdabot>Done.
08:58:35<joelr1>sjanssen: yes, that's a very good one! :D
09:01:36<tsp>> let swedishSwearWords = [("anteckningar","shit"),("tillbehör","penis")] in first (first swedishSwearWords))
09:01:36<lambdabot> Parse error
09:01:54<tsp>damn, my new swedish swear words gave a parse error
09:02:13<tsp>> "anteckningar tillbehör"
09:02:14<lambdabot> "anteckningar tillbeh\246r"
09:02:23<opqdonut>> first (1,2)
09:02:24<lambdabot> add an instance declaration for (Arrow (,))
09:02:24<lambdabot> In the expression: first (1...
09:02:32<opqdonut>see, firsting doesn't work for tuples
09:02:44<opqdonut>:t first
09:02:46<lambdabot>forall (a :: * -> * -> *) b c d. (Arrow a) => a b c -> a (b, d) (c, d)
09:02:52<tsp>thought I was giving it a tuple?
09:02:53<opqdonut>and besides i think that is not the first you want?
09:02:55<joelr1>@where FilePath
09:02:55<lambdabot>http://www-users.cs.york.ac.uk/~ndm/projects/libraries.php#filepath
09:02:56<lypanov>huh...
09:03:01<lypanov>isn't it just because you did )) ?
09:03:19<tsp>maybe it doesn't like the swedish swear words
09:03:33<lypanov>your ()s don't match up
09:03:35<tsp>oh
09:03:38<lypanov>ACTION is a haskell beginner so ignore him if need be
09:03:40<Syzygy->tsp: You call that a swearword?
09:03:46<lypanov>where beginner == hasn't used it :P
09:03:54<tsp>I'm assuming they're swear words
09:04:05<opqdonut>> let swedishSwearWords = [("anteckningar","shit"),("tillbehör","penis")] in head $ fst swedishSwearWords
09:04:06<lambdabot> lexical error in string/character literal (UTF-8 decoding error)
09:04:11<lypanov>lol
09:04:12<tsp>anteckningar and tillbehör are strange enough
09:04:16<opqdonut>that is probably what you meant
09:04:21<Syzygy->...
09:04:28<joelr1>is there a haskell colorizer for various languages?
09:04:33<Syzygy->anteckningar = notes. tillbehör = accessories.
09:04:35<opqdonut>> let swedishSwearWords = [(1,2),(3,4)] in head $ fst swedishSwearWords
09:04:36<tsp>ah, fst
09:04:36<lambdabot> Couldn't match expected type `(a, b)'
09:04:45<tsp>Syzygy-: lol
09:04:47<opqdonut>> let swedishSwearWords = [(1,2),(3,4)] in fst $ head swedishSwearWords
09:04:48<lambdabot> 1
09:04:49<opqdonut>gah i suck
09:04:57<Syzygy->opqdonut: You want to map somewhere....
09:05:05<tsp>ah, head, that'll work
09:05:19<opqdonut>Syzygy-: i was just trying to guess what tsp wanted to do
09:05:30<Syzygy->Oh, yeah, I kinda missed the start....
09:05:47<opqdonut>nvm
09:06:03<tsp>I tried to learn swedish, but gave up after hej and sverige :)
09:06:34<lypanov>i gave up after jag
09:06:42<tsp>lypanov: heh
09:06:42<lypanov>"Jag ... (tried to etc)"
09:07:13<tsp>I happen to like the verbs - similar to esperanto, jag har/du har/etc - never got to adjectives and adverbs though
09:07:39<Syzygy->lypanov: "Jag försökte" :)
09:07:52<tsp>but I accidentally used the wrong windows iso on my test vm, too lazy to reinstall - so its all in swedish
09:08:00<lypanov>Syzygy-: gave up i guess?
09:08:15<Syzygy->Hehe
09:09:08<tsp>oh, that's why I couldn't telnet to the box - I kept typing administrator, it wants administratör
09:09:14<lypanov>lol
09:09:16<Syzygy->Hehe
09:10:37<tsp>weird, even among windows oses the o isn't showing up right - my screen reader says quote, when its an o when I type it in here
09:10:52<Syzygy->oO
09:11:01<Syzygy->You use a screen reader?
09:11:18<opqdonut>tsp: probably charset issue
09:11:35<tsp>yup, screen reader
09:12:01<tsp>luckally enough I have a synth that speaks swedish, even if jag talär svenska inte :)
09:12:07<Syzygy->Hehe
09:12:17<lypanov>inte -> ?
09:12:20<tsp>not
09:12:24<lypanov>ACTION nods
09:12:25<Syzygy->You blind^Wvisually impaired^W^Wwhatever the right term should be?
09:12:29<lypanov>wanted to confirm :)
09:12:29<tsp>Syzygy-: yup
09:12:34<Syzygy->lypanov: inte == not
09:12:39<Syzygy->tsp: Right-o.
09:12:53<Syzygy->First time I encounter someone I know works that way.
09:13:02<tsp>I have the choice of learning english, spanish, swedish, finnish, german, etc - but I finally found a synth that speaks esperanto
09:13:08<Syzygy->Wow!
09:13:11<Syzygy->Cooooooool.
09:13:18<tsp>I even ahve one that speaks chinese, but that is weird
09:13:24<lypanov>i suppose i really should take up esperanto again lol
09:13:36<Syzygy->How do the readers handle mixed languages?
09:13:37<tsp>I need a terminal that supports utf-8 :)
09:13:51<tsp>ah, haskell always breaks on this
09:13:52<Syzygy->Say, if I should start talking swedish or german in here, what'd happen at your end?
09:13:55<Syzygy->Hehe
09:14:07<tsp>> 'Ã¥'
09:14:07<lambdabot> Improperly terminated character constant
09:14:20<tsp>Syzygy-: it'd try to read it currently using an english synth
09:14:29<Syzygy->For that matter, what does haskell code sound like?
09:14:41<tsp>why does it break? I hit the apostrophe, alt-0229, and another ' - it shows up on my end just fine
09:14:56<lypanov>shows up here fine also
09:14:57<tsp>code, and most everything else is just a really fast stream of words
09:14:59<Syzygy->tsp: So it'd be a combination of horribly mispronounced fragments and reading letters?
09:15:09<tsp>http://silenceisdefeat.org/~tspivey/eloquence.flac
09:15:14<tsp>Syzygy-: yup
09:15:29<tsp>reading anteckningar in english and swedish sounds totally different
09:15:36<Syzygy->Oh bugger. The computer I got here doesn't do sound. :(
09:15:48<tsp>wow
09:15:50<tsp>a computer without sound
09:16:10<Syzygy->Well, it has a soudncard, but I don't seem to have access rights to it, and I don'
09:16:25<Syzygy->I don't want to bug the sysadmin about it, since I'm only here for two weeks.
09:16:30<tsp>running windows? you should be able to access it - volume control :)
09:16:36<Syzygy->Nonono, linux
09:16:39<tsp>ah
09:16:41<Syzygy->And I'm very much not root.
09:16:45<Syzygy->So I can't poke at it.
09:16:48<tsp>damn
09:17:00<Syzygy->I'm getting through by bringing my mp3player to work :)
09:17:16<tsp>your at work, on a linux box? neat
09:17:22<Syzygy->Suer
09:17:34<Syzygy->The only ppl here who don't use linux are the MacOS 9 diehards....
09:17:39<tsp>ouch OS 9
09:17:47<tsp>would that even run haskell?
09:17:54<Syzygy->Dunno, wouldn't bet on it.
09:17:57<lypanov>os9?? lol
09:18:05<Syzygy->Though haskell isn't very much around here either.
09:18:15<dmead>lol
09:18:20<Syzygy->Which is funky, since I'm at on of the departments housing Per Martin-Löf.
09:19:05<tsp>lol, my screen reader said martin-loaf due to the ö - how do you type those anyways? I have to hit ^a^v"o
09:19:15<Syzygy->http://en.wikipedia.org/wiki/Per_Martin-L%C3%B6f
09:19:16<lambdabot>Title: Per Martin-Löf - Wikipedia, the free encyclopedia
09:19:28<Syzygy->tsp: I'm in sweden, using a swedish keyboard.
09:19:35<Syzygy->I haev a key dedicated to each of å ä ö
09:19:45<tsp>ah
09:20:19<tsp>I hate this windows terminal emulator - it works great for normal text, but it only supports unicode in japanese
09:20:44<tsp>utf-8 tera term pro
09:21:36<joelr1>folks, can you please try building the deriver library?
09:21:38<joelr1>@where derive
09:21:38<lambdabot>http://www.cs.york.ac.uk/fp/darcs/derive
09:21:47<joelr1>it doesn't build on my end with ghc 6.6
09:21:51<joelr1>and i wonder why
09:21:58<dmead>6.6 isn't on portage yet
09:22:09<Syzygy->It's in the layover though.
09:23:32<joelr1>ugh... portage? layover? what brand of ... ah, gentoo!
09:23:32<eivuokko>Yo.
09:23:54<joelr1>eivuokko: long time
09:24:35<eivuokko>Yeah :)
09:24:57<joelr1>ACTION high-fives eivuokko
09:26:01<eivuokko>Anyone got experiences if newStablePtr/freeStablePtr are expensive to call (calling atleast hundreds of times per second) or for gc? (with ghc rts)
09:26:05<fuzan>is there some function for lifting multiple items? ie. i want to compare three IO Integers, a b c
09:26:13<eivuokko>ACTION returns high-five
09:26:31<joelr1>fuzan: lifM3?
09:26:39<Syzygy->liftM3 you mean
09:26:42<fuzan>:t liftM3
09:26:45<lambdabot>forall a1 a2 a3 r (m :: * -> *). (Monad m) => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
09:26:45<joelr1>yes
09:27:10<fuzan>oh snap, that'll do it. thanks :)
09:27:18<joelr1>i used to wonder what liftMx do until i looked at the implementation
09:27:33<Syzygy->?src liftM3
09:27:33<lambdabot>liftM3 f m1 m2 m3 = do { x1 <- m1; x2 <- m2; x3 <- m3; return (f x1 x2 x3) }
09:27:38<Syzygy->Hehe
09:27:46<joelr1>Syzygy-: that's neat! i didn't know you could do that
09:29:41<dmead>>liftM2 (,) [1..5] [6..10]
09:29:41<joelr1>@paste
09:29:42<lambdabot>Haskell pastebin: http://hpaste.org/new
09:29:49<dmead>> liftM2 (,) [1..5] [6..10]
09:29:51<lambdabot> [(1,6),(1,7),(1,8),(1,9),(1,10),(2,6),(2,7),(2,8),(2,9),(2,10),(3,6),(3,7),(...
09:29:58<dmead>cartesian product
09:30:29<Syzygy->?t guard
09:30:29<lambdabot>Maybe you meant: tell temp time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ft v
09:30:34<Syzygy->?type guard
09:30:37<lambdabot>forall (m :: * -> *). (MonadPlus m) => Bool -> m ()
09:30:44<hpaste> joelr1 pasted "Error compiling derive" at http://hpaste.org/1261
09:30:54<joelr1>any suggestions on how to fix this?
09:31:17<Syzygy->> liftM2 (,) [1..5] [6..10] >>= guard . (\(x,y) -> x+y==10)
09:31:18<lambdabot> [(),(),(),()]
09:31:27<Syzygy->> liftM2 (,) [1..5] [6..10] >> guard . (\(x,y) -> x+y==10)
09:31:28<lambdabot> Couldn't match expected type `[]'
09:32:11<Syzygy->Hmmmm... Some way to do the do x <- a; y <- b; guard (a+b==10); return (a+b) with binds?
09:33:21<dmead>with a comprehension i think
09:33:35<dmead>peoples
09:33:42<dmead>is there a constructor for upper case chars?
09:34:01<dmead>outside of the parsec class
09:34:02<tsp>what does this come out as? Ĉ
09:34:04<tsp>damn
09:34:11<tsp>utf-8 doesn't work on any modern os
09:34:16<dmead>:s
09:34:19<tsp>at least not mine :)
09:34:27<dmead>maybe it's just irc
09:34:31<tsp>maybe
09:34:44<dmead>what did you mean to type?
09:35:00<Syzygy->dmead: Constructor?
09:35:03<tsp>esperanto C
09:35:04<dmead>ah
09:35:06<tsp>it comes up in the shell as a normal C
09:35:13<tsp>but appears in files as an esperanto one
09:35:24<fuzan>tsc, i saw a "? ??" :)
09:35:25<Syzygy->I saw Ä and a white blob
09:35:34<tsp>hmm, I'll put it in a text file
09:35:34<xpika>what does * -> * translate to?
09:35:41<tsp>Ŝ
09:35:49<tsp>I heard a ?
09:35:54<Syzygy->xpika: It's a kind that takes another type in order to generate a basic type.
09:35:57<xpika>as in return :: forall a (m :: * -> *). (Monad m) => a -> m a
09:36:17<tsp>what did taht come out as for you?
09:36:27<Syzygy->xpika: It means that m needs to be a type of kind * -> *, i.e. something that maps types to new types.
09:36:41<Syzygy->tsp: ^S
09:36:46<tsp>ah, there should be a unicode help channel around here somewhere
09:37:02<tsp>damn, it just shows up as either (1) a normal S in the shell, or 2) a ? in irc
09:37:03<Syzygy->#unicode for instance
09:37:14<Syzygy->Topic for #unicode: UNICODE users channel
09:37:19<Syzygy->(and it goes on to more)
09:37:25<tsp>hmm, good idea
09:38:01<xpika>so M needs to be of type data Something x = ...
09:38:48<ski>@kind Maybe
09:38:49<Syzygy->M needs to be something like IO, or [], or Maybe
09:38:51<lambdabot>* -> *
09:38:54<ski>@src Maybe
09:38:54<lambdabot>data Maybe a = Nothing | Just a
09:39:14<xpika>ok
09:39:15<ski>@kind Either
09:39:18<lambdabot>* -> * -> *
09:39:20<ski>@kind Either String
09:39:23<lambdabot>* -> *
09:39:30<xpika>:)
09:40:21<Syzygy->:k Either undefined
09:40:24<lambdabot>Not in scope: type variable `undefined'
09:40:27<Syzygy->Doh.
09:40:32<Syzygy->Is there smoe null type?
09:40:42<ski>Void
09:40:43<ski>?
09:40:53<Syzygy->:k Either Void
09:40:56<lambdabot>Not in scope: type constructor or class `Void'
09:41:09<eivuokko>There isn't for context like that. Usually such type is designated by type variable.
09:41:41<ski>@djinn Either a b -> (a -> Void,b -> Void) -> Void
09:41:41<lambdabot>f a =
09:41:41<lambdabot> case a of
09:41:41<lambdabot> Left b -> \ (c, _) -> c b
09:41:41<lambdabot> Right d -> \ (_, e) -> e d
09:41:42<xerox>?kind Control.Monad.RWS.RWST
09:41:44<lambdabot>* -> * -> * -> (* -> *) -> * -> *
09:41:48<dmead>tsp: hows your haskell coming?
09:42:01<ski>@djinn-env
09:42:01<lambdabot>Plugin `djinn' failed with: IRCRaised Data.ByteString.last: empty ByteString
09:42:07<ski>bah
09:42:51<dmead>ski: you doing some logic too?
09:44:29<joelr1>any template haskell experts in the house?
09:46:54<dcoutts>joelr1: the Q functor instance is almost certainly defined in one of the TH modules
09:47:13<joelr1>dcoutts: oh...
09:47:14<dcoutts>otherwise if it's only in a later version or something then just define it locally
09:47:18<dcoutts>@type fmap
09:47:20<lambdabot>forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b
09:47:22<dcoutts>@type liftM1
09:47:24<lambdabot>Not in scope: `liftM1'
09:47:28<joelr1>M
09:47:30<dcoutts>@type Control.Monad.liftM1
09:47:33<lambdabot>Not in scope: `Control.Monad.liftM1'
09:47:36<joelr1>@type liftM
09:47:38<lambdabot>forall a1 r (m :: * -> *). (Monad m) => (a1 -> r) -> m a1 -> m r
09:47:41<dcoutts>ah yes :-)
09:48:11<joelr1>dcoutts: i guess i have to go fishing through the TH modules. i wouldn't know how to define a local instance
09:48:19<joelr1>meaning what to put in the "methods"
09:48:51<dcoutts>joelr1: notice how the type of fmap and liftM have a remarkable similarity? :-)
09:49:19<joelr1>dcoutts: they look almost the same, yes, except functor is used instead of monad
09:49:21<joelr1>why?
09:51:59<ski>mathematically, every monad is a functor, and its 'fmap' is just 'liftM' as defined by
09:52:03<ski>@src liftM
09:52:03<lambdabot>liftM f m1 = do { x1 <- m1; return (f x1) }
09:52:19<Syzygy->?src IO fmap
09:52:20<lambdabot>fmap f x = x >>= (return . f)
09:52:35<ski>@undo do { x1 <- m1; return (f x1) }
09:52:35<lambdabot>m1 >>= \ x1 -> return (f x1)
09:52:36<Syzygy->See any similarity?
09:53:08<ski>(every instance of 'Monad' ought to be an instance of 'Functor' with 'fmap' being same as 'liftM')
09:53:18<joelr1>yes, yes, just trying to figure out what this has to do with the TH error in http://hpaste.org/1261
09:54:26<ski>(it would be better if 'Functor' was a superclass of 'Monad' .. but we'd like the class system to be more expressive so we can e.g. state defaults nicer ..)
09:56:45<joelr1>dcoutts: it's TH.Syntax
09:58:11<joelr1>dcoutts: but it's imported. weird...
09:58:24<dcoutts>weird indeed
10:00:43<joelr1>dcoutts: if I add a local instance declaration then i get "Data/Derive/TH.hs:23:10: Not in scope: data constructor `Q`" any tips on this?
10:00:49<mnislaih>I can't find the Functor instance fo Q either
10:00:55<joelr1>i guess i have to go fishing for Q
10:01:05<joelr1>mnislaih: TH.Syntax, it's there
10:01:13<joelr1>mnislaih: in ghc 6.6 at leat
10:01:16<joelr1>least
10:02:25<mnislaih>if you were in 6.7, you can say "derive instance Functor Q" inside your module
10:02:27<joelr1>cause Q is exported from TH.Syntax as well
10:02:47<joelr1>is the list of new features in 6.7 posted someplace?
10:02:54<mnislaih>but you can always write the instance manually
10:03:02<mnislaih>or just use liftM
10:03:03<joelr1>mnislaih: i did. see the next error above
10:05:39<joelr1>i'm starting to get this weird feeling... that the sources in darcs that i'm looking at do not match the compiler that i'm using
10:06:14<mnislaih> you are looking at the ghc sources?
10:06:28<joelr1>mnislaih: yes, but i pulled them from darcs so they must be 6.7
10:06:39<joelr1>i'll have to go find my darwinports sources for 6.6
10:07:01<mnislaih>those would be at http://darcs.haskell.org/ghc-6.6/
10:07:02<lambdabot>Title: Index of /ghc-6.6
10:07:24<joelr1>mnislaih: well, that makes my job easier. so hunting for Functor Q I go
10:07:43<mnislaih>but if you are looking for the Language.Syntax.TH, that is at http://darcs.haskell.org/libraries/template-haskell/
10:07:44<lambdabot>Title: Index of /libraries/template-haskell
10:08:29<joelr1>mnislaih: thanks, looking...
10:09:13<joelr1>mnislaih: same thing. look at the instance Functior Q
10:09:15<joelr1>it's there
10:09:18<joelr1>and Q is exported
10:09:26<mnislaih>Thu Mar 22 18:01:42 CET 2007 Ian Lynagh <igloo@earth.li>
10:09:26<mnislaih> * Add instance Functor Q and make Quasi require Functor
10:09:38<joelr1>@#%@#
10:09:38<lambdabot>Unknown command, try @list
10:09:39<mnislaih>that was added a few days ago
10:09:44<mnislaih>:S
10:10:00<joelr1>mnislaih: added to 6.6 a few days ago?
10:10:17<mnislaih>it's not there in 6.6,
10:10:29<joelr1>much grief
10:10:46<mnislaih>yep,
10:10:48<joelr1>still, why does it complain about missing Q?
10:10:57<joelr1>not in scope data constructor Q
10:11:31<mnislaih>because it is not exported
10:12:02<mnislaih>you cannot really define the Functor instance locally,
10:12:13<mnislaih>(I believe)
10:12:45<joelr1>mnislaih: are you on 6.7? how close is that to production?
10:13:07<joelr1>mnislaih: where can i read up on the features? /googling/
10:13:13<mnislaih>it flukes sometimes, but not very often
10:13:32<mnislaih>dont know.
10:14:05<mnislaih>well there is the debugger, stand-alone deriving, a lot of improvements to the type system
10:14:28<mnislaih>and now that Gregory Wright added a ghc-devel MacPort
10:14:32<joelr1>mnislaih: what's standalone deriving?
10:14:52<joelr1>mnislaih: don't see that (macport)
10:14:59<joelr1>i only see 6.5 and 6.7
10:15:02<joelr1>err, 6.6
10:15:04<mnislaih>ask ghc to derive Q for you, even if you didn't define Q yourself
10:15:27<mnislaih>G Wright posted to the glasgow-haskell-users list 2 or 3 days ago
10:16:54<joelr1>mnislaih: looking...
10:18:02<joelr1>found the post
10:18:22<joelr1>i guess i'll just build the darcs version ... but then i'll have to rebuild my libs... argh...
10:18:41<mnislaih>oh, and cabal-install comes there too
10:18:47<joelr1>i guess i gotta look at it as my contribution to ghc development
10:18:53<joelr1>mnislaih: what's cabal-install?
10:19:16<mnislaih>havent seen hackage ?
10:19:20<mnislaih>hackage.haskell.org
10:20:42<joelr1>mnislaih: yes, seen hackage
10:20:47<joelr1>so it pulls from there automatically?
10:21:22<mnislaih>yep
10:23:04<joelr1>mnislaih: does it automatically get invoked when you do runhaskell Setup.hs configure?
10:23:46<mnislaih>no, I don't think so. But you better ask one of the cabal developers, they might have plans for that
10:25:15<joelr1>mnislaih: ok, i'll try to run it
10:26:14<joelr1>mnislaih = pepe?
10:26:22<mnislaih>yes
10:26:30<joelr1>ah, i'll have to remember that
10:26:35<joelr1>@localtime mnislaih
10:26:37<lambdabot>Local time for mnislaih is 2007-04-05 12:26:25 +0200
10:26:45<mnislaih>hm?
10:26:47<joelr1>mnislaih: madrid?
10:26:51<mnislaih>valencia
10:27:03<joelr1>mnislaih: cool! what do you dedicate yourself to?
10:27:13<mnislaih>PhD procrastinating
10:27:21<mnislaih>you are in Mallorca right ?
10:27:28<joelr1>mnislaih: nah, tenerife
10:27:32<mnislaih>ahh
10:28:04<joelr1>but i can't afford to procrastinate :-)
10:30:05<joelr1>mnislaih: i gave meself 1 week to rewrite my translator from ocaml
10:51:30<joelr1>mnislaih: what did you do about System.Console.Readline?
10:52:00<mnislaih>follow the instructions at http://mult.ifario.us/articles/tag/macosx
10:52:49<joelr1>ok
10:52:53<mnislaih>if that's dead, http://hackage.haskell.org/trac/ghc/wiki/X86OSXGhc
10:52:54<lambdabot>Title: X86OSXGhc - GHC - Trac
10:53:48<joelr1>i have readline in macports
10:53:53<joelr1>i guess i should just point to it
10:53:59<mnislaih>yep
11:07:24<mnislaih>joelr1: I forgot to mention, after configure, check that ghc/libraries/readline says READLINE_BUILD_PACKAGE=yes
11:07:44<joelr1>shoot, i didn't
11:07:55<mnislaih>that's ghc/libraries/readline/config.mg sry
11:08:00<mnislaih>config.mk
11:08:20<joelr1>yes, it does
11:08:28<joelr1>maybe i need to do a global distclean
11:08:33<mnislaih>it's all fine then
11:08:54<joelr1>cause just reconfiguring and letting make take over from where it left does not work
11:09:14<mnislaih>you don't need to reconfigure if it was already allright
11:09:29<joelr1>i did need to reconfigure to add readline paths
11:09:43<joelr1>i still get the error from ghci
11:09:46<mnislaih>oh,
11:09:56<joelr1>should i clean in the compiler/ghci and deriver/ghci directories?
11:09:59<mnislaih>yeah, make distclean is the safest way
11:10:09<mnislaih>but you can try to touch InteractiveUI.hs
11:10:20<mnislaih>and make clean only the readline package
11:10:28<mnislaih>not sure if that will do the trick though
11:10:36<joelr1>doing
11:17:07<tsp>I guess if teckningar are notes, I can shorten that to teckning = one of them?
11:17:22<tsp>that's an odd sounding word if I ever heard one :)
11:21:14<joelr1>tsp: are you learning swedish?
11:21:21<Syzygy->teckningar = drawings
11:21:32<Syzygy->And yes, -ar is one of the plural suffices.
11:26:35<joelr1>folks, is there a syntax colorizer in haskell?
11:26:42<joelr1>that can be used for other languages
11:30:24<dons>yeah, HsColour
11:30:27<dons>?where HsColour
11:30:28<lambdabot>http://www.cs.york.ac.uk/fp/darcs/hscolour/
11:30:36<dons>its the one we use on hpaste.org
11:32:15<joelr1>dons: that only colorizes haskell code, though. can be be extended?
11:32:48<SamB_XP>it doesn't even support .txt!
11:32:50<joelr1>i guess i'll need to loook into it
11:36:42<joelr1>what do you make of this error?
11:36:43<joelr1>unknown symbol `_derivezm0zi1_DataziDeriveziPeephole_zdf7_closure'
11:36:50<joelr1>this happens when i run ghci -package derive
11:37:06<joelr1>where derive is something that i just built and installed
11:37:41<phoniq>running that through c++filt might help
11:38:00<joelr1>phoniq: but derive is a haskell package, cabalized too
11:38:45<phoniq>oops. haskell's mangled symbol names look c++ish.
11:47:16<joelr1>mnislaih: have you see this?
11:47:17<joelr1>basicTypes/OccName.lhs-boot:1:0:
11:47:17<joelr1> Failed to load interface for `Prelude':
11:47:42<mnislaih>that would be for stage2 ?
11:48:11<joelr1>mnislaih: i guess. this is when trying to pick up after reconfigure. let me clean, configure and rebuild everything again
11:48:16<mnislaih>oh, yes, that's probably due to split-objs causing trouble
11:48:27<mnislaih>create a custom build.mk with split-objs disabled
11:48:42<mnislaih>you know, in ghc/mk/
11:49:14<mnislaih>and then make clean ; make -j2
11:49:54<mnislaih>joelr1: make sure you disable split objs
11:50:16<joelr1>mnislaih: why would i?
11:50:28<joelr1>mnislaih: doesn't it help? or it fails on mac osx
11:50:52<joelr1>or does it help pick up after a failure?
11:51:03<mnislaih>split objs seem to cause trouble on mac osx. I disabled it a while ago and never looked back
11:52:18<mnislaih>spying the macports settings for ghc-6.6 might give some further info on why
11:53:52<joelr1>mnislaih: fishing for those settings ...
11:55:15<mnislaih>note that everything works finely without split objs, it's just that link times will be a bit longer
11:56:17<joelr1>mnislaih: where should i look for settings in macports? i have 3 files under distfiles/ghc
11:56:23<joelr1>untar the bootstrap files?
11:56:46<mnislaih>I guess in the port file mainly
11:56:52<joelr1>i wish i could just look at the patches
11:57:08<joelr1>mnislaih: silly question, i know, but where's the port file?
11:57:26<mnislaih>dont know in the filesystem. it's all available in the macports subversion repo
11:57:46<mnislaih>let me find the link
11:58:21<mnislaih>http://trac.macosforge.org/projects/macports/browser/trunk/dports/lang/ghc
11:58:23<lambdabot>Title: /trunk/dports/lang/ghc - MacPorts - Trac, http://tinyurl.com/yuucya
11:58:30<mnislaih>there you go, the portfile and the patches are there
11:59:13<joelr1>thanks pepe
11:59:15<joelr1>Plan to throw one away. You will do that, anyway. Your only choice is whether to try to sell the throwaway to customers. - Frederick Brooks.
11:59:29<joelr1>boom! right in the spot
11:59:47<mnislaih>heh :)
11:59:49<joelr1>this has happened to me a couple of times already, except i never sold the throwaway to customers :D
12:00:03<joelr1>mnislaih: happening to me right now, throwing away the ocaml version
12:00:38<mnislaih>viva haskell ;)
12:01:22<joelr1>viva le haskell
12:01:29<joelr1>sounds cooler i think
12:01:45<joelr1>how do the french say viva?
12:02:04<joelr1>pepe, didn't find anything re: split-objs
12:02:41<joelr1>mnislaih: not in the port file anyway. loooking at patches
12:04:18<joelr1>patch files have nothing on that either. but ghc is still building so i'll wait until it fails
12:04:32<joelr1>make -j 2 screams
12:04:42<joelr1>make -j fails with out of memory errors eventually
12:05:34<mnislaih>º
12:06:03<joelr1>mnislaih: i think you are right. editing config
12:07:03<mnislaih>hopefully I'm right. Otherwise you won't be building ghc today :)
12:07:19<joelr1>mnislaih: still, it's strange that there's no patch for it in macports
12:08:10<mnislaih>prolly the port does something that solves the problem with split objs
12:08:17<robreim>Are there any plans to implement a String typeclass to clean up all the different String and ByteString.* functions?
12:08:40<mnislaih>gotta go for lunch
12:08:42<mnislaih>gl joelr1
12:08:44<dcoutts>robreim: not any immediate plans
12:08:53<joelr1>thanks mnislaih
12:09:52<robreim>dcoutts: got any idea what sort of problems such an endeavor might encounter?
12:10:18<dcoutts>type, performance and dependencies
12:10:58<joelr1>dcoutts: duncan, any idea on why a module of an installed library could not be found?
12:11:46<robreim>dcoutts: sorry if it should be obvious to me, but can you elaborate? Perhaps with examples?
12:13:04<quicksilver>joelr1: you got mail :)
12:13:14<joelr1>quicksilver: checking...
12:13:26<quicksilver>let constructorName = takeWhile (/=' ') . show in constructorName (Just undefined)
12:13:29<quicksilver>> let constructorName = takeWhile (/=' ') . show in constructorName (Just undefined)
12:13:30<lambdabot> "Just"
12:13:34<quicksilver>that's pretty interesting
12:13:37<dcoutts>joelr1: the module might not be exposed, the package might not be exposed
12:13:39<quicksilver>not that that:
12:13:41<joelr1>quicksilver: is that you, jules?
12:13:44<quicksilver>> show (just undefined)
12:13:44<lambdabot> Not in scope: `just'
12:13:50<quicksilver>> show (Just undefined)
12:13:51<lambdabot> Undefined
12:13:53<dcoutts>robreim: sorry, no time. I've got to finish a paper.
12:13:57<quicksilver>joelr1: right
12:14:04<robreim>no problem. Thanks anyhow.
12:14:17<dcoutts>robreim: ask me in two days time :-)
12:14:18<quicksilver>joelr1: metaprogramming is great but you don't always needs it; or not as much as many people imagine, anyhow
12:14:36<joelr1>quicksilver: appreciate your email. reading...
12:15:03<Syzygy->> let constructorName = takeWhile (/=' ') . show; test = (23 :: Integer) in constructorName test
12:15:05<lambdabot> "23"
12:15:09<Syzygy->Doh.
12:15:17<robreim>dcoutts: I'll try to remember. In the meantime, best wishes with your paper. Gambatte!
12:15:30<Syzygy->> let constructorName = takeWhile (/=' ') . show; test = (return 15)::Maybe Integer in constructorName test
12:15:31<mux>dcoutts: out of curiosity, what's your paper about?
12:15:32<lambdabot> "Just"
12:15:35<Syzygy->Ah!
12:16:01<quicksilver>and I bet there is a typeclass hack to tell how many parameters a constructor has, too
12:16:04<quicksilver>although not a h98 one
12:16:13<dcoutts>mux: fusion
12:16:38<mux>dcoutts: again! ;-)
12:16:52<dcoutts>mux: up, more fusion
12:17:19<joelr1>quicksilver: awesome suggestions, thanks. i do want to automatically choose the # and type of args, though
12:17:25<mux>great, I wish I could attend your talk
12:17:59<joelr1>i have a suspicion that dons and dcoutts are writing a paper together. maybe two!
12:18:01<joelr1>hehe
12:18:10<dcoutts>@arr
12:18:10<lambdabot>Aye
12:18:16<joelr1>two days... two papers... two days
12:18:44<dcoutts>mux: the conference isn't for months yet but the deadline...
12:19:05<mux>oh
12:20:16<joelr1>@arr
12:20:16<lambdabot>Aye
12:20:21<joelr1>hmm
12:21:48<quicksilver>joelr1: yeah, I know you do
12:21:55<quicksilver>joelr1: I thought the point was interesting to make nonetheless
12:22:54<joelr1>quicksilver: i concur
12:25:34<araujo>morning!
12:26:13<joelr1>@where derive
12:26:14<lambdabot>http://www.cs.york.ac.uk/fp/darcs/derive
12:32:14<hpaste> quicksilver pasted "Counting arguments using a type class" at http://hpaste.org/1262
12:32:22<quicksilver>joelr1: check that paste
12:34:05<joelr1>quicksilver: hmm...
12:34:24<joelr1>quicksilver: i gotta save that pasted!
12:36:34<joelr1>quicksilver: totally love it but i have something like 100 parsers to derive, very tedious by hand
12:36:53<hpaste> quicksilver annotated "Counting arguments using a type class" with "Now it describes the arguments too" at http://hpaste.org/1262#a1
12:36:54<joelr1>quicksilver: i'm saving your tips for other future uses, though
12:37:16<quicksilver>joelr1: now it counts the types and lists them in a concrete data type
12:37:28<joelr1>hmm...
12:37:42<joelr1>let me take that a bit further
12:38:21<joelr1>quicksilver: if you can grab the arg types as a list you can probably generate a list of parsers from it, right? if you were able to attach a type to each parser
12:38:46<tsp>Program som körs!
12:38:54<joelr1>although you would need to collect all your types into the separate ArgTypes ADT.
12:38:59<joelr1>quicksilver: right ^^^
12:39:00<joelr1>?
12:39:04<tsp>just realized I had to reinstall inux :)
12:39:07<tsp>linux
12:39:29<tsp>accidentally deleted the disk
12:39:35<Cale>whoa
12:39:49<Cale>Which linux will you be installing? :)
12:39:54<joelr1>ubuntu!
12:40:04<Cale>Yeah, Ubuntu rocks :)
12:40:43<tsp>arch
12:40:45<Cale>Too bad about your files, eh? Or do you keep a separate home partition?
12:40:53<tsp>Cale: heh, it was my haskell test box
12:40:54<tsp>vmware
12:40:56<Cale>ah
12:41:02<tsp>everything important is on this sparc box
12:41:05<quicksilver>joelr1: sorry, I was tidying it up
12:41:06<joelr1>Cale: big time! that's what i'm using as my amazon EC2 image
12:41:15<joelr1>quicksilver: another paste? :D
12:41:26<hpaste> quicksilver annotated "Counting arguments using a type class" with "tidier, no more quadratic instance explosion" at http://hpaste.org/1262#a2
12:41:26<joelr1>quicksilver: more type class magic?
12:42:02<hpaste> quicksilver annotated "Counting arguments using a type class" with "try again (was tidier, no more quadratic instance explosion" at http://hpaste.org/1262#a3
12:42:23<quicksilver>joelr1: better, don't need instances for each possible a->b->TestType
12:42:35<quicksilver>Cale: care to take a look?
12:42:46<Cale>okay
12:42:48<quicksilver>Cale: objective was to produce a type class framework which can 'introspect' an ADT
12:42:58<quicksilver>Cale: and find out how many parameters, and what types, each constructor has
12:43:07<joelr1>quicksilver: i still see them there, instances for each possible a -> b -> TestType
12:43:15<Cale>Have you looked at SYB?
12:43:19<quicksilver>joelr1: not in the last paste. just one instance for it
12:43:33<quicksilver>Cale: yes; this is just H98 + MPTCs, though
12:43:37<joelr1>quicksilver: instance DescribeArgs (String->TestType) TestType where descArgs _ = [JStr]
12:43:38<Cale>ah, okay
12:43:42<joelr1>this is the last paste
12:43:45<joelr1>the tidier one
12:44:05<quicksilver>joelr1: no, that's the one I pasted in error :)
12:44:07<quicksilver>joelr1: scroll down
12:44:11<quicksilver>joelr1: or, reload
12:44:23<joelr1>quicksilver: got it
12:45:12<joelr1>quicksilver: can you paste the output from a couple of examples? like you did with CountArgs?
12:45:24<joelr1>quicksilver: well, never mind that, a better question
12:46:07<joelr1>quicksilver: does this solution require me to gather all my types under ArgTypes?
12:47:14<hpaste> quicksilver annotated "Counting arguments using a type class" with "with examples + one more constructor" at http://hpaste.org/1262#a4
12:47:21<quicksilver>joelr1: yes
12:47:33<quicksilver>joelr1: or you could use 'Typeable'
12:47:41<quicksilver>joelr1: which is a built-in haskell way to concretize most types
12:47:58<quicksilver>joelr1: I don't think it's a bad thing to collect all your types into a constructor, personally
12:48:20<joelr1>quicksilver: well, i have a huge AST, right
12:48:37<quicksilver>joelr1: but presumably no more than a dozen parameter types...
12:48:44<quicksilver>joelr1: most DSLs just have 4 or 5
12:48:54<joelr1>quicksilver: with types for numerical expressions, string expressions, etc.
12:49:30<quicksilver>joelr1: ok, go on
12:49:47<joelr1>quicksilver: to tell you the truth, arguments can only be of type string, bool or num expression, although just NumExpr can look like this
12:49:50<joelr1>@paste
12:49:50<lambdabot>Haskell pastebin: http://hpaste.org/new
12:50:06<hpaste> joelr1 pasted "NumExpr" at http://hpaste.org/1263
12:50:30<joelr1>string expression and bool expr look similar
12:50:44<joelr1>so what i'm trying to derive is a parser for this type
12:51:03<quicksilver>ACTION nods
12:51:33<joelr1>the reason that have separate NumGroup, BoolGroup, StrGroup or same for NumArrayVar, etc. is because i would like to use quickcheck to generate a random AST
12:51:57<joelr1>and with just Expr (like i had before) i would be generating invalid ASTs at times
12:52:15<joelr1>the way i have it now everything is nicely typed
12:52:19<quicksilver>ACTION nods
12:52:26<quicksilver>well, perhaps you want data.typeable then
12:52:33<joelr1>the kicker is that NumCall has about... let me count them
12:52:33<quicksilver>http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Typeable.html
12:52:35<lambdabot>http://tinyurl.com/ylclo5
12:52:51<quicksilver>or, to be honest, perhaps you want to do with with Data.Derive just as stefan suggested
12:53:03<quicksilver>but it's interesting to see how far you can get within the language
12:53:21<joelr1>quicksilver: 170+ constructors describing the various numerical functions
12:53:50<quicksilver>joelr1: funky :)
12:53:56<joelr1>quicksilver: so i want to 1) derive parsers for these and 2) derive pretty-printers
12:54:02<joelr1> based on the types
12:54:24<quicksilver>there was a paper on writing pretty printers and parsers simultaneously
12:54:31<joelr1>it's easy because the format is always the same: function name '(' arg1 , arg2 , ... ')'
12:54:43<joelr1>quicksilver: don't have that paper
12:54:55<quicksilver>joelr1: http://www.cs.ru.nl/A.vanWeelden/bi-arrows/
12:54:57<lambdabot>Title: There and Back Again: Arrows for Invertible Programming
12:55:12<joelr1>quicksilver: but i can imagine that you can somehow derive an unparser from a parser
12:55:32<joelr1>this sucks. full paper at ACM :(
12:55:34<joelr1>why?!
12:55:40<quicksilver>joelr1: http://citeseer.ist.psu.edu/alimarine05there.html
12:55:41<lambdabot>Title: There and Back Again: Arrows for Invertible Programming (ResearchIndex)
12:55:47<quicksilver>joelr1: downloadable from that link
12:55:50<quicksilver>joelr1: good old citeseer
12:56:11<Botje>damn you, quicksilver. I was just about to start working for school :)
12:56:21<quicksilver>Botje: damn me for which part?
12:56:34<Botje>linking to a paper about stuff that interests me ;)
12:56:36<quicksilver>joelr1: I think I'll email my snippet to the -cafe. No doubt there are even cleverer generalisations
12:57:22<joelr1>quicksilver: definitely but hang on a bit
12:57:36<joelr1>quicksilver: maybe you'll want to add more?
12:57:58<joelr1>anyway, i downloaded the paper. eventually, i'll set friday aside (saturday maybe?) just to reading papers :D
12:58:07<quicksilver>:)
12:58:25<quicksilver>Cale: seen this trick before?
12:58:28<joelr1>but back to the grind, would you say that it's impossible to derive the parser and pprinter with your approach?
12:58:45<quicksilver>> let constructorName = takeWhile (/=' ') . show in constructorName (Just undefined)
12:58:46<lambdabot> "Just"
12:59:10<quicksilver>joelr1: no, not at all. But in the design I outlines, you would need to 'shadow' all your argument types with a concrete ADT
12:59:20<quicksilver>joelr1: at least that's work that only needs doing once, but it's still work
12:59:40<quicksilver>joelr1: on the other hand, you could use Data.Typeable and its TypeRep, which gives you that for most types for free
13:00:03<joelr1>quicksilver: another paste would be _very_ welcome ;-)
13:00:08<quicksilver>joelr1: for which part?
13:00:14<joelr1>keeping the old paste, of course, for pasting both
13:00:16<joelr1>for typeable
13:03:59<hpaste> quicksilver annotated "Counting arguments using a type class" with "Data.Typeable version" at http://hpaste.org/1262#a5
13:04:33<quicksilver>joelr1: it's almost identical. My 'ConcreteType' class was just a cut-down special case of Data.Typeable.
13:04:59<joelr1>quicksilver: looking
13:05:31<quicksilver>joelr1: oh, I removed the multiple parameters on the typeclasses. They were not necessary, I was just confused.
13:05:37<joelr1>quicksilver: so no unification of types is needed
13:06:39<joelr1>quicksilver: would you say that what's needed now is to make each type an instance of a Parseable class and an instance of a PrettyPrintable one?
13:07:08<joelr1>cause then, it would seem, you could just fmap parse to the list of returned types to parse
13:07:19<joelr1>and fmap pprint to pretty-print
13:07:29<quicksilver>joelr1: more or less, yes
13:07:39<joelr1>quicksilver: why more or less?
13:07:41<quicksilver>joelr1: there's some work to do in terms of adding commas in between productions
13:07:47<quicksilver>joelr1: and brackets around them
13:07:52<quicksilver>joelr1: it's not hard though
13:08:27<quicksilver>joelr1: anyhow I have to grab some lunch and do some work. I'll paste the last version to the -cafe in case anyone has a comment
13:08:46<joelr1>quicksilver: thanks a lot! can i ask one more q?
13:09:16<joelr1>should this support liftMx to return the type?
13:09:24<joelr1>with the parsed arguments
13:10:20<joelr1>anyhow, this is extra-fine type class hackery! :D thanks again
13:10:44<Saizan>couldn't this be handled once with some typeclass recursiveness hackery?
13:10:56<joelr1>Saizan: don't ask me
13:11:02<joelr1>i wouldn't know
13:11:07<Saizan>enumering types i mean
13:13:18<joelr1>i also wonder if there's a hack to get the constructors... hmm... after this i figure (almost) anything is possible!
13:13:43<quicksilver>joelr1: 'get the constructors'? what do you mean?
13:13:53<Saizan>given the type?
13:13:57<joelr1>quicksilver: i thought you were out to lunch :D
13:14:00<desp>odd
13:14:12<quicksilver>joelr1: no, I went to buy a sandwich
13:14:25<quicksilver>joelr1: ah, well that's a tricky one because they don't have the same type as each other
13:14:38<quicksilver>joelr1: so without existentials, you can't make that a well-typed program
13:14:41<joelr1>well, if my NumCall has 170 constructors metaprogramming lets me derive the whole type
13:16:33<quicksilver>joelr1: yes, I see what you mean
13:16:45<quicksilver>joelr1: I can't think of a way of doing that :)
13:17:01<Saizan>something with TH maybe?
13:17:15<quicksilver>Saizan: the point of this tangent it to avoid true metaprogramming
13:17:26<quicksilver>Saizan: he already knows how to do it with Data.Derive, more or less
13:17:33<Saizan>oh ok
13:17:39<quicksilver>Saizan: I was showing how close he could get with a couple of typeclasses
13:23:28<joelr1>very close indeed
13:32:58<hpaste> Saizan annotated "Counting arguments using a type class" with "one recursive case to rule them all" at http://hpaste.org/1262#a6
13:34:50<joelr1>Saizan: looking
13:35:19<joelr1>Saizan: what does that give you? you didn't post example output
13:36:30<Saizan>it gives you the same functionality with only 2 instances, regardless of the number and arity of the contructors
13:37:02<joelr1>i see
13:37:45<joelr1>haskell is awesome precisely because of folks like you (Saizan, quicksilver, dons, dcoutts, Cale and others too)
13:37:54<joelr1>i think this is strongly underappreciated
13:38:57<quicksilver>Saizan: ah, I wondered if that was possibly
13:39:07<quicksilver>Saizan: I ran out of time to try it :)
13:39:19<joelr1> i had a chance to compare during my ocaml month
13:40:08<joelr1>how in the world do i debug: baz.hs:30:3: Not in scope: `a1'
13:40:28<joelr1>(posted to cafe)
13:41:01<Philippa>joelr1: well, in one sense it's trivial - the identifier's not bound there
13:41:16<Philippa>do you know where the binding site you're expecting to cover that use is?
13:41:20<joelr1>Philippa: right. the question where does it come from. it's not obvious by looking at the code
13:41:39<Philippa>you mean there's no a1 at 30:3? Oh
13:41:43<Philippa>which implementation're you using?
13:41:46<joelr1>Philippa: beats me! it's template haskell generating a1, i think
13:41:52<Philippa>ah
13:41:54<joelr1>Philippa: take a look at the last message in cafe
13:41:59<Philippa>in that case, have fun
13:42:13<joelr1>Philippa: under Automatic Derivation of ..
13:42:23<Philippa>something that might help: you can use debug.trace from inside the quotation monad
13:42:32<joelr1>hmm
13:42:44<Philippa>another something that /might/ help: IIRC there're show instances on the quoted code types
13:42:51<Saizan>you can dump the code generated by TH with a flag
13:42:56<Igloo>joelr1: Pretty-print the stuff you're splicing in
13:43:19<Igloo>and if that doesn't help, print the actual datatype
13:43:27<joelr1>Saizan: which flag
13:43:32<Saizan>-ddump-splices iirc
13:43:46<joelr1>Igloo: i'm not splicing much in, just a name
13:44:19<joelr1>that helped
13:44:54<hpaste> joelr1 annotated "NumExpr" with "result from -ddump-splices" at http://hpaste.org/1263#a1
13:46:26<hpaste> sebell pasted "Parsec string matching issues" at http://hpaste.org/1264
13:48:44<joelr1>sebell: if you are matching a portion you need to use try, i think
13:48:50<hpaste> sebell annotated "Parsec string matching issues" with "Possible fix" at http://hpaste.org/1264#a1
13:48:53<joelr1>sebell: so that the parser fakes reading no input
13:49:07<joelr1>sebell: yup
13:51:12<sebell>bleh. That was a blonde moment
13:53:38<joelr1>happens to me all the time
13:56:13<joelr1>:t fromInteger
13:56:15<lambdabot>forall a. (Num a) => Integer -> a
14:03:03<sorear>hello!
14:03:12<glguy>oh dear :)
14:03:24<joelr1>hi stefan
14:03:30<joelr1>glguy: what;s your name?
14:03:46<glguy>*** glguy is n=eric@
14:03:53<glguy>:)
14:03:59<sorear>and with a little googling...
14:04:07<sorear>you may have heard of 'hpaste'
14:04:15<sorear>read the who-wrote-it
14:04:16<glguy>it doesn't take much to tie me to a real name and email
14:04:22<sorear>then read the darcs inventor
14:04:42<glguy>joelr1: why do you ask?
14:04:49<sorear>Eric Mertens <emertens@gmail.com>**20070118045641]
14:04:55<glguy>yeah, that one
14:05:52<joelr1>glguy: for no reason. just like to associate nicks with name of people posting to cafe
14:06:05<glguy>ah
14:06:10<glguy>I don't post *too* much
14:06:18<joelr1>yeah, unlike me
14:06:30<beelsebob>is there a properly proscribed way of renaming files/folers in darcs?
14:06:33<sebell>My inbox is full of Joel ;)
14:07:25<sorear>beelsebob: darcs mv
14:07:28<glguy>I remembered that I am off tomorrow when I got to work today
14:07:41<glguy>that really brightened up my morning :)
14:15:09<sorear>ACTION has a LOT of mails to reply to...
14:19:02<joelr1>sorear: not really :D
14:19:46<joelr1>sorear: you should get one last mail that clears it up. well, almost since the parser doesn't work right but that doesn't seem to have anything to do with derivation
14:26:38<matthew-_>@src Monad ((,) a)
14:26:39<lambdabot>Source not found. You type like i drive.
14:26:42<matthew-_>@src Monad (,)
14:26:42<lambdabot>Source not found. Your mind just hasn't been the same since the electro-shock, has it?
14:27:32<matthew-_>@type \f -> f >>= (,)
14:27:34<lambdabot>forall a b. (b -> a) -> b -> (a, b)
14:27:44<sorear>@src (,) >>=
14:27:45<lambdabot>Source not found. Maybe if you used more than just two fingers...
14:27:49<sorear>@src , >>=
14:27:49<lambdabot>Source not found. BOB says: You seem to have forgotten your passwd, enter another!
14:27:53<glguy>(,) isn't a monad?
14:28:02<sorear>glguy: import
14:28:05<mauke>(,) takes two args, it can't be a monad
14:28:08<sorear>@instances Monad
14:28:09<lambdabot>((->) r), ArrowMonad a, Cont r, ContT r m, Either e, ErrorT e m, IO, Maybe, RWS r w s, RWST r w s m, Reader r, ReaderT r m, ST s, State s, StateT s m, Writer w, WriterT w m, []
14:28:13<matthew-_>it's the -> r
14:28:19<sorear>@instances-importing Control.Monad.Instances Monad
14:28:20<lambdabot>((->) r), ArrowMonad a, Cont r, ContT r m, Either e, ErrorT e m, IO, Maybe, RWS r w s, RWST r w s m, Reader r, ReaderT r m, ST s, State s, StateT s m, Writer w, WriterT w m, []
14:28:25<matthew-_>must be. (,) is a function
14:28:27<sorear>@instances-importing Control.Monad.Writer Monad
14:28:28<lambdabot>((->) r), ArrowMonad a, Cont r, ContT r m, Either e, ErrorT e m, IO, Maybe, RWS r w s, RWST r w s m, Reader r, ReaderT r m, ST s, State s, StateT s m, Writer w, WriterT w m, []
14:28:38<matthew-_>so it must be the ((->) r) which is the monad
14:28:41<glguy>ah, I see what you were trying to do
14:28:47<sorear>@tell dons @instances-importing Control.Monad.Writer Monad doesn't find (,) a
14:28:47<lambdabot>Consider it noted.
14:28:55<sorear>@flush
14:29:03<glguy>@wipe
14:29:03<lambdabot>Maybe you meant: dice time type wiki
14:29:41<dhart>I have a quick question: in using HOpenGL, GHC seems to be bafled by "Vertex2 100 100", saying "ambigouis type variable". Is there a way of "casting" he values to GLfloat?
14:29:56<matthew-_>100::GLfloat
14:30:05<mauke>(100 :: GLfloat)
14:30:05<dhart>thx a bunch
14:30:24<mauke>@bot
14:30:24<lambdabot>:)
14:30:30<mauke>bah, lag
14:34:33<sorear>joelr1: so how long did it take you to figure out I was S. O'Rear? A *lot* of people seem to think I'm a random guy with a pseudonym and an earache...
14:35:05<joelr1>sorear: ugh... a minute yesterday. you said something and then sent me an email
14:37:57<joelr1>mnislaih: i wonder if my prelude error is caused by my using make -j 2
14:38:27<mnislaih>the prelude error means that base did not build
14:38:48<sebell>joelr1: Which snapshot are you building?
14:38:49<mnislaih>make -j2 works fine here
14:39:02<mnislaih>did split-objs help ?
14:39:08<dhart>And how would I do a conversion from Integer to GLfloat?
14:39:13<sorear>fromInteger
14:39:44<joelr1>sebell: ugh... 0404
14:39:57<joelr1>mnislaih: no, it did not
14:40:18<joelr1>mnislaih: i put NO in my build.mk
14:40:29<mnislaih>can you check what happens when you call make from libraries/base ?
14:40:33<joelr1>mnislaih: oh, i did manage to build the "quickest" configuration, btw
14:40:38<joelr1>i can't build the perf one
14:40:46<joelr1>with or without split objects
14:41:57<sebell>joelr1: Hmm. I build 0404 yesterday without any issues... (default build)
14:42:21<joelr1>sebell: platform?
14:42:30<sebell>Linux x86. Are you using Mac OS X?
14:42:36<joelr1>sebell: 100%
14:42:40<sebell>ACTION doesn't think he has 0404 on his Mac
14:44:11<mnislaih>joelr1: it's certainly possible to build "perf" in Os X, although I don't have 0404 either. I have Mar 29 here
14:44:27<sorear>I'm using 0402, built from darcs with my TH patches
14:44:40<joelr1>sorear: mac osx ? intel?
14:44:45<sorear>wanted to spare myself the embarrasement of sending patches that broke the build
14:44:46<mnislaih>ACTION builds from darcs too
14:44:53<sorear>sorry, PC intel
14:45:04<joelr1>i'm building from darcs myself
14:45:11<sorear>having mukke, why not make install?
14:45:35<joelr1>mukke?
14:45:39<joelr1>who is mukke
14:46:06<sorear>past tense of make?
14:48:15<sebell>joelr1: I don't know if it would make a different, but I would try the source snapshot distribution
14:48:18<sebell>*difference
14:52:29<joelr1>my example parser doesn't work :-(
14:52:59<joelr1>can anyone suggest a reason?
14:53:44<sorear>have you looked at the generated code?
14:54:12<joelr1>i should, let me just make a paste
14:54:15<joelr1>@paste
14:54:15<lambdabot>Haskell pastebin: http://hpaste.org/new
14:54:45<hpaste> joelr1 pasted "simple parser not working" at http://hpaste.org/1265
14:55:42<hpaste> joelr1 annotated "simple parser not working" with "generated code" at http://hpaste.org/1265#a1
14:56:21<joelr1>sorear: i don't think it's the code
14:58:10<joelr1>meaning i don't think it's the derivation that's causing the problem, it's the structure of the parser
15:00:44<sorear>joelr1: found it
15:00:52<joelr1>sorear: found what?
15:02:33<hpaste> joelr1 annotated "simple parser not working" with "still no dice" at http://hpaste.org/1265#a2
15:02:56<joelr1>this is what i'm trying: run fooParser "Bar (10, 10.345)"
15:03:43<beelsebob>joelr1: why not just use Happy?
15:04:12<joelr1>beelsebob: too late. plus, my original ocaml parser was written yacc-style and i much rather use the combinators
15:04:39<joelr1>beelsebob: i can test things in chunks
15:06:23<joelr1>sorear: what did you find?
15:09:38<sorear>joelr1: mail sent
15:11:03<joelr1>sorear: thanks stefan. can you tell me why the choice version with try doesn't work?
15:11:07<joelr1>in the paste
15:11:27<joelr1>i.e. one that has choice [ try $ float, integer ]
15:11:45<joelr1>it would seem to me that it would try float first and then integer
15:12:08<joelr1>this works on Foo, for example
15:12:26<joelr1>*Main> run fooParser "Foo (10.345)"
15:12:27<joelr1>Foo (Num 10.345)
15:12:47<joelr1>it doesn't work for run fooParser "Bar (10, 10.345), though. let me try your version anyhow
15:16:00<quicksilver>joelr1: surely the float will match an int though
15:16:12<quicksilver>joelr1: and just return a floatified version of the int?
15:16:31<yaarg>why did the designer of sed decide to use / as a delimter?
15:16:36<yaarg>i mean really WTF was he thinking?
15:16:53<joelr1>quicksilver: right but there's on constructor that starts with a double
15:17:18<joelr1>i mean bar wants int first ... oh, i see... i think i see
15:17:32<joelr1>it eats up the int as a float and bombs out
15:17:34<ibid>yaarg: i believe it predates sed :)
15:17:49<ibid>yaarg: probably comes from the original ed
15:18:09<yaarg>probably right
15:18:10<ibid>(you do know that grep comes from the ed command g/re/p :)
15:18:24<ibid>(the name, that is)
15:18:39<yaarg>yup
15:19:06<robreim>I can't make changes to my trac proposal. Has this something to do with that big spamming I heard mention of?
15:19:21<yaarg>i just realised i spammed the wrong channel too :)
15:19:39<sorear>robreim: log in as guest, pw guest
15:20:01<sorear>anons can still make changes, it's just registered users that are locked out
15:20:06<robreim>sorear: I'm logged in as myself. Is guest preferable?
15:20:10<robreim>oh ok, thanks :)
15:20:21<ibid>why does that make sense?
15:20:37<sorear>robreim: and nag Igloo (?) to add you to the 'developers' group
15:20:43<joelr1>sorear: what is your sign parser?
15:20:58<sorear>joelr1: it's from the Token source
15:21:08<sorear>ACTION makes sure it is exported
15:21:16<joelr1>sorear: it's not exported... i think
15:21:25<Igloo>robreim: What's your username?
15:21:41<sorear> sign = (char '-' >> return negate)
15:21:41<sorear> <|> (char '+' >> return id)
15:21:41<sorear> <|> return id
15:21:50<robreim>Igloo: robreim
15:21:50<sorear>that shouldn't be too much to copy :)
15:22:20<Igloo>robreim: OK, should work now
15:22:21<joelr1>sorear: right, thanks
15:22:35<robreim>Igloo: yup! Thanks plenty :)
15:24:11<joelr1>sign doesn't work with doubles :(
15:24:15<joelr1>working on it
15:26:19<sorear>joelr1: it does too
15:26:37<sorear>joelr1: you're just running into the fact lambda bound variables are monomorphic :(
15:26:42<joelr1>ugh
15:27:20<joelr1>sorear: so what am i to do?
15:27:26<sorear>you could work around it by having sign return +1 or -1
15:28:00<sorear>then replace each sg with (fromIntegral sg *)
15:28:08<sorear>fromInteger even
15:28:45<joelr1>right
15:28:55<joelr1>trying
15:32:10<joelr1>:t either
15:32:14<lambdabot>forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
15:32:33<sorear>@djinn (a -> c) -> (b -> c) -> Either a b -> c
15:32:34<lambdabot>f a b c =
15:32:34<lambdabot> case c of
15:32:34<lambdabot> Left d -> a d
15:32:34<lambdabot> Right e -> b e
15:32:52<sorear>@src either
15:32:52<lambdabot>either f _ (Left x) = f x
15:32:52<lambdabot>either _ g (Right y) = g y
15:33:09<sorear>probably that last is the clearest :)j
15:34:13<joelr1>sorear: i like the 1st one, actually. so either takes two functions and one either a b returned by naturalOrFloat
15:34:27<joelr1>:t naturalOrFloat
15:34:29<lambdabot>Not in scope: `naturalOrFloat'
15:34:37<joelr1>@where naturalOrFloat
15:34:37<lambdabot>I know nothing about naturalorfloat.
15:34:47<sorear>:t Text.ParserCombinators.Parsec.Token.natOrFloat
15:34:49<lambdabot> Not in scope: `Text.ParserCombinators.Parsec.Token.natOrFloat'
15:34:53<sorear>:t Text.ParserCombinators.Parsec.Token.naturalOrFloat
15:34:55<lambdabot>forall st. Text.ParserCombinators.Parsec.Token.TokenParser st -> Text.ParserCombinators.Parsec.Char.CharParser st (Either Integer Double)
15:35:45<quicksilver>sorear: would be a small-but-cute enhancement to djinn
15:35:56<quicksilver>sorear: for it to rewrite top-level cases as multiple definitions
15:36:34<sjanssen>top level cases on a simple variable
15:36:53<sorear>hehe. djinn was given to us by a hacker of far greature stature than I
15:37:09<sjanssen>sorear: but it'd be great fun to send a patch to lennart!
15:37:09<sorear>or were you not implying I wrote it?
15:38:50<tsp>> "haskell är en Program som körs"
15:38:52<lambdabot> "haskell \228r en Program som k\246rs"
15:39:20<earthy>haskell is a program with what now?
15:39:24<tsp>no idea
15:39:34<mauke>> "€"
15:39:35<lambdabot> "\8364"
15:39:41<sorear>> "?"
15:39:43<lambdabot> "?"
15:39:50<tsp>same thing here - a ?
15:39:55<quicksilver>sorear: I didn't intend to imply you wrote it. Just you had contrasted the two definitions
15:40:03<earthy>> "\8364"
15:40:04<lambdabot> "\8364"
15:40:08<earthy>pity. :)
15:40:11<mauke>U+20AC (0xe2 0x82 0xac): EURO SIGN [€]
15:40:26<tsp>what is a program som körs?
15:40:27<sjanssen>since when did lambdabot learn UTF-8?
15:40:47<sorear>sjanssen: it doesn'
15:41:04<sorear>sjanssen: it passes an uninterpreted string of bytes to GHCI 6.6
15:41:12<sorear>sjanssen: which does know utf8
15:41:32<sorear>well, GHC actually
15:41:46<chessguy>?version
15:41:47<lambdabot>lambdabot 4p517, GHC 6.6 (OpenBSD i386)
15:41:47<lambdabot>darcs get http://www.cse.unsw.edu.au/~dons/lambdabot
15:42:23<tsp>OpenBSD? yuck
15:42:26<tsp>freebsd ftw
15:42:26<glguy>lol
15:42:30<hpaste> joelr1 annotated "simple parser not working" with "a generated parser issue?" at http://hpaste.org/1265#a3
15:42:54<joelr1>sorear: still not working but i'm fighting it
15:44:44<sjanssen>wow, 77 Haskell mailing list posts since I sent to sleep
15:45:31<chessguy>?vera ftw
15:45:33<lambdabot>No match for "ftw".
15:45:40<sorear>it's all joelr1's fault ;)
15:45:46<sorear>chessguy: for teh win
15:46:01<joelr1>ACTION hides in his cave
15:46:06<chessguy>win?
15:46:21<syntaxfree>I'm trying out common lisp.
15:46:22<sorear>hello syntaxfree!
15:46:26<sorear>yay?
15:46:30<tsp>common lisp? heh
15:46:32<syntaxfree>I feel like I'm cheating on my wife or something.
15:46:39<opqdonut>:DD
15:46:42<hpaste> joelr1 annotated "simple parser not working" with "close but no cigar" at http://hpaste.org/1265#a4
15:46:48<syntaxfree>I became curious because of the CLOS article that came out on reddit.
15:46:53<glguy>syntaxfree: well, she's probably cheating with lambdabot
15:46:59<glguy>syntaxfree: so it all works out
15:47:02<chessguy>@quote cheat
15:47:02<lambdabot>sebazzz says: * sebazzz sabe que emonk es un negro sucio y cheatero
15:47:16<syntaxfree>the "generic dispatch" thing is actually very very close to what I'm used to in gnu r.
15:47:16<chessguy>uh
15:47:21<syntaxfree>but no lazy evaluation is weird!
15:47:21<joelr1>syntaxfree: set your feelings free
15:47:36<greenrd>Is it my overactive imagination, or did someone once announce a library to make it easier to use the GHC API?
15:47:38<syntaxfree>anyway, hello everyone!
15:47:40<chessguy>i don't think that quote should be in there
15:47:43<joelr1>syntaxfree: i'm a language whore although haskell is becoming my favorite
15:47:46<sorear>greenrd: hs-plugins
15:47:51<int-e>joelr1: you're using the result of sign with two different types I think; use fromIntegral sign in the Num case?
15:47:53<syntaxfree>hey sorear :)
15:48:04<sorear>@remember syntaxfree I'm trying out common lisp. ... I feel like I'm cheating on my wife or something.
15:48:04<lambdabot>Done.
15:48:09<greenrd>sorear: I don't think it's that I'm thinking of. hs-plugins is for loading code dynamically, right?
15:48:19<syntaxfree>(defun g (x y) (setq x (+ y x)))
15:48:23<sjanssen>greenrd: I vaguely remember that announcement
15:48:25<joelr1>int-e: let me try
15:48:25<greenrd>I've found lemmih's ghc-api library, but that's not what I'm thinking of - I think it's just a snapshot of the ghc api
15:48:29<sorear>greenrd: yeah, but it uses ghc-plugis
15:48:39<sorear>er, ghc-api
15:48:39<syntaxfree>(defun dup (f i) (funcall f i i))
15:48:40<greenrd>ok
15:48:44<mauke>syntaxfree: (defun g (x y) (incf x y))
15:48:59<chessguy>is this #haskell or #lisp?
15:48:59<greenrd>but I'm actually interested in parsing and pretty printing Haskell code with all ghc extensions enabled
15:49:03<greenrd>hehe
15:49:11<sorear>syntaxfree: don't you just love languages where funcall is explicit? :)
15:49:17<syntaxfree>guess what (dup #'+ (g x x)) yields?
15:49:26<syntaxfree>sorear: I prefer the scheme way, I think.
15:49:35<emu>(setq x (+ y x)) is pointless (sorry)
15:49:45<glguy>incf?
15:49:46<emu>take it to #lisp
15:49:54<chessguy>yeah, anyway
15:49:56<joelr1>int-e: doesn't work
15:50:02<syntaxfree>I'm just bitching about "no lazy evaluation".
15:50:12<syntaxfree>It's meant for haskellers to feel all smug and superior.
15:50:27<emu>bitch about the lack in scheme
15:50:39<emu>CLers love their side-effects
15:51:03<sjanssen>most Haskell features are meant to make us feel smug and superior
15:51:17<joelr1>int-e: Expected type: Either Integer Integer
15:51:18<greenrd>hehe
15:51:20<chessguy>that's gotta be even weirder than african tribal people who stick bones through their noses
15:51:36<glguy>ACTION wouldn't mind learning a lisp dialect that didn't have crappy naming conventions
15:51:53<sebell>glguy: What's wrong with Scheme?
15:51:58<emu>hey dontcha love nthcdr or rplacd
15:52:20<syntaxfree>I thought CLers loved their macros.
15:52:27<emu>that too
15:52:27<sorear>emu: "If I were to do it again? I would spell creat with an e."
15:52:32<emu>hehe
15:52:38<syntaxfree>In the end, it strikes me that I'm losing out by knowing just one programming language.
15:52:40<joelr1>i feel particularly stupid today
15:52:55<mauke>yeah, a common function like rplacd needs a short name, while a seldom used low-level function like multiple-value-bind ... er
15:53:01<syntaxfree>If I'm going for a mistress, I might as well choose Lisp instead of Cobol or something.
15:53:02<sorear>ACTION has done memcpy(dst, dst, sizeof src) in haskell
15:53:16<joelr1>mind you, i wrote a fully-functioning translator from one language to another in a month, while learning ocaml
15:53:23<joelr1>what does that say about haskell?!
15:53:27<int-e>joelr1: what is the type of naturalOrFloat?
15:53:32<emu>mauke: except no one uses rplacd anymore =)
15:53:37<sorear>:t Text.ParserCombinators.Parsec.Token.naturalOrFloat
15:53:38<joelr1>int-e: one sec
15:53:39<hpaste> DIARULE annotated "(no title)" with "NEW YORK" at http://hpaste.org/1109#a4
15:53:39<lambdabot>forall st. Text.ParserCombinators.Parsec.Token.TokenParser st -> Text.ParserCombinators.Parsec.Char.CharParser st (Either Integer Double)
15:53:44<emu>it mostly exists for the purposes of dredging up funny names
15:53:45<sorear>int-e: ^^
15:53:48<syntaxfree>learning a ML would really be cheating.
15:54:03<mauke>rplaca, cdadr, ...
15:54:09<syntaxfree>why would I learn another functional typeful language? What's wrong with the one I'd have? That'd be vicious thrill-seeking.
15:54:14<syntaxfree>Oh, c'mon. I love cadaddr.
15:54:18<hpaste> joelr1 annotated "simple parser not working" with "not working" at http://hpaste.org/1265#a5
15:54:26<joelr1>there
15:54:35<sorear>syntaxfree: they only go up to 4, for no good reason :)
15:54:37<emu>syntaxfree: actually, only up to 3 (a|d) are defined
15:54:49<emu>in scheme it is special cased for any number
15:55:07<mauke>what?
15:55:10<sorear>Oh. ISTR getting that 4 from r5rs.
15:55:12<mauke>I don't want to learn scheme anymore :(
15:55:19<sjanssen>joelr1: what is the type of naturalOrFloat?
15:55:23<sorear>:t Text.ParserCombinators.Parsec.Token.naturalOrFloat
15:55:24<cjeris>emu: scheme has an infinite number of symbols bound in the initial environment???
15:55:26<lambdabot>forall st. Text.ParserCombinators.Parsec.Token.TokenParser st -> Text.ParserCombinators.Parsec.Char.CharParser st (Either Integer Double)
15:55:27<sorear>sjanssen: ^^
15:55:40<joelr1>i dig a fair bit of lisp programming, on two projects. ran away from lisp afterwards.
15:55:45<joelr1>no, make that 3 projects
15:55:46<int-e>joelr1: I think you want either (Int . (sign *)) (Num . (fromIntegral sign *)) num
15:55:46<emu>i was pretty sure it was scheme. maybe just mzscheme. but scheme doesnt have symbols like lisp.
15:55:46<cjeris>sorear: i think it's 4 in Common Lisp.
15:55:54<joelr1>that's excluding those of my own
15:55:59<sjanssen>@hoogle lexeme
15:55:59<lambdabot>Text.ParserCombinators.Parsec.Token.lexeme :: TokenParser st -> CharParser st a -> CharParser st a
15:55:59<lambdabot>Text.Read.Lexeme :: data Lexeme
15:56:06<sjanssen>@hoogle sign
15:56:06<lambdabot>Prelude.significand :: RealFloat a => a -> a
15:56:07<lambdabot>Prelude.signum :: Num a => a -> a
15:56:07<lambdabot>Control.Concurrent.QSem.signalQSem :: QSem -> IO ()
15:56:18<joelr1>int-e: trying
15:56:18<int-e>sjanssen: sign is defined in the paste
15:56:21<sorear>int-e: i had intended for him to use (fromInteger sign *) in the Num case
15:56:23<emu>my job is work in CL. but anyway, i have to run.
15:56:24<mauke>hmm, I should write an Acme::CADR
15:56:25<sebell>emu: What do you mean, doesn't have symbols like CL?
15:56:28<quicksilver>XLISP had cadadrs up to 7, if I'm not mistaken
15:56:28<int-e>sorear: me too
15:56:33<hpaste> sjanssen annotated "simple parser not working" with "should be fixed" at http://hpaste.org/1265#a6
15:56:39<joelr1>finally! the magic moment
15:56:41<int-e>sorear: well, fromIntegral but that's a small difference :)
15:56:48<joelr1>int-e and sjanssen win
15:56:52<dhart>How does one combine Monads togther?
15:57:08<joelr1>that's one ugly little parser, though
15:57:10<joelr1>dammit
15:57:15<joelr1>lets see if it works now
15:57:17<sorear>dhart: you can't
15:57:22<syntaxfree>with monad combinators! \o/
15:57:40<sorear>dhart: values of a monad can be combined with >>=, and functions derived from it like replicateM
15:57:41<dhart>sorear: I thought it was possible? Monad combinators?
15:58:08<Cale>dhart: By combining monads, you do mean the types, right?
15:58:35<Cale>There's a technique which is commonly used called monad transformers to build up monads from pieces.
15:58:39<hpaste> joelr1 annotated "simple parser not working" with "yay! i can move on now!" at http://hpaste.org/1265#a7
15:58:42<syntaxfree>I'm joking about monad combinators.
15:58:44<syntaxfree>sorry.
15:58:45<joelr1>thank you folks
15:58:47<dhart>Let me introduce the simple example I am trying to implement, to make things clearer
15:58:51<dhart><dhart> class Renderable a where
15:58:51<dhart><dhart> render :: a -> IO ()
15:59:02<Cale>(But you can't automatically construct a monad transformer from a monad.)
15:59:22<dhart>I want to add a "Reader RenderParams" and a "State GameState"
15:59:28<Cale>(I might not be around long, I haven't had any sleep)
16:00:02<sorear>Oh, then just use ReaderT RenderParams (State GameState) as your monad
16:00:16<sorear>the order matters in general, but not in this case
16:00:17<Cale>dhart: You can: newtype MyMonad a = MM (ReaderT RenderParams (StateT GameState IO) a)
16:00:27<Cale> deriving (Functor, Monad)
16:00:49<dhart>Why "ReaderT" and not "Reader", same question for "State" and "StateT"
16:00:57<joelr1>as for why i ran away from lisp... one project was a new one and i totally hated my boss's technique since he wrote lisp c-style. the next one was ITA and just grokking the code was difficult. you couldn't just run a bunch of unit tests to see what breaks. HUGE codebase. then, i joined another project and had to refactor. again, impossible to change and see what breaks, no unit tests and dynamic typing. argh!
16:01:01<sorear>@kind ReaderT
16:01:04<lambdabot>* -> (* -> *) -> * -> *
16:01:04<sorear>@kind Reader
16:01:05<Cale>Because they're transforming the underlying monad.
16:01:06<lambdabot>* -> * -> *
16:01:10<hpaste> sjanssen annotated "simple parser not working" with "reduce the ugly" at http://hpaste.org/1265#a8
16:01:13<joelr1>ocaml is fast and cool but haskell is wicked!
16:01:21<Cale>ReaderT is a thing which adds reader-like functionality to another monad.
16:01:23<sorear>as you se ReaderT takes an extra parameter
16:01:35<dhart>right
16:01:39<sorear>(kinds are to types as types are to values)
16:01:49<joelr1>sjanssen: you cheated! you just removed the parens :D
16:02:13<joelr1>err, the curly braces, etc
16:02:32<joelr1>how do i remember my own quote?
16:02:33<sjanssen>yes, cuz they're ugly ;)
16:02:46<joelr1>sjanssen: nah, i'm taking to that style nowadays
16:02:47<Cale>Newtype-deriving is a simple Haskell extension which lets you derive any class for your newtype that the old type supports.
16:02:50<glguy>{; } is good for one thing: one-liners for lambdabot
16:02:53<Cale>(well, almost any class)
16:03:03<sjanssen>joelr1: how come?
16:03:05<sorear> @remember joelr1 foo bar?
16:03:06<glguy>(also for machine generated code)
16:03:12<joelr1>oh, c'mon you guys
16:03:12<glguy>but not for normal human use!
16:03:27<joelr1>@remember joelr1 ocaml is fast and cool but haskell is wicked!
16:03:27<lambdabot>Done.
16:03:30<joelr1>there
16:03:52<glguy>ACTION reminds the insane masses not to quote themselves :-p
16:04:14<Cale>dhart: Because the types get so long and complicated, and it's easy to abuse/get confused about the layering which occurs when building up monads with monad transformers, it's a good idea to newtype the whole stack and then write your own run function.
16:04:21<joelr1>sjanssen: dunno why. i'll try reformatting some code to see. i have also taken to putting commas and semis before the statements
16:04:46<sebell>joelr1: I agree, that's gross :)
16:04:56<joelr1>Cale: what about putting the whole stack into a monad of its own?
16:05:09<joelr1>sebell: do { ... } is gross? or putting commas in front?
16:05:09<dhart>Cale and sorear: Thx for the help. I'll try to play around with the newtype you provided le Cale.
16:05:13<sjanssen>joelr1: yes, that style is common in Haskell. It makes it easier to rearrange the order of lines
16:05:24<Cale>joelr1: Well, it is a monad already -- you could smash it out by hand, but there's not a whole lot of point to that usually.
16:05:56<joelr1>Cale: i remember having a lot of trouble with lifting when i had ErrorT in the middle of the stack
16:06:05<joelr1>Cale: so i guess my point would be to simplify the lifting?
16:06:31<Cale>Well, what you should normally do is what I was about to describe...
16:06:52<Cale>You can either derive MonadState GameState and MonadReader RenderParams, or you can provide your own interfaces to their functionality.
16:07:35<sebell>joelr1: do { ; } -- especially if you're not binding
16:07:48<joelr1>Cale: is there an example of doing so? could you add a tiny bit to the wiki maybe?
16:07:55<Cale>Providing your own names for get and put, etc in your monad is generally a good idea, because the names can help the library user understand what it is that's being manipulated, and if the monad representation ever has to change, you only need to change the operations in one place.
16:08:11<joelr1>sebell: well, yes, i agree that one-liners are cooler with >>=
16:08:34<dhart>Cale: I got this error with the newtype you gave me: Can't make a derived instance of `Monad GameMonad'
16:08:34<dhart> (`Monad' is not a derivable class
16:08:50<Cale>dhart: Which Haskell implementation are you using?
16:09:02<Cale>-fglasgow-exts ?
16:09:08<dhart>I'm compiling with GHC 6.6
16:09:29<Cale>okay, then add {-# OPTIONS_GHC -fglasgow-exts #-} to the top of your file
16:09:37<kmg>@pl \x -> (rem x 3 == 0) || (rem x 5 == 0)
16:09:38<lambdabot>ap ((||) . (0 ==) . flip rem 3) ((0 ==) . flip rem 5)
16:09:41<Cale>which should turn on newtype deriving
16:09:58<dhart>It worked with that compile option, thx a lot.
16:10:20<dhart>I like to understand what I did. What is the difference brought by that compile option?
16:10:39<Cale>It turns on all the features of GHC beyond the Haskell 98 standard.
16:10:40<kmg>@pl \x -> x <= 10^6
16:10:40<lambdabot>(<= 10 ^ 6)
16:10:51<Cale>Well, all the non-dangerous ones, anyway.
16:11:08<dhart>I didn't know that newtype could not derive in H98
16:11:24<Cale>It can derive only the usual things like Read and Show in H98.
16:11:31<kmg>@pl \x -> rem x 2 == 0
16:11:32<lambdabot>(0 ==) . flip rem 2
16:11:39<joelr1>sorear: my next step would be to derive a pretty printer
16:12:07<joelr1>sorear: the inverse of the derived parser. just so that i could print the constructor name and then the args within parens and separated by comma
16:12:25<kmg>@pl \y -> y*y
16:12:26<lambdabot>join (*)
16:13:54<dhart>Cale: I'm still confused as to what the run function is used for in Monads: is it for executing the list of actions? In that case, how would one define and implement a run method for my new monad?
16:14:13<joelr1>sorear: i'm sure it's gona be a struggle but i really like working with derive so far. as opposed to dealing with naked TH
16:15:24<Cale>dhart: Well, when you're working with monadic values, you think of those as abstract computations waiting to be run. They often need something extra -- like an initial state or environment, in order to begin working.
16:16:12<Cale>(We know that internally, State and Reader are implemented as ordinary functions, but that's an implementation detail)
16:17:06<Cale>runState, given a State computation, and an initial state, runs the computation using the initial state, and gives a resulting value together with the final state.
16:17:44<dhart>I know I have to give my custom monad the starting ReaderT state (RenderParams) and a starting StateT state (GameState), and that it should return the finale GameState + some extra computation values
16:18:30<dhart>runGameMonad :: r -> s -> (s',a) -- but I think I'm missing something there
16:18:38<sorear>@tell ndm [Apr 5 16:14 UTC 2007] <joelr1> sorear: I'm sure it's gonna be a struggle but I really like working with derive so far; esp. as opposed to dealing with naked TH.
16:18:38<lambdabot>Consider it noted.
16:18:50<Cale>Right, so runMyMonad :: MyMonad a -> RenderParms -> GameState -> IO (a, GameState)
16:18:52<Cale>perhaps
16:18:53<sorear>he'll be pleased when he gets back :)
16:19:06<joelr1>dhart: did you look at the code for ... what was that game's name? implemented using Yampa
16:19:10<Cale>Note that we can't escape IO here.
16:19:13<sorear>joelr1: frag
16:19:22<joelr1>yep, frag
16:19:27<joelr1>dhart: did you look at frag?
16:19:27<Cale>So we'll actually be producing an IO action.
16:19:50<joelr1>sorear: i'm about to save hundreds of lines of code
16:19:53<joelr1>parsing code
16:19:57<dhart>joelr1: I did look at frag but failed to compile it succesfully
16:20:18<joelr1>dhart: ok, then you can see how they are doing state, etc
16:20:33<dhart>Cale: it's a good thing we cant escape IO here as the function calling my render function expects an IO back
16:21:43<Cale>(of course, you probably want to find a more creative name than MyMonad :)
16:22:02<Cale>If you want more detail about how I think monad transformers are best used...
16:22:20<Cale>http://cale.yi.org/index.php/How_To_Use_Monad_Transformers
16:22:23<lambdabot>Title: How To Use Monad Transformers - CaleWiki
16:23:03<Cale>I'm afraid I aimed that article a little higher than at the complete monad transformer beginner, but hopefully it's not too bad.
16:23:30<chessguy>i was wondering when Cale would trot out that link :)
16:23:41<sorear>is yi.org named after tuomov/dons/jyp's yi?
16:24:01<Cale>chessguy: I've finally begun to package up the things where I've repeated myself over and over in the past :)
16:24:08<chessguy>hehe
16:24:19<dmwit>Does anybody have some suggested reading for Typeable?
16:24:32<sorear>@google Typing dynamic typing
16:24:36<lambdabot>http://www.cs.uu.nl/~arthurb/dynamic.html
16:24:37<lambdabot>Title: Typing Dynamic Typing
16:24:37<sorear>iirc
16:25:02<dmwit>Awesome, thanks!
16:25:59<dhart>Cale: I have pmed you if you dont mind.
16:26:03<sorear>dmwit: no, that's not the write paper
16:26:09<Cale>dhart: no you haven't
16:26:15<sorear>dhart: check your sever messages
16:26:19<Cale>dhart: You're probably not registered.
16:26:20<sorear><*dhart> Cale: I have pmed you if you dont mind.
16:26:29<dhart>Cale: right
16:26:30<sorear>the * means not-identified
16:26:36<dhart>Cale: must not be registered
16:26:43<dmwit>Hmmm... this paper seems to be about Dynamic, not Typeable.
16:26:49<sorear>only registered users are allowed to send pms
16:26:57<Cale>sorear: My client doesn't show that marker.
16:27:04<glguy>what marker?
16:27:08<sorear>dmwit: actually it's about neither, I pulled the wrong name
16:27:11<dhart>ok, so this is my current runGameMonad implementation:
16:27:12<dhart>runGameMonad :: GameMonad a -> RenderParms -> GameState -> IO (a, GameState)
16:27:12<dhart>runGameMonad gm rp gs =
16:27:12<dhart> let (a, newState) = runStateT gs in
16:27:12<dhart> let b = runReaderT rp in
16:27:26<dhart>but I'm really stuck due to all this Monadic layering.
16:27:35<sorear>Cale: apparantly your client has to explicitly request it
16:27:44<sorear>Cale: i'm using erc-capab-module
16:28:28<Cale>runGameMonad (GM x) rp gs = runStateT gs (runReaderT rp x)
16:28:32<sorear>dmwit: the first "Scrap your boilerplate" paper has a section on typeable
16:28:35<Cale>I think that'll do it.
16:28:53<sorear>@google scrap your bolrod
16:28:55<lambdabot>http://tunes.org/~nef/logs/haskell/06.03.15
16:28:57<Cale>er
16:28:58<sorear>@google scrap your boilerplate
16:29:00<lambdabot>http://www.cs.vu.nl/boilerplate/
16:29:00<lambdabot>Title: Scrap your boilerplate ... in Haskell
16:29:04<Cale>modulo bad parameter order
16:29:13<Cale>er...
16:29:21<Cale>never mind, I'm tired :)
16:29:27<dhart>Cale: I'm baffled. I still have so much to learn about Haskell
16:29:32<chessguy>bolrod?
16:29:36<dhart>Cale: thx, I'll try it out
16:29:39<Cale>runGameMonad (GM x) rp gs = runStateT (runReaderT x rp) gs
16:29:42<Cale>I think
16:29:46<Cale>@type runReaderT
16:29:48<lambdabot>forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
16:29:52<Cale>yes.
16:30:04<Cale>GM is the newtype constructor for your newtype.
16:30:14<dmwit>sorear: Thanks again.
16:30:29<Cale>If you keep it within the module where you're defining your monad, and don'
16:30:33<Cale>and don't export it
16:30:34<sorear>Thu Mar 8 08:32:47 PST 2007 Ian Lynagh <igloo@earth.li>
16:30:34<sorear> * Build the libraries with cabal
16:30:41<sorear>Igloo++ Igloo++ Igloo++
16:30:46<sorear>fptools must die.
16:30:49<sorear>@flush
16:30:57<Cale>then you'll have control over which parts of the application can define new operations for your GameMonad
16:31:11<Cale>You might want to derive MonadIO though
16:31:29<Cale>Which will let you liftIO any IO action, making it a GameMonad action.
16:33:50<dhart>why do you provide 2 arguments to runStateT?
16:33:52<chessguy>?hoogle lift
16:33:52<lambdabot>Control.Monad.Trans.lift :: (MonadTrans t, Monad m) => m a -> t m a
16:33:53<lambdabot>Text.ParserCombinators.ReadPrec.lift :: ReadP a -> ReadPrec a
16:33:53<lambdabot>Language.Haskell.TH.Syntax.lift :: Lift t => t -> Q Exp
16:33:59<Cale>dhart: because it takes two
16:34:03<chessguy>@hoogle+
16:34:03<lambdabot>Language.Haskell.TH.Syntax.Lift :: class Lift t
16:34:04<lambdabot>Monad.liftM :: Monad a => (b -> c) -> a b -> a c
16:34:04<lambdabot>Monad.liftM2 :: Monad a => (b -> c -> d) -> a b -> a c -> a d
16:34:07<Cale>dhart: the computation, and the initial state
16:34:08<glguy>cool, now dhart has a ~ in front of his name for not being identified
16:34:15<Cale>@type runStateT
16:34:17<lambdabot>forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
16:34:22<dhart>@hoogle runStateT
16:34:22<lambdabot>Control.Monad.State.runStateT :: StateT s m a -> (s -> m (a, s))
16:34:24<chessguy>?where hoogle
16:34:25<lambdabot>http://www.haskell.org/hoogle
16:34:37<dmead_>> "hello channel"
16:34:38<lambdabot> "hello channel"
16:35:25<dhart>It's weird, my hoogle says "runStateT :: (s -> m (a, s))", but the extra parameter probably comes from the fact the function is inside the monad definition
16:35:37<sorear>yeah
16:35:43<sorear>it's a record selector
16:35:47<sorear>@src StateT
16:35:47<lambdabot>Source not found. Maybe if you used more than just two fingers...
16:35:50<sorear>@src State
16:35:50<lambdabot>Source not found. Just what do you think you're doing Dave?
16:36:01<sorear>ACTION beats up @src
16:36:08<dmwit>lambdabot, his name isn't Dave.
16:36:12<chessguy>why is there a liftIO, but not, say, a liftState
16:36:23<dmwit>:t liftIO
16:36:25<lambdabot>forall a (m :: * -> *). (MonadIO m) => IO a -> m a
16:36:30<Cale>dhart: hoogle suffers from some irritating bugs
16:36:36<sorear>chessguy: you don't need it
16:36:41<sorear>:t put
16:36:43<lambdabot>forall s (m :: * -> *). (MonadState s m) => s -> m ()
16:37:11<Cale>dhart: You probably shouldn't trust it to give accurate type signatures for everything, use :t instead.
16:37:12<chessguy>...
16:37:13<sorear>chessguy: mtl uses undecidable instances to automatically lift get/put into any monad stack containing a State or StateT
16:37:40<sorear>it's IO that is broken, for needing liftIO
16:37:50<sorear>we should have all IO ops auto-lift
16:38:03<Cale>It doesn't *need* liftIO, it's just extremely convenient to have it.
16:38:17<Cale>You could also do lift . lift . lift
16:38:27<Cale>With as many lifts as needed.
16:38:50<sorear>"io theMRSucks = liftIO theMRSucks" ftw
16:38:55<dhart>Cale: thx for everything, I understand it much better now. I'm curious, now that the StateT monad is inside the ReaderT, how conveluted it will be to do "put" and "get" functions?
16:39:07<sorear>value restriction probably sucks more though
16:39:22<Cale>dhart: not at all, because there's an instance which makes them available "through" the ReaderT
16:40:05<Cale>dhart: Though that's a good observation.
16:40:29<Cale>Ordinarily, without that instance, you'd have to use lift in order to get at them.
16:40:50<Cale>lift takes an action in an underlying monad, and gives the equivalent in the transformed monad.
16:40:59<Cale>@type lift
16:41:01<lambdabot>forall (m :: * -> *) a (t :: (* -> *) -> * -> *). (MonadTrans t, Monad m) => m a -> t m a
16:41:22<Cale>m a -> t m a
16:41:44<Cale>@type lift get
16:41:46<lambdabot>forall (m :: * -> *) a (t :: (* -> *) -> * -> *). (MonadTrans t, MonadState a m) => t m a
16:42:03<Cale>@type \x -> lift (put x)
16:42:05<lambdabot>forall s (m :: * -> *) (t :: (* -> *) -> * -> *). (MonadTrans t, MonadState s m) => s -> t m ()
16:42:47<sorear>No wonder darcs stopped...
16:43:00<sorear>ACTION wishes flow control was harder to accidentally use
16:43:01<Cale>But that's unnecessary in this case, because there's a "lifting instance" for MonadState for any ReaderT over another MonadState instance.
16:43:20<sorear>@src ReaderT get
16:43:20<lambdabot>Source not found. That's something I cannot allow to happen.
16:43:23<sorear>:(
16:43:46<sioraiocht>@src fix
16:43:47<lambdabot>fix f = let x = f x in x
16:43:56<chessguy>Cale: i definitely agree with your comments in your article about the arbitrary existence of some lifting operations and not others being *very* confusing
16:46:07<tsp>argh, everything's being a Meddelandefältet today
16:46:52<Cale>chessguy: Yes, that was one thing which made monad transformers a lot harder for me to figure out at first. Once I fully realised that was what was going on, things started making a whole lot more sense.
16:47:25<Cale>Part of me would sort of prefer that those instances were left out.
16:47:29<dhart>Cale: nice, I'll check it out first thing tomorow. Now I need to leave work ^^ thx for all the help
16:47:37<sorear>@babel fr en Meddelandefält
16:47:38<lambdabot>Plugin `babel' failed with: IRCRaised Data.ByteString.last: empty ByteString
16:47:42<sorear>:(
16:47:53<Cale>dhart: quite welcome :)
16:47:56<Cale>oop
16:47:58<chessguy>Cale: or maybe require an extra import at least
16:47:59<tsp>it's swedish for something
16:48:05<chessguy>sorear: that's not french
16:48:06<Cale>chessguy: yes!
16:48:15<Cale>import Control.Monad.LiftingInstances
16:48:21<tsp>there's a Meddelandefältet, and a program som körs
16:48:53<sorear>tsp: Oh. So I went through all the trouble of /whois, host, and whois(1) only to discover "Calgary, CA" isn't relevant?
16:48:55<sorear>:)
16:49:14<monochrom>They don't use French in Calgary.
16:49:25<sorear>ACTION has no clue where calgary is, but knows that the only non-english language spoken in any large part of CA is french
16:49:26<tsp>sorear: heh, british columbia, but close enough
16:49:35<tsp>I hate french
16:49:38<tsp>mi parolas Esperanton
16:49:59<monochrom>Western Canada is very English and also pro-US actually.
16:50:14<chessguy>what a bunch of weirdos
16:50:21<Cale>Boooo US.
16:50:35<sorear>tsp: Calgary is from the snail-mail contact address for your ISP, it isn't specifically tagged as referring to you.
16:50:40<tsp>heh, french can manges la merde francaise for all I'm concerned
16:50:42<Cale>(I live in Ontario)
16:50:42<joelr1>:t >>=
16:50:43<[malte]>tsp, ankaÅ­ vi? tamen mi dezirus pli bone paroli Haskelon
16:50:44<lambdabot>parse error on input `>>='
16:51:03<chessguy>:t (>>=)
16:51:05<lambdabot>forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b
16:51:08<sebell>:t (>>=)
16:51:10<lambdabot>forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b
16:51:26<joelr1>aha
16:51:28<joelr1>:t (>>)
16:51:31<lambdabot>forall (m :: * -> *) a b. (Monad m) => m a -> m b -> m b
16:51:41<tsp>[malte]: mi lernas esperanton :) Cxu vi parolas bona haskelon?
16:51:43<chessguy>@hoogle m a -> (a -> b)
16:51:44<lambdabot>No matches, try a more general search
16:51:58<tsp>I seriously need an utf-8 client
16:52:07<[malte]>tsp, ni daÅ­rigu en #esperanto
16:52:18<chessguy>@hoogle (a -> b) -> m a
16:52:18<lambdabot>Prelude.($!) :: (a -> b) -> a -> b
16:52:19<lambdabot>Prelude.($) :: (a -> b) -> a -> b
16:52:19<lambdabot>Control.Monad.Error.catchError :: MonadError e m => m a -> (e -> m a) -> m a
16:52:28<chessguy>@hoogle (a -> b) -> m a -> m b
16:52:29<lambdabot>Prelude.($!) :: (a -> b) -> a -> b
16:52:29<lambdabot>Prelude.($) :: (a -> b) -> a -> b
16:52:29<lambdabot>Prelude.maybe :: b -> (a -> b) -> Maybe a -> b
16:55:21<chessguy>?where ndm
16:55:22<lambdabot>http://www.cs.york.ac.uk/~ndm/
16:55:59<sorear>neil d. mitchell, phd student, yhc hacker, #haskeller
16:56:25<daniel_larsson>"meddelandefält" = message field
16:56:26<daniel_larsson>"Programmet som körs" = The program that's running
16:56:31<sorear>gone for a week
16:56:54<chessguy>yeah, i was actually looking for his homepage
16:57:12<daniel_larsson>tsp: above, if you're still confused :)
16:57:30<ozzilee>Can someone help me with some really newbie questions? First, how do I get out of GHCi?
16:57:47<Igloo>:q
16:59:18<Cale>Or ctrl-c
16:59:20<chessguy>ozzilee: many commands to ghci involve a colon, followed by a letter, as just demonstrated
16:59:21<sorear>Igloo: when I pulled your most recent 4 patches, darcs died with an internal consistency error
16:59:28<sorear>Cale: only on windows
16:59:33<sorear>:?
16:59:34<Cale>sorear: huh?
16:59:47<Cale>sorear: ctrl-c works for me on ubuntu
17:00:03<Cale>er...
17:00:05<daniel_larsson>Cale: not on my ubuntu. Ctrl-D works fine though
17:00:07<Cale>sorry, ctrl-d
17:00:12<Cale>yeah
17:00:12<ozzilee>ctrl-c doesn't work on os x either
17:00:14<sorear>Cale: on windows ghci dies messily on ctrl-c, on (Debian sid) it stops computation, displays "Interrupted", adn returns to the repl
17:00:28<ozzilee>crtl-d does though, thanks
17:00:32<glguy>: reloads the current file
17:00:47<sorear>ozzilee: type :? <ENTER>
17:00:50<Cale>ACTION wonders how long he's been "awake"
17:00:54<sorear>read what it says
17:01:55<ozzilee>sorear: thanks
17:01:56<Cale>Hmm, 23 hours.
17:02:04<joelr1>can this be made shorter?
17:02:05<joelr1>do { x <- foo; y <- bar; return $ N x y }
17:02:17<joelr1>:t liftM2
17:02:19<lambdabot>forall a1 a2 r (m :: * -> *). (Monad m) => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
17:02:20<Cale>joelr1: liftM2 N foo bar
17:02:26<joelr1>argh
17:02:32<joelr1>i'm an idiot. thanks cale
17:03:57<narain>:t do {x <- foo; y <- bar; return $ N x y}
17:04:00<lambdabot>Not in scope: `foo'
17:04:00<lambdabot>
17:04:00<lambdabot><interactive>:1:19: Not in scope: `bar'
17:04:18<narain>ignore that
17:05:38<ozzilee>Ok, I can declare a function "foo" with "let foo x = x + 1", is this correct?
17:05:45<chessguy>:t do {?x <- ?foo; ?y <- ?bar; return $ ?N ?x ?y}
17:05:47<lambdabot>Parse error in pattern
17:06:01<narain>ozzilee: yes
17:06:18<chessguy>> let foo x = x + 1 in foo 1
17:06:19<lambdabot> 2
17:06:22<joelr1>how abou tthis one?
17:06:25<joelr1>foo = option Nothing $ do { reserved "xx"; strExpr >>= return . Just }
17:06:26<narain>:t do {x <- ?foo; y <- ?bar; return $ ?N x y}
17:06:28<lambdabot>parse error on input `?'
17:06:34<joelr1>even shorter without sacrificing clarity?
17:07:35<narain>:t ?x + ?y
17:07:37<lambdabot>forall a. (?x::a, ?y::a, Num a) => a
17:08:08<chessguy>:t do {return ?x}
17:08:10<lambdabot>forall t (t1 :: * -> *). (?x::t, Monad t1) => t1 t
17:08:57<sorear>foo = option Nothing $ reserved "xx" >> fmap Just strExpr
17:09:24<narain>?t option
17:09:24<lambdabot>Maybe you meant: tell temp time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ft v
17:09:30<narain>:t option
17:09:31<lambdabot>Not in scope: `option'
17:09:59<sorear>it is in parsec
17:10:09<narain>oh, ok
17:10:57<sorear>OR, if you are willing to use a recent addition (maybe just in trac, but I think it's in darcs too)
17:11:08<sorear>foo = optionMaybe $ reserved "xx" >> strExpr
17:15:24<joelr1>sorear: hmm
17:15:51<joelr1>sorear: @#@#% of course! we are in the maybe monad!!!
17:16:00<sorear>no we are in parsec
17:16:17<joelr1>sorear: in that particular parser
17:16:24<sorear>haskell-mode doesn't properly highlight CPP :(
17:17:50<dmwit>sorear: :set ft=cpp ;-)
17:18:00<joelr1>sorear: what about this one? shares = do { e <- numExpr; reserved "xx"; return $ Qty e }
17:18:10<sorear>dmwit: but if I do that it doesn't properly hl Haskell :)
17:18:38<sorear>shares = fmap Qty numExpr *> reserved "xx"
17:18:53<sorear>where x *> y = do { a <- x ; y ; return x}
17:18:59<dmwit>sorear: I think the real problem here is that you have C++ and Haskell in the same buffer. =P
17:19:04<joelr1>hmm
17:19:11<sorear>dmwit: CPP, not C++
17:19:33<dmwit>?where cpp
17:19:33<lambdabot>I know nothing about cpp.
17:19:34<sorear>dmwit: I don't want to write all this unboxed primop mangling by hand :)
17:19:41<sorear>dmwit: C PreProcessor
17:19:44<sorear>ghc -cpp
17:19:44<dmwit>o
17:19:56<sorear>?where hscpp
17:19:56<lambdabot>I know nothing about hscpp.
17:20:06<sorear>?google hscpp
17:20:07<lambdabot>http://urchin.earth.li/pipermail/debian-haskell/2004-September/000012.html
17:20:08<lambdabot>Title: [Debian-haskell] Re: [Haskell] hscpp
17:20:16<thedward>is it likely that there will be some sort of String type class in the future? To generalize over [Char] and Bytestring (and whatever else)?
17:20:19<joelr1>sorear: thanks
17:20:48<sorear>... who here has heard of heat sink corner press pins?
17:21:07<sorear>thedward: not likely at all
17:21:11<sorear>ACTION cynicises
17:21:25<sorear>look at ross' collections
17:21:29<sorear>@where collections
17:21:30<lambdabot>I know nothing about collections.
17:22:06<glguy>Foldable and Traversable generalize of some of that stuff though
17:22:29<thedward>well, I am mainly wondering if there is some reason it would be a bad idea.
17:22:45<glguy>thedward: what function would it have?
17:23:32<sorear>@where+ hscpp It's called cpphs, dimwit!
17:23:32<lambdabot>Done.
17:23:39<sorear>@where cpphs
17:23:39<lambdabot>http://www.cs.york.ac.uk/fp/cpphs/
17:23:43<thedward>glguy: to make it easier to write code that operates on any type of String?
17:23:52<dmwit>haha
17:23:57<dmwit>?where hscpp
17:23:57<lambdabot>It's called cpphs, dimwit!
17:24:00<dmwit>=)
17:24:44<glguy>thedward: ok... so I'll clarify: what function*s* would it have?
17:24:51<sorear>also http://haskell.org/cpphs/
17:24:52<lambdabot>Title: cpphs
17:25:50<thedward>glguy: hmm. well all the ones that come immediately to mind are list functions; maybe it should be a List type class :)
17:26:03<glguy>thedward: like Traversable?
17:26:07<sjanssen>thedward: I've hacked up a little 'Stringable' class before
17:26:24<thedward>ooh. Traversable, I've been meaning to read up on that.
17:26:24<sorear>thedward: ross paterson's collections probably do what you want
17:26:37<Debolaz>Which book is the defacto guide to Haskell?
17:26:43<Debolaz>ACTION is on a shopping spree.
17:26:58<sjanssen>it'd be a nice thing to have, especially with the half a dozen string representations around
17:27:01<thedward>well, what I actually want is to write some code that with either Strings or Bytestrings
17:27:08<sjanssen>sorear: I think you mean jyp's collections package
17:27:17<sjanssen>there is also Edison
17:27:42<sebell>thedward: You could always just write your code with a qualified module name
17:27:58<sjanssen>thedward: feel free to yank http://darcs.haskell.org/SoC/fps-soc/Data/Stringable.hs
17:28:37<sorear>we NED properly overloaded basic ops, like ++
17:29:07<sjanssen>emphasized typos are especially humorous
17:29:19<glguy>(.) = fmap (++) = mappend ? :)
17:29:21<thedward>sjanssen: that is exactly the sort of thing I want. Thanks. :)
17:29:29<sorear>glguy: yah
17:29:53<narain>:t mappend
17:29:55<lambdabot>forall a. (Monoid a) => a -> a -> a
17:30:11<narain>Mon*oid*? eep
17:30:24<sjanssen>narain: they're much simpler than Monads
17:30:27<sorear>it's elementary abstract algebra!
17:30:28<sorear>!!
17:30:32<opqdonut>yeh
17:30:33<sorear>@src Monoid
17:30:34<lambdabot>class Monoid a where
17:30:34<lambdabot> mempty :: a
17:30:34<lambdabot> mappend :: a -> a -> a
17:30:34<lambdabot> mconcat :: [a] -> a
17:30:39<opqdonut>?instances Monoid
17:30:40<glguy>monoids have an associative operation and an identity
17:30:40<lambdabot>(), (a -> b), (a, b), (a, b, c), All, Any, Dual a, Endo a, Ordering, Product a, Sum a, [a]
17:31:05<opqdonut>(++) for [] i'd guess?
17:31:06<narain>that's it? haha, that's cute
17:31:14<sorear>opqdonut: yes
17:31:15<opqdonut>and . for (a->b)?
17:31:24<sorear>opqdonut: no, liftM2 mappend
17:31:28<narain>> mappend (1,2) (3,4)
17:31:29<sorear>@src (->) mappend
17:31:29<lambdabot> Add a type signature
17:31:29<lambdabot>Source not found. That's something I cannot allow to happen.
17:31:36<glguy>> Sum 1 `mappend` Sum 10
17:31:37<lambdabot> Sum {getSum = 11}
17:32:00<sorear>> mappend ("foo"++) ("bar"++) "baz" -- silently different in 6.6 and 6.4!
17:32:01<lambdabot> "foobazbarbaz"
17:32:05<sjanssen>> mappend (Sum 1, Product 2) (Sum 3, Product 4)
17:32:06<lambdabot> (Sum {getSum = 4},Product {getProduct = 8})
17:32:07<narain>:t mappend (?a,?b) (?c,?d)
17:32:09<lambdabot>forall t t1. (?a::t, ?b::t1, ?c::t, ?d::t1, Monoid (t, t1)) => (t, t1)
17:32:13<sorear>6.4 saz: "foobarbaz"
17:32:17<glguy>> (Product 3, Sum 3) `mappend` (Product 2, Sum 2)
17:32:19<lambdabot> (Product {getProduct = 6},Sum {getSum = 5})
17:32:27<glguy>oh, someone already did that :)
17:32:38<narain>ohh
17:32:56<narain>fun
17:33:06<glguy>> mempty :: Sum Int
17:33:07<lambdabot> Sum {getSum = 0}
17:33:13<sjanssen>narain: there are several monoids with the numbers, so we have newtype wrappers to choose them
17:33:44<narain>sjanssen: that makes sense
17:33:59<narain>> mempty :: All
17:34:00<lambdabot> All {getAll = True}
17:34:17<narain>just checking
17:34:41<sjanssen>to see monoids used to great effect, see the fingertree paper by Hinze and Paterson
17:34:52<narain>wait, () is a monoid? what's mappend for ()? const?
17:35:11<narain>> mappend () ()
17:35:11<lambdabot> ()
17:35:14<glguy>> () `mappend` undefined
17:35:14<lambdabot> ()
17:35:25<glguy>> undefined `mappend` ()
17:35:26<lambdabot> ()
17:35:34<glguy>mappend _ _ = ()
17:36:06<narain>now that's just silly
17:36:17<sorear>The Ordering instance is very useful.
17:36:36<opqdonut>> [()..]
17:36:38<lambdabot> [()]
17:36:41<opqdonut>:D
17:36:44<opqdonut>excellent
17:36:49<glguy>> liftM2 mappend [LT ..] [LT ..]
17:36:49<sjanssen>yes, compare on lists is something like:
17:36:51<lambdabot> [LT,LT,LT,LT,EQ,GT,GT,GT,GT]
17:37:18<sjanssen>> mconcat (zipWith compare "stuff" "stuff2")
17:37:19<lambdabot> EQ
17:37:23<sjanssen>bah
17:37:29<sorear>@scheck \a b c d -> ((a `compare` b) `mappend` (c `compare` d)) == ((a,b) `compare` (c,d)) :: Bool -> Bool -> Bool -> Bool -> Bool
17:37:31<lambdabot>Couldn't match expected type `Bool -> Bool -> Bool -> Bool -> Bool'
17:37:33<sjanssen>close
17:37:36<glguy>> liftM2 (\x y -> (x,y,mappend x y)) [LT ..] [LT ..]
17:37:37<lambdabot> [(LT,LT,LT),(LT,EQ,LT),(LT,GT,LT),(EQ,LT,LT),(EQ,EQ,EQ),(EQ,GT,GT),(GT,LT,GT...
17:37:40<sorear>@scheck (\a b c d -> ((a `compare` b) `mappend` (c `compare` d)) == ((a,b) `compare` (c,d))) :: Bool -> Bool -> Bool -> Bool -> Bool
17:37:42<lambdabot> Failed test no. 3. Test values follow.: True, True, False, True
17:37:48<narain>?src Ordering
17:37:48<lambdabot>data Ordering = LT | EQ | GT
17:37:58<sorear>@scheck (\a b c d -> ((a `compare` b) `mappend` (c `compare` d)) == ((a,c) `compare` (b,d))) :: Bool -> Bool -> Bool -> Bool -> Bool
17:37:59<lambdabot> Completed 16 test(s) without failure.
17:38:17<sorear>@src (,) compare
17:38:17<lambdabot>Source not found. Have you considered trying to match wits with a rutabaga?
17:38:29<narain>?src Ordering compare
17:38:29<lambdabot>Source not found. Do you think like you type?
17:38:33<narain>oh wait
17:38:38<narain>?src Ordering mappend
17:38:39<lambdabot>Source not found. You type like i drive.
17:38:50<narain>i didn't come here to be insulted
17:38:56<glguy>qq
17:39:26<dmwit>How does lambdabot drive?
17:39:31<sorear>glguy: how dare you!
17:39:38<sorear>:)
17:39:47<glguy>umm... lol? ;)
17:40:03<sorear>narain: patch it
17:40:28<glguy>and if you think "sure, that's a good idea", then fix ?vixen and ?let first
17:40:36<glguy>and then bother changing the error messages
17:40:50<dmwit>What's wrong with ?vixen?
17:40:51<glguy>afterward
17:40:59<glguy>?vixen didn't used to say this:
17:41:00<lambdabot><undefined>
17:41:12<narain>?vixen
17:41:12<lambdabot><undefined>
17:41:13<dmwit>I thought dons just disabled it for a while.
17:41:14<narain>?vixen
17:41:14<sjanssen>I think we're waiting on a fix for the regex libraries for let
17:41:14<lambdabot><undefined>
17:41:18<narain>?vixen
17:41:18<lambdabot><undefined>
17:41:25<narain>take that you foul mouthed bot
17:41:27<glguy>or fix this:
17:41:34<glguy>?type mapM
17:41:36<lambdabot> Ambiguous occurrence `mapM'
17:41:37<lambdabot> It could refer to either `mapM', imported from Control.Monad.Writer
17:41:42<sorear>glguy: don't discourage fixes
17:41:51<sjanssen>glguy: you know how to use darcs send
17:42:16<glguy>sjanssen: I'm only arguing that there are much more important things to worry about than sudo insults
17:42:17<narain>not like i know nearly enough to fix any bugs in lambdabot
17:42:29<sorear>glguy: also, if narain removes the insults, @let will be AUTOMATICALLY fixed
17:42:39<glguy>?
17:42:47<sorear>since @let is fixed in darcs but dons hasn't bothered to recompile
17:42:51<glguy>ahh
17:43:07<glguy>but if the insults are fixed, dons will be hot to recompile?
17:43:11<sjanssen>narain: you'd be surprised. lambdabot is a good project to cut your teeth on
17:43:12<glguy>"fixed"
17:43:27<sjanssen>bug dons to recompile in 24 hours or so, after the ICFP deadline
17:43:41<narain>im already cutting my teeth on something else
17:43:44<sorear>when are ICFP papers published?
17:43:58<sorear>ACTION is still managing to avoid hacking ghc
17:44:08<sjanssen>probably at ICFP, August or so?
17:46:15<narain>anyway i wouldn't want to lobotomize lambdabot's testy personality
17:51:40<sebell>Hmmm. I can't seem to use runInteractiveCommand from GHCI
18:09:34<sjanssen>@yow
18:09:34<lambdabot>... the MYSTERIANS are in here with my CORDUROY SOAP DISH!!
18:10:28<opqdonut>@. elite yow
18:10:29<lambdabot>WhY iS ev3Ry+hinG mAd3 of lY(r4 zp4nd3x?
18:12:02<sjanssen>sebell: what happens?
18:13:48<sebell> sjanssen: I get EOF exception when trying to read from the output handle
18:15:57<hpaste> sjanssen pasted "ghci session with runInteractiveCommand" at http://hpaste.org/1266
18:18:45<sjanssen>sebell: do simple things like "ls" work?
18:20:01<sebell>sjanssen: that seems to work for me
18:21:17<sebell>sjanssen: the issue seems to be with my own function (which in turn uses unsafeInterleaveIO)
18:24:26<sioraiocht>anyone know how to get haskell mode in emacs to use ghci instead of hugs? i fixed it once but i can't remember how and this is a new install
18:24:51<sebell>(add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
18:25:23<sorear>aslo look at the haskell interpreter command in customize
18:25:31<freshhawk>is there a current best practice for avoiding thread starvation / memory issues when you have multiple producers and one consumer communication over a tchan?
18:25:54<freshhawk>*communicating
18:25:55<sioraiocht>sebell, sorear : tahnks
18:26:32<sorear>yay, I finally got a chance to use Any
18:26:55<sjanssen>@pl ssfold p f a0 xs = foldr (\x xs a -> if p a then a else xs (f a x)) id xs a0
18:26:56<lambdabot>ssfold = (flip .) . flip flip id . ((foldr . (const .)) .) . (. ((ap id .) . flip)) . (.) . ap . (if' =<<)
18:27:20<mauke>@. pl . unpl pl ssfold p f a0 xs = foldr (\x xs a -> if p a then a else xs (f a x)) id xs a0
18:27:23<lambdabot>ssfold = (flip .) . flip flip id . ((foldr . (const .)) .) . (. flip (flip . (((.) . (>>=) . (id >>=)) .) . flip flip (return .) . (((.) . (>>=)) .) . flip) (return .)) . (.) . (>>=) . (if' =<<)
18:28:27<narain>@. unpl pl ssfold p f a0 xs = foldr (\x xs a -> if p a then a else xs (f a x)) id xs a0
18:28:28<lambdabot>ssfold aa bl b c = foldr (\ br _ -> (aa >>= if') >>= \ be -> ((\ o -> o) >>= \ ay -> (\ s -> bl s br) >>= \ ax -> return (ay ax)) >>= \ bd -> return (be bd)) (\ k -> k) c b
18:28:45<sjanssen>hmm, lambdabot seems to be generating bad results here
18:29:14<sjanssen>@pl ssfold p f a0 xs0 = foldr (\x xs a -> if p a then a else xs (f a x)) id xs0 a0
18:29:15<lambdabot>ssfold = (flip .) . flip flip id . (foldr .) . (. ((flip (.) .) . flip)) . (.) . (.) . ap . (if' =<<)
18:29:21<kpreid>pl or unpl?
18:29:26<mauke>unpl is almost pure obfuscation
18:29:28<sjanssen>kpreid: pl
18:29:44<kpreid>both have flaws in their parsing, but I wrote unpl :)
18:31:10<narain>does pl work by eliminating one argument at a time?
18:31:11<sorear>kpreid: unfortunately you aren't doing enough type checking :) I want eta expansion and monad op inlining
18:31:27<sioraiocht>is it possible to do parallel list comprehension?
18:31:39<kpreid>sorear: so write it :-)
18:31:48<narain>@pl \xs0 -> foldr (\x xs a -> if p a then a else xs (f a x)) id xs0 a0
18:31:48<lambdabot>flip (foldr ((ap (if' =<< p) .) . flip (.) . flip f) id) a0
18:31:54<sioraiocht>and by that i mean do the evaluation on each member of the list in parallel
18:31:55<mauke>I think ghc supports it as an extension
18:32:01<narain>@pl \a0 xs0 = foldr (\x xs a -> if p a then a else xs (f a x)) id xs0 a0
18:32:01<lambdabot>(line 1, column 9):
18:32:02<lambdabot>unexpected "="
18:32:02<lambdabot>expecting pattern or "->"
18:32:09<LeCamarade>Stuck with a problem. I need to iterate over data that I collect from an IO monad (hence can't get rid of the blemish). But I can't return that, because it would ruin my returns ... I don't know if I should just think harder, or it isnormal to meet such quirks (and think of a work-around). Do I just need some sleep? :D
18:32:09<narain>@pl \a0 xs0 -> foldr (\x xs a -> if p a then a else xs (f a x)) id xs0 a0
18:32:10<lambdabot>flip (foldr ((ap (if' =<< p) .) . flip (.) . flip f) id)
18:32:14<sorear>narain: it is ordinary abstraction elimination, followed by the most sophisticated optimizer in the Haskell world.
18:32:27<sorear>sioraiocht: Control.Parallel.Strategies.parList
18:32:37<mauke>LeCamarade: I don't understand
18:32:49<mauke>sorear: wtf? what's wrong with zipWith?
18:32:59<LeCamarade>I am trying to get the filesystem as a tree.
18:33:01<mnislaih>help. where is the combinator for onclick in the xhtml package ?
18:33:02<sorear><sioraiocht> and by that i mean do the evaluation on each member of the list in
18:33:02<sorear> parallel
18:33:16<sorear>mauke: does zipWith do parallelism?
18:33:17<sebell>LeCamarade: You stay in the IO Monad
18:33:27<sioraiocht>sorear: thanks
18:33:38<LeCamarade>mauke: Yeah.
18:33:45<mauke>sorear: oh, right :( my interpretation was faulty
18:34:10<LeCamarade>The problem is that I think I should be returning the next file/dir, yet that would require ... wait a second ...
18:34:29<LeCamarade>mauke: Lemme first try what I thought of ...
18:34:48<sorear>sioraiocht: confusingly, parallel list comprehension is also the name of an unrelated ghc extension
18:35:04<sioraiocht>sorear: ah
18:36:24<sebell>sjanssen: I added EOF checking to my hGetContentsTimeout, but now it doesn't behave as it does in the compiled program -- in fact, the compiled program never reached EOF before at all
18:38:44<sjanssen>sebell: may I see the code?
18:41:37<hpaste> sebell pasted "hGetContentsTimeout" at http://hpaste.org/1267
18:42:57<stepcut>haddock barfs on this line: deriving (Monad, MonadIO, MonadFix, Functor, MonadReader TaskIOStyle), because of the MonadReader TaskIOStyle
18:43:04<stepcut>what is the best work-around ?
18:43:22<sjanssen>stepcut #ifndef HADDOCK
18:44:05<procyon112>fix haddock? *nudge-nudge-wink-wink*
18:44:29<sjanssen>or perhaps a dummy instance guarded by #ifdef HADDOCK
18:45:08<sjanssen>sebell: you should probably use waitProcess p to make sure you don't leave zombies
18:45:24<stepcut>sjanssen: spiffy, thanks
18:45:37<sioraiocht>sorear: so if Strategy is a -> Done, then how does parList get a value from a Strategy to build the list
18:45:51<sorear>sioraiocht: ?
18:45:56<sorear>type Done = ()
18:46:06<sorear>it just represents a side effect
18:46:14<sjanssen>@hoogle using
18:46:14<lambdabot>Control.Parallel.Strategies.using :: a -> Strategy a -> a
18:46:17<sorear>par :: Done -> Done -> Done -- do it in parallel!
18:46:39<sioraiocht>@t Control.Parallel.Strategies.parList
18:46:39<lambdabot>Maybe you meant: tell temp time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ft v
18:46:47<sioraiocht>@type Control.Parallel.Strategies.parList
18:46:49<lambdabot>forall a. Strategy a -> [a] -> Done
18:47:06<sioraiocht>ohh, n/m i get it, now
18:49:30<stepcut>hrm, now haddocks dies on: #ifndef HADDOCK
18:49:32<stepcut>:-l
18:51:25<sorear>stepcut: is your program a program?
18:52:02<stepcut>?? it's a module in a library...
18:52:09<sorear>http://hackage.haskell.org/trac/hackage/ticket/102
18:52:10<lambdabot>Title: #102 (building haddock for executables wont CPP) - Hackage - Trac
18:52:28<sorear>haddock doesn't cpp, you need to have something else (like cabal) do it first
18:52:36<sorear>or just upgrade to haddock.ghc
18:53:00<stepcut>ok, I was justing running 'haddock ABIO.hs', but in practice, it is run by cabal
18:53:30<sorear>haddock ABIO.hs wouldn't work anyway
18:53:39<Saizan> ?where derive
18:53:44<sorear>you need to specify an output format and a output directory
18:53:45<Saizan>?where derive
18:53:45<lambdabot>http://www.cs.york.ac.uk/fp/darcs/derive
18:53:53<sjanssen>sebell: does the program work differently if you compile with -threaded?
18:53:57<sorear>derive is pouplar? what have I done :(
18:55:11<Saizan>well i have to do that "derive a 'untyped' representation for my state type", and thought derive could help
19:00:28<glguy>@temp
19:00:30<lambdabot> now 17.6°, min 17.5°, max 24.2°, rain 0.0mm, wind 31km/h SW
19:02:05<glguy>!say hello
19:02:05<hpaste>hello
19:02:15<sorear>!say hi?
19:02:38<glguy>?admin+ :n=user@ip68-7-248-101.sd.sd.cox.net
19:02:38<lambdabot>Not enough privileges
19:02:45<glguy>err
19:02:48<glguy>!admin+ :n=user@ip68-7-248-101.sd.sd.cox.net
19:02:56<emu>@temp where?
19:02:56<lambdabot> now 17.6°, min 17.5°, max 24.2°, rain 0.0mm, wind 31km/h SW
19:03:01<glguy>I forget if the leading : needed to be there
19:03:01<Saizan>derive's cabal misses mtl in build-depends
19:03:35<sorear>it shouldn't depend on mtl
19:04:00<sorear>@admin + hpaste
19:04:11<sorear>!msg lambdabot @msg #haskell Muahahaha?
19:04:25<sorear>!say testing?
19:05:36<Saizan>Data/Derive/Play.hs:import Control.Monad.State
19:05:48<glguy>!admin+ n=user@ip68-7-248-101.sd.sd.cox.net
19:05:54<sorear>!msg lambdabot @msg #haskell Muahahaha?
19:05:58<Saizan>well maybe i've pulled a very recent patch
19:06:04<sorear>!say hi?
19:06:07<glguy>ACTION goes to check the code
19:06:11<glguy>did I remove !admin+ ??
19:06:30<sjanssen>speaking of derive, aren't these blank lines in derive.cabal illegal?
19:06:41<Igloo>Hmm, what's the flag to show which RULES are being applied?
19:06:49<sorear>-ddump-simpl-stats
19:07:12<sorear>sjanssen: I only wrote the .cabal, never tested it :)
19:07:17<Igloo>Thanks
19:07:23<Igloo>ACTION wonders what -ddump-rules is meant to do
19:07:26<glguy>!admin+ :sorear!n=user@ip68-7-248-101.sd.sd.cox.net
19:07:32<glguy>sorear: that should do it
19:07:35<glguy>i was forgetting the nick
19:07:39<sorear>!msg lambdabot @msg #haskell Muahahaha?
19:07:44<sorear>!say hi?
19:07:44<hpaste>hi?
19:07:52<glguy>> PRIVMSG lambdabot @msg #haskell Muahahaha?
19:07:52<glguy>:sorear!n=user@ip68-7-248-101.sd.sd.cox.net PRIVMSG #haskell :!say hi?
19:07:52<lambdabot> Parse error
19:08:09<glguy>lambdabot rejected the command, but hpaste tried making it
19:08:25<glguy>!say @admin + glguy
19:08:26<hpaste>@admin + glguy
19:08:26<sorear>@admin + hpaste
19:08:41<sorear>!say @msg #haskell Bwahaha!
19:08:42<hpaste>@msg #haskell Bwahaha!
19:08:42<lambdabot>Bwahaha!
19:08:47<Igloo>sorear: Do you happen to know if you can print the source before and after the rules are applied?
19:08:49<lambdabot>?
19:09:26<sorear>-ddump-simpl-iterations, -dverbose-core2core
19:09:31<sorear>or so the wiki said
19:09:44<sorear>@wiki GHC/Using_rules
19:09:45<lambdabot>http://www.haskell.org/haskellwiki/GHC/Using_rules
19:10:51<sjanssen>boo, derive isn't darcs sendable
19:11:17<sorear>I've directly bood ndm twice.
19:11:33<sorear>Just for that I'll say his email in cleartext:
19:11:38<sorear>ndm@cs.york.ac.uk
19:11:49<sorear>FTR he is out of communication for a week
19:11:57<sorear>with intent to continue hacking derive
19:12:34<sjanssen>he must be paranoid, he doesn't even include his email in darcs record messages
19:14:01<sjanssen>anyway, I just fixed the .cabal and replaced fmap with liftM for 6.6 compatibility
19:14:33<sjanssen>sorear: do you want the patches too?
19:14:37<sorear>darcs send --to=ndm@cs.york.ac.uk
19:14:55<sorear>sjanssen: no, I'm respecting his absense as if it were a lock
19:14:59<sjanssen>yep, already sent to ndm
19:15:42<Igloo>sorear: Thanks!
19:16:00<joelr1>sorear: he took a week off to hack derive?
19:17:06<sorear>he's also attending some kind of conference
19:17:18<sorear>but the details are a bit fuzzy
19:19:27<joelr1>sorear: what do you do for a living?
19:19:42<joelr1>sjanssen: and what about you?
19:20:15<pejo>sorear, wasn't it BTCS or something like that?
19:21:05<sjanssen>joelr1: I'm a computer science undergrad
19:21:21<joelr1>sjanssen: cool
19:22:15<sebell>sjanssen: Yes, I see the same behavior with GHCI as -threaded
19:22:27<sebell>(sorry for the late response)
19:22:30<sorear>joelr1: I stay at home and act like a 16-year-old dependant?
19:22:53<joelr1>sorear: :D
19:23:25<joelr1>sorear: i stay at home too
19:23:40<sjanssen>sebell: ghci uses the threaded RTS, so I think you've officially narrowed your problem
19:23:55<sjanssen>sorear: just "act like"?
19:24:00<sorear>yeah, but you probably don't get infinite free food, shelter, internet, and education :)
19:24:08<sjanssen>infinite?
19:24:12<sebell>sjanssen: Indeed.
19:24:12<joelr1>sorear: infinite?
19:24:15<glguy>sjanssen: in the verizon sense
19:24:23<joelr1>5Gb of food
19:24:24<joelr1>hehe
19:24:24<glguy>infinite for 5gig, which ever comes first
19:24:25<sorear>in the Haskell sense
19:24:27<sjanssen>glguy: 5 gigabytes of steak/month
19:24:45<sorear>no, my supplies are infinite but lazily evaluated
19:25:01<sorear>I only consume a finite amount in any given timeslot
19:25:19<qwr>so you're just not forced a strict evaluation?
19:25:57<sjanssen>sorear's refrigerator is just one big thunk
19:26:03<joelr1>hehe
19:26:34<glguy> /set format_unidentified_nick Loser:$0
19:26:36<glguy>oops
19:26:44<glguy> /set format_unidentified_nick Loser:$0
19:26:46<glguy>err!
19:26:52<glguy>damn spaces
19:27:03<glguy>you'd think that when you press UP
19:27:06<glguy>that it would fix that
19:27:30<sjanssen>now we all know that glguy hates unregistered nicks
19:28:23<joelr1>i think i just eliminated over 1000 lines of code thanks to sorear, maybe 1500
19:28:26<glguy>hate is such a strong word
19:28:31<joelr1>and that's not the end
19:28:45<joelr1>i should be able to blow away 500-1000 more
19:28:45<joelr1>he
19:28:46<sorear>apr1 : 09:56:07 <ndm> oh, btw - i'm off to Oxford all next week, out of email contact
19:29:07<sorear>BCTCS
19:29:18<mauke>0xf0rd
19:29:19<sorear>http://www.cs.swan.ac.uk/BCTCS2006/
19:29:21<lambdabot>Title: BCTCS 2006
19:29:35<qwr>ACTION is too lazy to register the damn nick. and there seem to be plenty of free nicks for backup. ;)
19:30:03<glguy>14:29 (*) Loser:qwr is too lazy to register the ... ;-)
19:30:18<qwr>yeah :)
19:31:08<sorear>* *qwr is too lazy to register the damn nick. and there seem to be plenty of free
19:31:09<sorear> nicks for backup. ;)
19:31:22<sorear>you realize it would have taken less typing just to register?
19:31:34<sorear> /msg nickserv register <password>
19:32:52<qwr>now, that i didn't have to figure out how, it was easy ;)
19:33:26<glguy>ACTION wonders where Loser:qwr went
19:33:51<glguy> /set format_unidentified_nick ~$0
19:33:55<glguy>:(
19:34:04<sjanssen>@slap glguy
19:34:04<lambdabot>why on earth would I slap glguy
19:34:14<glguy>ACTION isn't actually intentionally sending this stuff to channel
19:34:32<glguy>Time to drink some more coffee I guess
19:36:27<glguy>ACTION wonders why people would want to turn garbage pop music *up* when we aren't supposed to have audible music at all
19:36:47<glguy>I wonder if he just doesn't know what he's listening to
19:36:59<monochrom>in an office?
19:37:02<glguy>yeah
19:37:27<glguy>ACTION is completely ready to start his new job in Portland
19:37:29<monochrom>someone should let him know he should stop
19:38:01<glguy>monochrom: I Don't want to open myself up to the possibility of a conversation with him
19:38:29<procyon112>lol
19:39:03<glguy>which I would consider worse than having to block out christina aguilara(?)
19:39:25<astrolabe>You could try singing along
19:39:55<monochrom>You could compete and play Carmina Burana.
19:40:28<stepcut>hrm, for some reason ./Setup haddock, is running cphhs on ABIO.hs, but it never actually runs haddock on it :(
19:40:57<stepcut>oh wait, hahaha
19:41:09<stepcut>I'm just looking in the wrong output directory :)
19:42:46<sjanssen>glguy: throw things at him
19:42:49<sorear>glguy: How about explosives?
19:43:25<monochrom>A power outage.
19:44:11<sjanssen>one of those EMPs the movies always use?
19:44:12<sorear>ghc -e 'cycle "\0\255"' > /dev/audio
19:44:19<glguy>poweroutage woudl be great
19:44:24<glguy>because I would get to go home earlier
19:44:26<sjanssen>sorear++
19:44:43<glguy>sorear: does that do more than static?
19:44:45<sjanssen>ACTION waits for @flush
19:44:54<sorear>glguy: eeeeeeeeeeeeeee!
19:45:01<glguy>?help flush
19:45:02<lambdabot>flush. flush state to disk
19:45:14<sorear>glguy: maximum amplitude, maximum frequency square wave
19:45:22<monochrom>ACTION tries
19:45:24<glguy>Oh, does sorear @flush after karma to ensure that it is saved?
19:45:26<sorear>glguy: or silence if you aren't using 8-bit unsigned :)
19:45:29<sorear>@flush
19:45:30<sorear>yeah
19:45:32<glguy>?karma
19:45:33<lambdabot>You have a karma of 50
19:45:38<glguy>mine hasn't changed for a while
19:45:59<sorear>My karma high watered at fourty after shapr rewarded my for yi synhl.
19:46:02<glguy>everyone was excited about hpaste, but then I faded away
19:46:09<sorear>Then I lost it all to the bot crash.
19:46:14<glguy>ahh
19:46:17<glguy>?karma sorear
19:46:17<lambdabot>sorear has a karma of 30
19:46:23<sorear>glguy: hpaste is boring, you need new features
19:46:24<glguy>The great bot crash of 2007?
19:46:29<glguy>sorear: I agree
19:46:56<SamB_XP>like nethack?
19:47:15<glguy>ACTION has been playing with Factor recently
19:47:24<sorear>glguy: like ... type checking ... more channels ... multisyntax with autodetection ... an announce api ...
19:47:35<glguy>announce api?
19:47:41<sorear>you realize they are still using lisppaste over in #darcs?
19:47:52<sorear>like connect and recieve a lazy [Announce]
19:48:02<SamB_XP>interesting idea, sorear
19:48:20<SamB_XP>why don't you go write an RFC for one of those?
19:48:39<sorear>ACTION would write hpaste-mode for emacs if it had a decent api
19:48:43<sjanssen>type checking would be really nice IMO
19:48:56<sorear>SamB_XP: you really think the ietf cares about pastebots?!
19:48:58<glguy>I've never used the GHC API, what would that take?
19:49:07<sjanssen>newbies always forget to state the error messages
19:49:10<glguy>sorear: nope, they care about cash money
19:49:19<SamB_XP>sorear: I was thinking something more along the lines of "lazy RSS"
19:49:40<sorear>glguy: GHC API will probably segfault in no time, it's too big. Do as lambdabot does and fork a subprocess.
19:50:04<hpaste> boowax annotated "Monad Issue" with "(no title)" at http://hpaste.org/1268#a1
19:50:12<sorear>> array (0,maxBound::Int) [(1000000,'a')] -- look, segfault is caught!
19:50:14<lambdabot>Terminated
19:50:15<boowax>Since you guys were helpful to me last time, I've come back for more! I'm having a problem getting something to compile, can any of you guys give me some insight as to how to fix it? http://hpaste.org/1268#a1
19:50:18<sjanssen>GHC API also won't protect you from evil TH hacks
19:50:36<sorear>filtering out {-# OPTION will :)
19:50:39<monochrom>ghc -e 'map Char.chr $ Random.randomRs (0,255) $ Random.mkStdGen 42' > /dev/audio
19:51:05<sorear>monochrom: THAT is static.
19:51:08<SamB_XP>GHC API doesn't support -fno-th?
19:51:26<monochrom>Yeah
19:51:30<sorear>SamB_XP: -fno-th can be overriden with {-# OPTIONS -fth #-}
19:51:38<sorear>so we need to filter as well
19:51:51<SamB_XP>okay, so -fno-th-I-really-mean-it
19:51:54<monochrom>Ha, I don't need map.
19:52:03<sjanssen>or just run ghc with dropped privileges
19:52:14<sorear>tuukkah: ping?
19:52:24<sorear>I meant twanvl :)
19:52:29<sorear>twanvl: ping?
19:52:35<twanvl>sorear: pong
19:52:39<monochrom>ghc -e 'Random.randomRs ('\0','\255') $ Random.mkStdGen 42' > /dev/audio
19:54:09<xerox>ghc -e 'Control.Monad.Fix.fix (\xs -> 1 : 1 : zipWith (+) xs (tail xs))' > /dev/audio
19:54:30<joelr1>requiring TH seems to make ghc want functions to be defined before use
19:54:31<sorear>twanvl: My original plan had been to concentrate all the prettying logic in Peephole ... any particular reason you are doing the prettying in lK ?
19:54:50<twanvl>No, I just didn't know that
19:54:54<sorear>joelr1: yeah, that's why we have the derivations in separate modules
19:55:05<joelr1>aha!
19:55:19<twanvl>But why not do it immediatly?
19:55:51<sorear>separation of concerns?
19:56:08<sorear>smart constructors can only act as bottom-up traversals
19:56:18<xerox>ghc -e 'cycle (replicate 1000 '\0' ++ replicate 1000 '\255')' > /dev/audio
19:56:19<xerox>alarm
19:56:20<sorear>the peephole can be context sensitive
19:57:39<sorear>also, we really don't want special case code in derivations, because the goal of derive is to make adding derivations easier, and it helps if there is less code involved.
19:58:11<boowax>any takers for helping me with this: http://hpaste.org/1268#a1 ? I'm new to Haskell so it may be a fairly simple fix
19:58:56<Saizan>boowax: you are trying to compare two values which have different types, it seems
19:59:03<chessguy>procyon112: ping?
20:00:20<Saizan>your valTy is not a simple Type, but a Either ErrorTy Type, so you have to unpack it
20:00:35<SamB_XP>Saizan: well, the paste is called "Monad issues"
20:00:36<boowax>saizan: yes, that seems to be the case...the type in question is an Either ErrorTy Type and I just want to compare on Type....is there an easy way to extract it from the Either?
20:00:44<SamB_XP>so remember to use monads in the solution ;-P
20:00:47<joelr1>is there a way to resolve recursive module dependencies in haskell?
20:00:53<joelr1>or with ghc to be precise
20:01:09<SamB_XP>joelr1: you mean {-# SOURCE #-}?
20:01:10<sjanssen>with pain, yes
20:01:18<SamB_XP>and .hs-boot
20:01:26<joelr1>i put my derived parsers in a separate module but just realized (ghc told me) that mod1 (non-derived) needs funs from mod2
20:01:38<sjanssen>joelr1: it's better to eliminate the cyclic dependencies
20:01:46<SamB_XP>yes, quite
20:01:54<procyon112>sorear: I just had a weird realization
20:01:55<joelr1>sjanssen: that would require moving huge chunks of code from one module to another
20:02:01<joelr1>i can try ... i guess
20:02:07<SamB_XP>well, you can try the other way first
20:02:15<sorear>procyon112: cool, type theory ocks
20:02:24<SamB_XP>but don't blame *me* if you somehow manage to crash GHC (if this somehow involves TH)
20:02:29<joelr1>SamB_XP: which way? moving chunks is not gonna work, chunks are too huge
20:02:36<procyon112>sorear: You know Turing's halting problem thought experiment proof? Imagine a list of all possible computer programs.....
20:02:36<joelr1>this does involve TH
20:02:51<sorear>procyon112: yeah, semi-decidable
20:02:51<procyon112>sorear: My code generates that list :)
20:02:51<sjanssen>joelr1: there is no real limit to cut and paste
20:03:08<sorear>joelr1: stop using _derive_print_instance
20:03:12<SamB_XP>sorear: well, don't worry about it until GHC crashes okay?
20:03:18<Saizan>boowax: you can pattern match on it, like how you do with ty, or use the function either, or reqrite that function in a MonadError fashion maybe
20:03:19<joelr1>sorear: i'm not!
20:03:27<joelr1>sorear: i just ghc --make
20:03:38<sorear>joelr1: you just have a bunch of $( derive ... )'s rgith?
20:03:43<joelr1>$( derive makeFunParser ''StrCall )
20:03:44<joelr1>yea
20:03:51<joelr1>in mod2 that's required by mod1
20:03:51<xerox>ghc -e 'let tune = 42 in Monad.join $ map (\(t,s) -> replicate (t*10) s) (zip (Random.randomRs (0::Int,10) (Random.mkStdGen tune)) (Random.randomRs ('\0','\255') (Random.mkStdGen tune)))' > /dev/audio
20:03:54<xerox>mewzik
20:04:08<joelr1>i think i'm an idiot
20:04:19<SamB_XP>procyon112: do you have a decision procedure that determines whether or not a given file is a computer program?
20:04:20<sorear>so mod2 is a bunch of derives,and mod1 is the data types, and they are mutually recursive?
20:04:23<procyon112>sorear: All my future career programming asignments are in that list... Now I just need an algorithm to map specifications to an index, and my entire career is lazily evaluated :)
20:04:34<xerox>(t*100) is more audible, maybe.
20:04:39<sorear>procyon112: beware of the exponential.
20:04:58<sorear>what, people are having fun writing haskell audio programs?
20:05:00<SamB_XP>procyon112: you'd be surprise how long it takes to generate some of those entries
20:05:13<SamB_XP>also, isn't the index essentially the same thing as the entry?
20:05:30<joelr1>i just need to reverse the require order
20:05:32<sorear>my BF theorem prover can't prove S, it's just too complicated
20:05:39<joelr1>and move a few little bits to the TH module
20:06:03<stepcut>argh. So, I tried to use #ifdef __HADDOCK__, but now cpp is stripping out most of my file because it has the strings /* and later */
20:06:26<procyon112>SamB_XP: Yeah... mapping spec to index is a substantially more difficult problem than generating a lazy list of all possible well-typed programs :)
20:06:46<joelr1>no, does not work
20:07:46<joelr1>sorear: as soon as i derive it wants stuff from ModuleA but it I keep everything in one module then i need to order the functions
20:08:13<procyon112>SamB_XP: It works by generating all possible well-typed abstract syntax trees in a turing complete language.
20:08:20<joelr1>and in at least one case i don't think i can order the functions
20:08:41<sorear>joelr1: can you hpaste a small thing?
20:08:57<joelr1>sorear: sure
20:09:00<joelr1>what do you need?
20:09:11<Gwern>has anyone else been using dmenu? am I just imagining it or does dmenu convert apostrophes to backticks?
20:09:14<joelr1>@paste
20:09:15<lambdabot>Haskell pastebin: http://hpaste.org/new
20:09:29<procyon112>SamB_XP: Using S,K and Y (ap, const and fix) as primitives, all possible programs can be expressed, so this just filters out the poorly typed ones and returns the valid ones in a lazy list.
20:10:07<mauke>Gwern: you're imagining it :-)
20:10:16<SamB_XP>procyon112: dude, that won't be able to fulful the requirements of most specs!
20:10:21<chessguy>procyon112: so when are we going to be ready to integrate? i wanna play!
20:10:31<hpaste> joelr1 pasted "small thing" at http://hpaste.org/1269
20:10:39<joelr1>sorear: there ^^^
20:10:47<SamB_XP>people are always wanting the programs to read files or do something on the intarweb or something like that
20:10:51<sjanssen>joelr1: if you're trying to build ghc 6.7 just because you want to use derive, I have patches for you
20:11:15<sorear>procyon112: just pull the occurs check out, and eliminite Y, and optimize the type checker to (const True)
20:11:25<joelr1>sjanssen: i thought i could use derive with 6.6. i'm doing that at the moment, actually. do you have patches for ghc 6.7? because it doesn't build for me :D
20:11:33<joelr1>sjanssen: thanks, of course
20:11:36<procyon112>SamB_XP: I can just add primitives to access those things.
20:11:48<mauke>Gwern: it seems to use LEFT SINGLE QUOTATION MARK [‘] and RIGHT SINGLE QUOTATION MARK [’], though
20:11:54<SamB_XP>what about EGA graphics!
20:12:04<joelr1>sjanssen: i patched derive this morning (someone complained about my 70 messages :D)
20:12:22<sjanssen>joelr1: ah, did you send your fix to ndm?
20:12:24<Gwern>mauke: weird. I wonder how I should fix that?
20:12:24<procyon112>chessguy: Next step is a well-typed crossover operator.... then I should be able to integrate.
20:12:30<joelr1>sjanssen: nope
20:12:40<SamB_XP>hoarder of patches!
20:12:41<joelr1>sjanssen: i thought it was a glitch in the matrix
20:12:41<chessguy>procyon112: cool! any guess on an ETA?
20:12:59<SamB_XP>procyon112: so you can use it to make pretty pictures?
20:13:00<sjanssen>joelr1: was it the *same* cat?
20:13:04<joelr1>i thought that surely sorear and ndm would have the stuff that builds
20:13:08<sorear>joelr1: what's BoolCall, what is boolCall
20:13:08<sorear>?
20:13:17<sjanssen>joelr1: anyway, I sent ndm a fix for that
20:13:22<procyon112>chessguy: no firm estimate.. couple of days. I might get lots of time to work on it this weekend, or I might get none at all.
20:13:30<joelr1>sorear: BoolCall has a bunch of constructors for funs that return Bool (conceptually)
20:13:32<joelr1>same for others
20:13:33<sorear>joelr1: I don't usually bother to test except on <1 week old ghc:)
20:13:33<chessguy>lol, ok
20:13:38<procyon112>SamB_XP: I could... it's turing complete :)
20:13:40<sorear>joelr1: boolCall?
20:13:44<joelr1>boolCall is the parser, same for numCall, etc.
20:13:56<SamB_XP>procyon112: I was referring to the term "integrate"
20:13:59<sorear>hmm. what do you use boolCall for?
20:13:59<joelr1>sorear: boolCall is supposed to parse all the boolean functions
20:14:12<SamB_XP>it seems that the chief use of integration is making pretty pictures ;-P
20:14:14<joelr1>sorear: i use it in the condExpr, hang on
20:14:29<chessguy>procyon112: i'm thinking about just outputing stats to text files, and then basically using gnuplot for the interface
20:14:52<hpaste> joelr1 annotated "small thing" with "boolCall used here" at http://hpaste.org/1269#a1
20:14:55<sorear>joelr1: I think you might be able to avoid dependencies by using the class method directly.
20:14:56<joelr1>sorear: check
20:14:57<procyon112>chessguy: That sounds cool for now.
20:14:57<boowax>saizan: thanks for the help! I tried doing it with the pattern matching as you suggested and I'm having other issues with that...can you show me how to use the Either function you mentioned? my attempt at google-ing it was less than helpful
20:15:54<chessguy>procyon112: we can extend your REPL to seed and evolve populations, i think
20:15:55<SamB_XP>ACTION wishes you could change resolution in DOS by dragging on the corner of the window
20:15:56<sorear>joelr1: replace boolCall with parse globally, the type checker will know what you mean
20:16:14<sorear>@docs Data.Either
20:16:14<lambdabot>http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Either.html
20:16:37<joelr1>sorear: interesting... that would surely be hard to grok, though. parse? where does it come from? that type of thing
20:16:46<SamB_XP>well, more to the point, in near-DOS
20:16:54<joelr1>let me try with boolCall
20:16:57<procyon112>chessguy: I can't get my unifier to do infinite types... I've got a thread on haskell-cafe about it... but it's no hold up. I can still do turing-complete trees by adding fix as a primitive.
20:17:31<joelr1>sorear: you rock!
20:17:34<sorear>if you want to be explicit you could use (parse :: CharParser s BoolExpr)
20:17:35<sorear>:)
20:17:36<chessguy>procyon112: i can't even grok infinite types
20:18:04<procyon112>chessguy: Yea.. I can see the REPL and/or GUI doing cool things.. like selecting primitives, kicking off runs, selecting type schemes, all sorts of stuff.
20:19:19<procyon112>chessguy: infinite types are easy. It's the type of general recursion... (a->a)->a. It just means that this might not halt (all non-infinite types halt) because the type refers back to itself.
20:19:51<chessguy>hmm
20:20:13<joelr1>sorear: no, not needed
20:20:24<procyon112>chessguy: so, my unifier's problem is that it can'
20:20:33<procyon112>t figure out infinite types
20:21:18<procyon112>chessguy: but that's ok, because you can cheat, by giving fix as a primitive, and telling the unifier it's type (a->a)->a, so it doesn't have to figure it out.
20:21:46<procyon112>chessguy: and anything that can be resolved to an infinite type, can also be resolved in terms of fix.
20:21:47<chessguy>o
20:21:49<chessguy>ok
20:22:00<Saizan>boowax: another thing, you are using throwError in one of the case branches, so the typesign for checker doesn't seem quite right, unless you have some custom throwError
20:23:26<procyon112>chessguy: Haskell uses that method... It doesn't do infinite type either, but it gives fix as part of the language, and recursive lets and functions in terms of fix, so that any program can be written.
20:23:39<chessguy>i see
20:25:38<kscaldef>anyone around who might be able to help me with a HaXml problem (hopefully a simple one)?
20:26:51<Heffalump>depends on how simple
20:27:32<kscaldef>I'm just trying to parse and validate a document. The parsing goes fine, and the DTD and content look sane
20:27:43<procyon112>chessguy: It might be nice to have an infinite type checker as a kind of GP system because more funky recursive programs can be expressed easier if infinite types are allowed, but using fix works in a pinch, even if it makes it more difficult on the evolution, which I'm not confident it does.
20:27:49<kscaldef>but when I call validate, it compains about everything
20:28:01<kscaldef>every element is unknown, every atttribute is unknown
20:28:09<chessguy>procyon112: we can always add it later, too
20:28:20<chessguy>(assuming we can get it working
20:29:22<chessguy>ACTION finally breaks down and orders TAPL from amazon
20:29:22<procyon112>chessguy: I've never seen a paper on infinite types vs. fix in GP... actually, I've only seen about 3 papers on recursive GP ever :)
20:29:50<joelr1>yay, my stuff compiles! with derive and everything! kudos to sorear
20:29:55<kscaldef>so, it seems like what I want to do is very simple, but I must be doing something dumb
20:30:13<joelr1>ACTION high-fives sorear and goes to watch a movie. hacking to continue a little later
20:30:15<procyon112>PolyGP is the only deep work I've seen on this stuff.
20:30:43<chessguy>that was an interesting paper, if a little out-dated
20:30:52<joelr1>quality time with one's wife is very important! wives can only handle so many all-day haskell hacking sessions
20:31:13<Heffalump>kscaldef: nothing obvious comes to mind
20:31:27<chessguy>joelr1: that's why i need to solve all the world's problems in haskell in the next 10.5 months, before i get married!
20:31:29<Heffalump>but HaXml is a little temperamental in my experience
20:31:39<joelr1>ehehe
20:31:48<kscaldef>hmm... is there another validating XML parser I should consider?
20:32:02<joelr1>ACTION looks forward to using HaXml /will know who to go to/
20:32:08<chessguy>(man, i'm going to have to start pulling all-nighters soon)
20:32:11<joelr1>ACTION is away
20:32:25<monochrom>I swear by HXT
20:32:35<joelr1>oh, year, here's a going-away present: http://flickr.com/photos/joelr1
20:32:36<lambdabot>Title: Flickr: Photos from joelr1
20:32:38<procyon112>chessguy: I've already solved all the worlds problems in Haskell... All the solutions are somewhere in that lazy list of mine :)
20:34:18<kscaldef>monochrom: well, the existence of a cookbook for hxt is encouraging
20:34:40<procyon112>map eval allPossiblePrograms -- is fun to watch
20:35:27<Saizan>hxt is very nice the moment you realize it's like a list monad with arrow combinators
20:36:04<emu>count halting allPrograms / count (not . halting) allPrograms
20:36:19<procyon112>hehe
20:36:23<chessguy>lol
20:36:51<Saizan>you can calculate the chaitin constant! :D
20:36:52<monochrom>I have a code optimiser that simplifies that code to 0.
20:37:00<kscaldef>Saizan: I'm not sure I have enough haskell experience for that realization to apply
20:37:15<procyon112>Saizan: Isn't it effectively 1?
20:37:24<Heffalump>so, arrows are supposed to be good at tracking static properties of functions, right?
20:37:26<emu>count halting allPrograms / length allPrograms, sorry
20:37:44<chessguy>it's oo/oo
20:38:03<emu>counting and length are probably not good ways to put this
20:38:21<Saizan>procyon112, isn't it the probability that a random program halts? and is quite impossible to know its value
20:38:56<monochrom>lim n->oo (count programs under n that halts / n)
20:39:22<emu>that sounds better
20:39:31<monochrom>ACTION was a mathematician
20:39:40<emu>ACTION is not
20:39:47<procyon112>Saizan: The research I've seen estimates the value as infintessimally close to 1.
20:39:48<monochrom>ACTION is not
20:39:52<Syzygy->monochrom: Was? What happened?
20:40:04<monochrom>I entered computer science.
20:40:43<dylan>ACTION wants a new job
20:40:48<procyon112>Saizan: So, all programs are non-halting, except for the infinitely small subset we are actually interested in ;)
20:41:52<emu>that speaks about decidable languages then too?
20:44:30<procyon112>Essentually, if you introduce general recursion into the language, then the the ratio of non-halting programs to halting approaches 1 as the allowable size of the programs approach infinity.
20:44:58<Heffalump>dylan: what's wrong with your current one?
20:45:15<emu>approaches 1? that would be 1:1
20:45:44<Heffalump>procyon112: is the argument easy to summarise?
20:45:44<procyon112>emu: er... sorry. ratio of non-halting to total count.. my bad
20:46:28<procyon112>Heffalump: I've only seen it done experimentally.. I'm not sure if it's proven.
20:47:37<emu>whacha do, pick a compact representation of a turing machine and simulate n-bit ones ?
20:47:44<emu>*all n-bit ones
20:47:49<emu>for each n
20:48:10<emu>they still need some kind of bound
20:48:26<Saizan>yeah, you generate all bit-strings of lenght < n and see if they halt
20:48:36<procyon112>emu: I haven't personally, but I've seen a few papers that did more or less that for different representations.
20:49:14<emu>then you're testing linear bounded automatons
20:50:17<procyon112>emu: I'm more interested in the practical applications than the proof, so whether the limit is assymptotically 1 or not is less important to me than "it looks like it, so it's pretty close to something like that", since I'm developing large GP trees.
20:52:08<sorear> What order are the fields in a foreign import decl?
20:53:03<sjanssen>foreign import ccall "foo.h funcname" funcname :: stuff
20:54:15<sorear>where does unsafe go?
20:54:45<mauke>foreign import ccall safe "unistd.h execv" c_execv :: Ptr CChar -> Ptr (Ptr CChar) -> IO CInt
20:54:46<sorear>ok, random search found it
20:54:59<sorear>the ffi could use more DWIM
20:55:07<sorear>permutation parsers aren't that hard
20:55:29<sjanssen>or you could just learn the syntax
20:55:54<sorear>that's like expecting me to memorize the options to fsck
20:56:05<sorear>i just about never use it
20:56:07<monochrom>I heard some programmers bitched about the freedom in Java of allowing "public static final" to be permuted.
20:56:17<sorear>but when I need it, I need documentation or dwim
20:56:28<monochrom>dwim = ?
20:56:39<sorear>do what I (obviously) mean
20:56:59<mauke>int const unsigned typedef long foo;
20:57:58<sorear>bwahaha!
20:58:31<sorear>I've thoughroughly read that section of the spec, and implemented it
20:58:36<sorear>and I still did a double take
20:58:57<sorear>Oh, right, typedef *is* a storage class qualifier...
21:01:02<sorear>*Main Control.Concurrent System.Posix.Unistd> ghc-6.7.20070402: internal error: interpretBCO: unknown or unimplemented opcode 36080
21:01:05<sorear>nice.
21:01:19<monochrom>haha
21:07:19<matthew-_>ok, I need a map with fold in a monad
21:07:30<sjanssen>@type foldM
21:07:32<lambdabot>forall a b (m :: * -> *). (Monad m) => (a -> b -> m a) -> a -> [b] -> m a
21:07:45<matthew-_>fantastic. cheers.
21:08:51<syntaxfree>oh, boy.
21:09:51<monochrom>hey, girl.
21:12:00<Saizan>syntaxfree, it has been a long time, isn't it?
21:12:08<syntaxfree>yeah.
21:12:18<syntaxfree>I haven't been hacking much.
21:12:20<syntaxfree>or at all.
21:13:22<Saizan>we could have used a rant or two :)
21:14:00<matthew-_>@pl foldM (\(ls,acc) l -> f (l,acc) >>= \(l',acc') -> return (l:ls, acc'))
21:14:02<lambdabot>foldM (uncurry (flip (ap . (((>>=) . f) .) . flip (,)) . flip flip snd . (ap .) . flip flip fst . (((.) . const . (return .) . (,)) .) . flip (:)))
21:14:13<matthew-_>ew. Um, any clues?!
21:14:27<syntaxfree>Lispers have no zygomorphisms.
21:14:35<syntaxfree>I think I'm gonna rant about that.
21:14:50<syntaxfree>I saw an article on CLOS on reddit.
21:15:01<Saizan>zygomorphism?
21:15:07<syntaxfree>the generic dispatch mechanism is precisely what I'm used to in GNU R.
21:15:13<syntaxfree>So I decided to hack on it for a while.
21:15:20<syntaxfree>In the beginning, it's great fun.
21:15:40<syntaxfree>You feel somewhat like cheating on your wife, but, c'mon. Variadic functions, named arguments, macros...
21:15:55<syntaxfree>It's like going to this bordello where the girls will do all that kinky stuff your wife won't.
21:16:19<syntaxfree>but then, after a while, the fun wears off and you start feeling dirty for messing with the impure stuff.
21:16:36<syntaxfree>Finally, you return home thinking of how much you really love your wife and shouldn't have done that.
21:18:16<Saizan>?type \f -> foldM (\(ls,acc) l -> first (l:) `fmap` f (l,acc) )
21:18:16<syntaxfree>@help define
21:18:18<lambdabot>forall b d (m :: * -> *). (Functor m, Monad m) => ((b, d) -> m ([b], d)) -> ([b], d) -> [b] -> m ([b], d)
21:18:19<lambdabot>help <command>. Ask for help for <command>. Try 'list' for all commands
21:19:37<matthew-_>ahh, I thought I didn't know "first" - in Arrows.
21:19:58<matthew-_>Saizan: cheers, a solution that forces me to learn Arrows ;)
21:21:09<Saizan>well first f (x,y) = (f x,y) for the (->) arrow
21:21:10<sorear>Is there a recommended style for implementation documentation?
21:21:16<sorear>@src (->) first
21:21:17<lambdabot>first f = f *** id
21:21:23<sorear>@src (->) ***
21:21:23<lambdabot>Source not found. Sorry about this, I know it's a bit silly.
21:21:28<sorear>@src (->) (***)
21:21:29<lambdabot>(f *** g) ~(x,y) = (f x, g y)
21:21:49<syntaxfree>> ((+1) *** (-1)) (3,5)
21:21:49<lambdabot> add an instance declaration for (Num (b' -> c'))
21:21:59<sorear>:t (-1)
21:22:01<lambdabot>forall a. (Num a) => a
21:22:02<sorear>nice try.
21:22:11<sorear>sections aren't that simple :(
21:22:26<Saizan>screw unary minus!
21:22:34<luis>ACTION eyes syntaxfree
21:22:41<sorear>ACTION almost never uses negative numbers in Haskell
21:22:41<syntaxfree>> ((+1) *** (subtract 1)) (3,5)
21:22:43<lambdabot> (4,4)
21:23:01<sorear>ACTION wouldn't mind if unary minus was spelled N E G A T E
21:23:06<sjanssen>I think - should be made part of the lexical syntax for num literals
21:23:42<sorear>sjanssen: but then foo-1 woudn't work
21:23:47<sjanssen>such that (-1) parses as negative one, and (- 1) parses as subtract 1
21:24:02<sorear>foo-1 lexes now as foo - 1
21:24:09<sorear>foo-1 would lex as foo -1
21:24:11<sjanssen>sorear: correct. I think it's less hackish than what we have now
21:24:25<syntaxfree>maybe we should undefine (-) altogether.
21:24:28<syntaxfree>leave it for custom operators.
21:24:29<sorear>I think it should be eliminated altogether
21:24:39<matthew-_>Saizan: sorry, my original was wrong!
21:24:43<syntaxfree>it'd be great fun to make (-) = (*)
21:24:49<matthew-_> foldM (\(ls,acc) l -> f (l,acc) >>= \(l',acc') -> return (l':ls, acc'))
21:25:00<matthew-_>i.e. the l' in the return
21:26:34<Saizan>?type \f -> foldM (\(ls,acc) l -> first (:ls) `fmap` f (l,acc)) --?
21:26:36<lambdabot>forall b b1 d (m :: * -> *). (Functor m, Monad m) => ((b, d) -> m (b1, d)) -> ([b1], d) -> [b] -> m ([b1], d)
21:27:16<matthew-_>Saizan: yep, quite why I couldn't work that out, I'm not sure ;)
21:27:22<procyon112>?hoogle (***)
21:27:22<lambdabot>Did you mean: (***)
21:27:23<lambdabot>Prelude.undefined :: a
21:27:23<lambdabot>Control.Monad.Reader.ask :: MonadReader r m => m r
21:28:29<sjanssen>ACTION wonders how import Prelude hiding ((-)) would work
21:29:06<mauke>?hoogle ***
21:29:07<lambdabot>Control.Arrow.(***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
21:30:25<procyon112>that's handy. I have no idea what arrows are, but *** will be very useful :)
21:30:56<mauke>?hoogle &&&
21:30:56<lambdabot>Control.Arrow.(&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
21:31:12<Saizan>?hoogle +++
21:31:12<lambdabot>Control.Arrow.(+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')
21:31:13<lambdabot>Text.Html.(+++) :: (HTML a, HTML b) => a -> b -> Html
21:31:13<lambdabot>Text.ParserCombinators.ReadP.(+++) :: ReadP a -> ReadP a -> ReadP a
21:41:39<sorear>ACTION uses Haskell to write the world's first unlambda compiler!
21:45:26<matthew-_>grrr. Do I take it that readFile and writeFile close the file handles as lazily as possible?
21:45:43<bos>yes.
21:45:52<matthew-_>so if you've read it with readFile and then later on you try to write to it you have major issues?
21:45:59<bos>yes.
21:46:09<bos>at least if you're using windows.
21:46:14<matthew-_>linux here!
21:46:15<matthew-_>so the way round is to actually get the handles properly and hClose them?
21:46:18<bos>but probably on other OSes too.
21:46:32<bos>yes, you need to do the I/O quite imperatively.
21:46:37<matthew-_>ok, thanks
21:49:27<qwr>matthew-_: use strict bytestring's readFile
21:49:41<qwr>matthew-_: if you want the whole file
21:49:58<qwr>and want to close it right away
21:52:20<matthew-_>qwr: ahh, thanks. I'll look into that.
21:53:37<qwr>and Data.ByteString.Char8 unpacks as [Char]
21:54:12<desp>@whereis tackling
21:54:13<lambdabot>Maybe you meant: where where+
21:54:17<desp>@where tackling
21:54:18<lambdabot>I know nothing about tackling.
21:54:24<desp>@where awkward squad
21:54:25<lambdabot>I know nothing about awkward.
21:54:48<mauke>@google awkward squad
21:54:51<lambdabot>http://en.wikipedia.org/wiki/Awkward_Squad
21:54:51<lambdabot>Title: Awkward Squad - Wikipedia, the free encyclopedia
21:54:57<desp>@remember tackling http://research.microsoft.com/~simonpj/papers/marktoberdorf/
21:54:58<lambdabot>Done.
21:56:29<sorear>@flush
21:56:47<mauke>@unflush
21:56:47<lambdabot>Not enough privileges
21:56:52<sorear>just ... so many opportunities for side tracking
21:56:53<mauke>:(
21:57:32<desp>@remember awkward http://research.microsoft.com/~simonpj/papers/marktoberdorf/
21:57:32<lambdabot>Done.
21:57:36<desp>@where awkward
21:57:36<lambdabot>I know nothing about awkward.
21:57:39<desp>argh!
21:57:49<desp>I lose.
21:58:14<sorear>@quote awkward
21:58:14<lambdabot>awkward says: http://research.microsoft.com/~simonpj/papers/marktoberdorf/
21:58:25<sorear>@quote tackling
21:58:26<lambdabot>tackling says: http://research.microsoft.com/~simonpj/papers/marktoberdorf/
21:59:00<sorear>@where+ tackling http://research.microsoft.com/~simonpj/papers/marktoberdorf/
21:59:00<lambdabot>Done.
21:59:08<sorear>@where+ awkward http://research.microsoft.com/~simonpj/papers/marktoberdorf/
21:59:09<lambdabot>Done.
21:59:18<mauke>@where tackling the awkward squad
21:59:19<lambdabot>http://research.microsoft.com/~simonpj/papers/marktoberdorf/
22:00:09<desp>sorear: thanks
22:00:16<sorear>yw
22:01:07<desp>sorear: care to get sidetracked again? how do you like http://desp.night.pl/juwenalia3.png as a t-shirt design? ;)
22:02:15<sorear>Heh. cute. (Just personally not big on patterned clothing)
22:02:23<desp>ah.
22:02:46<sorear>I can't read the text but something screams "promoting a technical conference and/or video game"
22:03:08<desp>it's actually for a student's festival. for the students of the departament of mathematics and computer science.
22:03:18<desp>s/'s/s'/
22:03:59<dmwit>Just a guess, but is matematyki "mathematics"? ;-)
22:04:05<desp>yup
22:04:16<desp>and you could probably say "informatics"
22:04:21<dmwit>And "wydziat" is clearly "Wuzdat?"
22:04:29<desp>;)
22:04:45<sorear>What's the best haskell compiler for recursive-newtype-intensive programs? (hbc?)
22:05:07<mauke>haha, "what's the the best compiler for X"
22:05:35<sorear>there is a undisputed best compiler for general haskell, GHC
22:05:38<mauke>.oO( metahc -fghc )
22:05:54<sorear>but a long-standing bug renders it useless for my purpose
22:05:58<mauke>just change the build options, etc
22:06:07<sorear>we actually have that
22:06:10<sorear>@where hmake
22:06:10<lambdabot>http://haskell.org/hmake
22:21:51<dmead>hey channel
22:22:00<dmead>i'm in type constructor hell =/
22:24:22<stepcut>heh
22:24:32<monochrom>type constructor is easy
22:25:46<monochrom>actually everything is easy. then humans cook up messy code. so there is some chance you are in complexity hell and not type constructor per se, and the complexity is self-inflicted.
22:26:41<wmind>why don't imperative languages have nice simple sum types
22:26:52<wmind>most even have some sort of case for the pattern matching...
22:27:10<mauke>OCaml does :-)
22:27:30<dmead>i have a dependant typing problem actually
22:27:30<wmind>does OCalm count as imperative?
22:27:38<dmead>it's in between
22:27:57<stepcut>what about javascript ?
22:27:58<dmead>?seen sorear
22:27:59<lambdabot>sorear is in #darcs, #haskell-overflow, #ghc and #haskell. I last heard sorear speak 21m 48s ago.
22:28:05<dmead>?seen dons
22:28:06<lambdabot>dons is in #haskell-soc, #haskell-overflow and #haskell. I last heard dons speak 10h 57m 30s ago.
22:28:19<dmead>yeaaa
22:28:20<wmind>stepcut: I don't know :)
22:28:27<monochrom>Pascal has nice simple sum type.
22:28:30<dmead>i'm trying to figure out a dependant type structure for FOL
22:28:34<dmead>i mean
22:28:36<dcoutts>dmead: he's probably still a sleep
22:28:40<dmead>ah
22:28:45<wmind>monochrom: you mean variant records?
22:28:52<monochrom>Yes.
22:29:07<dmead>you know whats nice
22:29:27<dmead>if you include a type synonym in an data declaration
22:29:31<dmead>it can't be shown
22:29:34<dmead>=/
22:29:35<lightstep>i think Fortress is functional, since you have some kind of tagging for side-effects of functions, like monadic operations in askell
22:29:36<wmind>monochrom: well that's not even safe ...
22:29:37<dmead>apparently...
22:29:52<monochrom>I recall that it's safe. C's union not safe.
22:30:39<wmind>monochrom: how can it be safe?
22:30:47<monochrom>OK, I forgot.
22:31:02<wmind>monochrom: it's a record, and some fields are enabled depending on others
22:31:18<wmind>monochrom: you check the flag field and decide what to access
22:31:24<wmind>monochrom: it can't be safe
22:32:17<dmead>?paste
22:32:18<lambdabot>Haskell pastebin: http://hpaste.org/new
22:32:26<wmind>monochrom: plus I don't even find that simple :D an haskell like sum and then pattern matching in case would do the job
22:33:18<augustss>yo
22:34:46<sorear>hello!
22:35:22<hpaste> dmead pasted "dependant types for FOL?" at http://hpaste.org/1270
22:35:23<sorear>dmead: you called?
22:35:47<hpaste> dmead annotated "dependant types for FOL?" with "(no title)" at http://hpaste.org/1270#a1
22:35:55<dmead>allo
22:36:14<dmead>augustss: you probably know the answer to this
22:36:44<dmead>i'm trying to figure out a nice way to represent FOL as type constructors
22:37:47<sorear>augustss: can hbc survive newtype V = V (U V -> U V)
22:37:48<augustss>dmead: you need dependent types to represent quantifiers
22:38:14<sorear>I non-negotiably have that type in my program. I could use hugs, but I'd like an optimizing compiler.
22:38:20<augustss>sorear: probably, but i don't know
22:39:03<dmead>augustss: indeed, did you have seperate types for propositions, predicates and variables in dijnn?
22:39:11<sorear>About how much of a fight do you think hbc install will put up?
22:39:15<Igloo>sorear: Is this the known GHC-loops bug? If so, and you have a real use for it, then you should let SPJ know
22:39:36<augustss>what djinn does have little relevance, since djinn only does propositional logic
22:40:03<dmead>oh
22:40:11<dmead>i thought yours did FOL
22:40:24<sorear>Igloo: does it matter if the program is not one anybody will actually use?
22:40:43<sorear>Igloo: or rather, the functionality is pretty useless
22:40:58<sorear>Igloo: it's an Unlambda compiler
22:41:06<augustss>dmead: no quantifiers. quantifiers makes it undecidable
22:41:10<sorear>should I still tell him?
22:41:36<augustss>sorear: installing hbc is most likely a major pain
22:41:38<dmead>augustss: what method for proving did you use?
22:42:15<sorear>some kind of CJK calculus
22:42:18<Igloo>sorear: If you want to run the program, then yes
22:42:27<augustss>dmead: a variation of Gentzen's LJ
22:42:29<Igloo>sorear: The description on http://www.haskell.org/ghc/docs/6.6/html/users_guide/bugs.html#bugs-ghc says:
22:42:31<sorear>there's a well commented source file in the djinn repo
22:42:32<lambdabot>Title: 12.2. Known bugs or infelicities, http://tinyurl.com/22mp2v
22:42:33<dmead>hmm
22:42:35<Igloo>We have never found another class of programs, other than this contrived one, that makes GHC diverge, and fixing the problem would impose an extra overhead on every compilation. So the bug remains un-fixed.
22:42:46<dmead>i'm trying to do resolution
22:42:55<sorear>@where spj
22:42:56<lambdabot>I know nothing about spj.
22:43:12<Igloo>assuming that is the same problem you're running into
22:43:34<Igloo>glasgow-haskell-users@haskell.org is probably the best place to bring it up
22:43:36<augustss>dmead: does resolution give you a constructive proof?
22:43:55<dmead>augustss: yes
22:44:16<dmead>err
22:44:19<dmead>it's gives you a proof
22:44:24<dmead>what do you mean by constructive proof?
22:44:57<monochrom>Whenever "a or b" is proved, the proof tells you "it's actually a" or "it's actually b".
22:45:01<augustss>you can't use the law of excluded middle (or double negation, or something equivalent)
22:45:15<dmead>ah
22:45:21<monochrom>Whenever "exist x. Px" is proved, the proof tells you a lot about the x chosen.
22:45:29<augustss>I wanted a proof method that gave me programs
22:45:35<dmead>ah
22:45:59<dmead>resolution just says when you have a v b and ~a v c
22:46:05<dmead>you can write b v c
22:46:27<monochrom>yeah, usually, when proving "exist x. Px", an algorithm (maybe slow but still) is produced for crunching out an x.
22:47:06<dmead>hmm, resolution in FOL is still much simpler than that
22:47:07<monochrom>Yes that one kills constructivity.
22:47:08<augustss>dmead: but that uses excluded middle
22:47:32<dmead>whats wrong with that?
22:47:41<dmead>@hoogle halp
22:47:42<lambdabot>No matches found
22:47:45<dmead>hmm
22:47:46<augustss>proving for propositional calculus in classical logic is easy
22:47:58<dmead>right
22:48:06<dmead>in FOL you skolemize each predicate
22:48:08<augustss>it's the constructive part that is the challange
22:48:21<dmead>and it gives you an interpretation ( i think ) that is valid to do resolution with
22:48:22<monochrom>It doesn't tell you "it's b" or "it's c". More detailedly, it says "a or ~a, but I don't care which, it's probably impossible to find out anyway"
22:48:38<dmead>oh well
22:48:40<stepcut>Igloo: are you subscribed to debian-haskell@lists.urchin.earth.li ?
22:48:49<dmead>thats just the resolution rulew
22:49:02<dmead>the entire proof method requires you to break a sentence into a list of conjuncts
22:49:14<Igloo>stepcut: Yes
22:49:20<augustss>dmead: what method you use depends on what your purpose is (and your philosophy :) )
22:49:26<dmead>hmm
22:49:33<monochrom>Yes, one could refrain from that rule. Fewer things can be proved, but all proofs provide more information.
22:50:00<dmead>resolution is an inference rule
22:50:05<monochrom>It is okay because constructivity does mean fewer things provable anyway.
22:50:57<sorear>@all-dicts skolemize
22:50:58<lambdabot>No match for "skolemize".
22:51:18<dmead>http://planetmath.org/encyclopedia/Skolemization.html
22:51:20<lambdabot>Title: PlanetMath: Skolemization
22:52:13<augustss>Thoralf Skolem
22:52:16<sorear>brilliant
22:52:45<sorear>computing a supertype of an arbitrary type with no existentail quantification...
22:52:57<monochrom>it sounds like resolution is in-grained in classical non-constructive logic then.
22:53:11<luis>Does anybody have an HTML version of YAHT?
22:53:26<dmead>ni
22:53:28<dmead>no
22:53:32<Saizan>?google wikibook YAHT
22:53:34<lambdabot>http://en.wikibooks.org/wiki/Haskell/YAHT
22:53:43<sorear>how embarrasing
22:53:46<dmead>you can use resolution in FOL if you have a correct skolem function
22:53:50<sorear>@hoogle Char -> IO ()
22:53:50<lambdabot>Prelude.putChar :: Char -> IO ()
22:53:51<lambdabot>System.Console.Readline.completeInternal :: Char -> IO ()
22:53:51<lambdabot>System.Console.Readline.setPendingInput :: Char -> IO ()
22:53:57<luis>Saizan: thanks
22:54:00<monochrom><a href="yaht.pdf">yaht</a>
22:54:01<sorear>I can't believe putChar slipped :)
22:54:11<dmead>hey
22:54:20<dmead>i'm making a type synonym
22:54:21<sorear>ndm++
22:54:24<sorear>@flush
22:54:24<dmead>which is Char -> [Char]
22:54:30<dmead>can i add a show instance for that?
22:54:36<sorear>no
22:54:38<dmead>=/
22:54:41<sorear>you can if it's a newtype
22:54:47<dmead>HMM
22:54:48<dmead>alright
22:54:54<sorear>but type synonyms are basically macros
22:55:14<dmead>right
22:55:23<dmead>it's sorta tricky
22:55:46<dmead>i've got a few paragraphs what what a well formed formula for FOL is
22:56:03<dmead>and i'm trying to cram that into not as many lines of data types
22:56:14<dmead>*of what
22:57:52<monochrom>should be just a few lines
22:58:00<dmead>yea
22:58:18<dmead>i keep running into problems with show =/
22:58:27<augustss>why
22:58:35<augustss>can't you just derive it?
23:01:48<Igloo>stepcut: Why did you ask? Did I miss a message there?
23:02:11<hpaste> dmead pasted "layout manager hates me" at http://hpaste.org/1271
23:03:38<stepcut>Igloo: no, but I am going to send one, and I wanted to make sure you had the opportunity to see it
23:03:47<Igloo>OK :-)
23:03:53<stepcut>Igloo: debian packages (everyones, not just yours) install the documentation in /usr/share/doc
23:04:05<hpaste> sorear pasted "Is this a GHCi bug?" at http://hpaste.org/1272
23:04:17<Igloo>stepcut: I have plans to do something else, probably for 6.6.1
23:04:29<stepcut>Igloo: but ghc-pkg describe pkgName, says that it is stored in /usr/share/pkgName-1.0/doc/html
23:04:51<stepcut>Igloo: which is, (a) wrong (b) unfortunate, because haddock uses that information to try to create links between packages
23:04:51<Igloo>stepcut: I'm not quite sure what something else is, but I do now know how to merge docs into one big haddock index
23:04:58<Igloo>stepcut: Right, there's a bug about that too
23:05:02<Igloo>I'll look into it at the same time
23:05:23<sorear>Can someone take a quick look at that paste and tell me if I should file a ticket?
23:05:23<stepcut>Igloo: spiffy, I wasn't sure if anyone had noticed yet
23:05:40<Igloo>I think Ross Patterson filed it a week or so ago
23:06:04<augustss>dmead: what's the 'a in 'Formula a' anyway?
23:06:16<monochrom>s/Not Formula/Not (Formula a)/
23:06:54<augustss>I mean, i can see it in quantifier, but it makes little sense to me
23:06:58<chessguy>?uptime
23:06:58<lambdabot>uptime: 1d 7h 56m 42s, longest uptime: 5d 3h 40m 45s
23:07:09<stepcut>Igloo: spiffy, I want to make sure I update my cabalDebianTemplate when we figure out what the right thing to do is
23:08:09<augustss>sorear: seems a bit fishy
23:08:12<stepcut>Igloo: also, since I am bugging you, what is the policy for updating things like libghc6-time-dev ? Version 1.1 has bringerts time parsing functions, and fixes a bug in formatDate
23:08:14<Igloo>*nod*
23:08:46<sorear>Igloo: I can't find the ticket
23:09:02<Igloo>stepcut: Prod me, I guess :-)
23:09:08<stepcut>ok
23:09:33<stepcut>I wasn't sure if it was frozen due to etch, policy, or just no one complaining :)
23:09:48<Igloo>sorear: It's not in tract AFAIK, just documented at the URL I gave above (in the GHC user guide)
23:10:52<stepcut>you can't make rfc2822 date's using time-1.0 because there is no (clean) way to show seconds rounded to whole numbers ;)
23:11:06<Igloo>stepcut: Oh, true, technically I probably shouldn't upload it to unstable
23:11:11<Cin>hi. the wikibook about Haskell is really good, so far. I especially like the summaries and excersizes, they help a lot to re-enforce what I has just been read. thanks for the link :)
23:11:12<stepcut>s/date's/dates/
23:11:39<stepcut>Igloo: are you involved with the GSoC project to try to auto debianize and autobuild hackagedb ?
23:12:24<sorear>Igloo: Oh, this paste has nothing whatsoever with recursive newtypes.
23:12:25<sorear>isearch-backward doesn't take regexes?!
23:12:33<sorear>found it (isearch-backward-regexp, C-M-r)
23:12:37<stepcut>:p
23:13:20<Igloo>sorear: Oh, well, if it's an unknown bug then file it!
23:13:26<sorear>stepcut: does that mean I should take aptage off my TODO list?
23:13:50<stepcut>sorear: dunno, I am not even sure if the project was approved
23:14:32<sorear>Igloo: Is a registered wiki account 'sorear' usable for bug reporting on GHC-trac? ISTR some of the others were locked.
23:14:47<sorear>s/wiki//
23:16:35<Igloo>sorear: It is now
23:17:17<sorear>ty
23:25:06<dmead>augustss: dont i need it there for the other types?
23:25:23<dmead>wait
23:25:24<dmead>nm
23:25:25<dmead>XD
23:25:37<augustss>dmead: what other types would you need?
23:26:04<dmead>for efficency reasons in resolution i need a seperate type for propositional classes
23:26:25<augustss>hmmmm
23:26:32<dmead>and predicates, and the quantifiers
23:26:42<dmead>i know it could all be in the same recursive type
23:26:50<augustss>go for the simple solution first, then optimize
23:26:51<dmead>but that complicates things at many stages
23:27:06<sorear>#1268
23:27:08<dmead>this is my attempt at optimization
23:27:10<dmead>hehe
23:27:22<dmead>my prover thats up on the wiki already does propositional stuff
23:28:11<sorear>There's efficiency and then there is efficiency.
23:28:21<sorear>Avoiding nub is the first kind.
23:28:35<dmead>is nub short for something?
23:28:39<sorear>no
23:28:41<dmead>cause thats e-slang for newb
23:28:47<augustss>dmead: no
23:28:53<augustss>it's an english word
23:28:54<sorear>Writing pretty printing combinator libraries that do not allocate using GHC primops is the second kind.
23:29:24<dmead>ah
23:29:37<sorear>Wow, it's even in my dictionary!
23:29:43<augustss>dmead: meaning "the essence of"
23:30:15<narain>is there a good type class for things that behave like invertible functions?
23:30:26<augustss>narain: no
23:30:41<augustss>narain: but you can make one
23:30:42<sorear>Transform isn't good enough for you?
23:30:49<narain>yes, i guess i will
23:30:54<sorear>augustss: he did, yesterday
23:31:19<augustss>i guess it all depends on what ones means by "is"
23:31:20<narain>sorear: yes, then i saw a discussion of Monoid today
23:31:43<sorear>Invertable functions form a group, which is a ... duh!
23:31:44<narain>then i thought, hey, a transform is a monoid
23:31:52<sorear>a transform is a group.
23:31:57<sorear>a group is a transform.
23:32:01<sorear>they are the same.
23:32:09<narain>not really...?
23:32:12<sorear>transform2 is still needed however
23:32:35<sorear>class Transform t where
23:32:35<sorear> comp :: t -> t -> t
23:32:35<sorear> nill :: t
23:32:35<sorear> invr :: t -> t
23:32:36<narain>a transform is something that transforms other things
23:33:00<sorear>class Group g where
23:33:00<sorear> operate :: t -> t -> t
23:33:00<sorear> identity :: t
23:33:00<sorear> inverse :: t -> t
23:33:18<narain>ah well
23:33:27<narain>guess it's more of a different perspective
23:33:35<sorear>class Group t => Transform t e where
23:33:36<sorear> transform :: t -> e -> e
23:33:46<narain>the reals form a group but not really a transform
23:33:52<narain>sorear: right
23:34:03<narain>so is Group built-in?
23:34:07<sorear>no :(
23:34:15<sorear>further we require a 'homomorphism' law
23:34:28<sorear>transform a . transform b == transform (a `comp` b)
23:34:40<sorear>id == transform nill
23:34:47<sek>what module are abstract algebra notions in?
23:34:53<dmead>can you guys see an error here?
23:34:54<dmead>http://hpaste.org/1271
23:34:58<sorear>sek: none
23:35:04<dmead>ghci says i have a bad layout
23:35:04<sorear>@where numericprelude
23:35:04<lambdabot>darcs.haskell.org/numericprelude/
23:35:06<dmead>but i don't see how
23:35:14<sorear>^^^ non standard lib
23:35:32<sjanssen>dmead: "newtype Proposition = Char" probably doesn't mean what you think it does
23:35:44<sek>nice, thanks. Will check it out
23:35:51<dmead>ah
23:36:11<sjanssen>dmead: but the compiler is complaining about layout?
23:36:16<dmead>yes
23:36:20<dmead>i changed newtype to data
23:36:22<dmead>and it's alright
23:36:25<narain>yeah, i really feel the numeric prelude should be part of the standard
23:36:30<narain>ACTION <3 math
23:36:33<sorear>yay for type systems
23:36:35<sorear>curr = unsafePerformIO (newIORef Nothing)
23:36:43<dmead>narain: theres a discussion on the mailing list to that effect
23:36:48<sorear>thankfully I caught that before trying to use it :)
23:37:00<narain>dmead: what was the consensus?
23:37:11<dmead>i forget
23:37:17<dmead>sorear started the topic
23:37:24<narain>ok, i'll look
23:37:29<sorear>"Why the Prelude must die" ?
23:37:53<sorear>IMO it was fairly OT by the time the numeric prelude was mentioned.
23:38:28<sjanssen>dmead: I'm not getting layout errors
23:38:52<dmead>weird
23:38:59<hpaste> sjanssen annotated "layout manager hates me" with "fixed" at http://hpaste.org/1271#a1
23:39:11<ptolomy>Y'know, I used to think the Haskell Anti-Syntactical Sugar Lobby was a bit goofy, but just yesterday I was converting a ~200 line program that used strings extensively to use ByteString, and I realized how often I use limiting syntax.
23:39:37<sjanssen>dmead: I got a kind error " `Formula' is not applied to enough type arguments"
23:39:48<dcoutts>ptolomy: syntactic sugar is great :-)
23:39:51<Botje>HASSL? that's cool.
23:40:02<dmead>ah
23:40:06<dmead>are you on 6.6 per chance?
23:40:06<ptolomy>Now I think the Haskell Anti-Syntactical Sugar Lobby is slightly less goofy. :)
23:40:08<dcoutts>ptolomy: and yeah, I miss it when using ByteString
23:40:09<narain>sorear: good golly that's a long thread
23:40:16<sjanssen>dmead: yes. Are you using tabs?
23:40:21<dmead>yes
23:40:22<dmead>hehe
23:40:27<dmead>i think
23:40:42<sjanssen>I think we just need to make our sugar overloaded
23:40:42<dmead>i forget if emacs just maps tab to spaces for haskell-mode
23:40:47<dcoutts>ptolomy: so surely it's an argument for extending the syntactic sugar rather than eliminating it
23:40:56<dcoutts>sjanssen: just
23:40:58<dcoutts>erm
23:41:01<dcoutts>just/right
23:41:02<ptolomy>dcoutts: Yeah, ruins all my fun pattern matching.
23:41:09<ptolomy>dcoutts: Absolutely.
23:41:12<dmead>i wouldn't want to use haskell without the sugar
23:41:19<dmead>it's really ugly and perlish at times otherwise
23:41:19<ptolomy>I'm all for string-as-a-typeclass now.
23:41:23<dmead>from what i've seen
23:41:27<sjanssen>dmead: if you're using tabs, and they aren't displayed as 8 spaces in your editor, you're going to have problems
23:41:30<sorear>What is the best way to get IO (Maybe Char) in the style of C's getchar?
23:41:33<dmead>ah
23:41:36<dcoutts>ptolomy: heh, I'm just writing a rant against that particular idea...
23:41:40<mauke>no, I'm not :(
23:41:51<sjanssen>dcoutts: so is ICFP crunch time over?
23:41:51<dmead>i have another question
23:41:53<ptolomy>dcoutts: I should add "or any viable alternative".
23:41:55<dmead>if anyones up for it
23:42:02<dcoutts>sjanssen: oh not yet, but I was inspired to rant
23:42:03<sorear>I can't figure out any way better than catchJust getChar...
23:42:11<dmead>how do you define a type with just the upper case letters?
23:42:15<mauke>sorear: yeah, that's how I'd do it
23:42:16<sorear>dmead: newtype
23:42:25<dmead>newtype Upper = ?
23:42:29<sorear>mauke: seriously? *gulp*
23:42:46<dmead>i see theres UppercaseLetter in data.char
23:42:50<mauke>yeah, like OCaml
23:42:56<dmead>but theres nothing writting on/with it
23:43:03<sorear>ocaml uses eof exceptions :(
23:43:04<sorear>?
23:43:17<mauke>yes
23:43:27<monochrom>yes
23:43:32<sjanssen>yes
23:43:42<sjanssen>ACTION is just trusting mauke and monochrom
23:44:04<dmead>yes
23:44:07<dmead>(follower)
23:44:11<mauke>val input_char : in_channel -> char
23:44:20<mauke>Raise End_of_file if there are no more characters to read.
23:44:28<ptolomy>"Ocaml reminds me of my ex-girlfriend: fast and ugly."
23:44:33<sjanssen>sorear: you could also check the return value of hGetBuf
23:44:50<monochrom>plus ocaml is eager. the two together causes it to easy to write naive code that stack-overflows because of layers and layers of try-catch.
23:45:17<dmead>?type toupper
23:45:19<lambdabot>Not in scope: `toupper'
23:45:24<sorear>but .. try-catch can be implemented so as to have the try-bluck in tail call context!
23:45:30<sorear>or is ml too dumb?
23:45:36<sorear>?type toUpper
23:45:38<lambdabot>Char -> Char
23:45:46<narain>something i saw in the Prelude-must-die thread: "For example: we know that all Monads are Functors, but that is not expressed in the type classes, because it would be too much a pain to do so."
23:45:49<sorear>much as I hate it, haskell uses CamelCase
23:45:53<narain>is this true? why would it be a pain?
23:46:04<mauke>is there a name for the match/try inversion pattern I'm thinking of?
23:46:09<sorear>because we don't have the class system extension proposal?
23:46:24<sjanssen>narain: the "pain" is exactly one line of boilerplate
23:46:36<monochrom>boilerplate is pain :)
23:47:00<dmead>> newtype Upper = toUpper Char
23:47:01<lambdabot> Parse error
23:47:15<dmead>hmm
23:47:16<sjanssen>sorear: please don't tie the functor/monad issue to class system extensions -- every time somebody proposes to fix the hierarchy we get sidetracked with extension proposals
23:47:28<mauke>let rec mangle_lines fh a = match ( try Some (words (input_line fh)) with | _ -> None ) with | None -> a | Some w -> mangle_lines fh (parse_info w :: a)
23:47:37<narain>sjanssen: do you mean having to also instantiate Functor every time you want to define a Monad?
23:47:44<mauke>^ does that pattern have a name?
23:47:58<dmead>mauke: either?
23:47:59<sjanssen>there are certainly advantages to such extensions, but it's really not needed for Functor/Monad
23:48:05<sjanssen>narain: correct
23:48:06<dmead>?type Either
23:48:08<lambdabot>Not in scope: data constructor `Either'
23:48:39<narain>sjanssen: i wouldn't mind that
23:48:42<mauke>dmead: huh?
23:48:51<dmead>Either type
23:48:54<sjanssen>instance Functor T where fmap f x = x >>= return . f -- is not very painful at all
23:49:08<dmead>Either a = Left a | Right a
23:49:12<dmead>or something like that
23:49:16<mauke>fmap = liftM
23:49:23<mauke>dmead: ... ok?
23:49:55<sjanssen>mauke: yes, assuming liftM isn't removed/rewritten when Functor becomes a superclass of Monad
23:50:15<sorear>@hoogle isJust
23:50:15<lambdabot>Maybe.isJust :: Maybe a -> Bool
23:54:52<stepcut>ACTION looks forward to that day
23:55:33<stepcut>anyone know why the NatTransf class from gofer never made it into haskell? Was it a bad idea? Or just underappreciated ?
23:58:17<dan__>blah
23:58:33<mauke>yes, master?
23:58:40<dan__>:P
23:59:18<Cale>stepcut: a bit of both.
23:59:55<dmead>wonderful
23:59:55<narain>?quote
23:59:56<lambdabot>beelsebob says: > filter isJuggler #haskell
23:59:58<Cale>stepcut: It was less appreciated than it should have been, but it also makes a strange assumption that there should be some canonical natural transformation where there is one.

Back to channel and daily index: content-negotiated html turtle