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:31 | <mauke> | s/_ <- // |
| 00:00:36 | <emu> | yep |
| 00:00:46 | <emu> | but it points out the genesis of the _ in sequence_ ;) |
| 00:01:06 | <mauke> | sequence_ [y1, y2, y3, ...] == do { y1; y2; y3; ... ; return () } |
| 00:02:48 | <hughperkins> | oh, sequence /= sequence_ ? two different functions? |
| 00:02:59 | <emu> | sequence_ is used when you purely want the side effects |
| 00:03:06 | <emu> | that didn't sound quite right |
| 00:03:55 | <hughperkins> | ok |
| 00:04:00 | <mauke> | hughperkins: sequence_ swallows the return value, giving you only () |
| 00:04:06 | <oerjan> | sequence_ throws away the results of the actions, sequence collects them in a list |
| 00:04:14 | <hughperkins> | Ah ok |
| 00:05:27 | <oerjan> | @src sequence_ |
| 00:05:27 | <lambdabot> | sequence_ ms = foldr (>>) (return ()) ms |
| 00:06:17 | <hughperkins> | how can I do something like "when( path /= "." and path /= ".." )" ? |
| 00:06:23 | <hughperkins> | ie, combine two conditions |
| 00:06:30 | <oerjan> | hughperkins: && |
| 00:06:34 | <hughperkins> | Ok |
| 00:06:56 | <hughperkins> | Cool! |
| 00:07:22 | <mauke> | when (all (path /=) [".", ".."]) |
| 00:07:38 | <emu> | 'and' and 'or' are list-versions of && and || which shortcut too because of lazy eval ;) |
| 00:08:05 | <oerjan> | although in that case you could also do not (path `elem` [".", ".."]) |
| 00:08:21 | <mauke> | path `notElem` [".", ".."] |
| 00:09:34 | <oerjan> | it occurs to me that sequence_ could have used foldr1 to be more tail recursive |
| 00:09:56 | <mauke> | foldr is never tail recursive |
| 00:10:37 | <mauke> | and sequence_ can't use foldr1 because that would fail for empty lists |
| 00:10:47 | <oerjan> | it could check |
| 00:11:13 | <mauke> | wtf? |
| 00:11:15 | <oerjan> | although i just realized it doesn't work because it needs to throw away the result |
| 00:11:53 | <oerjan> | (a separate [] case) |
| 00:12:14 | <mauke> | then why use foldr1 instead of foldr? |
| 00:12:30 | <oerjan> | what i mean is, foldr1 (>>) l could be tail recursive in the last action of l, in some monads |
| 00:13:04 | <Saizan> | tail recursive in the last action? |
| 00:13:14 | <mauke> | huh? |
| 00:13:38 | <Saizan> | you just want to create a m1 >> m2 >> m3 >> ... >> return () |
| 00:13:54 | <oerjan> | no return () at the end that would ruin it |
| 00:14:05 | <oerjan> | so it wouldn't be either sequence or sequence_ |
| 00:14:20 | <mauke> | I don't get it |
| 00:14:20 | <emu> | @tell sjanssen 1.37 sec with IOUArrays. there's something about ST arrays that spoj especially doesn't like. and ghc shows more efficiency with IO arrays in my local tests too :/ |
| 00:14:21 | <lambdabot> | Consider it noted. |
| 00:14:45 | <Saizan> | well sequence is m1 >>= m2 >>= m3 >>= ... >>= mN |
| 00:14:52 | <Saizan> | uhm no. |
| 00:15:10 | <Saizan> | quite different :) |
| 00:15:13 | <sjanssen> | emu: bizarre |
| 00:15:13 | <lambdabot> | sjanssen: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 00:15:22 | <oerjan> | i mean, say you do cmd = foldr1 (>>) [something1, something2, cmd] |
| 00:15:28 | <sjanssen> | wait, I've got an idea |
| 00:15:36 | <hughperkins> | how can I do something like "contents2 <- filter not(`elem` [".",".."]) contents |
| 00:15:55 | <emu> | sjanssen: i can't recreate the discrepancy though. on my tests, IOUArrays are only like 10-20% faster. on spoj, it just bombs |
| 00:15:58 | <hughperkins> | ie, take the list "contents" and filter out "." and ".." and put that in list contnts2 |
| 00:16:01 | <oerjan> | (not . (`elem` [".",".."])) |
| 00:16:07 | <mauke> | hughperkins: let contents2 = filter (`notElem` [".",".."]) contents |
| 00:16:27 | <Saizan> | contents2 <- filter (\c -> not (c `elem` [".",".."])) contents, also |
| 00:16:47 | <mauke> | he wants contents2 to be a list |
| 00:17:36 | <hughperkins> | Cool! :-) |
| 00:17:44 | <Saizan> | mauke: right, my bad |
| 00:17:57 | <emu> | ST is mysteriously chewing up more RAM too -- could be strictness issue at hand |
| 00:21:13 | <oerjan> | there's an ST.Lazy, isn't there? |
| 00:21:41 | <emu> | well yes, but IO is strict and does much better so i'd imagine laziness is bac |
| 00:21:42 | <emu> | bad |
| 00:22:15 | <emu> | then again we've already shown that i know nothing |
| 00:22:39 | <oerjan> | strange there should be a difference since i just yesterday saw that IORef is defined in terms of STRef |
| 00:22:45 | <oerjan> | @src IORef |
| 00:22:45 | <lambdabot> | newtype IORef a = IORef (STRef RealWorld a) |
| 00:23:03 | <sorear> | and, ST and IO are represented samely |
| 00:23:06 | <sorear> | @src ST |
| 00:23:06 | <lambdabot> | newtype ST s a = ST (STRep s a) |
| 00:23:09 | <sorear> | @src IO |
| 00:23:09 | <lambdabot> | newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #)) |
| 00:23:12 | <sorear> | @src STRep |
| 00:23:12 | <lambdabot> | type STRep s a = State# s -> (# State# s, a #) |
| 00:29:41 | <emu> | also i don't think lazy ST permits STUArrays |
| 00:33:05 | <emu> | blah, there isn't much performance difference between ST and IO on my system. but on spoj its the difference between TLE and 1.5seconds runtime. i've made sure everything is the same except the types. |
| 00:33:13 | <emu> | something is scerwy |
| 00:40:14 | <cartman> | hi |
| 00:41:10 | <cartman> | Latest GHC doesn't compile with gcc 4.2.0 ( http://hackage.haskell.org/trac/ghc/ticket/1427 ) , is there a way to get some attention to this bug? Or shall I just more than 1 day (doh ;)) |
| 00:41:12 | <lambdabot> | Title: #1427 (GHC fails to compile with gcc 4.2.0) - GHC - Trac |
| 00:41:20 | <cartman> | good lambdabot |
| 00:41:29 | <cartman> | s/more/wait more |
| 00:42:19 | <oerjan> | @version |
| 00:42:19 | <lambdabot> | lambdabot 4p525, GHC 6.6 (Linux i686 2.66GHz) |
| 00:42:19 | <lambdabot> | darcs get http://www.cse.unsw.edu.au/~dons/lambdabot |
| 00:42:19 | <emu> | probably wait |
| 00:42:27 | <emu> | i'm sure the ghc devs are enjoying their weekend |
| 00:42:36 | <oerjan> | no connection to the current lambdabot problems? |
| 00:43:11 | <cartman> | emu: ah forget about weekend even :| |
| 00:43:13 | <cartman> | emu: thanks |
| 00:43:41 | <emu> | i have a sid chroot but i didnt update to gcc 4.2 |
| 00:45:39 | <cartman> | well I use Pardus Linux anyway |
| 00:45:50 | <cartman> | Debian bug report is a good reference, hence I added it |
| 00:46:02 | <int80_h> | ACTION stays sane by using netbsd |
| 00:46:03 | <emu> | ah. trying it now |
| 00:46:45 | <cartman> | it was a tough job to bootstrap ghc btw |
| 00:46:53 | <cartman> | libreadline.so.4 dependency is not good :-/ |
| 00:47:06 | <cartman> | ACTION just packaged ghc for Pardus |
| 00:52:59 | <syntaxfree> | ACTION announces he's about to engage in general-purpose whining in #haskell-blah for public amusement. |
| 00:53:24 | <emu> | cartman: yea i imagine |
| 00:53:39 | <emu> | does your source package self-bootstrap? |
| 00:53:47 | <emu> | sounds difficult |
| 00:53:59 | <syntaxfree> | how is ghc bootstrapped nowadays, btw? |
| 00:54:06 | <cartman> | emu: it uses a pre-compiled ghc with libreadline.so.4 to bootstrap normal ghc |
| 00:54:10 | <syntaxfree> | i remember some ancient version of ghc was written in one of the MLs. |
| 00:54:16 | <cartman> | in the end a native ghc build done |
| 00:54:33 | <cartman> | but if precompiled packages @ haskell.org used libreadline.so.5 |
| 00:54:36 | <cartman> | it would be easier |
| 00:55:45 | <emu> | isn't there a version w/o readline |
| 00:55:54 | <emu> | that's for ghci really |
| 00:56:52 | <syntaxfree> | my ghci has no readline support. |
| 00:57:24 | <syntaxfree> | and no, rlwrap doesn't help. |
| 00:57:39 | <cartman> | emu: not on haskell.org |
| 00:57:48 | <cartman> | emu: I can now use my native ghc to bootstrap the source |
| 00:57:50 | <cartman> | evil :) |
| 01:20:46 | <oerjan> | ever heard of -th? :) |
| 01:21:11 | <oerjan> | (i need to learn to check my window focus) |
| 01:32:45 | <xpika> | has anyone here compiled readline4 on cywin? |
| 01:43:52 | <hpaste> | int80h pasted "int80_h borks parser" at http://hpaste.org/311 |
| 01:47:39 | <int80_h> | any ideas guys? |
| 01:48:32 | <int80_h> | hmm this is wierd, the way it formatted my code in the web browser |
| 01:53:59 | <kpreid> | int80_h: perhaps you got some ‘curly’ quotes in your source? |
| 01:54:29 | <kpreid> | yes...that would be consistent, with hpaste failing to process utf-8 |
| 01:54:55 | <kpreid> | 'tis a shame that Haskell 98 wasn't specified with encoding facilities |
| 01:59:51 | <int80_h> | kpried, do you men I should have ' instead of ` or visa versa? this is code I snagged from someone's blog. |
| 02:01:42 | <int80_h> | I think I've got it figured out. |
| 02:01:59 | <int80_h> | I fixed that line and now it's got the same complaint for other lines. I hope that's all that is wrong |
| 02:15:19 | <kpreid> | int80_h: I mean you have ‘f’ and “foo” instead of 'f' and "foo" |
| 02:15:48 | <kpreid> | ‘, ’, `, and ' are all distinct |
| 02:21:14 | <int80_h> | thanks |
| 02:25:39 | <int80_h> | kpried, can you see what's wrong with this? |
| 02:25:40 | <int80_h> | nadsat <- anyChar 'manyTill' (char ":"); |
| 02:26:05 | <kpreid> | ` is for infix, ' is for characters |
| 02:26:37 | <int80_h> | it's complaining about 'manyTill' |
| 02:26:41 | <kpreid> | yes |
| 02:26:57 | <int80_h> | ah, so I should use ` |
| 02:26:59 | <kpreid> | yes |
| 02:28:50 | <oerjan> | int80_h: also you probably need ':' or you will get a type error once it parses |
| 02:32:13 | <chadz> | salutations! |
| 02:33:11 | <jfredett> | hmm |
| 02:33:23 | <jfredett> | i'm looking for a Hashmap / dictionary datatype |
| 02:33:37 | <jfredett> | does one exist? |
| 02:33:43 | <jfredett> | Oh! I can hoogle it |
| 02:33:46 | <jfredett> | @hoogle Dict |
| 02:33:47 | <lambdabot> | No matches found |
| 02:33:52 | <jfredett> | @hoogle Hash |
| 02:33:53 | <lambdabot> | Data.HashTable :: module |
| 02:33:53 | <lambdabot> | Data.HashTable.HashTable :: data HashTable key val |
| 02:33:53 | <lambdabot> | Data.HashTable.hashInt :: Int -> Int32 |
| 02:33:56 | <jfredett> | hah hah! |
| 02:34:31 | <chadz> | jfredett: i recommend Data.Map |
| 02:34:37 | <jfredett> | I forget I have all these things -- most other languages dont have such wonderful API finding utilities. |
| 02:34:43 | <jfredett> | Map, gotcha |
| 02:34:54 | <chadz> | :t lookup |
| 02:34:56 | <lambdabot> | forall a b. (Eq a) => a -> [(a, b)] -> Maybe b |
| 02:35:07 | <chadz> | hmm |
| 02:35:14 | <chadz> | :t Data.Map.lookup |
| 02:35:16 | <lambdabot> | forall k a (m :: * -> *). (Ord k, Monad m) => k -> Data.Map.Map k a -> m a |
| 02:35:31 | <chadz> | :t fromList |
| 02:35:33 | <lambdabot> | Not in scope: `fromList' |
| 02:35:40 | <jfredett> | So its a monad? |
| 02:35:43 | <jfredett> | ish |
| 02:35:44 | <jfredett> | thing? |
| 02:36:02 | <oerjan> | jfredett: no, Data.Map is pure |
| 02:36:24 | <jfredett> | nifty |
| 02:36:26 | <oerjan> | (tree-based) |
| 02:37:02 | <jfredett> | so wait- i have Data.map, I create a map with some key type and some value type? |
| 02:37:08 | <Cale> | It returns its result typed in a monad, which is really an awful hack. It uses 'fail' if the value isn't there. |
| 02:37:08 | <jfredett> | does the Key have to be orderable? |
| 02:37:24 | <oerjan> | jfredett: yes |
| 02:37:32 | <Cale> | Really, it ought to be (MonadZero m) => ... |
| 02:37:51 | <Cale> | but if you use a monad which isn't a MonadZero, your program will just die on failure. |
| 02:38:24 | <Cale> | (Unfortunately, MonadZero is gone, so you just have to know which monads have a suitable fail) |
| 02:38:33 | <jfredett> | i see. |
| 02:38:34 | <Cale> | Most likely, you'll just want Maybe |
| 02:38:39 | <jfredett> | right |
| 02:38:41 | <oerjan> | Cale: i never quite understood the difference between fail and MZero |
| 02:38:57 | <chadz> | > Data.Map.lookup 1 $ fromList [(1,"hello"),(2,"world")] |
| 02:38:58 | <lambdabot> | Not in scope: `fromList' |
| 02:39:09 | <chadz> | > Data.Map.lookup 1 $ Data.Map.fromList [(1,"hello"),(2,"world")] |
| 02:39:10 | <lambdabot> | Not in scope: `Data.Map.fromList' |
| 02:39:15 | <chadz> | psh |
| 02:39:23 | <oerjan> | @type MZero |
| 02:39:25 | <lambdabot> | Not in scope: data constructor `MZero' |
| 02:39:27 | <Cale> | oerjan: fail is sort of a hack which was put into the Monad class to simplify the translation of do-notation. |
| 02:39:45 | <Cale> | @type mzero |
| 02:39:47 | <lambdabot> | forall (m :: * -> *) a. (MonadPlus m) => m a |
| 02:40:02 | <jfredett> | oh dear-- lots of monads |
| 02:40:19 | <Cale> | They moved mzero into MonadPlus when they removed monad comprehensions, for some ill-conceived reason. |
| 02:40:30 | <jfredett> | I'm only starting to get comfy w/ monads |
| 02:41:04 | <chadz> | jfredett: read marlow's akward squad, it's the best paper for introducting monads imho |
| 02:41:28 | <chadz> | @go awkward squad marlow |
| 02:41:31 | <lambdabot> | http://research.microsoft.com/~simonpj/ |
| 02:41:31 | <lambdabot> | Title: Simon Peyton Jones |
| 02:41:59 | <vincenz> | > 1 |
| 02:42:00 | <lambdabot> | ghc-6.6: could not execute: gcc |
| 02:42:02 | <jfredett> | I've read quite a number of papers on them, Haskell Wikibook, YahT, millions. |
| 02:42:02 | <vincenz> | @join #oasis |
| 02:42:18 | <chadz> | jfredett: try this one :) |
| 02:44:32 | <jfredett> | you know the best thing about Hoogle's documentation- all the various docs for the operators/etc have complexity info |
| 02:54:45 | <hpaste> | int80h annotated "int80_h borks parser" with "int80_h borks parser, the revenge " at http://hpaste.org/311#a1 |
| 02:55:14 | <int80_h> | I have new problems, pretty sure not related to the old ones. |
| 02:55:35 | <jfredett> | so heres a conceptual question about monads |
| 02:55:35 | <jfredett> | say I have a return value of Maybe a, I know that I get out either Nothing or Just x, where x is a value with type a. |
| 02:55:35 | <jfredett> | is there a way to get the x value out of the just x permanently? rather than having to use >>= all the time? |
| 02:56:45 | <oerjan> | jfredett: use a case statement |
| 02:57:10 | <jfredett> | ediboh? |
| 02:57:12 | <jfredett> | as in: |
| 02:57:35 | <jfredett> | case blah of |
| 02:57:35 | <jfredett> | Just x = x |
| 02:57:35 | <jfredett> | Nothing = <something else> |
| 02:57:35 | <jfredett> | ? |
| 02:57:41 | <oerjan> | right |
| 02:57:48 | <jfredett> | you mean- that will work? |
| 02:57:53 | <jfredett> | I pulled that out of my ass |
| 02:57:58 | <jfredett> | I thought that was pseudocode |
| 02:58:09 | <oerjan> | actually = should be -> but the rest is correct |
| 02:58:30 | <jfredett> | holy crap dude, I love haskell. |
| 03:00:08 | <int80_h> | oerjan, any ideas on how I can fix my borked parser? |
| 03:00:18 | <int80_h> | yeah haskell is my new true love. |
| 03:01:26 | <oerjan> | int80_h: there is some serious junk in the original |
| 03:01:59 | <int80_h> | oh I can repaste with the new code, I expect the junk is gone now |
| 03:02:12 | <oerjan> | no, it's still there |
| 03:02:30 | <oerjan> | (in your "revenge") |
| 03:03:15 | <oerjan> | from the line with "Either ParseError b" things don't make sense |
| 03:03:54 | <int80_h> | arg...this was supposed to be working code from some guy's blog |
| 03:04:04 | <int80_h> | could you take a look at his blog to help me figure things out? |
| 03:04:12 | <int80_h> | I posted his url |
| 03:04:13 | <oerjan> | i'll take a look at the _actual_ original |
| 03:04:32 | <int80_h> | yeah it started with me cutting and pasting |
| 03:06:10 | <oerjan> | ah right, there is some code in the original that is just comments, not supposed to be included in the final source |
| 03:08:25 | <oerjan> | remove the lines "Either ParseError b", "fmap", "main" and "fmap" |
| 03:08:34 | <int80_h> | oh...garrrrr |
| 03:10:25 | <int80_h> | still getting complaints about ubst s m = unwords $ map (\x-> Map.findWithDefault x x m) (words s) |
| 03:10:39 | <int80_h> | oops |
| 03:10:50 | <int80_h> | that was bad...did that make sense on what line is troublesome? |
| 03:11:16 | <int80_h> | subst s m = unwords $ map (\x-> Map.findWithDefault x x m) (words s) |
| 03:11:32 | <int80_h> | parser.hs:25:13: parse error on input `=' |
| 03:12:29 | <int80_h> | what just happened? Netsplit? |
| 03:12:33 | <oerjan> | int80_h: remove the indentation on that line |
| 03:12:38 | <int80_h> | thanks |
| 03:13:15 | <oerjan> | and also on "main = " if you haven't already |
| 03:13:47 | <int80_h> | yeah I just did and now I get the following errors |
| 03:14:15 | <int80_h> | parser.hs:10:38: Couldn't match expected type `Char' against inferred type `[Char]' In the first argument of `char', namely `":"' In the second argument of `manyTill', namely `(char ":")' In a 'do' expression: nadsat <- anyChar `manyTill` (char ":") |
| 03:14:20 | <int80_h> | Failed, modules loaded: none. |
| 03:14:44 | <int80_h> | is this referring to the original problem? |
| 03:14:56 | <oerjan> | i did tell you above you needed to change ":" to ':' :) |
| 03:15:21 | <jfredett> | you should just reverse the polarity on the flux capacitor function on line 36 |
| 03:15:32 | <jfredett> | that'll fix everything, int80_h. |
| 03:15:34 | <int80_h> | ACTION giggles |
| 03:15:43 | <int80_h> | ACTION pokes jfredett |
| 03:17:44 | <int80_h> | ACTION wuves oerjan |
| 03:17:52 | <int80_h> | thanks guy, it compiles |
| 03:18:02 | <jfredett> | hey! thats a bad touch! |
| 03:18:05 | <jfredett> | ACTION crys |
| 03:30:38 | <siti> | does alloca zero the memory it allocates? |
| 03:33:06 | <jfredett> | is there a wayto check what instances a certain type implements? |
| 03:33:14 | <jfredett> | w/ ghci or lambdabot? |
| 03:33:33 | <ddarius> | Try :info |
| 03:33:39 | <jfredett> | :info String |
| 03:33:41 | <jfredett> | ? |
| 03:33:47 | <ddarius> | In GHCi |
| 03:33:59 | <jfredett> | oh.:/ |
| 03:34:19 | <ddarius> | Or just look at the documentation pages which should list at least the ones defined in that module. |
| 03:34:45 | <jfredett> | cool |
| 03:34:52 | <jfredett> | info didn't help much |
| 03:34:57 | <jfredett> | i guess its to hoogle for me |
| 03:35:39 | <ddarius> | jfredett: You shouldn't really need that information. You should more need to know whether a specific (collection of) instance(s) exist. |
| 03:36:36 | <jfredett> | well, i just want to know whether String is orderable |
| 03:36:53 | <jfredett> | or whether I'm going to rethink my methods. |
| 03:37:45 | <sjanssen> | jfredett: yes, String is an instance of Ord |
| 03:37:59 | <jfredett> | awesome, i figured it would be |
| 03:39:41 | <oerjan> | @help instances |
| 03:39:41 | <lambdabot> | instances <typeclass>. Fetch the instances of a typeclass. |
| 03:39:51 | <oerjan> | @instances Ord |
| 03:39:53 | <lambdabot> | (), All, Any, Bool, Char, Double, Either a b, Float, Int, Integer, Maybe a, Ordering, Product a, Sum a, [a] |
| 03:39:53 | <jfredett> | brilliant. |
| 03:40:36 | <jfredett> | and since String = [Char], String is orderable, awesome |
| 03:41:12 | <sjanssen> | parametric polymorphism with typeclasses ftw |
| 03:41:51 | <jfredett> | ACTION mimics Howard Dean, "Yaaarrghh" |
| 03:43:07 | <emu> | man where do they have FIOS in pit |
| 03:52:45 | <oerjan> | @instances-importing Ord |
| 03:52:46 | <lambdabot> | (), All, Any, Bool, Char, Double, Either a b, Float, Int, Integer, Maybe a, Ordering, Product a, Sum a, [a] |
| 04:05:15 | <lispy> | what is Product a? |
| 04:05:22 | <lispy> | i haven't seen that before |
| 04:05:32 | <lispy> | same with sum |
| 04:05:42 | <lispy> | ?google Product |
| 04:05:44 | <lambdabot> | http://en.wikipedia.org/wiki/Product_(business) |
| 04:05:44 | <lambdabot> | Title: Product (business) - Wikipedia, the free encyclopedia |
| 04:05:51 | <ddarius> | @index Produce |
| 04:05:51 | <lambdabot> | bzzt |
| 04:05:51 | <lispy> | ?hoogle Product |
| 04:05:52 | <lambdabot> | Prelude.product :: Num a => [a] -> a |
| 04:05:53 | <ddarius> | @index Product |
| 04:05:53 | <lambdabot> | bzzt |
| 04:06:08 | <ddarius> | It's newish related to Monoids. |
| 04:06:13 | <ddarius> | @doc Data.Monoid |
| 04:06:13 | <lambdabot> | http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Monoid.html |
| 04:06:28 | <lispy> | ?. tiny-url doc Data.Monoid |
| 04:06:29 | <lambdabot> | Plugin `compose' failed with: IRCRaised Parse error: "doc" |
| 04:07:48 | <ddarius> | @help docs |
| 04:07:48 | <lambdabot> | docs <lib>. Lookup the url for this library's documentation |
| 04:07:58 | <ddarius> | @. tiny-url docs Data.Monoid |
| 04:07:59 | <lambdabot> | http://tinyurl.com/y5qk9n |
| 04:09:53 | <lispy> | thanks |
| 04:16:32 | <sam-j> | does anyone know of any documentation or tutorial regarding Text.ParseCombinators? |
| 04:18:08 | <sam-j> | (other than the official docs, that is) |
| 04:18:55 | <sam-j> | ah, nevermind I think I just found it. |
| 04:26:46 | <Cale> | sam-j: There's the Parsec documentation. |
| 04:27:37 | <sam-j> | Cale: Yes I just found it and it's quite good. I looked a bit this afternoon but I think I just googled for the wrong terms. Thanks. :) |
| 04:49:53 | <shachaf> | dons: /last dons |
| 04:49:57 | <shachaf> | Oops. |
| 04:51:07 | <dons> | ?pong |
| 04:51:07 | <lambdabot> | CSE : "Abdullah","Lili Marziana","PhD Student","ATP Australian Technology Park","","lilia" |
| 04:51:08 | <lambdabot> | CSE : "Ahmed","Nadeem","Research Fellow","K17 501E","57229","nahmed" |
| 04:51:08 | <lambdabot> | CSE : "Ahmed","Shabbir","PhD Student","K17 501-19","55301","shabbira" |
| 04:51:08 | <lambdabot> | CSE : "Akand","Elma Hussana","PhD Student","K17 401-02","56913","akande" |
| 04:51:08 | <lambdabot> | CSE : "Al-Kilidar","Hiyam","PhD Student","ATP Australian Technology Park","","hiyama" |
| 04:51:10 | <lambdabot> | [325 @more lines] |
| 04:51:10 | <dons> | huh |
| 04:51:13 | <dons> | oh, yes. |
| 04:51:16 | <dons> | ?ring dons |
| 04:51:16 | <lambdabot> | CSE : "Stewart","Donald","PhD Student","K17 501-16","57225","dons" |
| 04:51:18 | <dons> | :} |
| 05:18:55 | <dons> | another amazing sigfpe/monad post, http://programming.reddit.com/info/1z0on/comments |
| 05:18:56 | <lambdabot> | Title: How to write efficient optimzation code without really trying (reddit.com) |
| 06:10:21 | <hpaste> | gattocarlo pasted "problems with Xlib.FontStruct" at http://hpaste.org/312 |
| 06:25:15 | <pastorn> | dons: you there? |
| 06:25:31 | <dons> | yep |
| 06:25:43 | <pastorn> | you know farre? |
| 06:25:54 | <dons> | no? |
| 06:25:57 | <pastorn> | anyway, he told me you were working on a book |
| 06:26:06 | <dons> | right. |
| 06:26:07 | <gour> | dons: hi, how many chapters of 'real-world' are already written? ;) |
| 06:26:15 | <dons> | 1 1/2? |
| 06:26:43 | <pastorn> | how many chapters are planned? |
| 06:27:15 | <dons> | lots :-) see http://www.realworldhaskell.org/blog/2007/05/23/real-world-haskell-its-time/ |
| 06:27:18 | <lambdabot> | Title: Real World Haskell » Blog Archive » Real-world Haskell: it’s time!, http://tinyurl.com/2ddm5b |
| 06:29:09 | <gour> | dons: any estimation how bulky the book would be? |
| 06:29:28 | <dons> | fairly big, i suspect |
| 06:29:31 | <dcoutts> | door stopper |
| 06:32:11 | <gour> | dons:that's great. just do it. i'll buy one for sure. do you have any date in mind how long it would take? |
| 06:33:27 | <gour> | dcoutts: due to your reviews ? |
| 06:33:38 | <dcoutts> | gour: huh? |
| 06:34:09 | <gour> | dcoutts: i mean book will become bulky after you send your 'patches' in review-form ;) |
| 06:34:14 | <dcoutts> | heh heh |
| 06:34:39 | <dcoutts> | I would not dream of telling them what to do :-) |
| 06:34:58 | <gour> | you're still enjoying life, holidays etc. in the form of R&D ? |
| 06:35:00 | <gattocarlo> | dcoutts: we have a cabal issue with xmonad |
| 06:35:19 | <gour> | dcoutts: or realy holidays now? |
| 06:35:23 | <gour> | *real |
| 06:35:40 | <dcoutts> | gattocarlo: sorry, got to sleep, send email to cabal-devel or me or xmonad list or something, or tell me next time I'm around |
| 06:35:49 | <gattocarlo> | the haddock hook treats libraries differently from exec |
| 06:35:50 | <dcoutts> | ACTION :: IO Sleep |
| 06:35:51 | <dons> | gattocarlo: yes, cabal list is best. |
| 06:35:52 | <gattocarlo> | ok |
| 06:35:58 | <gattocarlo> | ok |
| 06:36:15 | <dons> | if you come up with a patch to cabal to allow execs to get haddocks built, i'd be pretty confident it would be accepted |
| 06:36:28 | <gattocarlo> | sorry guys, 'night |
| 06:37:40 | <emu> | anyone got recommendations on a good blog for haskell posts w/ code |
| 06:38:05 | <dons> | a good blog oftware? |
| 06:38:10 | <emu> | yea |
| 06:38:32 | <dons> | hmm. see what sigfpe or ekidd use. anythiing that let's you embed HsColour -css output |
| 06:39:02 | <emu> | oh dons btw, my bottleneck turned out to be some weirdness with ST |
| 06:40:04 | <dons> | interesting. |
| 06:40:22 | <gour> | @localtime dcoutts |
| 06:40:23 | <lambdabot> | Local time for dcoutts is Sun Jun 17 07:39:41 |
| 06:40:44 | <gour> | huh, nice time for going to bed... |
| 06:41:17 | <emu> | mornings are meant to sleep through |
| 06:41:47 | <dons> | i don't think that's duncan's current time zone though.. |
| 06:41:47 | <gour> | emu: worst time for sleep if you want to stay healthy ;) |
| 06:42:15 | <gour> | dons: right, that's utc |
| 06:42:19 | <emu> | dons: yea it makes no sense. locally, ST is fine. but there, it causes some serious problems. IOUArrays were blazing fast otoh, with the same exact code. |
| 06:43:03 | <sjanssen> | emu: strangest of all: IOUArrays are simple wrappers around STUArrays |
| 06:43:14 | <dons> | i've found some issues with optimsing ST code -- but that's weird. as IO*Array is just a layer over ST*Array |
| 06:43:25 | <dons> | maybe some extra strictness got inserted somewhere |
| 06:43:40 | <emu> | and even stranger, i just tried to rewrite another program from ST to IO arrays, and that made things worse |
| 06:43:43 | <dons> | for true speed, nothing beats !Ptr Foo though. (though also, nothing is more dangerous ;) |
| 06:44:06 | <emu> | i was breaking out FFI .. i wanted to use strtoul for number parsing |
| 06:44:30 | <emu> | it would work in byte-code toplevel but crash in compiled code :/ |
| 06:44:53 | <dons> | yeah, FFI makes a nice flexible ST monad, but also more dangerous |
| 06:46:56 | <ariks> | data Color = RGB Int Int Int | CMYK Int Int Int Int deriving (Eq, Show) |
| 06:46:56 | <ariks> | [B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[BB[B[B[B[B[B |
| 06:47:26 | <ariks> | bah, sorry. touchpad has a damn "middle click" spot.. that i accidentally hit |
| 06:47:46 | <ariks> | i'll look into disabling that right now. |
| 06:48:06 | <emu> | dons: i'd imagine its some weird stirctness thing, except that i couldn't replicate the behavior locally |
| 06:51:07 | <rhz> | I have a Haskell program which is freezing at some certain point. Can I trace through it somehow to work out which function is causing it to freeze? |
| 06:51:49 | <Cale> | Debug.Trace will let you annotate expressions with messages to be printed when they're evaluated. |
| 06:52:31 | <rhz> | Ok but the problem is that I don't want the console to be flooded with messages. |
| 06:53:14 | <rhz> | I only want to work out what is going on when the program freezes which is about 10 seconds into it. |
| 06:53:51 | <ibid> | use binary search with trace |
| 06:54:06 | <ibid> | put trace somewhere. if you get the message, it's before the freeze |
| 06:54:29 | <ibid> | (of course, laziness makes determining "before" a bit tricky) |
| 07:03:50 | <emu> | woot, i beat CAML on Prime gen |
| 07:05:07 | <dons> | sweet! |
| 07:15:00 | <ddarius> | dons, do you notice xmonad spazzing out when you right-click a link and choose Save Link As... in Firefox (in fullscreen mode)? |
| 07:15:24 | <cc> | dwm has that prob too. theres a thread about it - ffox bug |
| 07:15:31 | <cc> | you can fix it by expanding the 'details' pane |
| 07:15:32 | <ddarius> | Ah, ok. |
| 07:15:34 | <dons> | ddarius: as in, focus is lost on the background window? |
| 07:15:37 | <cc> | then it stays expanded on future saves |
| 07:15:41 | <emu> | b.c. of dialog box |
| 07:15:42 | <cc> | you mean its resizing itself in a loop? |
| 07:15:47 | <dons> | or can you elaborate on 'spazzing out' ? |
| 07:15:56 | <emu> | ratpoison spazzes too |
| 07:15:57 | <ddarius> | dons: It keeps changing size. |
| 07:16:00 | <emu> | freezes up |
| 07:16:07 | <dons> | oh , let's see. |
| 07:16:34 | <dons> | fixed in the head branch of xmonad |
| 07:16:45 | <dons> | that just pops up a full size window. no spazzing out |
| 07:16:58 | <dons> | we handle hints properly now -- in 0.2 you'd probably get spazzing, yes. |
| 07:17:03 | <ddarius> | As in a patch applied right now? I just pulled and recompiled a few minutes ago. |
| 07:17:25 | <dons> | ah no, just the head branch as is. hmm. at least i couldn't reproduce it |
| 07:17:31 | <dons> | save as gives me a normal fullscreen tiled window |
| 07:17:47 | <dons> | ddarius: can you ask on #xmonad, see if sjanssen or someone else can reproduce it |
| 07:18:30 | <dons> | yes, i have no problems with 'save link as'. even if i pull it into the floating layer and resize it |
| 07:18:40 | <sjanssen> | ddarius: it's a known bug in GTK |
| 07:18:44 | <dons> | maybe that's changed into something more insidious in newer firefoxes? |
| 07:18:56 | <dons> | ah ha |
| 07:19:44 | <cc> | cant cause minefield-20070614 to spazz out |
| 07:19:46 | <dons> | yeah, i'm using an older firefox, with an older gtk. |
| 07:19:55 | <dons> | which seems to be no spazzy |
| 07:20:30 | <ddarius> | dons: How friendly is conkeror with AJAXy sites in your experience? |
| 07:21:34 | <dons> | haven't used conkeror. i used konqueror a while ago, but not ajaxy |
| 07:22:10 | <ddarius> | I must have misremembered who it was. |
| 07:22:49 | <dons> | stepcut maybe? |
| 07:22:53 | <cc> | ACTION tried conkeror for a couple days - plain ffox keybindings are a lot less insane than M-x h b, et |
| 07:23:04 | <cc> | ctrl-t becomes C-x-5-2! |
| 07:23:06 | <cc> | come on... |
| 07:23:39 | <ddarius> | cc: I switched it to the vim keybindings then hacked those to work with a Dvorak layout and just other things I would want. |
| 07:24:10 | <sjanssen> | ddarius: I suggest vimperator |
| 07:24:31 | <sjanssen> | it's more stable than conkeror in my experience |
| 07:25:28 | <ddarius> | sjanssen: Looks nice though I'll have to hack keybindings yet again. |
| 07:34:59 | <Moozilla> | So, how would I do graphics type stuff in haskell? |
| 07:35:43 | <dons> | what kind of graphics? |
| 07:35:46 | <dons> | 3d, or 2d? |
| 07:35:49 | <ddarius> | You go to the Applications and Libraries page linked to from haskell.org and then to the relevant section. |
| 07:36:09 | <Moozilla> | 2d, are there any built in libraries? |
| 07:36:12 | <dons> | in particular, there's gtk2hs for 2d stuff (including vector graphics) |
| 07:36:31 | <dons> | ?where gtk2hs |
| 07:36:31 | <lambdabot> | http://haskell.org/gtk2hs/ |
| 07:36:52 | <Moozilla> | Alright |
| 07:36:53 | <ddarius> | Moozilla: For "standard libraries" you go to the standard library documentation page. |
| 07:36:55 | <ddarius> | @doc |
| 07:36:55 | <lambdabot> | http://haskell.org/ghc/docs/latest/html/libraries/index.html |
| 07:36:55 | <dons> | there's a few others, findable from hackage.haskell.org or the haskell.org page ddarius mentioned. |
| 07:37:31 | <Moozilla> | Thanks |
| 07:38:00 | <Moozilla> | So with this can I read images? |
| 07:38:20 | <dons> | yeah, i think gtk2hs can read a few standard formasts now. there are other libraries too for that. |
| 07:38:31 | <Moozilla> | Great |
| 08:12:35 | <dons> | slides from last week's SAPLING workshop, http://programming.reddit.com/info/1z1yf/comments |
| 08:12:36 | <lambdabot> | Title: Haskell fusion, generics, pattern calculus, index type families: slides from SAP ... |
| 08:12:53 | <dons> | includes a talk on fusion, on indexed type families (in ghc now), and haskell on the gpu :-) |
| 08:20:11 | <cinimod> | dons: how easy would it be to add bit twiddling operations to ByteStream? |
| 08:21:08 | <dons> | to ByteString? |
| 08:21:10 | <cinimod> | dons: I'd like to use it for the crypto library but ByteStream couldn't do xor last time I looked |
| 08:21:21 | <dons> | just use Data.Bits for the bit fiddling |
| 08:21:26 | <cinimod> | dons: oops yes ByteString |
| 08:21:39 | <dons> | also, check the latest crypto libs, they use both bytestrings and bit fiddling |
| 08:21:41 | <dons> | (on hackage.org) |
| 08:22:07 | <dons> | lazy bytestrings are particularly well suited to crypto, in my opinion, since they stream in constanst space, and give you bytes pretty simply |
| 08:22:41 | <cinimod> | dons: blimey I maintain crypto and I don't recall adding bytestrings |
| 08:22:48 | <cinimod> | dons: I'll take a butchers |
| 08:23:08 | <dons> | oh cinimod hehe /me realises who cinimod is :) |
| 08:23:20 | <dons> | yeah, there's this Dom guy you should talk to |
| 08:23:24 | <dons> | :P |
| 08:23:33 | <dons> | i thought you did lazy bytestring stuff during the hackathon? |
| 08:23:56 | <cinimod> | dons: no because I needed Data.Bits |
| 08:24:10 | <cinimod> | dons: are you saying ByteString is an instance? |
| 08:24:32 | <dons> | so you want to xor 2 bytestrings directly? |
| 08:24:58 | <dons> | there's no Bits instance for ByteString, but of course there is for the Word8's bytestrings are made up of. |
| 08:25:13 | <cinimod> | dons: I'll have to check but yes that's pretty much it |
| 08:25:54 | <dons> | if there's a sensible instance of Bits for ByteStrings (of either flavour) it'd make a useful patch to the bytestring lib (or maybe an extra library) |
| 08:26:12 | <dons> | it might be confusing since people would not expect bytestrings themselves to be Bits-able |
| 08:26:33 | <cinimod> | dons: ok I'll have to take another look. |
| 08:26:49 | <cinimod> | dons: I'm in the middle of GADTs and ASN.1 at the moment |
| 08:27:01 | <dons> | oh, sounds fun! |
| 08:27:10 | <cinimod> | dons: and my brain can't switch easily - maybe next weekend |
| 08:27:37 | <dons> | you should write up what you're doing with the GADTs. enforcing some crypto properties, I presume? |
| 08:27:44 | <cinimod> | dons: it seems to work well so far |
| 08:28:06 | <cinimod> | dons: well it's not crypto (although it's used in X.509) |
| 08:28:26 | <dons> | ah I see, you're using a GADT to embed the ASN data type? |
| 08:28:40 | <cinimod> | dons: but yes I can enforce only integers to be used for e.g. a constrained INTEGER |
| 08:28:49 | <cinimod> | dons: exactly |
| 08:28:51 | <dons> | yeah, that's cool |
| 08:29:22 | <cinimod> | dons: I will write it up but it's no small amount of work |
| 08:29:51 | <cinimod> | dons: I'm actually doing PER (Packed Encoding Representation) |
| 08:30:31 | <cinimod> | dons: and just the INTEGER encoding is a lot of work (constrained, semi-constrained and unconstrained) |
| 08:31:37 | <dons> | yeah |
| 08:42:44 | <eivuokko> | Is there other .net backend on haskell compilers than yhc's (or one seriously in works)? |
| 08:42:59 | <dons> | there's a .Net binding for ghc in the works |
| 08:43:45 | <eivuokko> | I've been playing with c# and f# using xna...I'd like haskell. |
| 08:44:14 | <eivuokko> | ..and I need verifiable bytecode for that. |
| 08:44:28 | <eivuokko> | (if I want to run the app in xbox) |
| 08:44:37 | <Heffalump> | DYM managed? |
| 08:44:40 | <eivuokko> | So just using libs isn't quite enough |
| 08:45:34 | <eivuokko> | Yes, it is managed, and even more, verified = no unsafe pointers etc. |
| 08:46:05 | <Heffalump> | oh, I thought managed implied verified |
| 08:46:16 | <Heffalump> | and that managed was the .NET term, whereas verified is the JVM term |
| 08:46:20 | <Heffalump> | but I could well be confused |
| 08:46:37 | <eivuokko> | I am not that much of an expert, I just skimmed the specs and I recall them using word verified |
| 08:46:54 | <eivuokko> | Might be that api docs use other terms |
| 08:48:18 | <eivuokko> | Is that .net binding the stuff that's been on for year or two and has no published patches or binaries? |
| 08:48:38 | <eivuokko> | (except the stuff on main ghc repos, that doesn't work) |
| 08:48:48 | <xpika> | @where flags |
| 08:48:48 | <lambdabot> | http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html |
| 08:51:27 | <Heffalump> | http://www.cin.ufpe.br/~haskell/haskelldotnet/ exists but is still vapourware |
| 08:51:29 | <lambdabot> | Title: The Haskell.NET Project |
| 08:51:38 | <eivuokko> | Yes, that. |
| 08:51:38 | <Heffalump> | but they've been making some noise lately, so perhaps they'll release something soon |
| 08:52:01 | <eivuokko> | Mhm |
| 08:53:30 | <yakov> | morning |
| 08:53:49 | <Heffalump> | how much of a rush are you in? |
| 08:54:08 | <eivuokko> | Not rush. I can continue using c# and f# :-P |
| 08:54:50 | <eivuokko> | And most fun stuff doesn't work on xna/xbox anyway, so can't do really interesting things anyway. |
| 08:56:42 | <LeCamarade> | eivuokko: I use F#, and I am lovin' it. Of course, I pray for the Haskell.NET project everyday, but ... until then. :o) |
| 08:56:54 | <eivuokko> | I miss monads. |
| 08:58:02 | <LeCamarade> | eivuokko: Me too. And .NET has some ashamingly-procedural libraries. Too, too procedural. |
| 08:58:22 | <eivuokko> | Hmm |
| 08:58:27 | <LeCamarade> | And very little support for functional programming in the .NET runtimes. |
| 08:58:33 | <eivuokko> | Indeed. |
| 08:58:56 | <eivuokko> | Seen how f# compiler algebraic datatypes? -.- |
| 08:58:58 | <LeCamarade> | They told the F# guy that `programs that allocate a lot' (like the functional ones) are bugs. :o( |
| 08:59:25 | <eivuokko> | Yeah, I am kinda worried about that stuff. They say on xbox the garbage collector is pretty bad. |
| 09:00:45 | <LeCamarade> | Oh. Hadn't heard of that. And that the support for tail-recursion is a bit crippled. In fact, F# is a lot like an attempt to show that FP can be done on .NET. If it is something to prove, that causes fear. |
| 09:01:27 | <LeCamarade> | But I've not had any intense programs, so I can't judge the performance. I'm just glad about having OCaml on .NET. :o) |
| 09:01:29 | <eivuokko> | Hmm? How is tail-recursion crippled? Atleast there's an instruction for that. |
| 09:02:00 | <Adamant> | what about .NET 3? I thought it was supposed to improve matters |
| 09:02:10 | <Adamant> | for FP-ish programs |
| 09:02:10 | <eivuokko> | Ah, you mean it cannot be verified in all cases... |
| 09:02:40 | <eivuokko> | The quick glance I had on .net 3 stuff didn't seem such a big improvement, but I am not a compielr writer really. |
| 09:06:47 | <dmead> | ?paste |
| 09:06:47 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 09:07:48 | <nomeata> | lambdabot, messages? |
| 09:08:21 | <nomeata> | can I make lambdabot forget a message I sent someone? |
| 09:08:44 | <nomeata> | @tell dons ignore my last message, repo was up again, I did not forget, you got the patches by mail. |
| 09:08:45 | <lambdabot> | Consider it noted. |
| 09:09:02 | <nomeata> | @botsnack |
| 09:09:02 | <lambdabot> | :) |
| 09:13:24 | <LeCamarade> | eivuokko: On tail-recursion: I remember reading something about there being a kind of difficulty in just forcing the jumps, especially when working with other code written in them other languages. Still searching for the link ... |
| 09:13:53 | <LeCamarade> | Not this one, but I'm getting close: http://geekswithblogs.net/jwhitehorn/archive/2007/06/06/113060.aspx |
| 09:13:56 | <lambdabot> | Title: Tail Recursion Revisited, http://tinyurl.com/2fvgzx |
| 09:14:40 | <LeCamarade> | Oh, actually, they were saying it had been healed: http://geekswithblogs.net/jwhitehorn/archive/2006/06/09/81257.aspx |
| 09:14:42 | <lambdabot> | Title: Tail Recursion, http://tinyurl.com/23jx7j |
| 09:14:44 | <LeCamarade> | :o) |
| 09:15:18 | <dmead> | LeCamarade, IL gets translated to bytecode? |
| 09:15:37 | <dmead> | when compilation is done |
| 09:15:38 | <dmead> | etc |
| 09:15:46 | <LeCamarade> | IL is bytecode ... |
| 09:15:53 | <dmead> | oh |
| 09:16:41 | <LeCamarade> | ACTION steps away for a while ... |
| 09:41:39 | <DRMacIver> | Hm |
| 09:42:10 | <DRMacIver> | Trying to create eager functional data structures whose performance doesn't suck is really making me appreciate laziness. :) |
| 09:42:24 | <dons> | DRMacIver: in Haskell? |
| 09:42:24 | <lambdabot> | dons: You have 11 new messages. '/msg lambdabot @messages' to read them. |
| 09:42:31 | <DRMacIver> | dons: No. |
| 09:42:43 | <dons> | i've got a theory that haskell + bang patterns is rather good for eager structures (see lazy bytestrings for an example) |
| 09:43:09 | <DRMacIver> | I need to read through the lazy byte strings stuff more carefully. |
| 09:43:17 | <DRMacIver> | As what I'm doing at the moment is very close to it in some respects. |
| 09:43:33 | <DRMacIver> | (It's a bit closer to Ropes really, but similar idea) |
| 09:43:41 | <dons> | yeah, sounds related. |
| 09:44:26 | <DRMacIver> | It is, unfortunately, implemented in Java, but that's a feature rather than a bug. :) |
| 09:44:37 | <dons> | hehe |
| 09:44:42 | <dons> | yeah, you'll miss laziness. |
| 09:44:52 | <DRMacIver> | I'm using laziness in a few places where I can. |
| 09:45:19 | <dons> | so i wonder: is it easier to build eager structures in lazy-by-default, or strict-by-default languages? |
| 09:45:20 | <DRMacIver> | It does some lazy IO for example (or will do, not much of that is implemented right now) |
| 09:45:42 | <dons> | the problem i suspect being that strict languages only have second class laziness support |
| 09:45:49 | <dons> | while lazy languages have good strictness facilities |
| 09:46:02 | <DRMacIver> | I discovered that trying to make laziness work in Java is really really difficult in certain cases. |
| 09:46:14 | <DRMacIver> | I mean, you can do the basic calculate and cache thing. |
| 09:46:17 | <[LeCamarade]> | DRMacIver: I remember you saying you'd built a laziness lib for Java. Was that a build-up to this? |
| 09:46:37 | <DRMacIver> | That's easy. But making it thread safe without introducing horrific deadlocking potential is hard. |
| 09:46:44 | <dons> | so the java guys probably never thought about laziness? you're breaking new ground doing it by hand? |
| 09:46:45 | <DRMacIver> | [LeCamarade]: The laziness lib in Java rather failed. :-/ |
| 09:46:48 | <[LeCamarade]> | dons: It's why I think laziness should be the default - you can escape it if you don't want it. |
| 09:47:03 | <DRMacIver> | [LeCamarade]: I couldn't make it work in the type system. |
| 09:47:16 | <hpaste> | gattocarlo annotated "problems with Xlib.FontStruct" with "solved problems with Xlib.FontStruct" at http://hpaste.org/312#a1 |
| 09:47:18 | <dons> | [LeCamarade]: yes, needs good good good support for strictness though (at a minimum, bang patterns) |
| 09:47:24 | <dons> | gattocarlo: good newS! |
| 09:47:40 | <DRMacIver> | This is both more and less ambitious - it's a very narrow scope, but a much larger task. I'm essentially recreating the String class using a purely functional (ish) approach. |
| 09:48:02 | <DRMacIver> | dons: I'm somewhat breaking new ground. I'm sure other people have done parts of this before. :) |
| 09:48:05 | <[LeCamarade]> | DRMacIver: Ah. That's the sad part. Java wins, even while being ungood. :o( |
| 09:48:16 | <gattocarlo> | dons: now I can write a dzen in haskell! |
| 09:48:32 | <DRMacIver> | [LeCamarade]: Yeah. I figured out a way I could do it by basically making everything typed as Object until the last possible minute, but I couldn't be bothered. |
| 09:48:35 | <dons> | gattocarlo: yeah, i was just about to say! |
| 09:48:41 | <dons> | it looks like the stub of a dzen :-) |
| 09:48:52 | <dons> | gattocarlo: so what was the problem, can you summarise? |
| 09:48:56 | <DRMacIver> | [LeCamarade]: It was basically going to end up with me writing a dynamically typed lazy EDSL in Java. :) |
| 09:49:11 | <gattocarlo> | dons: the same afecting Tabbed.hs |
| 09:49:35 | <dons> | not an X11 binding problem, but just calling Xlib incorrectly? |
| 09:49:51 | <gattocarlo> | yes, you need first to set the fonts with loadQueryFont |
| 09:50:02 | <dons> | silly imperative languages :-) |
| 09:50:07 | <gattocarlo> | otherwise FontStruct is not built |
| 09:50:09 | <LeCamarade> | DRMacIver: I am writing me a language for my kind of work in the near future. I was worried to death of thinking I was going to be patching someone's language, as though there is a compiler tax. |
| 09:50:18 | <dons> | gattocarlo: good work. |
| 09:50:22 | <LeCamarade> | With all the bells and whistles. :o) |
| 09:50:37 | <gattocarlo> | dons: thanks, I'll submit a patch for Tabbed.hs soon |
| 09:50:52 | <dons> | cool. |
| 09:52:17 | <DRMacIver> | LeCamarade: Heh. I must admit, I've never gotten around to actually writing a language. I keep wanting to, but I've never had a task for which it was worth the effort. |
| 10:12:28 | <olsner> | anyone here using the haskell xcode plugin? just installed it - I'm getting "Internal error occurred while creating dependency graph: *** +[NSCFNumber count]: selector not recognized" when trying to build my project |
| 10:15:05 | <rhz> | laziness makes debugging using trace somewhat difficult I'm finding |
| 10:26:07 | <xs> | hi. i'm about to abandon haskell for a project i'm working on. i want opengl and i want threading (a separate render and event dispatch thread, at least). glut cannot do this. gtk2hs cannot do this (as i understand it). does anyone happen to have a glimmer of haskell hope? |
| 10:30:19 | <eis> | i don't see why glut and gtk2hs wouldn't be able to do this |
| 10:30:30 | <eis> | i know that gtk2hs used to have problems with threads, but those have been fixed |
| 10:31:14 | <dons> | pretty sure gtk2hs works now. check with dcoutts |
| 10:31:44 | <xs> | initGUI still spouts stuff at me saying "don't use a threaded RTS", which puts me off |
| 10:31:58 | <xs> | glut isn't threadsafe (and is really only for toy applications, afaict) |
| 10:32:23 | <xs> | i'll look again at gtk2hs. thanks. |
| 10:32:32 | <eis> | another option is hsSDL |
| 10:32:52 | <dons> | glut's been used in frag (a pretty big use case). what are you doing that you can choose between glut or gtk2hs -- aren't they wildly different? |
| 10:33:46 | <xs> | i just want to dump opengl to the screen. i don't care how, really. whatever works. i presume i can do most of glut in gtk+. |
| 10:34:09 | <xs> | eis: hm. there seem to be many haskell sdl bindings. is this one known-good? |
| 10:34:43 | <dons> | check hackage.haskell.org to find whatever is latest |
| 10:35:24 | <dons> | and perhaps double check on the mailing list about your problems with gtk and glut. there may be experts who know exactly whta you should be doing |
| 10:35:47 | <dons> | since there's been quite a bit of graphics / 3d /gl stuff, i'd be really surprised if it wasn't possible with the current libs |
| 10:39:18 | <xs> | dons: cheers. the libsdl people should be told of hssdl. they point to a dead sf.net project on their haskell language support bit right now. |
| 10:42:10 | <eis> | xs: maybe you can tell them? :) |
| 10:44:56 | <xs> | yup. am doing so |
| 10:50:47 | <eis> | cool =] |
| 10:54:33 | <sphynx> | I woner why \t -> (snd t, fst t) is pl-ed to "liftM2 (,) snd fst". Is tuple a monad too? |
| 10:55:55 | <Lemmih> | sphynx: No, it's using the Reader monad. |
| 10:56:44 | <dons> | Lemmih: can you help out xs with the SDL stuff? |
| 10:58:16 | <Lemmih> | xs: Need help? |
| 10:58:27 | <Lemmih> | xs: How's lscd doing, btw? |
| 10:58:28 | <dons> | wow. the new gadt stuff in darcs looks cool |
| 10:58:46 | <dons> | glad to see that's going forward. been hanging out for darcs + gadts since '05, iirc |
| 10:58:46 | <eis> | dons: what's that? |
| 10:59:03 | <dons> | check the darcs list, "darcs patch: start gadt stuff (and 29 more)" |
| 10:59:37 | <Heffalump> | we first laid the plans for it in Estonia |
| 11:00:30 | <dons> | yeah. good to see the code now. i guess the GADT embedding takes a while to settle in? :-) |
| 11:00:45 | <dons> | also good to see David working on darcs, and not xmonad ;) |
| 11:00:53 | <kowey> | doesn't even compile yet... but getting closer |
| 11:01:07 | <dons> | so .. is the path to all glory for darcs? |
| 11:01:09 | <Heffalump> | I think it just took ages for anyone to have time to implement it in darcs |
| 11:01:15 | <dons> | yeah. |
| 11:01:25 | <Heffalump> | also, we spent a lot of time prototyping GADT-based conflictor solutions that went nowhere |
| 11:02:06 | <dons> | it'd be interesting to see a summary of the origins, side alleys , and path forward for the gadt stuff in darcs (and its type hacking in general) |
| 11:02:48 | <Heffalump> | I think someone wrote a wiki page about it somewhere. I remember explaining it to them and then reviewing the page after they wrote it. |
| 11:03:21 | <Heffalump> | the basic idea is pretty obvious, though it didn't seem so obvious at the time we designed this stuff (and GADTs were quite new then) |
| 11:03:49 | <Heffalump> | http://wiki.darcs.net/index.html/GADTPlan |
| 11:03:53 | <lambdabot> | Title: GADTPlan - DarcsWiki |
| 11:04:15 | <kowey> | might be worth updating that with new notation |
| 11:08:41 | <DRMacIver> | dons: If you're interested, the conclusion seems to be that even trying to do this lazily in Java will nuke your performance from orbit. |
| 11:09:22 | <dons> | hehe. useful to know. |
| 11:09:36 | <dons> | hmm. "disclosure.org" would make a cool FP domain name. |
| 11:09:54 | <dons> | maybe `disclosure' should have been what sequence.complete.org was called. |
| 11:17:43 | <ClaudiusMaximus> | @type (>>=) |
| 11:17:45 | <lambdabot> | forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b |
| 11:18:49 | <astrolabe> | @seen ekidd |
| 11:18:49 | <lambdabot> | I saw ekidd leaving #haskell 8h 24m 48s ago, and . |
| 11:21:23 | <hughperkins> | Hi. Was playing with adding package from packagedb. Ran configure + build + install, then ghc-pkg list, but dont see the package |
| 11:21:59 | <hughperkins> | Platform = Windows. The files seem to end up in d:\program files\haskell , but the ghc instalaltion is at O:\devtools\ghc |
| 11:22:34 | <hughperkins> | Tried messing around with the --prefix but no joy so far :-/ Seems like the Setup.lhs install is not registering the package? |
| 11:22:47 | <Heffalump> | it ought to |
| 11:22:54 | <hughperkins> | Yes :-) |
| 11:22:55 | <Heffalump> | check that the configure step lists the right ghc |
| 11:23:01 | <hughperkins> | Yes it does |
| 11:23:08 | <Heffalump> | dons:\program files\haskell will be executables |
| 11:23:21 | <Heffalump> | gah, s/dons/d/ # silly autocomplete |
| 11:23:29 | <Heffalump> | what is the package? |
| 11:23:56 | <hughperkins> | tried several. at the moment haddock |
| 11:24:28 | <hughperkins> | but the issue also exists with other packages, eg http |
| 11:24:28 | <Heffalump> | oh, that's not a library |
| 11:24:35 | <Heffalump> | haddock, that is |
| 11:24:35 | <hughperkins> | Ah ok :-) |
| 11:24:42 | <Heffalump> | http really ought to end up in ghc-pkg |
| 11:24:52 | <hughperkins> | html is, but I dont see http |
| 11:26:02 | <hughperkins> | retrying... |
| 11:27:02 | <Heffalump> | and I do use Windows (at work, anyway) and I've never had a problem with installing things |
| 11:28:16 | <hughperkins> | well... just tried rerunning configure, build , install for http, but not seeing it in ghc-pkg |
| 11:28:29 | <hughperkins> | I'm on a public terminal, maybe something in the registry changes from machien to machine? |
| 11:28:34 | <hpaste> | ClaudiusMaximus annotated "any thoughts on this dynamic method dispatcher?" with "ah, so that's why Map.insert has the argument order that it does" at http://hpaste.org/265#a1 |
| 11:28:42 | <hughperkins> | oh wait, I'm blind, http is there Heh! |
| 11:29:24 | <hughperkins> | Great! |
| 11:32:02 | <Heffalump> | :-) |
| 11:32:12 | <Heffalump> | there's no standard for capitalisation, which doesn't help |
| 11:32:15 | <Heffalump> | cos the alphabetical list is confusing |
| 11:33:34 | <hughperkins> | Ah yes... |
| 11:41:35 | <Saizan_> | grep ftw |
| 11:44:12 | <hughperkins> | Looking for a really simple example of reading a few values from an xml file? something like reading <config value1="blah" value2="foo" /> or <config><value1>blah</value1><value2>foo</value2></config |
| 11:44:22 | <Heffalump> | are you using HaXml? |
| 11:45:21 | <hughperkins> | thats whats insatlled at the moment. Is that the de facto standard? |
| 11:46:36 | <Heffalump> | yeah |
| 11:46:50 | <Heffalump> | it produces fairly verbose data structures, but that's kind of inevitable with XML |
| 11:47:08 | <Heffalump> | my usual approach is to make a DTD and then use Haskell2Xml to make that into a custom parser for that DTD |
| 11:47:13 | <Heffalump> | but that's not "really simple" |
| 11:47:13 | <psykotic> | dons, hey :) |
| 11:47:19 | <hughperkins> | Right :-) |
| 11:47:33 | <Heffalump> | so I don't think I can provide any short examples |
| 11:47:41 | <hughperkins> | Hmmm, ok |
| 11:48:03 | <hughperkins> | In C# what I do is use reflection to read/write directly between arbitrary objects and xml. |
| 11:48:19 | <hughperkins> | Trying to figure out how to map that onto haskell |
| 11:52:24 | <hughperkins> | Ideally, I'd like to be able to be able to parse haskell types and use that to generate the xml, but I've no idea if that's even possible, so trying to code something "by hand" for now |
| 11:56:48 | <ClaudiusMaximus> | @type Data.Map.lookup |
| 11:56:50 | <lambdabot> | forall k a (m :: * -> *). (Ord k, Monad m) => k -> Data.Map.Map k a -> m a |
| 11:58:15 | <apfelmus> | Is there a systematic way to predict space usage of a Haskell program? |
| 11:58:48 | <apfelmus> | I mean, for running time, one can pretend that we are doing eager evaluation |
| 11:59:11 | <apfelmus> | and know for sure that lazy evaluation will take less reduction steps |
| 11:59:30 | <olsner> | wouldn't that be equivalent to determining at compile-time exactly when which data can be garbage collected? |
| 11:59:32 | <Igloo> | Lazy evaluation might take longer if space usage is higher and the GCer has more work to do |
| 11:59:58 | <apfelmus> | Igloo: yes, but let's put this aside :) |
| 12:00:35 | <apfelmus> | i mean, if i want to know asymptotic time complexity |
| 12:01:07 | <pejo> | apfelmus, 1 +1 will take the same amount of reduction steps under cbn/cbv. |
| 12:01:46 | <rhz> | is there some reasonably straightforward way to get a screenshot in GLUT in Haskell? |
| 12:01:49 | <apfelmus> | pejo: yeah, i mean <=, i always mix up those two |
| 12:02:50 | <apfelmus> | in fact, running time analysis can be done with a lazy/strict hybrid evaluation model |
| 12:03:22 | <dons> | hey psykotic |
| 12:03:28 | <dons> | i just replied. thanks for the insight! |
| 12:03:32 | <psykotic> | dons, does it make sense? |
| 12:03:50 | <dons> | yeah, as long as you can fully construct the `type checked' value before you proceed to reduce it. |
| 12:04:07 | <dons> | and indeed, looks like we've got a proper dual there. the checkers roughly reflect each other forward or backward a phase |
| 12:04:30 | <psykotic> | yep, that's what i think is so nice about it |
| 12:05:27 | <dons> | interestingly, in both cases the now-defeated built in checking has to run |
| 12:05:46 | <dons> | in the static case it goes around checking everything is of type 'Universal' |
| 12:06:00 | <dons> | while in the dynamic case, I presume the built in test-and-then-reduce checking remains |
| 12:06:17 | <apfelmus> | i mean that you can perform some strict and some lazy reductions at any redex you want and always know that lazy evaluation will not take more step than such a hybrid |
| 12:06:25 | <pejo> | apfelmus, doesn't reasoning about space usage include reasoning about space leaks? Which is quite hard, they claim. |
| 12:06:31 | <apfelmus> | (any redex you want, but not inside lambda abstractions) |
| 12:06:59 | <Host47> | hello |
| 12:07:16 | <LeCamarade> | Hello. |
| 12:07:22 | <psykotic> | dons: that is true, but in the formal sense that is irrelevant. the key is that you can guarantee beforehand (via the static phase) that a certain class of errors won't manifest. in a reduction system, you'd express it in terms of "stuck terms". in scheme, you'd do it in terms of "runtime errors". |
| 12:08:06 | <dons> | yep, exactly. |
| 12:08:15 | <Host47> | (2*).sum [1..10] vs. ((2*).sum) [1..10] : why the parenthesis are needed? |
| 12:08:35 | <dons> | now I wonder: how rich does the dynacmically typed language have to be to support the embedded phase distinction, without implementing a full interpreter? |
| 12:08:46 | <apfelmus> | pejo: yep. but there are folklore examples and folklore intuition and i wonder whether their principles can be stated more or less formally |
| 12:09:18 | <LeCamarade> | @type (2*) |
| 12:09:20 | <lambdabot> | forall t. (Num t) => t -> t |
| 12:09:36 | <psykotic> | dons: i think that has more to do with the dynamic semantics of the two languages. for example, if you don't have closures, then you have to do some kind of defunctionalization and closure conversion to get an embedding. |
| 12:09:53 | <LeCamarade> | Host47: By putting the parens, you tell Haskell that you are not running the expression 2 *, but just currying the * function. |
| 12:10:03 | <LeCamarade> | Observe: |
| 12:10:18 | <LeCamarade> | let x = 2 * in 2 |
| 12:10:23 | <dons> | psykotic: yeah, that seems reasonable. |
| 12:10:26 | <LeCamarade> | let x = (2 *) in x 2 |
| 12:10:31 | <LeCamarade> | >let x = (2 *) in x 2 |
| 12:10:33 | <dons> | its easier in scheme :-) |
| 12:10:39 | <Host47> | LeCamarade: okok thx |
| 12:10:48 | <LeCamarade> | Host47: Phew. :o) |
| 12:10:58 | <LeCamarade> | @bot |
| 12:10:58 | <lambdabot> | :) |
| 12:11:05 | <Saizan> | Host47: because (2*) . sum [1..10] is parsed as (2*) . (sum [1..10]) which is wrong |
| 12:11:11 | <LeCamarade> | lambdabot: Now why didn't you eval? |
| 12:11:15 | <LeCamarade> | lambdabot-- |
| 12:11:31 | <Saizan> | Host47: function application has the highest precedency |
| 12:11:44 | <thorkilnaur> | > let x = (2 *) in x 2 |
| 12:11:46 | <lambdabot> | 4 |
| 12:11:50 | <Host47> | Saizan: clear thx |
| 12:12:24 | <thorkilnaur> | LeCamarade, because the space after > was missing, I think |
| 12:12:47 | <LeCamarade> | #haskell: Who is captaining the Wikibooks page on Haskell/Denotational_semantics? |
| 12:12:51 | <apfelmus> | however, the hybrid strict/lazy approach to time analysis fails for space analysis. Take for instance foldl (+) 0 [1..20] |
| 12:13:00 | <pejo> | apfelmus, if you find any work on stating it formally, please let me know. :-) |
| 12:13:41 | <apfelmus> | sure :D actually, i'm trying to write some wikibook contents about this |
| 12:13:43 | <LeCamarade> | pango_: Oh. I wanted to tell him that I, in fact, had the source code for an OCaml IRC bot, if he wanted one. |
| 12:13:52 | <LeCamarade> | Oops. |
| 12:14:43 | <apfelmus> | evaluating foldl (+) 0 [1..n] with lazy evaluation takes O(n) space |
| 12:15:02 | <apfelmus> | but evaluation it with eager evaluation takes O(n) space as well |
| 12:15:41 | <apfelmus> | the trick is to apply lazy reduction steps on the list but strict reduction steps on the accumulated (0+...) |
| 12:15:50 | <apfelmus> | the result is O(1) then |
| 12:15:58 | <apfelmus> | O(1) space that is |
| 12:16:50 | <apfelmus> | but to figure that out, you have to write down a complete trace of the graph reduction taking place |
| 12:17:51 | <pejo> | apfelmus, Hutton and Hope had some work on accurate step counting. Not sure if it contains anything useful for you though. |
| 12:18:22 | <apfelmus> | hm, i guess i should look into it again |
| 12:18:42 | <apfelmus> | however, the more accurate the procedure, the worse for the programmer |
| 12:19:23 | <apfelmus> | i mean, for time analysis, you can simplify a proof by evaluating redexes in advance |
| 12:20:36 | <apfelmus> | i only have a bad example: http://www.mail-archive.com/haskell@haskell.org/msg19980.html |
| 12:20:36 | <lambdabot> | Title: [Haskell] Re: Quicksearch vs. lazyness |
| 12:22:24 | <apfelmus> | in the analysis, you can first expand (foldTree f [1..4]) to ((1 `f` 2) `f` (3 `f` 4)) and look how much time this takes |
| 12:23:01 | <apfelmus> | then, you can wonder how lazy evaluation reduces this with f = merge |
| 12:24:04 | <apfelmus> | of course, the real execution will interleave both phases to obfuscation |
| 12:24:43 | <apfelmus> | but who have the _guarantee_ that this analysis can at worst overestimate the running time |
| 12:25:17 | <hughperkins> | Hmmm, sometimes its ok to use brackets and sometimes not; hard for a newbie :-/ |
| 12:25:39 | <hughperkins> | Why does putStrLn( "Your name is: " ++ name ) need brackets, but o it again |
| 12:26:00 | <DRMacIver> | It's because function application finds more strongly than operators. |
| 12:26:12 | <hughperkins> | but hSetBuffering stdin LineBufferinghSetBuffering stdin LineBuffering does not |
| 12:26:18 | <DRMacIver> | So putStrLn "Your name is: " ++ name gets parsed as (putStrLn "Your name is: ") ++ name |
| 12:26:23 | <hughperkins> | argh, cant use mouse |
| 12:26:25 | <hughperkins> | "hSetBuffering stdin LineBuffering" |
| 12:26:48 | <hughperkins> | Why cant i do "hSetBuffering( stdin LineBuffering )" |
| 12:26:57 | <DRMacIver> | The first parses as (hSetBuffering stdin) LineBuffering, which is correct. :) |
| 12:27:16 | <DRMacIver> | The second is incorrect because you're trying to apply stdin to LineBuffering |
| 12:27:23 | <DRMacIver> | Which is type unsound. |
| 12:27:43 | <DRMacIver> | Functions never have brackets for their arguments. Brackets just group things. |
| 12:27:44 | <hughperkins> | eh-heh, brain explodes |
| 12:27:52 | <hughperkins> | Ah |
| 12:28:00 | <oerjan> | hughperkins: parentheses must always be around a sinle expression |
| 12:28:07 | <oerjan> | *single |
| 12:28:08 | <hughperkins> | Ah ok |
| 12:28:12 | <DRMacIver> | When you're doing hSetBuffering stdin LineBuffering you're applying the function hSetBuffering to stdin and are getting back a function which you then apply to LineBuffering. |
| 12:28:15 | <Baughn> | hughperkins: Think lisp, if you like. (sqrt x), not sqrt(x). |
| 12:28:35 | <hughperkins> | Ah ok, interesting :-) |
| 12:28:38 | <Saizan> | (func arg1 arg2 .. argn) <-- right, wrong -> func(arg1 arg2 .. argn) |
| 12:29:57 | <hughperkins> | So, basically, if Pustrln took two arguments, it could look like this: |
| 12:29:58 | <Saizan> | we should put this in some of the tutorials, it's very different from the mainstream languages |
| 12:30:23 | <hughperkins> | putStrLn ( "Your name is " ++ name ) SomeSecondParameter |
| 12:30:39 | <Baughn> | hughperkins: Yes, exactly |
| 12:30:43 | <hughperkins> | Ok |
| 12:31:10 | <Baughn> | hughperkins: Though it has to be "someSecondParameter", as the intial letter's capital-ness is syntax. ;) |
| 12:31:11 | <hughperkins> | Ok, cool, that makes sense |
| 12:31:20 | <hughperkins> | Ah Heh! :-) |
| 12:31:23 | <olsner> | shouldn't I have gotten HaskellSupport.framework installed with my ghc installation? |
| 12:31:43 | <gh_> | hi, i'm trying to compile a haskell program written 4 years ago, it imports the module "IOExts" but it no longer exists in ghc, does anybody know by which one(s) it has been replaced ? |
| 12:32:09 | <Baughn> | gh_: Do you have a type signature for any of the functions in it? Or just a name? |
| 12:32:12 | <hughperkins> | IO? |
| 12:33:01 | <oerjan> | gh_: if you don't know what functions they are, try commenting out the import to see what it complains about |
| 12:33:12 | <gh_> | oerjan, yes, i'm goign to d this |
| 12:33:15 | <gh_> | do |
| 12:33:47 | <apfelmus> | gh_: most likely in one of System.* now. Try System.IO for a start |
| 12:34:02 | <hughperkins> | Saizan, where could be an appropriate page for me to add a couple of lines with " Functions never have brackets for their arguments. Brackets just |
| 12:34:05 | <hughperkins> | +group things."? |
| 12:34:15 | <hughperkins> | I mean, in the wiki? |
| 12:34:55 | <Saizan> | yeah in the wiki, i don't know if there's a page on syntax or such.. |
| 12:38:39 | <hughperkins> | Hmmm, theres quite a few tutorials / wikis about! |
| 12:39:51 | <gh_> | ok.. in fact i needed no more import to replace IOexts :) |
| 12:48:49 | <eis> | rhz: glReadPixels is usually used for taking a screenshot |
| 12:53:58 | <hughperkins> | newbie question: how do I do a nop or a "pass" in an if...else? eg "if count < 20 then my_function count + 1 else NOP |
| 12:54:57 | <oerjan> | hughperkins: you need to return _some_ value. It depends on what you want to do. |
| 12:55:41 | <erider> | good morning |
| 12:55:51 | <hughperkins> | its an imperative function that just has do putStrLn count |
| 12:56:00 | <hughperkins> | then it loops |
| 12:56:07 | <oerjan> | then return () is usually good |
| 12:56:34 | <eivuokko> | Or possibly when. |
| 12:56:37 | <oerjan> | as long as the then branch is IO () |
| 12:56:46 | <_roconnor> | @type until |
| 12:56:46 | <eivuokko> | :t Control.Monad.when |
| 12:56:49 | <lambdabot> | forall (m :: * -> *). (Monad m) => Bool -> m () -> m () |
| 12:56:49 | <lambdabot> | forall a. (a -> Bool) -> (a -> a) -> a -> a |
| 12:56:55 | <oerjan> | @src when |
| 12:56:56 | <lambdabot> | when p s = if p then s else return () |
| 12:57:33 | <oerjan> | when is an abbreviation, but it needs an import Control.Monad |
| 12:57:54 | <oerjan> | but you usually want that anyway for imperative code |
| 12:57:59 | <_roconnor> | @type while |
| 12:58:01 | <lambdabot> | Not in scope: `while' |
| 12:58:22 | <_roconnor> | > until (20<=) (^2) 1 |
| 12:58:28 | <lambdabot> | Terminated |
| 12:58:34 | <_roconnor> | > until (20<=) (^2) 2 |
| 12:58:35 | <lambdabot> | 256 |
| 12:58:48 | <rhz> | another newbie (kind of) question: can I force a list to be strict? |
| 12:59:01 | <sieni> | in what sense? |
| 12:59:02 | <_roconnor> | > until (20<=) (\x -> 3*x+1) 1 |
| 12:59:04 | <lambdabot> | 40 |
| 12:59:13 | <olsner> | @type until |
| 12:59:15 | <lambdabot> | forall a. (a -> Bool) -> (a -> a) -> a -> a |
| 13:00:02 | <_roconnor> | @type mapM putStrLn [1..20] |
| 13:00:04 | <lambdabot> | Ambiguous occurrence `mapM' |
| 13:00:04 | <lambdabot> | It could refer to either `mapM', imported from Control.Monad.Writer |
| 13:01:11 | <olsner> | ... but if there is only one candidate - in what way is it ambiguous? |
| 13:01:25 | <rhz> | The list is stored inside an IORef. I'm worried it is being reevaluated every time it is used. |
| 13:01:30 | <hughperkins> | http://paste.lisp.org/display/42901 |
| 13:01:57 | <oerjan> | rhz: it should not be evaluated more than once |
| 13:02:23 | <hughperkins> | getting error "Couldn't match expected type `()' against inferred type `IO t'" |
| 13:02:30 | <oerjan> | olsner: lambdabot cuts off the error messages |
| 13:03:01 | <Saizan> | ?type Data.Traversable.mapM |
| 13:03:03 | <lambdabot> | forall a (m :: * -> *) b (t :: * -> *). (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) |
| 13:05:18 | <Saizan> | hughperkins: seems like you are nesting IO actions, if you get stuck you can paste the code on hpaste |
| 13:05:22 | <Saizan> | @paste |
| 13:05:22 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 13:05:43 | <Saizan> | with the error .) |
| 13:05:48 | <hpaste> | (anonymous) pasted "(no title)" at http://hpaste.org/313 |
| 13:05:55 | <hughperkins> | http://hpaste.org/313 |
| 13:06:25 | <hughperkins> | there are several versions ;-) This one gives "parse error, possibly incorrect indentation" |
| 13:06:31 | <oerjan> | rhz: unless you are using unsafePerformIO as well |
| 13:07:09 | <mehrheit> | hughperkins, then and else should be indented more than if |
| 13:08:04 | <hughperkins> | Ah.... thanks merhrheit :-) |
| 13:08:56 | <hpaste> | Saizan annotated "(no title)" with "like this" at http://hpaste.org/313#a1 |
| 13:09:12 | <oerjan> | hughperkins: the problem in the when version was you forgot parentheses around the second argument |
| 13:09:19 | <Saizan> | or you can put everything on one line |
| 13:09:50 | <hughperkins> | Ok |
| 13:11:36 | <oerjan> | hughperkins: the $ operator is good to use if a function takes a complicated last argument |
| 13:11:38 | <hughperkins> | Ok cool that works :-) |
| 13:11:44 | <Saizan> | when (count /= 30) $ function2 (count+1) |
| 13:11:58 | <hughperkins> | ok |
| 13:12:10 | <Saizan> | here $ is like a ( that is closed at the end of the expression |
| 13:12:10 | <oerjan> | @quote stereo |
| 13:12:11 | <lambdabot> | Cale says: Welcome to #haskell where your questions are answered in majestic stereo! |
| 13:12:49 | <hughperkins> | the whole function2(count+1) is a second parameter to the when which is a function? |
| 13:12:56 | <Saizan> | yes |
| 13:13:04 | <hughperkins> | Ok, interesting |
| 13:13:08 | <oerjan> | @src when |
| 13:13:09 | <lambdabot> | when p s = if p then s else return () |
| 13:13:50 | <hughperkins> | Ah ok that makes sense now :-) |
| 13:14:33 | <oerjan> | @src ($) |
| 13:14:34 | <lambdabot> | f $ x = f x |
| 13:15:09 | <hughperkins> | Ummm, this is probably a newbie request that you hear many times but... is there any chance you could make functions implicitly return () so that if statements didnt require the else, which is currently required by the requirement to return()? |
| 13:15:41 | <dons> | yes, you use the function 'when' or 'unless' :-) |
| 13:15:43 | <dons> | ?src when |
| 13:15:43 | <lambdabot> | when p s = if p then s else return () |
| 13:15:46 | <dons> | ?src unless |
| 13:15:46 | <lambdabot> | unless p s = if p then return () else s |
| 13:15:52 | <hughperkins> | :-) |
| 13:15:53 | <dons> | they're in Control.Monad, so import that first |
| 13:15:58 | <hughperkins> | Ok |
| 13:16:15 | <xpika> | @src when |
| 13:16:15 | <lambdabot> | when p s = if p then s else return () |
| 13:16:25 | <dons> | this is a nice introductory example of how to write your own control structures too, btw. |
| 13:16:29 | <dons> | something to keep in mind. |
| 13:18:02 | <oerjan> | > 1+2 |
| 13:18:10 | <lambdabot> | 3 |
| 13:18:36 | <kpreid> | hughperkins: re parentheses, here's something you might find interesting |
| 13:18:57 | <kpreid> | > let f = uncurry replicate in f(3, "abc") |
| 13:18:59 | <lambdabot> | ["abc","abc","abc"] |
| 13:19:19 | <kpreid> | > replicate(3)("abc") |
| 13:19:20 | <lambdabot> | ["abc","abc","abc"] |
| 13:19:27 | <kpreid> | See, Haskell syntax is ordinary :-) |
| 13:19:52 | <dons> | yes, whitespace layout and parens-only-for-grouping give you a bit of roll-your-own syntax. |
| 13:20:15 | <dons> | you do see beginners use f(1,2) to write what we'd say as: f 1 2 |
| 13:24:24 | <xpika> | if you want parenthesis just type uncurry first |
| 13:24:33 | <xpika> | >uncurry div(100,2) |
| 13:24:39 | <xpika> | > uncurry div(100,2) |
| 13:24:40 | <lambdabot> | 50 |
| 13:26:37 | <Saizan> | ?type uncurry foldr |
| 13:26:39 | <lambdabot> | forall a b. (a -> b -> b, b) -> [a] -> b |
| 13:27:10 | <hughperkins> | Ok, interesting. |
| 13:27:28 | <dons> | :t uncurry |
| 13:27:30 | <lambdabot> | forall a b c. (a -> b -> c) -> (a, b) -> c |
| 13:27:32 | <dons> | :t curry |
| 13:27:34 | <lambdabot> | forall a b c. ((a, b) -> c) -> a -> b -> c |
| 13:27:55 | <hughperkins> | curry/uncurry are just functions written in Haskell? |
| 13:28:07 | <Saizan> | yes |
| 13:28:07 | <dons> | yeah |
| 13:28:09 | <dons> | ?src curry |
| 13:28:09 | <lambdabot> | curry f x y = f (x, y) |
| 13:28:11 | <dons> | ?src uncurry |
| 13:28:11 | <lambdabot> | uncurry f p = f (fst p) (snd p) |
| 13:28:18 | <hughperkins> | Hmmm, thats quite powerfull :-) |
| 13:28:31 | <dons> | yeah, its a good way to mess with how functions glue together |
| 13:28:34 | <dons> | ?src fst |
| 13:28:34 | <lambdabot> | fst (x,_) = x |
| 13:28:36 | <dons> | ?Src snd |
| 13:28:36 | <lambdabot> | Maybe you meant: rc src |
| 13:28:40 | <dons> | ?src snd |
| 13:28:40 | <lambdabot> | snd (_,y) = y |
| 13:28:45 | <dons> | another good couple to know are: |
| 13:28:47 | <dons> | ?src flip |
| 13:28:47 | <lambdabot> | flip f x y = f y x |
| 13:28:51 | <dons> | to flip arguments around |
| 13:28:52 | <dons> | and |
| 13:28:53 | <kpreid> | uncurry could also be written uncurry f ~(x,y) = f x y |
| 13:28:54 | <dons> | ?src (.) |
| 13:28:55 | <lambdabot> | (.) f g x = f (g x) |
| 13:28:59 | <dons> | function composition, of course. |
| 13:29:14 | <Saizan> | hughperkins: note that in f(a,b), (a,b) is not just syntax, but a value, a 2 element tuple |
| 13:29:23 | <dons> | flip/./curry/uncurry. glue for functions! :-) |
| 13:29:29 | <dons> | a new one in the mix is `on' |
| 13:29:30 | <dons> | on :: (b -> b -> c) -> (a -> b) -> a -> a -> c |
| 13:29:31 | <dons> | (*) `on` f = \x y -> f x * f y |
| 13:29:43 | <dons> | so we can write: sortBy (compare `on` fst) |
| 13:29:48 | <eivuokko> | Is on on std libs? |
| 13:30:02 | <dons> | in Data.Function yes. so it'll be in the next release of the base package |
| 13:30:15 | <eivuokko> | Cool, no idea how many times I rolled my own. |
| 13:30:22 | <dons> | me too! |
| 13:30:31 | <dons> | almost every time i sort pairs |
| 13:30:42 | <kpreid> | you know what would be neat? |
| 13:30:57 | <Saizan> | ?type comparing |
| 13:30:59 | <lambdabot> | forall b a. (Ord a) => (b -> a) -> b -> b -> Ordering |
| 13:31:09 | <dons> | kpreid: no. what is neat? |
| 13:31:14 | <kpreid> | if @pl could be told about new combinators (like on) and automatically generate optimization rules to and from it |
| 13:31:27 | <dons> | ah hmm. |
| 13:31:34 | <dons> | just as a set of rewrite rules |
| 13:31:48 | <dons> | just being able to extend @pl would be good. |
| 13:31:54 | <dons> | we really should talk more to the HaRe guy.. |
| 13:32:03 | <kpreid> | hmm |
| 13:32:19 | <dons> | its a pretty simple system, and ndm redid his own in yhc (DrHaskell) |
| 13:32:32 | <dons> | so we could either a) roll a new one, b) polish it up to make it easily extensible |
| 13:32:44 | <dons> | needs a phd student interested in term rewriting to spend a couple of days on it |
| 13:33:11 | <dons> | or, if you spend a couple of days on it, you should apply to also do a phd somewhere |
| 13:33:16 | <oerjan> | does @pl ever factor out common subexpressions? It seems that using `on` would require that. |
| 13:33:32 | <dons> | it does also factor out, yeah. but its a bit ad hoc, as far as term rewriting engines go |
| 13:34:41 | <Saizan> | ?pl \x y -> f x * f y |
| 13:34:41 | <lambdabot> | (. f) . (*) . f |
| 13:35:02 | <kpreid> | hmm. there isn't really such a thing as : on :: ap :: liftM |
| 13:35:22 | <dons> | ?unpl (f *** g) |
| 13:35:22 | <lambdabot> | (f *** g) |
| 13:35:34 | <kpreid> | lack of type inference |
| 13:35:53 | <dons> | ?pl \f g (x,y) -> (f x, g y) |
| 13:35:53 | <lambdabot> | flip flip snd . (ap .) . flip flip fst . ((.) .) . flip . (((.) . (,)) .) |
| 13:36:01 | <kpreid> | even if it did, you'd have to ?unpl ((f :: a -> a) ** g) |
| 13:36:24 | <dons> | yah, no type info. HaRe could do it though, I think |
| 13:47:44 | <eis> | ... |
| 13:49:03 | <hughperkins> | :t tail |
| 13:49:06 | <lambdabot> | forall a. [a] -> [a] |
| 13:49:12 | <hughperkins> | oops, wrong cmd |
| 13:51:22 | <pejo> | dons, the supply of phd students is unfortunately limited. :-) |
| 13:54:15 | <dons> | pejo: yes :-( |
| 13:54:39 | <dons> | ACTION is only weeks away from finishing, and real world (haskell!) pressures are taking away from my hacking time |
| 13:56:31 | <pejo> | dons, can you fail and postpone the defense for another year? Gives you time to teach some other grad student your stuff. ;) |
| 13:56:38 | <dons> | hehe |
| 13:56:39 | <eis> | how much does haskell pay per hour? |
| 13:56:55 | <erider> | happy father's day! |
| 13:57:19 | <dons> | not sure you can get paid by the hour. all the haskell jobs i've seen recently were 1 year+ salaries |
| 13:57:30 | <dons> | shapr might know |
| 14:00:00 | <eis> | anyone familiar with yhc javascript output? |
| 14:01:01 | <pejo> | dons, have a job waiting for you? |
| 14:01:12 | <dons> | pejo: yeah, i'm heading off to galois |
| 14:01:25 | <pejo> | dons, oh. Like all other grad students. :-) |
| 14:01:30 | <pejo> | Or rather former grad students, heh. |
| 14:01:33 | <dons> | apparently :} |
| 14:01:39 | <Igloo> | Who else is? |
| 14:02:05 | <dons> | well, i think i'm the only one so far in our generation, Igloo (?) |
| 14:02:14 | <dons> | though glguy is there now too. |
| 14:02:17 | <pejo> | Igloo, didn't Diatchki (sp?) go there too? |
| 14:02:20 | <dons> | yeah. |
| 14:02:33 | <Igloo> | OK |
| 14:15:45 | <dons> | night all. |
| 14:15:49 | <dons> | happy lambdas. |
| 14:18:01 | <araujo> | ACTION wonders if anyone has some server with some free space to share with a darc repo :-) |
| 14:31:43 | <hughperkins> | " |
| 14:32:00 | <hughperkins> | let valuesasnumbers = map read values" gives ambiguous type variable |
| 14:32:31 | <hughperkins> | been staring at it for a while, trying to explicitly declare the type to solve the issue -> cant seem to figure this out. |
| 14:32:43 | <hughperkins> | values is a list of strings |
| 14:34:37 | <dons> | right, its not sure what type you're trying to read into |
| 14:34:57 | <dons> | > map (read :: String -> Int) ["1", "2", "3"] |
| 14:34:58 | <lambdabot> | [1,2,3] |
| 14:35:05 | <dons> | > map (read :: String -> Bool) ["1", "2", "3"] |
| 14:35:06 | <lambdabot> | Exception: Prelude.read: no parse |
| 14:35:11 | <dons> | > map (read) ["1", "2", "3"] |
| 14:35:12 | <lambdabot> | [1,2,3] |
| 14:35:20 | <dons> | well, that used defaulting, so I was sneaky. |
| 14:35:34 | <hughperkins> | Ah, ok, cool :-) |
| 14:35:36 | <dons> | but normally you don't have defaulting, so the above would produce an ambiguous type variable error |
| 14:35:56 | <eis> | "file name does not match module name" |
| 14:36:12 | <eis> | how do i solve that compile error? my module name definitely matches the filename |
| 14:36:42 | <dons> | double check, module M where, M.hs |
| 14:36:54 | <eis> | oops nm |
| 14:37:14 | <hpaste> | mc pasted "diviseur : more simple ?" at http://hpaste.org/314 |
| 14:37:15 | <Igloo> | dons: Does lambdabot do any defaulting beyond what GHC does? |
| 14:38:00 | <hughperkins> | Cool, that works :-) |
| 14:38:54 | <Igloo> | Oh, that's interesting. 'map read ["1", "2", "3"]' doesn't work in ghci but 'print (map read ["1", "2", "3"])' does |
| 14:40:16 | <Syzygy-> | Cool. |
| 14:44:04 | <dons> | Igloo: yeah,, it uses ghci-style defaulting (-fextended-defaulting) |
| 14:44:26 | <Igloo> | Sorry, I meant GHCi. But the above is what confused me |
| 14:44:40 | <dons> | the print adds the Show instance, which kicks in the other defaulting stuff, yep, |
| 14:45:47 | <psykotic> | dons: do you know of any "well-known" compilers that use a dependently typed calculus as a core calculus in the compiler, even though the front-end language is non-dependently-typed? |
| 14:45:49 | <Igloo> | Hmm, yeah, but it's not too nice from a user's PoV |
| 14:46:25 | <psykotic> | dons: for ease and uniformity of encoding various type system features, say. |
| 14:46:44 | <Igloo> | Actually, there's already a Read constraint, so I'm not sure it should matter with the extended rules |
| 14:47:02 | <Igloo> | Oh, yes it does |
| 14:48:31 | <dons> | psykotic: hmm. System Fc (the GHC with type coercions) is getting there. But JHC is the prime example. pure lambda cube intermediate form |
| 14:48:57 | <psykotic> | oh, didn't know that about jhc. cool! |
| 14:48:59 | <dons> | there's Henk too, another pure type system intermediate language, used in a couple of compilers. |
| 14:49:06 | <dons> | (only researchy ones) |
| 14:49:45 | <dons> | Igloo: hmm, that's a bit weird that Show adds defaulting that Read doesn't |
| 14:53:48 | <psykotic> | dons: is there a good example of a type system feature jhc's encodes in its core PTS with much greater ease than ghc? |
| 15:03:55 | <dcoutts> | @seen xs |
| 15:03:56 | <lambdabot> | xs is in #haskell. I last heard xs speak 4h 18m 59s ago. |
| 15:04:30 | <dcoutts> | xs: Gtk2Hs does have support for the threaded rts, but you do need to be a bit careful about what you do from particular threads |
| 15:04:56 | <ekidd> | dons: Thanks for your advice on writing papers! It was a huge help. |
| 15:05:59 | <dcoutts> | xs: you'll note that the initGUI message mentions that you can use a separate function to initialise the GUI to use with the threaded rts. That's mainly so that casual users do not shoot themselves in the foot |
| 15:06:31 | <dcoutts> | xs: because Gtk+ is still a single threaded toolkit, so using it from the threaded rts needs some care |
| 15:14:21 | <olsner> | oh, henk sounds interesting |
| 15:16:37 | <hughperkins> | exit |
| 15:16:46 | <dons> | psykotic: it is suspected that GADTs and associated type families would be easier in JHC's core, than in System F-GHC style |
| 15:17:04 | <dons> | but now GHC uses System Fc, a core with extended stuff for type witnesses |
| 15:17:05 | <psykotic> | that makes sense. those are trivially encodeable in a dependently typed framework. |
| 15:17:11 | <dons> | maing both those easier. |
| 15:17:34 | <dons> | so, real world haskell stuff: not sure. experimental type system things, definitely |
| 15:17:38 | <vincenz> | > 1 |
| 15:17:39 | <lambdabot> | 1 |
| 15:18:18 | <psykotic> | dons: today's experimental type system things: tomorrow's real world haskell stuff :) |
| 15:18:41 | <psykotic> | the nested data parallellism stuff uses associated type families, right? |
| 15:19:03 | <dons> | yep |
| 15:19:10 | <dons> | to match up types with their distributed representation |
| 15:19:14 | <psykotic> | right |
| 15:31:15 | <psykotic> | dons: speaking of associated types, can you define 'instance' families abstracted over a type class? |
| 15:31:46 | <psykotic> | for example, imagine you wanted one kind of representation for types that implement a Hashable type class, another for those that only implement Ord, yet another for those that only implement Eq. |
| 15:32:04 | <psykotic> | (like for a map) |
| 15:32:29 | <dons> | right. class associated classes :-) they're a new feature. |
| 15:32:38 | <psykotic> | oh cool |
| 15:32:39 | <dons> | eactly so you can do things like switch on Ord or Eq |
| 15:33:09 | <dons> | see the slides on this here, (page 25) http://www.comp.mq.edu.au/~asloane/pmwiki.php/SAPLING/SAPLING071?action=download&upname=chakravarty-slides071.pdf |
| 15:33:10 | <lambdabot> | http://tinyurl.com/2donwk |
| 15:33:10 | <dons> | http://www.comp.mq.edu.au/~asloane/pmwiki.php/SAPLING/SAPLING071 |
| 15:33:11 | <lambdabot> | Title: : SAPLING - SAPLING 071 browse |
| 15:33:22 | <dons> | (last week, Manuel gave a talk on precisely this feature) |
| 15:33:43 | <Cheery> | you realise why haskell is more human-friendly than C? |
| 15:33:46 | <dons> | also appears to solve the restricted monad issue, say for Set monad. |
| 15:33:56 | <dons> | Cheery: hmm, no. why? |
| 15:34:03 | <dons> | segfaults? |
| 15:34:51 | <Cheery> | it's simple if you think of the code as a reflection of model in your mind |
| 15:35:24 | <Heffalump> | dons: are class associated classes actually in HEAD now, then? |
| 15:35:29 | <monochrom> | I know people who claim that it's natural to think up state-based mental models. |
| 15:35:33 | <Cheery> | assembly in itself does not convey much of interesting from that model |
| 15:36:16 | <dons> | Heffalump: nope. it's considered 2 days work though. so soon. |
| 15:36:21 | <Cheery> | therefore you benefit only little from compressing bunch of instructions |
| 15:36:42 | <dons> | Heffalump: mail chak et al if you want them sooner. |
| 15:36:43 | <Heffalump> | how does it solve the restricted monad issue? Don't you still have to redefine Monad to take advantage? |
| 15:36:57 | <Heffalump> | was just idly wondering, no urgent need. |
| 15:37:15 | <dons> | there's an example in the talk. I think you wrap the class Monad with a class-associated Restricted type? |
| 15:37:31 | <dons> | and then more restricted instances can fill out that type |
| 15:37:46 | <ekidd> | dons: Ooh. |
| 15:37:53 | <ekidd> | dons: sigfpe has been wanting that. |
| 15:37:55 | <dons> | ekidd: how'd the paper go, get it submitted? |
| 15:38:01 | <Cheery> | haskell, in other hand, wants code given in a more interesting form |
| 15:38:02 | <dons> | yeah, i saw that right at the end of today's article |
| 15:38:12 | <dons> | and mentioned it to sigfpe :-) |
| 15:38:48 | <ekidd> | dons: It's submitted. http://www.randomhacks.net/darcs/probability-monads/probability-monads.pdf |
| 15:38:49 | <Cheery> | but fails at providing straightforward way to convert the reflected models into binary |
| 15:38:49 | <lambdabot> | http://tinyurl.com/276u5w |
| 15:39:00 | <dons> | yay, well done ekidd |
| 15:39:24 | <ekidd> | dons: Many thanks to the Haskell community. I couldn't have done it without you all! |
| 15:39:50 | <dons> | its cool how blogging can lead to papers these days! |
| 15:39:58 | <dons> | now , just have to convince sigfpe to write some. |
| 15:40:02 | <vincenz> | type families seem like a REALLY cool feature |
| 15:40:18 | <dons> | vincenz: and so much simpler than functional dependencies |
| 15:40:43 | <dons> | its fairly intuitive how they work. per-instance types, classes and so on. type programming in the functional style, not the logic style |
| 15:42:08 | <dons> | ekidd: i like the coloured cross-refs in the .pdf. is that dvipdf? |
| 15:42:26 | <vincenz> | dons: what are the synonym families, they're not explained in those slides |
| 15:42:49 | <ekidd> | The hyperref package and pdflatex. |
| 15:43:06 | <dons> | ah yes. |
| 15:43:06 | <ekidd> | dons: You should also get a nice table of contents if you turn on bookmark view. |
| 15:43:23 | <dons> | vincenz: maybe check http://haskell.org/haskellwiki/GHC/Indexed_types ? |
| 15:43:25 | <lambdabot> | Title: GHC/Indexed types - HaskellWiki |
| 15:43:55 | <sorear> | (hello) |
| 15:43:57 | <Heffalump> | dons: I still don't see how you can do it without redefining Monad. But the redefinition would still be nicer than the current hacks people need. |
| 15:44:37 | <Heffalump> | vincenz: AIUI, there's families where you define instances using data, and there's families where you define them using type. But I may be a bit confused. |
| 15:44:58 | <sorear> | ACTION wonders why dons is awake |
| 15:45:08 | <Heffalump> | natural hacker behaviour? |
| 15:45:22 | <Heffalump> | @localtime dons |
| 15:45:24 | <vincenz> | ACTION read that as "natural number behaviour" |
| 15:45:25 | <lambdabot> | Local time for dons is Mon Jun 18 01:45:23 2007 |
| 15:45:45 | <Heffalump> | that's not late at all. Even I stay up that late at weekends occasionally nowadays. |
| 15:49:41 | <vincenz> | Heffalump: how about week days? |
| 15:50:03 | <Heffalump> | not a hope. I get up at 5:30 :-) |
| 15:50:14 | <ekidd> | dons: Let me know if you notice any glaring errors while glancing at my paper. :-) |
| 15:50:19 | <vincenz> | Heffalump: so what time do you hit the sack |
| 15:50:25 | <dons> | yep. you should have sent me a copy before the deadline ;) |
| 15:50:27 | <Heffalump> | 11:30 at the latest. |
| 15:50:31 | <ekidd> | I'm headed out for brunch, but I'll check with lambdabot when I get back. |
| 15:50:42 | <vincenz> | Heffalump: wow, 6h daily o.O |
| 15:50:46 | <dons> | i'm headed for bed, will read it through tomorrow and send some notes. |
| 15:51:10 | <ekidd> | dons: I know. :-/ I allocated a whole bunch of time to write it, and it still ended up taking me until almost the deadline. |
| 15:51:33 | <ekidd> | Next time, I'll leave even more time. |
| 15:51:36 | <dons> | hehe. |
| 15:51:50 | <dons> | that's what I always say too. the last paper was handled in a 7.30 am, 30 mins before the deadline |
| 15:52:23 | <ekidd> | I had no idea that "2 weeks before the deadline", was actually "leaving it for the last possible moment." |
| 15:52:57 | <pejo> | ekidd, or as a colleague put it - "Writing a paper takes the amount of time available until the deadline". :-) |
| 15:53:08 | <Heffalump> | vincenz: that's the absolute latest |
| 15:53:21 | <Syzygy-> | You write towards deadlines? O.o |
| 15:53:45 | <vincenz> | ACTION does too |
| 15:53:52 | <Syzygy-> | ACTION is typing up his first two papers ... Gonna see about a good point to submit them to when I'm done. :P |
| 15:54:09 | <ekidd> | Syzygy-: The paper was basically an excuse to go to Haskell Workshop and meet people, so submitting elsewhere wouldn't work. :-) |
| 15:54:31 | <vincenz> | ekidd: yeah, writing papers takes time |
| 15:54:37 | <vincenz> | ekidd: 2 weeks is really very little |
| 15:55:05 | <Syzygy-> | ekidd: Right. |
| 15:55:09 | <Syzygy-> | Oooooh, that reminds me... |
| 15:55:21 | <Syzygy-> | One of my papers might be a good reason to get to go to Haskell/FP-workshop-thingies. |
| 15:56:33 | <Heffalump> | ACTION probably can't go to ICFP this year :-( |
| 15:56:47 | <desp> | @hoogle Monad m => m (a -> m ()) -> [a] -> m () |
| 15:56:48 | <lambdabot> | No matches, try a more general search |
| 15:57:03 | <desp> | er, wrong |
| 15:57:11 | <desp> | @hoogle Monad m => (a -> m ()) -> [a] -> m () |
| 15:57:12 | <lambdabot> | No matches, try a more general search |
| 15:57:12 | <ekidd> | vincenz: Well, this is the third time I wrote it (first time as a paper, second time on my blog), so I made the mistake of saying, "How hard can this be?" |
| 15:57:29 | <desp> | @hoogle (a -> IO ()) -> [a] -> IO () |
| 15:57:30 | <lambdabot> | No matches, try a more general search |
| 15:57:32 | <Saizan> | ?type Prelude.sequence_ |
| 15:57:34 | <lambdabot> | forall (m :: * -> *) a. (Monad m) => [m a] -> m () |
| 15:57:43 | <Saizan> | ?type Prelude.mapM_ |
| 15:57:45 | <lambdabot> | forall a (m :: * -> *) b. (Monad m) => (a -> m b) -> [a] -> m () |
| 15:57:49 | <desp> | Saizan: thanks |
| 15:57:49 | <dons> | http://programming.reddit.com/info/1z3or/comments |
| 15:57:50 | <lambdabot> | Title: Type families in Haskell - and using them to do things (pdf) (reddit.com) |
| 15:58:06 | <dons> | i linked directly to the slides (which are also a nice use of the 'beamer' latex style for slides, fwiw, hmm.) |
| 15:58:26 | <desp> | why is m declared with an explicit kind here? |
| 15:58:46 | <Saizan> | because it's not *, and ghci likes to specify it |
| 15:58:46 | <dons> | lambdabot uses -fglasgow-exts for types, which prints the extra type info |
| 15:58:56 | <dons> | and kinds are nice. |
| 15:58:58 | <olsner> | > sequence [[1,2],[3,4]] |
| 15:58:59 | <lambdabot> | Terminated |
| 15:59:08 | <dons> | oh, that's fixed. i just need to update |
| 15:59:14 | <dons> | > Prelude.sequence [[1,2],[3,4]] |
| 15:59:16 | <lambdabot> | [[1,3],[1,4],[2,3],[2,4]] |
| 16:00:04 | <Saizan> | dons: that thing on constraint equality is intentionally vague or what? Elem c1 ~ Elem c2 in merge |
| 16:00:10 | <olsner> | that's cool.. I was mucking around with cartesian products before, but didn't find that one |
| 16:01:06 | <therp> | is there any predefined function that takes an element into a singleton list? |
| 16:01:13 | <ekidd> | dons: Oooh, clever. It's amazing what monad instances will do. |
| 16:01:25 | <Heffalump> | > return 1 :: [Int] |
| 16:01:26 | <therp> | hoogling for a -> [a] only give me (replicate 1) |
| 16:01:26 | <lambdabot> | [1] |
| 16:01:37 | <olsner> | > (:[]) 42 |
| 16:01:37 | <Heffalump> | but it's a little obscure, I tend to use (:[]) |
| 16:01:38 | <lambdabot> | [42] |
| 16:01:47 | <Heffalump> | or just write it out properly |
| 16:01:52 | <therp> | ah the monkey operator! |
| 16:01:52 | <vincenz> | Heffalump: ah the robot smiley :) |
| 16:02:02 | <dons> | ?quote ninja |
| 16:02:03 | <lambdabot> | SyntaxNinja says: * SyntaxNinja does the type-checking dance ;) |
| 16:02:05 | <dons> | ?quote ninja |
| 16:02:05 | <lambdabot> | SyntaxNinja says: * SyntaxNinja does the type-checking dance ;) |
| 16:02:10 | <dons> | ?quote monkey |
| 16:02:10 | <lambdabot> | bfulgham says: I now have trained-monkey-level skills in Haskell. I can write really bad shootout code (that the real people rewrite correctly), and build stuff like darcs. |
| 16:02:13 | <dons> | ?quote robot |
| 16:02:14 | <lambdabot> | No quotes match. You type like i drive. |
| 16:02:16 | <dons> | doh! |
| 16:02:24 | <vincenz> | dons: what was up with gcc y'day? |
| 16:02:31 | <olsner> | @quote operator |
| 16:02:31 | <lambdabot> | lambdabot says: <dmwit> ?quote ?quote <lambdabot> Plugin `quote' failed with: IRCRaised regex failed: (ReturnCode 13,"repetition-operator operand invalid") |
| 16:02:38 | <dons> | vincenz: ghc, you mean? |
| 16:02:43 | <vincenz> | dons: no, the lacking gcc |
| 16:02:46 | <dons> | mega serious file server failure. lost data and all |
| 16:02:46 | <eis> | @yow |
| 16:02:47 | <lambdabot> | Somewhere in suburban Honolulu, an unemployed bellhop is whipping up a |
| 16:02:47 | <lambdabot> | batch of illegal psilocybin chop suey!! |
| 16:02:50 | <vincenz> | ouch |
| 16:03:04 | <dons> | lucky i use darcs |
| 16:03:07 | <dons> | distribute your repos! |
| 16:03:16 | <dons> | ;) |
| 16:04:39 | <helmut> | dons: Yeah. I got that case, too once. :-) |
| 16:13:53 | <monochrom> | unemployed bellhop? type-incorrect haskell program? immortal mortal? dark light? |
| 16:15:14 | <olsner> | :t (let x = x in x) |
| 16:15:17 | <lambdabot> | forall t. t |
| 16:15:25 | <olsner> | > (let x = x in x) |
| 16:15:26 | <lambdabot> | Exception: <<loop>> |
| 16:15:47 | <emu> | the only thing that can be type forall t. t is _|_ |
| 16:18:22 | <olsner> | argh, what the heck is forall useful for? |
| 16:18:22 | <eis> | i'm confused how to convert (IOUArray Int Word8) into (Ptr a) |
| 16:18:34 | <eis> | so that i can write data to the array through the pointer |
| 16:18:57 | <olsner> | what's the difference between f :: a and f :: forall a. a? |
| 16:18:58 | <ndm> | @hoogle IOUArray Int Word8 -> Ptr a |
| 16:18:59 | <lambdabot> | No matches, try a more general search |
| 16:19:20 | <Saizan> | olsner: in haskell 98 every type variable is implicitly forall-ed |
| 16:19:21 | <ndm> | olsner: nothing |
| 16:19:31 | <Saizan> | ?type map |
| 16:19:33 | <lambdabot> | forall a b. (a -> b) -> [a] -> [b] |
| 16:28:15 | <eis> | can something like the IO monad work in a non lazy language? |
| 16:28:42 | <Syzygy-> | Sure. Why shouldn't it work? |
| 16:28:44 | <vincenz> | yes |
| 16:29:02 | <vincenz> | as long as you don't sequence IO actions, they're like statements wrapped in a little bubble |
| 16:29:40 | <dons> | yeah, you can do it in say, O'Caml. helps to have overloading, and monadic sugar, and some way to delay evaluation (like wrapping in a bubble) |
| 16:29:48 | <eis> | let a = putStrLn "yes" >> a |
| 16:30:01 | <vincenz> | eis: that is somethng else |
| 16:30:11 | <eis> | will i be able to evaluate that expression? |
| 16:30:14 | <vincenz> | eis: that's whether you can make 'fix' lzy |
| 16:36:41 | <olsner> | :t interact |
| 16:36:50 | <lambdabot> | (String -> String) -> IO () |
| 16:42:19 | <olsner> | @hoogle ([String] -> [String]) -> IO () |
| 16:42:19 | <lambdabot> | No matches, try a more general search |
| 16:42:48 | <olsner> | @pl interact (unlines . f . lines) |
| 16:42:48 | <lambdabot> | interact (unlines . f . lines) |
| 16:43:08 | <olsner> | @pl (\f -> interact (unlines . f . lines)) |
| 16:43:08 | <lambdabot> | interact . (unlines .) . (. lines) |
| 16:43:45 | <Syzygy-> | That's just echo, isn't it? |
| 16:44:44 | <matthew-_> | what's the standard solution to the lack of a ChangeLog field in cabal? |
| 16:44:45 | <lambdabot> | matthew-_: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 16:45:08 | <matthew-_> | I've ended up adding ChangeLog.txt as an extra src file |
| 16:45:26 | <matthew-_> | is there a better way? I just want to ensure it goes out with sdist... |
| 16:46:11 | <desp> | CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ |
| 16:53:36 | <eis> | i've always been suspicious that curl has a lot of ugly code |
| 16:54:25 | <olsner> | @remember <desp> CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ |
| 16:54:25 | <lambdabot> | Done. |
| 16:54:47 | <olsner> | perhaps <libcurl> would've been more appropriate as the "originator" of that quote, but whatever |
| 17:17:36 | <Heffalump> | @tell kowey isn't ghc 6.4.2 the latest 6.4 ghc? |
| 17:17:36 | <lambdabot> | Consider it noted. |
| 17:45:48 | <jfredett> | Do there exists any decent tutorials for Data.Tree? or is the Hoogle docs just about it? |
| 17:46:22 | <jfredett> | s/exists/exist |
| 17:46:56 | <Lemmih> | jfredett: There's the Haddock documentation. |
| 17:47:28 | <jfredett> | right- but thats the same as the docs on Hoogle, right? |
| 17:47:39 | <jfredett> | they're a little cryptic |
| 17:47:50 | <jfredett> | I was hoping for something a little more straightforward- |
| 17:49:05 | <Lemmih> | I thought Hoogle was a search tool. |
| 17:49:53 | <monochrom> | I think the like of "The elements of a tree in pre-order" is clear enough. |
| 17:51:26 | <monochrom> | http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Tree.html |
| 17:51:28 | <lambdabot> | http://tinyurl.com/29wgup |
| 18:00:53 | <jfredett> | Lemmih: Well, yes- but I mean the docs linked to by hoogle, |
| 18:00:53 | <jfredett> | monochrom: thanks, looks significantly easier to follow |
| 18:01:19 | <jfredett> | I think I must have gotten a bad link to the docs |
| 18:01:43 | <jfredett> | because the link i followed looked similar- but didn't have half of that information |
| 18:02:46 | <eis> | http://www.youtube.com/watch?v=iGZXhUeLh90 |
| 18:05:26 | <LeCamarade> | eis: What's it about? |
| 18:05:48 | <LeCamarade> | :oD |
| 18:05:53 | <olsner> | haskell on youtube!? |
| 18:06:04 | <Saizan> | youtube on #haskell |
| 18:06:26 | <eis> | "Physics Guy Rap" |
| 18:23:11 | <jaapweel> | I have a question about cabal |
| 18:23:23 | <jaapweel> | what are reasonable minimum versions to specify for base and parsec? |
| 18:23:32 | <jaapweel> | I'm using ghc 6.6 myself |
| 18:24:44 | <Lemmih> | jaapweel: Those packages are pretty stable. Not specifying a minimal version would be fine. |
| 18:24:59 | <jaapweel> | Lemmih, thanks |
| 18:25:50 | <jaapweel> | I wrote a module for CSV files; it's a very simple thing, but partially I just wanted something simple to learn to properly use cabal and hackage |
| 18:27:26 | <igli> | er it is actually preferred to specify a min; 6.6 is very diff to anything before as well |
| 18:27:38 | <mattam> | "knocked for six" ? |
| 18:28:08 | <igli> | http://www.peevish.co.uk/slang/a.htm |
| 18:28:09 | <lambdabot> | Title: A dictionary of slang - "A" - English slang of the UK |
| 18:32:56 | <Lemmih> | igli: There's no good way of selecting a min version. Much better to just say it has been tested with X, in my opinion. |
| 18:33:22 | <Igloo> | Yeah, I wouldn't bother going to any effort to find out what the minimums are, just put some in if you get bug reports |
| 18:33:38 | <igli> | oh sorry thought i was in #gentoo-haskell Lemmih |
| 18:44:53 | <cdiggins954> | I'm new here, anyone mind if I ask a noob question about GHC? |
| 18:45:45 | <Igloo> | Ask away! |
| 18:46:51 | <cdiggins954> | Thanks Igloo. Here is my noob question: "let m f = f (f);;" fails in GHC: "infinite types, yadda yadda yadda". I kind of know what this is all about, it requires a recursive type. I'm wondering if there is anyway to get haskell to infer the types, or if there are Haskell dialects which can handle infering simple recursive types? |
| 18:47:19 | <quicksilver> | not as far as I know |
| 18:47:32 | <quicksilver> | there is a nice thread on haskell-cafe explaining why you probably don't want that |
| 18:47:54 | <quicksilver> | basically, if you infer rectypes then every program becomes well-typed ;) just with an odd type |
| 18:48:03 | <quicksilver> | so the type-checker doesn't catch errors any more |
| 18:49:37 | <quicksilver> | http://groups.google.com/group/comp.lang.functional/browse_frm/thread/3646ef7e64124301/2a3a33bfd23a7184?lnk=st&q=ocaml+rectypes&rnum=2&hl=en#2a3a33bfd23a7184 |
| 18:49:39 | <lambdabot> | Title: comp.lang.functional | Google Groups, http://tinyurl.com/ypj9p3 |
| 18:49:43 | <quicksilver> | is one thread on the subject |
| 18:50:00 | <eivuokko> | Hmm. I think we call data/newtype that (possibly) contains itsels recursive. The error is about infinite type, which I dunno how to explain.. |
| 18:50:25 | <jaapweel> | I have a question about hackage |
| 18:50:28 | <cdiggins954> | quicksilver: thanks a lot for that. |
| 18:50:42 | <jaapweel> | is there anything special I need to do so that haddock documentation will actually show up on the hackage web site? |
| 18:51:06 | <mauke> | eivuokko: but the type is not infinite, it just refers back to itself |
| 18:51:09 | <jaapweel> | I recently contributed some haddock documentation to Audrey Tang's HsSyck, and she stuck it in 0.4, but it doesn't seem to be linked to from hackage |
| 18:52:59 | <cdiggins954> | quicksilver: however, I have doubt that "every program becomes well-typed" for example: let f = 1 + "hello" remains ill-tyepd. |
| 18:53:02 | <eivuokko> | mauke, I am not sure the distinction makes much sense in haskell? |
| 18:53:13 | <cdiggins954> | I can see how recursive types do wident the net of typable terms. |
| 18:53:34 | <mauke> | cdiggins954: that one already is well typed |
| 18:53:53 | <mauke> | f has the type [Char] |
| 18:54:42 | <cdiggins954> | mauke: My ghc just rejected it with: "No instance for (Num [Char]) arising from the literal ...." |
| 18:54:45 | <oerjan> | @type 1 + "hello" |
| 18:54:47 | <lambdabot> | No instance for (Num [Char]) |
| 18:54:47 | <lambdabot> | arising from the literal `1' at <interactive>:1:0 |
| 18:54:52 | <mauke> | yeah, you need an instance Num [a] |
| 18:55:14 | <jaapweel> | I think I've found the answer. Apparently you need to include the generated haddock documentation with the package. |
| 18:55:32 | <oerjan> | @type 1 + 'h' |
| 18:55:34 | <lambdabot> | No instance for (Num Char) |
| 18:55:34 | <lambdabot> | arising from the literal `1' at <interactive>:1:0 |
| 18:55:45 | <quicksilver> | cdiggins954: yes, true, actually it's "every program in lambda calculus" |
| 18:56:00 | <quicksilver> | cdiggins954: equating two primitive types does still fail unification |
| 18:56:12 | <mauke> | > succ 'h' |
| 18:56:14 | <lambdabot> | 'i' |
| 18:56:15 | <quicksilver> | cdiggins954: although that particular one doesn't, in haskell :) |
| 18:56:19 | <Syzygy-> | > (fromInteger 1) + 'h' |
| 18:56:19 | <lambdabot> | add an instance declaration for (Num Char) |
| 18:56:19 | <lambdabot> | In the expression: (fromInte... |
| 18:57:22 | <cdiggins954> | quicksilver: would it type the omega combinator as well? |
| 18:57:49 | <quicksilver> | cdiggins954: yes, I believe so |
| 18:58:01 | <quicksilver> | you can play with ocaml -rectypes to find out |
| 18:58:10 | <mauke> | what's omega? |
| 18:58:10 | <quicksilver> | that is the inference algorithm you're looking for |
| 18:58:27 | <cdiggins954> | mauke: let omega = m (m); |
| 18:58:38 | <cdiggins954> | let m f = f (f); |
| 18:59:22 | <quicksilver> | aka (\x . x x) (\x . x x) |
| 18:59:32 | <cdiggins954> | quicksilver, I'm using a constrained recursive type in my type inference algorithm that allows me to reject omega, but accepts m. |
| 18:59:34 | <oerjan> | basically everything has the type a = a -> a, i think |
| 19:00:31 | <cdiggins954> | quicksilver: I'm calling it a "self" type for lack of a better name, and it is a reference to a function within itself. |
| 19:00:42 | <mauke> | m :: a@(a -> b) -> b |
| 19:01:01 | <mauke> | so omega :: b? |
| 19:01:07 | <cdiggins954> | oerjan: I don't folllow. You mean when we use ocaml -rectypes? |
| 19:01:34 | <oerjan> | i mean anything in lambda calculus if you allow recursive types |
| 19:01:56 | <cdiggins954> | oerjan: I see. |
| 19:02:09 | <oerjan> | but yes, ocaml -rectypes does that, i used it for an Unlambda "compiler" once |
| 19:02:11 | <cdiggins954> | mauke: I am unfamiliar with the "@" syntax. |
| 19:02:53 | <mauke> | it's taken from haskell's pattern syntax |
| 19:02:58 | <cdiggins954> | oerjan: what was the overall experience writing an unlambda compiler? |
| 19:03:00 | <dolio> | @type let { m :: (forall a. a -> b) -> b ; m f = f f } in m |
| 19:03:02 | <lambdabot> | (forall a. a -> b) -> b ; m f = f f } in m :: forall b. (forall a. a -> b) -> b |
| 19:03:12 | <mauke> | var@pattern matches pattern and also binds the value to var |
| 19:03:26 | <cdiggins954> | mauke: thank you. |
| 19:04:07 | <cdiggins954> | dolio: thank you. |
| 19:05:10 | <oerjan> | cdiggins954: i did put it in quotes - it was very simple and not actually faster than an interpreter. http://oerjan.nvg.org/esoteric/unl2caml/ |
| 19:05:13 | <cdiggins954> | The definition that dolio gave seems to be another solution other without using recursive types. I don't see why we couldn't infer it. |
| 19:05:15 | <lambdabot> | Title: Index of /esoteric/unl2caml |
| 19:05:28 | <dolio> | cdiggins954: GHC doesn't infer higher-ranked types. |
| 19:05:51 | <dolio> | Rank-n inference might be undecidable in general. Not sure. |
| 19:05:51 | <cdiggins954> | dolio: which language/implementation does? |
| 19:06:07 | <cdiggins954> | dolio: rank-2 inference is known to be decidable. |
| 19:06:10 | <mauke> | AFAIK rank-2 inference is complicated but possible |
| 19:06:16 | <mauke> | rank-n is undecidable |
| 19:06:53 | <cdiggins954> | rank-2 algorithm: http://citeseer.ist.psu.edu/33675.html |
| 19:06:54 | <lambdabot> | Title: Rank 2 Type Systems and Recursive Definitions - Jim (ResearchIndex) |
| 19:07:15 | <swiert> | MLF does arbitrary rank type inference. |
| 19:07:22 | <swiert> | Although it does sometimes need annotations. |
| 19:07:38 | <cdiggins954> | oerjan: the unlambda compiler, it would type everything? Was the type inference algorithm still useful? |
| 19:07:39 | <dolio> | I also don't know if you can give all recursive types a nice rank-2 type, either. |
| 19:07:52 | <dolio> | We had trouble figuring out the sub-terms of the Y combinator last time this came up, as I recall. |
| 19:08:48 | <cdiggins954> | dolio: I am fairly sure that you can't give all recursive types a nice rank-2 type. |
| 19:09:08 | <cdiggins954> | I beleive this is why it is possible to accept m and reject omega. |
| 19:09:25 | <cdiggins954> | Mind you I am a bit in over my head ;-) |
| 19:09:28 | <oerjan> | cdiggins954: well Unlambda itself has only one type, which is essentially a@(a -> a) |
| 19:09:35 | <chessguy> | hi |
| 19:09:39 | <chessguy> | @seen procyon112 |
| 19:09:39 | <lambdabot> | I haven't seen procyon112. |
| 19:09:54 | <chessguy> | @tell procyon112 any progress on the class Evolvable? |
| 19:09:54 | <lambdabot> | Consider it noted. |
| 19:10:03 | <dolio> | cdiggins954: :) I only know what I've taken in by osmosis sitting around here and such, so I wouldn't worry about it. |
| 19:10:43 | <cdiggins954> | oerjan: that is interesting about unlambda. |
| 19:11:29 | <cdiggins954> | oerjan: unlambda is simply the S-K calculus, correct. |
| 19:11:38 | <dolio> | > let { m :: (forall a. a -> b) -> b ; m f = f f } in m (const 5) |
| 19:11:38 | <lambdabot> | Parse error |
| 19:11:44 | <SamB> | cdiggins954: it is not just that |
| 19:12:09 | <Saizan> | dolio: '>' has not -fglasgow-exts |
| 19:12:19 | <dolio> | Ah. |
| 19:12:26 | <oerjan> | cdiggins954: with some weird add-ons that don't change the basic fact that everything is a function |
| 19:12:46 | <SamB> | but they do make it impure... |
| 19:12:59 | <oerjan> | SamB: very much so |
| 19:13:12 | <cdiggins954> | SamB: I see. |
| 19:13:22 | <SamB> | I tried to write an interpreter once but I messed up the evaluation order. |
| 19:13:37 | <SamB> | so I just translated the sample C implementation into Haskell |
| 19:13:40 | <SamB> | it ran faster! |
| 19:14:06 | <cdiggins954> | SamB: cool. |
| 19:14:34 | <oerjan> | i understand the C version was itself translated from the Java one |
| 19:15:41 | <SamB> | the only explanation I could come up with was that GHC's garbage collector was faster because of (a) being precise and (b) taking advantage of the immutability of the values |
| 19:16:25 | <SamB> | or maybe it's because, come allocation, it hasn't got to search a free list |
| 19:16:54 | <SamB> | (the C implementation used libgc) |
| 19:18:15 | <cdiggins104> | Thanks everyone for their help. I gotta fly, see you around. |
| 19:45:23 | <eis> | how's everyone doing? |
| 19:47:47 | <astrolabe> | It's the end of the weekend :o |
| 19:48:19 | <eis> | shit happens :( |
| 19:48:31 | <Saizan> | i'm in the middle of finals and i have no will to study :\ |
| 19:51:02 | <eis> | so what will you do? |
| 19:52:00 | <Saizan> | i think i'll force myself.. |
| 19:52:30 | <Saizan> | and see if the little time that i have is enough |
| 20:21:09 | <ddarius> | @seen sjanssen |
| 20:21:09 | <lambdabot> | sjanssen is in #haskell and #xmonad. I don't know when sjanssen last spoke. |
| 20:35:59 | <fridim> | @hoogle game |
| 20:36:00 | <lambdabot> | No matches found |
| 20:36:03 | <fridim> | @hoogle games |
| 20:36:03 | <lambdabot> | No matches found |
| 20:36:13 | <fridim> | are there games written in haskell ? |
| 20:36:45 | <dgriffi3> | @where frag |
| 20:36:46 | <lambdabot> | http://www.haskell.org/haskellwiki/Frag |
| 20:36:51 | <fridim> | I can see : http://haskell.org/haskellwiki/Applications_and_libraries/Games |
| 20:36:52 | <lambdabot> | Title: Applications and libraries/Games - HaskellWiki |
| 20:37:57 | <ClaudiusMaximus> | > show ((+1)::Int->Int) |
| 20:38:02 | <lambdabot> | "<Int -> Int>" |
| 20:38:37 | <ClaudiusMaximus> | > show (Data.Dynamic.toDyn ((+1)::Int->Int)) |
| 20:38:39 | <lambdabot> | "<<Int -> Int>>" |
| 20:55:35 | <olsner> | @quote |
| 20:55:35 | <lambdabot> | Lemmih says: dons: I'm not exactly sure why my code works. It passed the testsuite so I must be doing something right. |
| 20:55:42 | <olsner> | @quote |
| 20:55:43 | <fridim> | Could not find module `Data.FiniteMap' |
| 20:55:43 | <lambdabot> | bos says: algorithm analysis is generally questionable. most of the people who write analyses are analysing the compexity of their own algorithms, and have an axe to grind. |
| 20:56:36 | <fridim> | (i'am trying to compile "mage" |
| 20:56:43 | <oerjan> | fridim: it has been deprecated |
| 20:56:55 | <fridim> | oh, ok. |
| 20:57:07 | <oerjan> | it's Data.Map now |
| 20:58:50 | <jaapweel> | allright, here's yet another question about cabal |
| 20:59:19 | <jaapweel> | i understand that for haddock documentation to show up on the hackage web site, i need to include the generated html files along with my source package, in the dist/doc/ directory |
| 20:59:46 | <jaapweel> | but when I build a tarball with runhaskell Setup.hs sdist, the tarball omits the entire dist/ part of the tree (probably correctly) |
| 20:59:56 | <jaapweel> | so do I have to manually add those files to the tarball somehow then? |
| 21:21:18 | <cdsmith> | If dons is here, thanks for posting the presentation about type families to reddit. Cool stuff. |
| 21:21:30 | <jaapweel> | hmm... well, i finished uploading http://hackage.haskell.org/cgi-bin/hackage-scripts/package/csv , without documentation links, because I can't figure it out |
| 21:30:14 | <ClaudiusMaximus> | @src maybe |
| 21:30:14 | <lambdabot> | maybe n _ Nothing = n |
| 21:30:14 | <lambdabot> | maybe _ f (Just x) = f x |
| 21:32:06 | <ClaudiusMaximus> | @pl \f x -> x f |
| 21:32:07 | <lambdabot> | flip id |
| 21:33:07 | <Heffalump> | Igloo++ # Cabal -> .deb instructions |
| 22:07:44 | <matthew-_> | ok, so, GHC Head, dual core opteron. Given application compiled with -threaded, application does two forkIOs and has two threads with work to do running concurrently. Run with +RTS -N2, but top shows only one of the cpus is in use. Any ideas? |
| 22:08:32 | <eis> | if you do two forkIOs won't you have 3 threads? |
| 22:08:39 | <matthew-_> | yep |
| 22:08:49 | <matthew-_> | one of them is blocking, waiting for the other 2 to finish |
| 22:09:12 | <matthew-_> | and I've tried -N3 and no change |
| 22:09:15 | <eivuokko> | Do they share data? |
| 22:09:32 | <matthew-_> | yep, via a structure that's like a Chan |
| 22:09:42 | <matthew-_> | and one's producing and one's consuming |
| 22:09:52 | <matthew-_> | and I've just realised I'm running the wrong test... |
| 22:09:53 | <matthew-_> | grrrrrrr |
| 22:10:21 | <matthew-_> | sorry for wasting your time - in the test I'm running, the two threads move in lockstep, so it's not surprisng only 1 cpu is loaded... |
| 22:11:05 | <eis> | i'm interested in running multithreaded haskell programs on multi cpu computers |
| 22:12:15 | <matthew-_> | mmm. although, I've just switched to the right test, where one thread is the producer and the other consumes |
| 22:12:20 | <matthew-_> | and it's the same story... |
| 22:12:53 | <matthew-_> | mmm. one core is totally idle. |
| 22:14:00 | <eivuokko> | I think RTS has some debugging/reportin towards thread scheduling. |
| 22:14:15 | <chadz> | matthew-_: they're runtime threads, i think you're not going to see them behave the same way (especially in top) as os threads |
| 22:14:44 | <chadz> | matthew-_: even though i think i remember -threaded should do more for you |
| 22:14:54 | <chadz> | i may be wrong, someone please correct me |
| 22:15:21 | <chadz> | performing forkIO n times will still show 1 process in top/ps |
| 22:15:55 | <matthew-_> | well, my understanding is that the -RTS -Nx option will produce x OS-level threads |
| 22:16:01 | <eivuokko> | Yeah |
| 22:16:15 | <matthew-_> | which work through the available Haskell-threads as and when they can be reduced |
| 22:16:45 | <matthew-_> | so if you have Haskell threads (via forkIO) that have work to do, 2 cores and +RTS -N2 |
| 22:16:52 | <matthew-_> | then you should see loading on both CPUs |
| 22:17:07 | <matthew-_> | one CPU shouldn't be saying 99.9% idle... |
| 22:17:13 | <chadz> | hmm. sure one's not blocked? |
| 22:17:25 | <matthew-_> | chadz, there's a producer and a consumer |
| 22:17:41 | <matthew-_> | I can make the consumer sleep for 5 secs before it starts work |
| 22:17:43 | <chadz> | and there's something to consume? |
| 22:17:57 | <matthew-_> | the producer has produced about 85,000 items in that time |
| 22:18:02 | <matthew-_> | there's work to be done! |
| 22:18:11 | <eivuokko> | Maybe you could try +RTS -vs? |
| 22:18:34 | <eivuokko> | But I am not sure if you have to recompile with debug or something. |
| 22:18:45 | <chadz> | matthew-_: no deadlock ? |
| 22:20:09 | <matthew-_> | chadz: no deadlock - they're both making progress |
| 22:20:39 | <matthew-_> | eivuokko: the -vs does produce a lot of output - I have a 20MB log file in no time! |
| 22:21:07 | <eivuokko> | -.- |
| 22:21:12 | <chadz> | matthew-_: you're set up for smp, right? :D |
| 22:21:46 | <chadz> | ugh, I want a machine with n>1 processors. |
| 22:22:13 | <eivuokko> | matthew, dunno, can't think much else you can do to debug it, except ofc tracing stuff yourself. |
| 22:22:26 | <matthew-_> | eivuokko: the log shows two workers |
| 22:22:50 | <eivuokko> | I am not really sure if you can be stuck like that with sharing lazy data, isn't that sort of sharing a busyloop... |
| 22:23:02 | <titusg> | I have installed the latest Yi on GHC 6.6 without any apparent errors but I can't run it - the error includes "Could not compile Yi.main"...where would be the best place to ask for help on this? |
| 22:23:54 | <matthew-_> | actually, there are 5 workers. |
| 22:24:08 | <matthew-_> | so that'll be 3 for me, 1 GC and I guess a signal handler? |
| 22:24:38 | <eivuokko> | Uh, does head have that sort of GC? |
| 22:24:47 | <matthew-_> | dunno |
| 22:24:48 | <matthew-_> | 70795 0x40800940, 4 0x41001940, 70771 0x41802940, 2 0x42003940, 1 0x42804940 |
| 22:24:51 | <eivuokko> | I thought the GC stops all threads. |
| 22:24:58 | <matthew-_> | oh ok, I'm guessing |
| 22:24:59 | <eivuokko> | Well, the major anyway |
| 22:25:16 | <matthew-_> | the 0x is the worker id, the other number is the number of times that id appeared in the log |
| 22:25:33 | <ndm> | @seen sorear |
| 22:25:33 | <lambdabot> | sorear is in #ghc, #xmonad, #haskell-overflow, #haskell-blah and #haskell. I last heard sorear speak 11m 24s ago. |
| 22:25:39 | <sorear> | hi\ |
| 22:26:03 | <ndm> | sorear, what are you hoping to do with Yhc.Core? We currently haven't done much with primitives, but if you want it, its something we intend to do (plus its not too hard) |
| 22:26:20 | <ndm> | we just left it until we had a user, otherwise you r un a real risk of picking a horrible design because you don't have a user |
| 22:26:35 | <araujo> | hello |
| 22:27:10 | <sorear> | ndm: Re-check your mailbox, I was about 2 words away from finishing my reply when you pinged :) |
| 22:28:22 | <ndm> | sorear, in future send to ndmitchell -at- gmail rather than ndm, otherwise i have a 2 minute delay on my email |
| 22:28:28 | <sorear> | also, imagine the possibility of 'foreign import javascript "abs(a)" js_abs' instead of 'js_abs a = unsafeJS "abs(a)"' ... |
| 22:28:34 | <sorear> | ndm: ok |
| 22:29:19 | <ndm> | sorear, we want to fully express primitives, and are happy to modify the syntax in whatever way that requires |
| 22:29:37 | <ndm> | sorear, i recently added CorePrim specifically so we have somewhere to put this additional information |
| 22:29:46 | <sorear> | cool |
| 22:29:59 | <ndm> | do you want to knock up a design? |
| 22:30:06 | <ndm> | i've never used the FFI features in Haskell, so have no idea what needs including |
| 22:30:21 | <ndm> | Tom was talking about extending it so we can use Yhc.Core as the Core language in Yhc |
| 22:32:11 | <ndm> | sorear, teh reason we didn't do javascript imports properly is because changing the front end of Yhc is painful, once we had it going properly, that is an option |
| 22:32:39 | <ndm> | plus, if you use Yhc.Core as your intermediate form, then Reach/Catch can make use of it |
| 22:33:06 | <sorear> | Reach? |
| 22:34:05 | <eis> | i'm interested in the yhc javascript output |
| 22:34:08 | <ndm> | the quickcheck property prover |
| 22:34:17 | <ndm> | eis, i don't know much about it, but it does work |
| 22:34:41 | <ndm> | there will be a paper on Reach in September, and a release hopefully within a month |
| 22:34:42 | <sorear> | ndm: (How) are types represented in Yhc.Core? I know expressions don't have types, but what about data Foo = Foo Int - (how) is the Int stored? |
| 22:35:08 | <ndm> | look at CoreData |
| 22:35:26 | <sorear> | ndm: There are no haddock comments. All I see is String |
| 22:35:43 | <ndm> | hmm, perhaps just as a String then |
| 22:35:49 | <sorear> | coreCtorFields :: [(String, Maybe CoreFieldName)] in context |
| 22:35:52 | <ndm> | again, we'd be happy to change that |
| 22:36:07 | <ndm> | we didn't jump so far as we have no ohter types |
| 22:36:21 | <ndm> | but quite a few places "half parse" those type declarations, so it makes sense if we do |
| 22:39:03 | <sorear> | ndm: I also see a lot of code in Core that looks like it would be well done with Derive and/or Uniplate :) |
| 22:39:16 | <ClaudiusMaximus> | @users |
| 22:39:17 | <lambdabot> | Maximum users seen in #haskell: 328, currently: 312 (95.1%), active: 43 (13.8%) |
| 22:39:20 | <sorear> | isCoreFoo most egregiously |
| 22:39:32 | <ndm> | sorear, yes, the plan is to move to Derive once we get round to it |
| 22:39:43 | <ndm> | sorear, but it does have Uniplate support already |
| 22:41:04 | <sorear> | eis: Yeah, there is a standalone Yhc.Core -> Javascript converter. Very standard spineless-G implementation, nothing fancy. |
| 22:42:17 | <matthew-_> | eivuokko, chadz: weird. With -N2 -V1 -C10, I occasionally see %CPU go to 141, but generally it stays at 100%. But more interesting is the fact that the CPU summaries show that only about 40% is user, and the rest, when not idle, is System. |
| 22:42:45 | <matthew-_> | I guess that must be a lot of mallocs/free on shared mem? |
| 22:43:34 | <sorear> | Or sleep etc. |
| 22:44:01 | <eivuokko> | I don't know about unixes, in Windows it could be a number of things. |
| 22:44:38 | <sorear> | matthew-_: what's in your loops? |
| 22:45:19 | <matthew-_> | sorear: one is writing to a chain of MVars - very much like a Chan |
| 22:45:21 | <matthew-_> | the other is reading |
| 22:45:33 | <sorear> | Chain of MVars? |
| 22:45:35 | <matthew-_> | the strace shows endless futexs |
| 22:45:40 | <sorear> | and what are you storing? |
| 22:45:43 | <matthew-_> | ints |
| 22:45:49 | <matthew-_> | and it's not strict |
| 22:45:59 | <sorear> | does calculating these ints take a long time? |
| 22:46:01 | <matthew-_> | no |
| 22:46:17 | <matthew-_> | it's literally +1 each time |
| 22:46:56 | <sorear> | fix $ \f n -> writeChan c n >> f (n+1) |
| 22:46:57 | <sorear> | ? |
| 22:47:23 | <sorear> | and how much code is in the consumer? you shouldn't be doing that much communication |
| 22:47:23 | <matthew-_> | well, in rather more words, but yes |
| 22:47:42 | <oerjan> | a thought: is the producer doing any significant work other than filling the chain with unevaluated int thunks? |
| 22:47:46 | <matthew-_> | consumer would be the obvious dual doing readChan |
| 22:48:00 | <matthew-_> | (though readChan only readMVars, I actually takeMVar) |
| 22:48:13 | <matthew-_> | nothing significant |
| 22:48:14 | <sorear> | matthew-_: [1..] has no consumer dual? |
| 22:48:52 | <oerjan> | then the consumer actually does that evaluation work, i guess... |
| 22:48:55 | <matthew-_> | err, fix $ \f () -> readChan c >> f () |
| 22:49:04 | <ndm> | http://www.cs.york.ac.uk/fp/darcs/cabal-o-matic/ |
| 22:49:06 | <lambdabot> | Title: Cabal-O-Matic |
| 22:49:18 | <ndm> | what do people think of that? not finished yet, not all the fields added, but a start |
| 22:49:37 | <matthew-_> | the only other thing going on in the loop is that every 10,000 times through they print out progress to stdout |
| 22:50:06 | <sorear> | http://members.cox.net/stefanor/1182120590.png |
| 22:50:14 | <sorear> | very informative front page there :) |
| 22:50:28 | <ndm> | sorear - Firefox and Safari only |
| 22:51:08 | <sorear> | ndm: What would the point of that be? |
| 22:51:33 | <sorear> | ACTION assumes this is just like dons' mkcabal - is he wrong? |
| 22:52:00 | <ndm> | sorear, its a GUI for that, in a web browser, with a nicer interface |
| 22:52:20 | <sorear> | ACTION is looking at the page source, and sees a whole lot of javascript but still has no clue what it's supposed to do... |
| 22:52:23 | <sorear> | oh. |
| 22:52:31 | <sorear> | ACTION recommends <noscript> |
| 22:54:16 | <ndm> | http://www.cs.york.ac.uk/fp/darcs/cabal-o-matic/demo.png |
| 22:54:26 | <ndm> | ACTION adds noscript, and there is a demo screenshot |
| 22:54:36 | <Igloo> | Is BSD4 one of the licences Cabal knows about? We should fix it if so |
| 22:54:48 | <ndm> | Igloo, it is |
| 22:55:17 | <Igloo> | It's silly to have a licence that probably no Haskell software has ever used, and that we don't want people to use |
| 22:55:43 | <sorear> | ndm: It could use more documentation :) the tab names mean nothing to me, and the left one isn't self-explanitory |
| 22:56:13 | <ndm> | sorear, its designed to be discoverable by use, but i can fix those bits easily enough |
| 22:56:18 | <ndm> | sorear, now with a noscript tag! |
| 22:56:51 | <Igloo> | ACTION calls my licence files COPYING FWIW. Avoids LICENSE/LICENCE arguments too :-) |
| 22:56:56 | <sorear> | ndm: It works fine in my FF. just I'd like to be prompted when FF is needed. |
| 22:57:10 | <sorear> | ACTION normally runs elinks, which is about ten times faster |
| 22:57:13 | <jaapweel> | MIT should be one of the possible licenses, though |
| 22:57:23 | <matthew-_> | MIT is 3-clause BSD isn't it? |
| 22:57:27 | <jaapweel> | It's what is used for HsSyck, and we had to make it "Other" or some such option because it wasn't available |
| 22:57:37 | <jaapweel> | no, it's the same as theX |
| 22:57:40 | <jaapweel> | X license, sorry |
| 22:57:42 | <ndm> | sorear, fair enough - i forgot that not everyone uses Firefox |
| 22:58:00 | <ndm> | Igloo, base seems to always use LICENCE though? |
| 22:58:05 | <matthew-_> | ahh, cabal people, how do you make sdist include a "ChangeLog.txt" file? |
| 22:58:11 | <Igloo> | jaapweel: Why do you prefer MIT to BSD3? |
| 22:58:14 | <jaapweel> | http://www.faqs.org/docs/artu/ch19s05.html#id3014860 |
| 22:58:15 | <lambdabot> | Title: Varieties of Open-Source Licensing |
| 22:58:36 | <jaapweel> | I don't particularly like the MIT license, but Audrey picked it, and I think it's common with Perl folk |
| 22:58:43 | <Igloo> | ndm: True (modulo spelling) |
| 22:59:05 | <sorear> | ndm: Strange. I can see the noscript tag in the source view, but the text isn't visible... |
| 22:59:14 | <jaapweel> | I personally prefer to hit the evil proprietary software corps with strong copyleft ;-) |
| 22:59:32 | <ndm> | sorear, weird... IE is having issue with it too |
| 22:59:48 | <swiert> | motthew-_: extra-source-files |
| 22:59:50 | <sorear> | ndm: though it doesn't matter much, one quickly gets the habit of flipping into highlighted-html mode ('\' key) at the first hint of rendering problems |
| 23:00:00 | <swiert> | *matthew-_ even |
| 23:00:06 | <matthew-_> | swiert: yeah, that's all I came up with. Seems somewhat "wrong" though. |
| 23:01:23 | <swiert> | I think that's how your supposed to do it. Readme's etc. all go under there. |
| 23:01:30 | <matthew-_> | oh ok, I didn't know that. |
| 23:01:33 | <chadz> | hmm -- i'm going to write some gallery software to manage a webalbum. |
| 23:01:47 | <chadz> | any interest? :D |
| 23:02:04 | <matthew-_> | that's a reasonably round wheel already, chadz. |
| 23:02:22 | <notsmack> | chadz: any interesting ideas beyond that? |
| 23:02:24 | <chadz> | what isn't anymore? |
| 23:02:47 | <jaapweel> | actually, given the existence of F#, it's not entirely impossible that at some point in the distant future, Microsoft will do something with Haskell outside of its open-source friendly research arm. They used a nasty shared source license for F#, and I think it would be a good idea if there were some crucial Haskell bits and pieces under GPL/LGPL so that Haskell cannot be embraced-and-extended into a "shared source" project. (To MS' |
| 23:02:47 | <jaapweel> | s credit, I think they actually reimplemented everything for F#.) |
| 23:03:02 | <lumi> | A shooting gallery web album? |
| 23:03:08 | <matthew-_> | chadz: typesetting. I would argue there is a real need to replace LaTeX, but the man-hours needed makes that really hard. |
| 23:04:11 | <chadz> | matthew-_: ah, just use the dom? hehe |
| 23:04:32 | <ndm> | i agree, Latex does need killing |
| 23:04:38 | <ndm> | something in Haskell would be perfect |
| 23:04:40 | <chadz> | notsmack: i'd like something that maintained a gallery -- you place raw/jpgs in somewhat of a respository |
| 23:04:59 | <matthew-_> | ndm: I think bits of it might be better in a pure constraint satisfaction language |
| 23:05:07 | <chadz> | notsmack: and it'll maintain thumbnails, resizing, exif info, etc. |
| 23:05:32 | <matthew-_> | ndm: I like LaTeX - it makes good output and I'm competant at using it, but it really does have a lot of warts and not a lot of purity |
| 23:05:52 | <ddarius> | There's a Common Lisp LaTeX-alike. |
| 23:05:56 | <jaapweel> | matthew-_, it's a weird situation. TeX is one of the very few sizeable software systems implemented pretty much without any bugs, but many of the design decisions are way outdated and trace back to memory limitations decades back. but to overcome the activation energy you have to live up to the quality of Don Knuth's freakishly well documented and debugged code... |
| 23:06:32 | <jaapweel> | (I'm referring just to TeX and METAFONT when I say well documented and debugged, not to LaTeX and all the other assorted bits and pieces) |
| 23:07:05 | <matthew-_> | right, bed time. night. |
| 23:07:29 | <MyCatVerbs> | Hrmn. It's theoretically possible to make web frameworks that make things like SQL injection and XSS impossible by using the type system to distinguish between safe and unsafe inputs, right? |
| 23:08:26 | <jaapweel> | don't even think it's that hard, at least in the case of SQL injection, if you construct all your SQL queries with combinators or macros rather than pasting strings together |
| 23:08:37 | <jaapweel> | I believe there is at least one SQL interface for Haskell that does just that |
| 23:08:50 | <notsmack> | MyCatVerbs: but sure, it is |
| 23:09:03 | <Saizan> | taint monad? |
| 23:09:06 | <MyCatVerbs> | jaapweel: oh, cool. |
| 23:09:20 | <jaapweel> | not sure about XSS, it seems to refer to a set of bugs that is still expanding over time |
| 23:09:24 | <MyCatVerbs> | Saizan: nah, but that'd work too. |
| 23:09:47 | <ddarius> | http://www.fractalconcept.com/asp/cl-typesetting |
| 23:09:51 | <lambdabot> | Title: Fractal Concept : CL-Typesetting home page |
| 23:10:06 | <chadz> | what's the most proliferant xml library, haxml ? |
| 23:10:25 | <jaapweel> | ddarius, neat |
| 23:10:55 | <jaapweel> | chadz, haxml and hxt actuall do somewhat different things |
| 23:10:58 | <sorear> | http://svn.openfoundry.org/pugs/Pugs.cabal.in |
| 23:11:00 | <MyCatVerbs> | Was thinking more like defining unSafeString and various safeString types, not exporting the constructors and using functions with sigs like escapeHTMLChars :: unsafeString -> safeString. |
| 23:11:13 | <sorear> | http://hackage.haskell.org/trac/c2hs/browser/c2hs.cabal |
| 23:11:14 | <lambdabot> | Title: /c2hs.cabal - c2hs - Trac |
| 23:11:22 | <sorear> | http://hackage.haskell.org/packages/archive/yi/0.2/yi.cabal |
| 23:11:44 | <jaapweel> | haxml parses DTDs and then generates code to deal with XML in a strongly typed way, where the Haskell type checker will play XML validator for you |
| 23:12:29 | <jaapweel> | hxt treats XML of all Schemas as belonging to the same type, which trades in some of the typechecking, but has a very neat framework for writing XML code that is generic and can operate on documents of different schemas |
| 23:13:14 | <jaapweel> | also, the haxml DTD compiler chokes very badly on very large DTDs. I ran it once on a large DTD, and it came up with several megabytes of Haskell source, which in turn when I fed them to ghc overheated my CPU... |
| 23:13:27 | <sorear> | darcs-monitor, darcs-graph, lambdabot, hoogle, hsutils, Related, arch2darcs, RBR |
| 23:13:34 | <chadz> | jaapweel: heh. |
| 23:13:59 | <sorear> | jaapweel: jhc is much better at that ime :) |
| 23:14:11 | <sorear> | atkrec, |
| 23:14:33 | <jaapweel> | sorear, yeah, I never dared run it. John Meacham is a nice enough guy, but he has a much better computer than I do |
| 23:15:10 | <sorear> | http://www.google.com/search?hl=en&ie=ISO-8859-1&q=%22license%20gpl%22%20inurl%3acabal |
| 23:15:25 | <lambdabot> | Title: "license gpl" inurl:cabal - Google Search, http://tinyurl.com/ywczxj |
| 23:15:38 | <sorear> | jaapweel: ^^^ |
| 23:16:07 | <sorear> | jaapweel: I think lambdabot is pretty critical Haskell infrastructure :) |
| 23:16:24 | <jaapweel> | yep! can't do without it ;-) |
| 23:16:38 | <ddarius> | It's surprising how much impact lambdabot has had. |
| 23:16:50 | <chadz> | hmm, i haven't done much work with XML at all. I'm thinking I could use something such as HXT to maintain some db/state of an album and then export XML documents to a directory that in turn could be served by a webserver -- is this reasonable? |
| 23:17:16 | <jaapweel> | I missed some of the earlier discussion. why exactly do you need to use XML? |
| 23:17:33 | <DRMacIver> | All applications need XML. |
| 23:18:07 | <jaapweel> | if you are not constrained by external standards, you may want to consider using something simpler, like YAML. XML tools tend to be kinda big and clunky. |
| 23:18:14 | <ddarius> | putStrLn "<greeting>Hello World</greeting>" |
| 23:18:34 | <sorear> | chadz: Or better yet, Read/Show |
| 23:18:39 | <DRMacIver> | jaapweel: But you should always use standards. Remember: Standard is way more important than useful. ;) |
| 23:18:42 | <Saizan> | ddarius: you forgot the preamble! |
| 23:19:15 | <jaapweel> | DRMacIver, YAML is perfectly well standardized. there is a very pretty standards document with lots of attention to character encodings and suchlike, and libraries that implement it for lots of languages |
| 23:19:47 | <Saizan> | "that in turn could be server by a webserver" <-- so xml+xsl is a reasonable choice, if you don't want some template library for the html |
| 23:19:50 | <sorear> | S-expressions have been standard for much longer than XML. |
| 23:19:52 | <jaapweel> | I'm not sure it has the imprimatur of some acronymed agency, but the standard seems to be RFC quality |
| 23:20:14 | <jaapweel> | sorear, they have been standard as in used a lot, but unfortunately there is no one clear standard for their syntax that is widely adopted |
| 23:20:19 | <DRMacIver> | jaapweel: But XML is more standard because it's enterprisey. |
| 23:20:35 | <jaapweel> | DRMacIver, yes! enterprisey! just like Haskell! |
| 23:20:43 | <DRMacIver> | jaapweel: Exactly! |
| 23:21:01 | <DRMacIver> | jaapweel: In case you haven't picked it up by now, I really hate XML and am not actually advocating its use. ;) |
| 23:21:17 | <sorear> | jaapweel: Eh? there are incompatible extensions, sure, but () atoms and numbers work everywhere |
| 23:21:45 | <jaapweel> | Saizan, there's a point to that. personally, I would prefer to write tree->tree transformations in a real functional languages rather than XSLT, but then again, I am prone to tendinitis, and apparently the XSLT people aren't |
| 23:22:33 | <chadz> | jaapweel: yah -- i'm going to write some silly little app to generate webalbums from a directory of images; yet I really don't know much about applications of XML and libraries associated with them |
| 23:22:33 | <jaapweel> | sorear, case-sensitivity is not standardized across Lisps, nor is whether you have bignums or just fixed size integers |
| 23:22:38 | <notsmack> | how do s-exp people handle validity checking? |
| 23:23:11 | <jaapweel> | notsmack, they don't; s-expressions are mostly used with lisp, which is quite radically dynamically typed |
| 23:23:13 | <sorear> | notsmack: Read fails if the parens aren't balanced |
| 23:23:18 | <jaapweel> | sorear, true, true |
| 23:23:25 | <notsmack> | sorear: i said validity, not well formedness... |
| 23:23:30 | <sorear> | notsmack: everything beyond that is semantics. |
| 23:23:40 | <sorear> | notsmack: XML can't validate semantics either |
| 23:23:50 | <jaapweel> | notsmack, well, in the case of S-expressions, there's only one type, which is the-one-lisp-type |
| 23:23:53 | <lumi> | Saizan: It's not a preamble, it's a prolog! |
| 23:23:58 | <jaapweel> | it's perfectly typesafe, just not very informative |
| 23:24:28 | <sorear> | ACTION dares notsmack to construct an XML schema of GHC Core (note, it must be impossible for core lint to fail) |
| 23:24:38 | <sorear> | Oh wait. |
| 23:24:46 | <sorear> | I suppose XSL is turing complete? |
| 23:25:01 | <notsmack> | yep |
| 23:25:12 | <jaapweel> | http://www.unidex.com/turing/utm.htm |
| 23:25:13 | <lambdabot> | Title: Universal Turing Machine in XSLT |
| 23:25:24 | <sorear> | jaapweel: XSL, not XSLT. |
| 23:25:30 | <notsmack> | but i don't see how that dare relates to chadz' problem, wherein it would be nice to have assured structure... |
| 23:25:41 | <Saizan> | jaapweel: yup, it's quite verbose, maybe we need an haskell dsl to generate xsl :) it feels silly tough.. |
| 23:25:42 | <sorear> | XML Schema Language |
| 23:25:43 | <jaapweel> | sorear, oops |
| 23:26:35 | <jaapweel> | that's the newfangled variety of DTD, right? |
| 23:27:27 | <sorear> | yeah |
| 23:34:44 | <jaapweel> | it seems that hsffig (one of the FFI generators) was motivated largely by the need for an FFI interface to new-style (Sleepycat/Oracle) Berkeley DB, which uses lots of structs with function pointers in them; but it hasn't yet let to a new-style berkeley DB binding. I can't quite get it to work right, it seems much more fussy about header files than c2hs is. I'd like an interface to new-bdb, though... |
| 23:35:09 | <jaapweel> | anyone got thoughts on what FFI tools deal best with funky uses of function pointers by a C library? |
| 23:35:29 | <jaapweel> | s/yet let/yet led/ |
| 23:37:28 | <chadz> | I think it was HaPPs that had methods for serializing datastructures out to XML, what was that using? |
| 23:38:46 | <Saizan> | chadz: haxml |
| 23:38:49 | <notsmack> | chadz: HAppS uses HaXmL |
| 23:38:55 | <notsmack> | Saizan: beat me to it |
| 23:39:26 | <Saizan> | notsmack: you've lost time getting the capitalization right :) |
| 23:42:56 | <jaapweel> | there is code in pugs that serializes data structures into YAML and back |
| 23:43:07 | <sorear> | Yes? |
| 23:43:08 | <Saizan> | i've TH code to generate Haskell <-> XML functions with HXT |
| 23:43:16 | <jaapweel> | yes, it uses drift |
| 23:43:19 | <sorear> | I'm sure it uses HsSyck? |
| 23:43:30 | <jaapweel> | I believe so |
| 23:43:35 | <jaapweel> | I looked at it a day or two ago |
| 23:43:41 | <sorear> | jaapweel: we need to standardize on MY derivation lib! :) |
| 23:43:49 | <sorear> | well mine and ndm's |
| 23:44:00 | <jaapweel> | HsSyck was lifted out of the pugs tree and relicensed |
| 23:44:08 | <jaapweel> | sorear, Data.Derive? |
| 23:44:17 | <sorear> | jaapweel: that's the one... |
| 23:44:43 | <jaapweel> | I'm sure you could get the pugs people to relicense the YAML serialization drift module as something other than GPL if you pulled it out into a nice cabalized library for them |
| 23:45:05 | <sorear> | jaapweel: Uhm... why? |
| 23:45:31 | <sorear> | jaapweel: Data.Derive is used only at build time. it can be GPL and it won't affect anybody |
| 23:45:35 | <jaapweel> | why am I sure? because they've been working on pulling out generally useful bits from the pugs tree and turning them into libraries. |
| 23:45:53 | <jaapweel> | what is GPL here is the module from pugs i'm referring to, not data.derive, and not drift |
| 23:45:53 | <sorear> | jaapweel: no, why would I want it !GPL |
| 23:46:08 | <jaapweel> | ah, you're saying that because it's a code generator it wouldn't matter |
| 23:46:17 | <jaapweel> | that might be true, hadn't thought of that |
| 23:46:57 | <jaapweel> | but aside from the licensing, there was a bit of a move toward pulling generally interesting bits out from pugs and turning them into libraries |
| 23:47:00 | <jaapweel> | hence HsSyck |
| 23:47:38 | <jaapweel> | it may take a little work here and there if they depend on internal pugs utility functions that you don't want to pull into the library, but in this particular case there are only 2 of those |
| 23:47:42 | <Saizan> | ?hackage hssyck |
| 23:47:43 | <lambdabot> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hssyck |
| 23:47:49 | <jaapweel> | which do something with utf8 |
| 23:48:10 | <sorear> | jaapweel: which needs to be a library itself! |
| 23:49:11 | <jaapweel> | sorear, yes, it probably should be. there is some UTF8 handling code in one of John Meacham's projects that would make a good library, i think, and in this particular case, the iconv binding might actually do the same job as that particular pugs function |
| 23:49:58 | <jaapweel> | http://svn.pugscode.org/pugs/src/DrIFT/YAML.hs |
| 23:50:14 | <jaapweel> | the culprits are import Pugs.Internals (encodeUTF8, decodeUTF8, addressOf, safeMode) |
| 23:50:31 | <jaapweel> | and import qualified UTF8 as Buf |
| 23:50:53 | <jaapweel> | the |
| 23:51:28 | <jaapweel> | the latter being a self-contained BSD licensed module with haddock comments and all that could be readily cabalized, i believe, but really ought to be part of the standard bytestring stuff |
| 23:51:48 | <jaapweel> | http://svn.pugscode.org/pugs/src/UTF8.hs |
| 23:58:32 | <araujo> | ACTION wonders if anyone would have a server with some free space to share with a darc repo |
Back to channel and daily index: content-negotiated html turtle