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:12 | <Toxaris> | actually, it would be cool if \bot would allow type signatures without definitions by silently inserting name = undefined "not yet defined", and deleting this line if name gets defined later, so one could define types for use in @type commands |
| 00:00:42 | <Toxaris> | ACTION would really love to hack on \bot if it would work on windows |
| 00:05:39 | <gwern> | > 0xdeadbeef + 1 |
| 00:05:40 | <lambdabot> | 3735928560 |
| 00:05:53 | <dmwit> | 0xdeadbff0? |
| 00:06:02 | <dmwit> | 0xdeadbef0 |
| 00:06:04 | <gwern> | hum. didn't know haskell did hex |
| 00:06:25 | <dmwit> | > 0o70 -- octal, too |
| 00:06:26 | <lambdabot> | 56 |
| 00:06:32 | <dmwit> | > 0o80 |
| 00:06:33 | <lambdabot> | Not in scope: `o80' |
| 00:06:36 | <dmwit> | heh |
| 00:06:48 | <MyCatVerbs> | gwern: Haskell hackers are *far* too lazy to do encode into hex by hand. :) |
| 00:07:01 | <paczesiowa> | does Isaac Potoczny-Jones hang out here? |
| 00:07:36 | <dons> | paczesiowa: yeah. |
| 00:07:54 | <dons> | paczesiowa: he's SyntaxNinja, but is generally online during the weekdays |
| 00:08:19 | <paczesiowa> | dons: thanks |
| 00:18:34 | <paczesiowa> | dons: do you know if he has darcs repos of libraries he is maintaining? (xml and feed) ? |
| 00:18:45 | <Quadrescence> | ?hoogle [a] -> Int -> a |
| 00:18:45 | <lambdabot> | Prelude.(!!) :: [a] -> Int -> a |
| 00:18:45 | <lambdabot> | Data.List.(!!) :: [a] -> Int -> a |
| 00:19:57 | <mmorrow> | if anyone is knowledgeable about lexing/parsing, would you mind taking a peek at http://hpaste.org/9499 |
| 00:19:59 | <dons> | paczesiowa: they're galois libraries. |
| 00:20:05 | <dons> | paczesiowa: we maintain them internally |
| 00:20:13 | <dons> | basically, send patches in, or requests. |
| 00:20:54 | <mmorrow> | i don't see a way to do it w/out requiring escaping interior occurrences of "|]" |
| 00:21:03 | <mmorrow> | (this is what ghc's parser does) |
| 00:21:17 | <paczesiowa> | dons: I would like all types in Text.RSS.Syntax to derive Eq |
| 00:21:52 | <dons> | paczesiowa: I think I either did that in the next release, or there was some reason we couldn't. |
| 00:21:56 | <dons> | oh, maybe it was xml. |
| 00:22:02 | <dons> | xml needed a lot of changes |
| 00:22:08 | <dons> | did you want to do this? |
| 00:23:09 | <paczesiowa> | dons: I just inserted 20 "derive Eq" in xml and feed, I can't see why it wouldn't work |
| 00:24:42 | <Cale> | mmorrow: I say just use infinite lookahead? |
| 00:25:05 | <Cale> | actually... |
| 00:25:19 | <mmorrow> | heh |
| 00:25:40 | <Cale> | What are the contents of a quasiquoted expression allowed to be? |
| 00:26:16 | <Cale> | Because if they're arbitrary, you could always match the first open-quasiquote with the last close-quasiquote in the whole file. |
| 00:26:37 | <mmorrow> | Cale: yeah, arbitrary. |
| 00:26:45 | <mmorrow> | hmm |
| 00:26:55 | <Cale> | So you're limited to one quasiquoted expression per file? |
| 00:26:57 | <dons> | paczesiowa: if you can just do that and send me the diff, i'll apply it. |
| 00:27:05 | <Cale> | Or do you take the largest thing which parses? |
| 00:27:14 | <Cale> | (with the qq parser) |
| 00:27:38 | <paczesiowa> | dons: I'll test it first |
| 00:27:39 | <dobblego> | is it illegal in most jurisdictions to claim to be a doctor without the relevant qualifications? e.g. on a business card? |
| 00:28:02 | <mmorrow> | Cale: the unfortunate thing is, how to parse the interior depends on which quasiquoter (determined by the var x in [$x|...|]) is used |
| 00:28:03 | <dons> | i doubt it, dobblego |
| 00:28:16 | <dobblego> | well that's just sad |
| 00:28:19 | <dons> | heh |
| 00:28:28 | <dons> | Dr. Dobblego has a nice ring :) |
| 00:28:32 | <Cale> | mmorrow: Right... so I'm asking if it's maximal munch, or what? :) |
| 00:28:52 | <dobblego> | not me, I just received a business card with such a fraudulent claim |
| 00:28:54 | <mmorrow> | Cale: what is "it" there? |
| 00:29:09 | <mmorrow> | ahh. |
| 00:29:13 | <Cale> | mmorrow: The specification for how to parse it. |
| 00:29:31 | <mmorrow> | at this point, we don't know what parser that x in [$x||] refers to |
| 00:29:39 | <mmorrow> | could be anything |
| 00:29:51 | <dons> | dobblego: heh. it's relatively trivial to check it now, so i suppose its effectively policed via google |
| 00:29:52 | <Cale> | oh, then this is just impossible |
| 00:30:02 | <mmorrow> | yeah, that's what i figured |
| 00:30:06 | <shapr> | dobblego: I think it's illegal to claim to be a medical doctor. |
| 00:30:07 | <dobblego> | dons, how do you check it exactly? |
| 00:30:11 | <sm> | um.. that's trippy. Is there a reason ghci might update timestamps of a bunch of lhs files while debugging ? |
| 00:30:19 | <Cale> | From what we've assumed, it's impossible to implement this feature. :) |
| 00:30:29 | <dobblego> | shapr, this guy isa Chiropractor who claims to be "Dr. So So" |
| 00:30:31 | <dons> | dobblego: i would try to find the universities graduation page details. they list who graduates when. |
| 00:30:43 | <dobblego> | dons, ok |
| 00:30:45 | <dons> | if you were really keen, you'd contract the instituition |
| 00:30:47 | <shapr> | dobblego: I don't think Chiropractors are classified as doctors. |
| 00:30:49 | <sm> | they've all been changed, by god. :) |
| 00:31:07 | <gwern> | preflex: seen beschmi |
| 00:31:07 | <preflex> | beschmi was last seen on #haskell 31 days, 14 hours, 2 minutes and 40 seconds ago, saying: ndmitchell: yeah, i'm using 1.2 |
| 00:31:10 | <Cale> | So either there are restrictions on what the quasiquoted string consists of, or something really trippy has to happen with regard to determining the parser. |
| 00:31:15 | <mmorrow> | Cale: i'm thinking maybe of doing something where the lexer somehow is passed a [(String,Lexer _ _)] associating possible quasiquoter identifiers with their lexers |
| 00:31:15 | <ddarius> | What you do is have the parser delimit itself. |
| 00:31:18 | <sm> | let's assume I confused darcs diff by symlinking the src dir in it's temporary directories... |
| 00:31:19 | <dobblego> | shapr, no, you need a Bachelor of Medicine to be a Medical Doctor afaik |
| 00:31:40 | <mmorrow> | Cale: heh, trippy |
| 00:32:26 | <ddarius> | ACTION refers mmorrow and Cale to Forth parsing words and CL reader macros. |
| 00:32:31 | <mmorrow> | Cale: the real drag is, if "|]" is restricted and has to be escaped to be "\\|]", then any qq syntax in a qq will be tedious |
| 00:33:10 | <dons> | anyone want to patch lambdabot to call preflex on @seen ? :) |
| 00:33:12 | <vixey> | I mean if you just got QQ to quote -haskell- and not these made up languages |
| 00:33:20 | <Cale> | Oh, I suppose there could be some kind of staging restriction wherein the parser to parse the qq sections can't occur in the same module. |
| 00:33:20 | <vixey> | then you could nest them no problem |
| 00:33:29 | <ddarius> | vixey: That's what TH currently does. |
| 00:33:30 | <mmorrow> | ddarius: noted. i've been meaning to read up on lisp macros |
| 00:33:38 | <vixey> | oh oh well then |
| 00:34:12 | <vixey> | there is not much to lisp reader macros |
| 00:34:19 | <Cale> | and then you can just try the qq parser on all the cases possible and take the largest one which parses. |
| 00:34:23 | <ddarius> | vixey: There isn't much to quasiquotation. |
| 00:34:28 | <vixey> | just got a hook into the parser, it gives you stream.. take what you want and control goes back to lisp |
| 00:34:43 | <mmorrow> | vixey, the crux is how to determine the closing "|]" in a QuasiQuoter internal string |
| 00:34:46 | <mmorrow> | http://hpaste.org/9499 |
| 00:35:02 | <ddarius> | mmorrow: As I said, it's the parsers job to delimit itself. |
| 00:35:16 | <Cale> | ddarius: so it gets the entire rest of the file? |
| 00:35:25 | <ddarius> | Furthermore, there is no reason the syntax for quasiquotation inside the parsed string has to be the same as Haskell's. |
| 00:35:28 | <ddarius> | Cale: Yes. |
| 00:35:47 | <Cale> | That's kind of scary. |
| 00:35:49 | <mmorrow> | ddarius: hmm. so i guess i'll have to figure out some way to pass the parsers assoc with various quasiquoters that'll potentially be seen to the initial lexer |
| 00:35:53 | <ddarius> | Cale: Yes. |
| 00:35:56 | <mmorrow> | oh |
| 00:35:59 | <mmorrow> | i gotcha |
| 00:36:06 | <mmorrow> | interesting |
| 00:36:20 | <Cale> | ddarius: Is it allowed to look ahead into parts which it doesn't eat? |
| 00:36:43 | <ddarius> | Cale: It could easily be implemented that way, but you could make that not be allowable. |
| 00:37:30 | <mmorrow> | ddarius: is this (to some extent/whatever) the method that reader macros use? |
| 00:37:51 | <mmorrow> | (parsing of them?) |
| 00:37:51 | <ddarius> | mmorrow: vixey described how reader macros work |
| 00:38:00 | <mmorrow> | ACTION scrolls back |
| 00:38:25 | <ddarius> | Forth parsing words are similar. |
| 00:38:26 | <mmorrow> | excellent |
| 00:38:51 | <mmorrow> | ACTION reads up on reader macros and forth parsing words |
| 00:39:47 | <Quadrescence> | ?hoogle a -> IO () |
| 00:39:47 | <lambdabot> | Prelude.print :: Show a => a -> IO () |
| 00:39:47 | <lambdabot> | System.IO.print :: Show a => a -> IO () |
| 00:39:47 | <lambdabot> | Data.HashTable.delete :: HashTable key val -> key -> IO () |
| 00:44:37 | <Quadrescence> | Correct this please? http://hpaste.org/9500 |
| 00:45:09 | <dons> | you're missing | syntax |
| 00:45:14 | <dons> | f x | x <= 2 = 7 |
| 00:45:22 | <dons> | | x == y = 8 |
| 00:45:34 | <dons> | the | should line up vertically |
| 00:45:41 | <dons> | oh, sorry, you do have them :) |
| 00:45:44 | <Cale> | oh, another problem... |
| 00:45:44 | <ddarius> | That doesn't actually matter |
| 00:45:44 | <vixey> | omg |
| 00:45:47 | <vixey> | I got 6.9! |
| 00:45:48 | <Cale> | x <- getLine |
| 00:45:48 | <dons> | ACTION read |n as 'ln' |
| 00:45:52 | <vixey> | mmorrow: thank you :) |
| 00:45:54 | <Cale> | in the where clause |
| 00:45:59 | <vixey> | just did make clean and i worked |
| 00:46:14 | <Cale> | Quadrescence: you have a spurious x <- getLine in the where clause |
| 00:46:27 | <Cale> | Quadrescence: that's a syntax error, it would only be allowed inside of a do-block |
| 00:46:30 | <Quadrescence> | Cale: How do I get the user's input each iteration? |
| 00:46:41 | <vixey> | last (reverse -> x:_) = x |
| 00:47:10 | <Cale> | oh, there's another problem with the way you're recursing as well |
| 00:47:26 | <Cale> | When you have x : xs, x must be an element, and xs a list |
| 00:47:31 | <Cale> | Not the other way around. |
| 00:47:44 | <Quadrescence> | Oh, oops, yeah. That is easily fixed. |
| 00:48:19 | <mmorrow> | vixey: sweet!!! |
| 00:48:23 | <dmwit> | Can't do IO in a pure function... ;-) |
| 00:48:31 | <vixey> | /usr/local/bin/ghci-6.9.20080619 -XViewPatterns -fth # yay |
| 00:48:32 | <Cale> | Easiest would most likely be to separate I/O from this parsing, I think. |
| 00:48:44 | <vixey> | ACTION has a look for some docs |
| 00:48:48 | <Cale> | For instance, take a list of strings as a parameter |
| 00:48:50 | <Quadrescence> | hum |
| 00:49:18 | <mmorrow> | vixey: up-to-date TH docs are here: http://code.haskell.org/~morrow/quasiquotes/template-haskell_docs_HEAD_080623/ |
| 00:49:19 | <lambdabot> | Title: template-haskell-2.2, http://tinyurl.com/6xdh6w |
| 00:49:42 | <mmorrow> | (well, as of 080623) |
| 00:50:04 | <Cale> | Quadrescence: If your function was to do IO, it would have an IO type. |
| 00:50:31 | <Cale> | Quadrescence: something like getPuzzleStructure :: Int -> IO [(String, Int, Int)] |
| 00:51:42 | <Cale> | If you want to keep things pure, perhaps better would be readPuzzle :: String -> [(String,Int,Int)] |
| 00:52:50 | <dons> | what's a good type with 3 inhabitants? |
| 00:52:55 | <dons> | other than Ord |
| 00:53:11 | <dons> | T | F | Unknown ? |
| 00:53:23 | <heatsink> | dons: Three-valued logic, sure. |
| 00:53:39 | <vixey> | Maybe Bool |
| 00:53:40 | <Trinithis> | Maybe Bool |
| 00:53:42 | <dons> | hmm, ternary logic. yes. |
| 00:53:57 | <Cale> | The latter of which would be something like readPuzzle xs = [(x,read y,read z) | (x:y:z:_) <- map words . lines $ xs] |
| 00:54:15 | <dons> | T | F | U |
| 00:54:25 | <Cale> | dons: hehe, data Bool = False | True | FileNotFound |
| 00:54:32 | <dons> | :) |
| 00:54:40 | <Cale> | Maybe Bool |
| 00:55:46 | <Cale> | or even... |
| 00:56:08 | <Cale> | readPuzzle xs = [(x,read y,read z) | (x:y:z:_) <- map words xs] |
| 00:56:16 | <Cale> | because you'll probably write: |
| 00:56:40 | <Cale> | getPuzzleStructure n = fmap readPuzzle (replicateM n getLine) |
| 00:57:06 | <Cale> | In which case, you'll want a list of strings anyway. |
| 00:57:23 | <Quadrescence> | My brain is struggling. |
| 00:57:50 | <heatsink> | ACTION prefers liftM over fmap |
| 00:58:04 | <vixey> | ACTION prefers . |
| 00:58:23 | <vixey> | :t read . getLine |
| 00:58:26 | <lambdabot> | forall a. (Read a) => IO a |
| 00:58:47 | <Trinithis> | ACTION prefers . |
| 00:58:54 | <ziman> | it should be (<$>) |
| 00:59:25 | <heatsink> | It took just over a half hour for cc1 to run on stage1/parser/Parser.hs -fvia-c. Any idea why that one file takes so long? |
| 00:59:35 | <dons> | gcc has some performance problems. |
| 01:00:00 | <heatsink> | hmm. |
| 01:01:38 | <Quadrescence> | Cale: How do I use replicateM? |
| 01:01:45 | <paczesiowa> | is there better way to update something inside record inside record than "currentRSS { rssChannel = (rssChannel currentRSS) { rssItems = map adjustDate (rssItems $ rssChannel currentRSS) } }" ? |
| 01:02:21 | <heatsink> | paczesiowa, not really. You can always write functions for the common cases though. |
| 01:03:12 | <paczesiowa> | I don't like records:( |
| 01:03:17 | <heatsink> | mapRSSChannel (mapRSSItems (map adjustDate)) currentRSS |
| 01:03:48 | <heatsink> | s/map/update |
| 01:04:21 | <paczesiowa> | heatsink: this is the only piece of such code so there's no common case |
| 01:08:07 | <heatsink> | Quadrescence, replicateM performs its argument repeatedly and returns a list of results. |
| 01:08:25 | <heatsink> | replicateM 4 m === do {x1 <- m; x2 <- m; x3 <- m; x4 <- m; return [x1, x2, x3, x4]} |
| 01:10:06 | <noohgodno> | > 5==2 |
| 01:10:08 | <lambdabot> | False |
| 01:10:14 | <noohgodno> | you don't say |
| 01:10:52 | <noohgodno> | > map (sum [1..500]) |
| 01:10:53 | <lambdabot> | add an instance declaration for (Enum (a -> b), Num (a -> b)) |
| 01:11:00 | <Cale> | @src replicateM |
| 01:11:01 | <lambdabot> | replicateM n x = sequence (replicate n x) |
| 01:11:04 | <heatsink> | >map sum [1..500] |
| 01:11:05 | <Cale> | @src sequence |
| 01:11:06 | <heatsink> | > map sum [1..500] |
| 01:11:06 | <lambdabot> | sequence [] = return [] |
| 01:11:06 | <lambdabot> | sequence (x:xs) = do v <- x; vs <- sequence xs; return (v:vs) |
| 01:11:06 | <lambdabot> | --OR |
| 01:11:06 | <lambdabot> | sequence xs = foldr (liftM2 (:)) (return []) xs |
| 01:11:07 | <lambdabot> | add an instance declaration for (Enum [a], Num [a]) |
| 01:11:14 | <mmorrow> | replicateM n = sequence . replicate n |
| 01:11:20 | <noohgodno> | haskell is really hard |
| 01:11:26 | <heatsink> | wait |
| 01:11:28 | <heatsink> | > sum [1..500] |
| 01:11:29 | <noohgodno> | i've never seen a language this hard |
| 01:11:30 | <lambdabot> | 125250 |
| 01:11:30 | <Cale> | noohgodno: map normally takes a function and a list |
| 01:11:55 | <Cale> | noohgodno: (and applies the function to each element of the list, giving a new list) |
| 01:11:59 | <Trinithis> | :t genericReplicateM |
| 01:12:00 | <noohgodno> | yeah i know |
| 01:12:04 | <newsham> | [15:10] < noohgodno> i've never seen a language this hard |
| 01:12:05 | <noohgodno> | so if i have |
| 01:12:09 | <mmorrow> | noohgodno: don't quit |
| 01:12:09 | <noohgodno> | map (n,sum [1..500]) |
| 01:12:15 | <newsham> | perhaps you're expecting to carry over a lot of experience from other languages |
| 01:12:27 | <newsham> | where haskell is a lot more different than most languages are to each other |
| 01:12:28 | <noohgodno> | i'm expecting to carry over more experience from math |
| 01:12:28 | <Cale> | noohgodno: ... which function are you trying to apply to which list here? |
| 01:12:40 | <noohgodno> | let's just say i want to do n^2 for each n |
| 01:12:43 | <Cale> | noohgodno: sum takes a list of numbers and produces a number |
| 01:12:49 | <noohgodno> | i know |
| 01:12:52 | <Cale> | okay |
| 01:12:54 | <newsham> | > map (^2) [2..10] |
| 01:12:56 | <lambdabot> | [4,9,16,25,36,49,64,81,100] |
| 01:13:00 | <Cale> | So sum [1..500] is a number |
| 01:13:01 | <noohgodno> | gotcha |
| 01:13:11 | <noohgodno> | sum map (^2) [2..1000] |
| 01:13:13 | <noohgodno> | > sum map (^2) [2..1000] |
| 01:13:14 | <lambdabot> | Couldn't match expected type `[a]' |
| 01:13:21 | <noohgodno> | > sum (map (^2) [2..1000]) |
| 01:13:22 | <lambdabot> | 333833499 |
| 01:13:22 | <Cale> | > sum (map (^2) [1..10]) |
| 01:13:24 | <lambdabot> | 385 |
| 01:13:25 | <noohgodno> | :] |
| 01:13:38 | <Trinithis> | noohgodno: Haskell is the most rewarding language I have learned. Well worth not giving up. |
| 01:13:41 | <noohgodno> | pays a metric fuckton, too |
| 01:13:56 | <noohgodno> | you know the average haskell coder in the US makes 200k/yr? |
| 01:14:12 | <newsham> | where did you hear that? |
| 01:14:23 | <noohgodno> | a big list of salaries |
| 01:14:35 | <noohgodno> | ;O |
| 01:14:41 | <mmorrow> | newsham: dons linked to it a while back |
| 01:14:53 | <newsham> | i guess i'll never own an army of haskell programmers |
| 01:14:58 | <Trinithis> | $ and a fun lanugauge? Amazing! |
| 01:15:16 | <noohgodno> | tech salaries go up 5% a year, too |
| 01:15:32 | <newsham> | thats because inflation is 5%/yr right now |
| 01:15:42 | <noohgodno> | not quite |
| 01:15:54 | <noohgodno> | of all industries, it has the fastest growing rate of salaries |
| 01:16:07 | <newsham> | you're right, its actually more lik 6-7% |
| 01:16:09 | <noohgodno> | er, largest rate of salary increase |
| 01:16:15 | <newsham> | or 4.25% if you measure in reallyodd ways |
| 01:16:34 | <noohgodno> | but inflation measures something very close to the mean increase in salary, doesn't it? |
| 01:16:35 | <newsham> | where I live, its about 5.25% even if you measure really poorly |
| 01:16:58 | <noohgodno> | in theory, money goes somewhere |
| 01:17:03 | <centrinia> | I have a feeling that people with doctorates make up a higher percentage of the Haskell programmer population than for something like C or Java. |
| 01:17:23 | <newsham> | centrinia: definitely, but salary falls off from masters to phd. |
| 01:18:10 | <noohgodno> | are there any haskell web apps |
| 01:18:20 | <newsham> | yes, hpaste for example. |
| 01:18:21 | <noohgodno> | i wanna see |
| 01:18:22 | <centrinia> | ~ HAppS |
| 01:18:28 | <newsham> | ?hpaste |
| 01:18:29 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 01:18:30 | <noohgodno> | is that just pastebin |
| 01:18:36 | <noohgodno> | that's lame |
| 01:19:06 | <noohgodno> | i want to see something really novel |
| 01:19:18 | <paczesiowa> | not enterprisey enough? |
| 01:19:21 | <noohgodno> | something inspiring! |
| 01:20:22 | <paczesiowa> | can you show me one inspiring website written in any language? |
| 01:20:44 | <heatsink> | Does adobe actionscript count? |
| 01:20:49 | <noohgodno> | that's all i try to ever code |
| 01:20:56 | <newsham> | not at all, heatsink. |
| 01:23:02 | <noohgodno> | though my success is mixed... |
| 01:23:29 | <centrinia> | I still think that functional reactive programming could be useful for interactive web pages. |
| 01:24:41 | <ddarius> | centrinia: So do the flapjax people. |
| 01:26:44 | <hml> | is template metaprogramming haskell's versin of macros ? |
| 01:27:27 | <robreim> | Is there any JHC hackers around? |
| 01:30:27 | <robreim> | hml, I haven't used it myself but I believe It's the equivalent of macros in the sense that you can change syntax fairly arbitrarily. It's probably not (though I don't know for sure) as powerful as lisp macros if that's what you're thinking of. |
| 01:32:34 | <dons> | have we avoided success yet!? |
| 01:32:37 | <vixey> | template metaprogramming |
| 01:32:43 | <vixey> | that's C++ right? |
| 01:32:50 | <dons> | hmm. can i get an interrobang tshirt!? |
| 01:32:55 | <noohgodno> | dons++ |
| 01:33:12 | <dons> | hey, awesome, http://www.zazzle.com/interrobang_shirt-235471175250401333?gl=hooferluvsu |
| 01:33:13 | <lambdabot> | Title: interrobang t-shirt from Zazzle.com, http://tinyurl.com/69rcyf |
| 01:33:33 | <dons> | i need more interrobang stuff |
| 01:33:59 | <heatsink> | That looks like a superhero logo. You can be interrobang man! |
| 01:34:03 | <noohgodno> | interrobanging is my life |
| 01:34:09 | <noohgodno> | just look at my handle |
| 01:34:10 | <dons> | shapr: i think the interrobang should be #haskell's motif :) |
| 01:34:15 | <robreim> | dons, maybe you should add conditional strict evaluation to haskell using an interrobang? |
| 01:34:24 | <dons> | oh, awesome, robreim |
| 01:34:27 | <noohgodno> | can somebody explain to me how the "do" keyword doesn't count as a "side effect" |
| 01:34:36 | <dons> | noohgodno: it introduces a monadic block of code |
| 01:34:43 | <dons> | which could potentially include side effects on the world |
| 01:34:48 | <dons> | if its in a world-effecting monad. |
| 01:34:52 | <robreim> | Guess what? I got a fever. And the only cure is more interrobang |
| 01:34:53 | <dons> | ‽ |
| 01:35:03 | <noohgodno> | robreim-- |
| 01:35:04 | <dons> | haskell‽ wtf‽ monads!!‽ |
| 01:35:06 | <heatsink> | noohgodno, it takes a while to understand monads. Lots of people here suggest the "monads as computation" page. |
| 01:35:37 | <noohgodno> | no, i got that |
| 01:35:46 | <noohgodno> | this language takes serious mind-bending |
| 01:35:49 | <noohgodno> | i need some hallucinogens |
| 01:36:13 | <heatsink> | noohgodno, just remember: there is no spoon. |
| 01:36:22 | <noohgodno> | there's very clearly a spoon |
| 01:36:25 | <dons> | , run prop_mempty_id |
| 01:36:25 | <dons> | , run prop_mempty_id |
| 01:36:27 | <dons> | grr. |
| 01:37:13 | <noohgodno> | they shoot horses, don't they |
| 01:37:17 | <robreim> | So noone here is adequately versed in JHC to be able to help an interested person with a couple of newbie questions? |
| 01:37:33 | <robreim> | ?karma |
| 01:37:33 | <lambdabot> | You have a karma of -1 |
| 01:37:43 | <robreim> | Aw, what was that for, noohgodno? |
| 01:38:05 | <noohgodno> | that tired snl reference |
| 01:38:36 | <dons> | robreim: SamB or john. |
| 01:40:51 | <robreim> | Thanks. john == john meacham |
| 01:41:22 | <atomiclambda> | ACTION is away: I'm busy |
| 01:42:10 | <noohgodno> | > 5 |
| 01:42:11 | <lambdabot> | 5 |
| 01:42:18 | <noohgodno> | ACTION nods |
| 01:42:23 | <heatsink> | ACTION starts building 6.6.1 and hopes the hc files will build on my other machine |
| 01:42:24 | <dons> | robreim: yup. |
| 01:42:34 | <dons> | heatsink: what are you porting to? |
| 01:43:19 | <noohgodno> | what the hell was J# |
| 01:43:52 | <heatsink> | dons: I want to build and link against 32-bit libraries on a 64-bit machine. For some reason, the 32-bit i386 distribution won't run: I get "floating point exception" messages at the very beginning, when running the `pwd' utility. |
| 01:43:58 | <newsham> | j# == embrace,extend,extinguish java |
| 01:44:33 | <ddarius> | newsham: Java's extinguished? |
| 01:44:48 | <newsham> | heatsink: you mean you built a haskell app on i386 and it wont run on your amd64/em64t? |
| 01:44:56 | <newsham> | ddarius: didnt work. |
| 01:45:19 | <robreim> | embrace, extend, extinguish... of course... no wonder Microsoft wanted to be distributed on the eee pc so badly. |
| 01:45:20 | <noohgodno> | remember when they spent a year and a half investigating microsoft, and absolutely nothing happened |
| 01:46:30 | <gwern> | hm, Igloo == Ian ??? |
| 01:46:34 | <gwern> | Lynagh? |
| 01:46:50 | <dons> | yes. |
| 01:46:59 | <heatsink> | newsham, I want to build an elf32-i386 binary on an amd64 machine so I can link with existing elf32-i386 libraries that I can't rebuild. |
| 01:47:04 | <dons> | is MS still relevant? |
| 01:47:25 | <dons> | :) didn't google, apple, zune and vista doom them to obsolesence? |
| 01:47:26 | <newsham> | ahh. |
| 01:47:32 | <glguy> | dons: you aren't *that* isolated |
| 01:47:33 | <lambdabot> | glguy: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 01:47:53 | <noohgodno> | glguy? |
| 01:47:56 | <newsham> | dons: still 90% market share on OS. though mac's at 7-9% and about +2%/yr |
| 01:48:04 | <noohgodno> | other arch users in here |
| 01:48:07 | <dons> | ACTION looks around for windows machines. |
| 01:48:18 | <dons> | glguy: yay, we live in a ghetto! :) |
| 01:48:21 | <newsham> | <- on winxp desktop now :) |
| 01:48:30 | <dons> | noohgodno: a bunch of arch users. |
| 01:48:34 | <gwern> | I'm not sure Mac isn't as much a problem as MS. macs are just unixy enough to tempt people into contorting their apps to cover all their edge cases and apple oddities |
| 01:48:48 | <dons> | gwern, and apple hates to share. |
| 01:48:57 | <gwern> | always have |
| 01:49:28 | <sjanssen> | the iPhone SDK business is rather frightening |
| 01:49:44 | <newsham> | wonder if android will have much of an impact |
| 01:50:07 | <gwern> | sjanssen: it brought home tivoization to me, anyway |
| 01:50:31 | <glguy> | "just unixy enough"? Mac = UNIX |
| 01:50:40 | <glguy> | or at least OS X |
| 01:51:12 | <gwern> | glguy: if that is so, why do I see so many issues with Macs coming up? |
| 01:51:26 | <newsham> | mach + unix + lots of objc stuff thats |
| 01:51:36 | <newsham> | compatibility not ensured |
| 01:51:38 | <gwern> | you have to have your head in the sand to not have noticed the endless torrent of emails and posts that start 'i'm on mac os x...' |
| 01:52:02 | <newsham> | gwern: 7-9% market share. |
| 01:52:19 | <glguy> | gwern: I'm just saying that mac isn't "unixy" it *is* UNIX |
| 01:52:24 | <gwern> | newsham: that's great for them, but I don't think it affects my point |
| 01:53:35 | <gwern> | ACTION notes that there are at least three ways I could argue macs are not UNIX, and none of which are relevant to my point that macs are painful for free software to support, on a level more remiscent of Windows pain than, say, openbsd pain |
| 01:54:06 | <sjanssen> | glguy: there are many ways in which OS X is not your typical Unix-like |
| 01:54:14 | <sjanssen> | for example, X11 is a ghetto |
| 01:54:17 | <slava> | gwern: i've had more openbsd pain than windows pain |
| 01:54:30 | <newsham> | slava: thats just theo ;-) |
| 01:54:40 | <slava> | no, i mean, getting shit to work right on openbsd |
| 01:54:41 | <glguy> | sjanssen: X11 is a ghetto, yes |
| 01:54:47 | <sjanssen> | glguy: on OS X |
| 01:54:53 | <glguy> | in general |
| 01:54:56 | <gwern> | slava: what, for haskell stuff? |
| 01:54:57 | <sjanssen> | glguy: X11 is a perfectly reasonable system otherwise |
| 01:55:06 | <slava> | gwern: no |
| 01:55:12 | <slava> | low-level systems programming stuff |
| 01:55:15 | <sjanssen> | glguy: can you actually argue that point? |
| 01:55:24 | <gwern> | ok then, I don't really care about low-level systems programming stuff :) |
| 01:55:47 | <slava> | people that develop your compilers and tools do though |
| 01:55:53 | <newsham> | "not only is unix dead, its beginning to smell bad" -rob pike. |
| 01:56:00 | <glguy> | sjanssen: that nvidia has to replace so much of the standard xorg code with a proprietary look-alike to get decent 3d performance because the feature set isn't there? |
| 01:56:11 | <newsham> | .... probably talking about X |
| 01:56:21 | <gwern> | newsham: ignore him; he's just unhappy plan 9 or inferno never caught on |
| 01:56:24 | <slava> | openbsd doesn't even support native threads yet iirc |
| 01:56:32 | <dons> | slava: wtf? |
| 01:56:35 | <newsham> | gwern: i dont think plan9 was ever intended to catch on. |
| 01:56:41 | <newsham> | inferno maybe. |
| 01:56:57 | <glguy> | and I agree that OS X is different than many of the "unix-like" systems |
| 01:57:04 | <glguy> | but it is certified as a UNIX |
| 01:57:04 | <dons> | slava, you mean kernel threads, in the style of pthreads? |
| 01:57:08 | <slava> | dons: yes |
| 01:57:13 | <sjanssen> | glguy: I think this has more to do with nvidia than X.org (which also isn't the same as X11, I'd like to add). Look at Intel's team for a good example of how to work with the code rather than against it |
| 01:57:35 | <dons> | hmm, I don't think that's true, slava. there's certainly some issues with smp, but pthreads at least works. :) |
| 01:57:35 | <gwern> | newsham: maybe. certainly plan 9 went down some very bad paths if the goal was to popularize it |
| 01:57:40 | <newsham> | gwern: and he has a very valid point. that the real unix ended about 25 years ago, and what is living on now is not unix nor particularly elegant |
| 01:57:40 | <dons> | the scheduler's not so hot though. |
| 01:57:46 | <slava> | dons: pthreads work but iirc they're not kernel threads |
| 01:58:09 | <dons> | hmm. do you have a ref? |
| 01:58:15 | <gwern> | newsham: alas, worse is better |
| 01:58:25 | <dons> | slava, i switched to linux from openbsd for better threading, fwiw :) |
| 01:58:41 | <dons> | my `par` programs weren't terribly efficient when stuck on one core. |
| 01:58:41 | <slava> | http://groups.google.com/group/comp.unix.bsd.openbsd.misc/browse_thread/thread/cbea9c8b273ac0d6 |
| 01:58:42 | <newsham> | openbsd has rfork. sounds like threads to me. |
| 01:58:43 | <lambdabot> | Title: Are OpenBSD threads (pthreads) using more than one core of multicore CPUs? - com ..., http://tinyurl.com/62yx4p |
| 01:59:50 | <dons> | slava, ah, good ref. espie knows what he's talking about. |
| 02:00:06 | <dons> | and that's exactly the behaviour you'll see -- threaded stuff tied to one kernel process. |
| 02:00:17 | <slava> | yeah, hence, no native threads :) |
| 02:00:32 | <dons> | yeah, only processes. the pthreads don't multiplex down. |
| 02:00:40 | <dons> | its not a system for shared mem smp programming. |
| 02:01:42 | <newsham> | dons: you'd enjoy freebsd *wink* *wink* *nod* *nod* |
| 02:01:52 | <dons> | too late. |
| 02:02:09 | <glguy> | dons: does that explain the poor results you were getting from the threaded runtime on openbsd? |
| 02:02:24 | <glguy> | when your benchmark was just jumping from one CPU to the other |
| 02:02:32 | <dons> | glguy, exactly that. |
| 02:02:38 | <TomMD> | On the OS front, after seeing http://web.cecs.pdx.edu/~rebekah/papers/hhv.pdf there is enough Haskell + Systems work out there that I am almost surprised a Haskell distro, with Haskell System tools and a hypervisor in Haskell, hasn't started. |
| 02:02:39 | <lambdabot> | Title: Formalizing Information Flow in a Haskell Hypervisor |
| 02:02:45 | <dons> | i was worried it was a ghc runtime issue, but its further down it seems. |
| 02:03:30 | <newsham> | tommd: interesting link. danke |
| 02:03:32 | <dons> | TomMD: so haskell kernel + the haskell package system, nixos, plus system tools? |
| 02:04:03 | <slava> | but how would you write to the file system, its purely functional |
| 02:04:05 | <slava> | </troll> |
| 02:04:15 | <glguy> | zippers! |
| 02:04:17 | <ddarius> | ZipperFS |
| 02:04:22 | <dons> | we've got 2 already. |
| 02:04:24 | <newsham> | deliminted continuations |
| 02:04:25 | <dons> | zipperfs and halfs. |
| 02:04:45 | <TomMD> | dons: Not entirely what I had in mind, but something close: Haskell Kernel + Haskell VMs providing system services in the micro-kernel sense + virtualized *nix domains providing any needed (and hopefully temporary) compatablity layer. |
| 02:04:45 | <dons> | but it's a lot of lisp-like ghetto-ism. let's play well with others, rather than building our own incompatible stack of kernel, drivers, fs, network stack, user land :) |
| 02:04:47 | <vixey> | haskell doesn't write to the file system, the file system writes to itsself |
| 02:04:48 | <glguy> | (just don't turn your computer off) |
| 02:04:50 | <dons> | oh, we've already got all those. |
| 02:06:15 | <slava> | dons: ghc has native and C codegens right? |
| 02:06:25 | <dons> | slava, yup. |
| 02:06:29 | <newsham> | tommd: are you familiar with the sel4 project? |
| 02:06:32 | <slava> | which ones do people use? |
| 02:06:35 | <slava> | one* |
| 02:06:41 | <ddarius> | Both. |
| 02:06:45 | <TomMD> | newsham: Yes I am, but not deeply. |
| 02:06:45 | <dons> | native is the default. |
| 02:06:52 | <sjanssen> | slava: the native codegen is default in 6.8 and later |
| 02:06:54 | <dons> | gcc is slower, but good for numerics. |
| 02:07:01 | <TomMD> | salva: Native also does better than you might expect. |
| 02:07:04 | <newsham> | not quite what you're talking about, but similar.. microkernel designed in haskell. |
| 02:07:07 | <sjanssen> | (on supported platforms, of course) |
| 02:07:13 | <dons> | native's better on the binary-trees benchmark, interestingly |
| 02:07:18 | <newsham> | what does HHV do about runtime issues like GC? |
| 02:07:26 | <TomMD> | pureMD5 used -fvia-c for a long time but I recently changed that based on 1) OS X bugs 2) The lack of any measurable performance difference |
| 02:07:35 | <dons> | TomMD: cool. |
| 02:07:49 | <sjanssen> | xmonad ditched -fvia-c long ago |
| 02:07:50 | <TomMD> | salva: Oh, you are talking about the OKl4 |
| 02:07:57 | <TomMD> | err, newsham, that was for you |
| 02:08:11 | <dons> | i'm not sure sel4 and okl4 are merged, are they? |
| 02:08:27 | <newsham> | tommd: the sel4 stuff hasnt been tossed over to OK labs yet as far as I know. |
| 02:08:30 | <TomMD> | no, but I thought sel4 was a 'c' based project. |
| 02:08:46 | <dons> | haskell , translated to isabelle, translated to C. |
| 02:08:52 | <dons> | usual story :) |
| 02:09:01 | <newsham> | they wrote the spec in haskell, hooked it up to a cpu emulator to run real userland programs to test, translated to isabelle for proofs, and are translating to C |
| 02:09:02 | <TomMD> | Oh, I am a bit confused on my breakdown, but I have seen the papers and was very happy that more than PSU was working that realm. |
| 02:09:05 | <dons> | unlike other ones, not haskell on bare metal. |
| 02:09:13 | <ddarius> | ACTION still has to read that Executing the Manual paper. |
| 02:09:44 | <newsham> | supposedly sel4 is done end of this year? i wonder how the progress is |
| 02:09:55 | <TomMD> | I was surprised when I saw how close the goals were of the aussies and PSU. |
| 02:10:05 | <newsham> | psu == coyotos? |
| 02:10:19 | <TomMD> | Newsham: PSU == Portland State. |
| 02:10:27 | <newsham> | ohh.. the hhv paper i presume. |
| 02:10:28 | <TomMD> | coyotos == JHU / Sharpio |
| 02:10:29 | <bos> | coyotos is jonathan shapiro's group at JHU. |
| 02:10:52 | <TomMD> | newsham: Yes, and the House work. And they have their own L4 in Haskell. |
| 02:11:07 | <newsham> | huh, interesting.. i had heard of house but not their l4 or this hhv |
| 02:11:16 | <newsham> | will have to read up :) |
| 02:11:31 | <dons> | some light reading, http://www.reddit.com/r/programming/comments/6vno1/a_neighborhood_of_infinity_untangling_with/ |
| 02:11:32 | <lambdabot> | Title: A Neighborhood of Infinity : Untangling with Continued Fractions: Part 0 : progr ..., http://tinyurl.com/5nr8lz |
| 02:11:44 | <TomMD> | newsham: Yeah, the hhv stuff seemed to avoid notice and the L4 work was mentioned in the house paper but Rebekah hasn't published about it since. |
| 02:13:58 | <dons> | ACTION heads out of the office. |
| 02:14:16 | <TomMD> | dons: You shouldn't be in the office at 7 on Sat. |
| 02:14:20 | <newsham> | late saturday at the office |
| 02:14:25 | <dons> | deadlines, man, deadlines. |
| 02:14:30 | <newsham> | (sunday if you're still on .au time ;-) |
| 02:14:41 | <slava> | dons: will ghci ever compile at runtime instead of interpretation? |
| 02:14:56 | <TomMD> | let the man leave the office |
| 02:14:59 | <TomMD> | ;-) |
| 02:15:18 | <gwern> | ACTION wonders what the deadlines are |
| 02:15:22 | <slava> | dons: so that you can type your tight loops directly at the interpreter prompt and have them run fast ;) |
| 02:16:18 | <ddarius> | slava: Use plugs |
| 02:16:57 | <gwern> | ghci doesn't do compilation? then what does :set -O2 do... |
| 02:17:32 | <slava> | i thought ghci was a bytecode interpreter |
| 02:17:39 | <TomMD> | It is |
| 02:17:45 | <slava> | so... ;) |
| 02:17:47 | <TomMD> | You can :set about anything you want |
| 02:17:51 | <slava> | does it compile or not :) |
| 02:17:59 | <newsham> | does PSU have a project page for their OS work? |
| 02:18:22 | <gwern> | 'does ghci have the compiler-nature?' |
| 02:18:26 | <ddarius> | It doesn't (except to bytecode). |
| 02:18:31 | <ddarius> | plugs does compile. |
| 02:18:56 | <TomMD> | newsham: Not yet, I expect one within a year. I'm sure you found the House page. Also see Mark Jones, Andrew Tolmach, and Rebekah Leslie. |
| 02:19:01 | <newsham> | "writing systems software in a functional language: an experience report" huh |
| 02:19:14 | <TomMD> | Yeah, and Jones will talk about that at ICFP |
| 02:19:26 | <TomMD> | Or, so I think I read. |
| 02:19:40 | <newsham> | neat |
| 02:20:07 | <newsham> | wish i could buy back my soul and go to pdx.edu ;-) |
| 02:20:18 | <TomMD> | Where is your soul? |
| 02:20:27 | <newsham> | i make money for a living. |
| 02:20:36 | <TomMD> | So do I, but I intend to be at PSU by March. |
| 02:20:39 | <newsham> | and grown quite accustomed to it |
| 02:20:43 | <TomMD> | So have I |
| 02:20:53 | <newsham> | congrats. |
| 02:21:17 | <TomMD> | Thanks - now I need to get used to starving again. |
| 02:21:20 | <newsham> | :) |
| 02:21:28 | <newsham> | good thing food prices have been moderate ;-) |
| 02:21:35 | <TomMD> | grrr |
| 02:22:08 | <newsham> | i bet you can find someone to pay you decent cash doing haskell while studying |
| 02:23:31 | <TomMD> | It would be nice. I've mentioned it to a couple profs and am exploring my own options. I just don't want to have any 'golden handcuffs'. Though in my case they would just be bronze. |
| 02:25:32 | <TomMD> | I saw the Sun Sparc deal earlier. I'm not applying, but hope someone neat like byorgey lands it. |
| 02:31:25 | <Elly> | sun sparc deal? |
| 02:31:49 | <newsham> | http://haskell.org/opensparc/ |
| 02:32:31 | <Elly> | heh |
| 02:32:42 | <Elly> | I've been working on an optimizing compiler for PPC all summer |
| 02:32:48 | <Elly> | but I know nothing about haskell code generation |
| 02:33:09 | <TomMD> | I don't think applying would hurt Suns feelings :-) |
| 02:33:24 | <slava> | Elly: do you know where to find accurate instruction schedules for the G5? |
| 02:35:30 | <Elly> | no idea at all |
| 02:35:40 | <Elly> | I am working on the platform-independent part of the optimizer |
| 02:35:42 | <slava> | ok |
| 02:37:25 | <atomiclambda> | ACTION is away: Hello again |
| 02:38:27 | <TomMD> | atomiclambda? Is that one dangerous lambda or a lambda that operates in a single step, invisible to other computations. |
| 02:38:49 | <slava> | TomMD: both! |
| 02:39:11 | <TomMD> | But I find atomicity to be safe, not dangerous. |
| 02:39:19 | <TomMD> | ... except to performance. |
| 02:40:05 | <newsham> | as long as the half-life is short |
| 02:41:39 | <TomMD> | ACTION going to sleep, lambdabot /tell me anything funny people say |
| 02:42:10 | <newsham> | ?quote funny |
| 02:42:10 | <lambdabot> | edwardk says: heh i should probably just type up the problem specification in haskell and click compile. funny how that seems to yield the answer ;) |
| 02:45:00 | <heatsink> | @quote |
| 02:45:00 | <lambdabot> | TuringTest says: They got it work in Haskell without understanding Haskell. It is quite an achievement, of some description. |
| 02:48:14 | <newsham> | neat, pdx.edu making new dialect for systems programming |
| 02:50:16 | <heatsink> | Maybe I'm missing something... does HSFFIG give you a way to get a pointer to a C structure's field? |
| 02:55:32 | <dons> | TomMD: by March eh? that's interesting news :) |
| 03:15:17 | <newsham> | how large is the haskell <-> runtime interface in ghc? |
| 03:15:30 | <newsham> | would it be pretty hard to use the ghc compiler and link against a different runtime? |
| 03:16:30 | <lispy> | ?quote funny |
| 03:16:30 | <lambdabot> | edwardk says: heh i should probably just type up the problem specification in haskell and click compile. funny how that seems to yield the answer ;) |
| 03:16:36 | <lispy> | ?quote not funny |
| 03:16:36 | <lambdabot> | No quotes for this person. My pet ferret can type better than you! |
| 03:16:46 | <heatsink> | IIRC, GHC's code generation has some hardwired knowledge of the GC that might be hard to port. |
| 03:16:46 | <lispy> | ?quote not.funny |
| 03:16:46 | <lambdabot> | No quotes match. Listen, broccoli brains, I don't have time to listen to this trash. |
| 03:17:14 | <heatsink> | This is only what I've learned from fooling around with the mangler though. |
| 03:17:17 | <Maciej> | Any ideas why I don't receive my own posts to haskell-cafe? |
| 03:17:31 | <lispy> | Maciej: might be a list setting |
| 03:17:44 | <dmwit> | newsham: We need a Haskell FFI. =P |
| 03:17:51 | <lispy> | Maciej: you can always sign up for message recipts |
| 03:17:55 | <Maciej> | No, the settings are correct, I just checked it. |
| 03:18:22 | <lispy> | Maciej: I mean, some lists just don't send them back to the sender...or is that what you check? |
| 03:18:23 | <hml> | :t show |
| 03:18:25 | <lambdabot> | forall a. (Show a) => a -> String |
| 03:18:26 | <lispy> | Maciej: do you use gmail? |
| 03:18:32 | <lispy> | :t fix show |
| 03:18:32 | <lambdabot> | String |
| 03:18:38 | <Maciej> | Yes I do |
| 03:18:44 | <newsham> | dmwit: ? |
| 03:18:50 | <lispy> | Maciej: ah, i think it's gmail's fault then |
| 03:19:20 | <dmwit> | newsham: ...to link against other Haskell code, generated by a different compiler. |
| 03:19:35 | <dmwit> | i.e. we need both a C FFI and a Haskell FFI. |
| 03:19:43 | <newsham> | ahh. i see what you're saying. |
| 03:19:54 | <dmwit> | And now, if the joke is thoroughly killed, I have some reddit to read. |
| 03:19:57 | <Maciej> | lispy: What's the problem with gmail? |
| 03:20:21 | <dmwit> | ;-) |
| 03:20:23 | <lispy> | Maciej: in my experience when you email a list, gmail doesn't show you the message that the list sends... |
| 03:20:42 | <dmwit> | Maciej: gmail tries to do the "Right Thing" about only showing one copy of any given email. |
| 03:21:03 | <dmwit> | It is one of the misfeatures that I am sad to say was duplicated by "sup" -- otherwise my favorite mail client. |
| 03:22:48 | <Maciej> | Strange .. |
| 03:26:29 | <lispy> | Maciej: if I were you, I'd check the list archives just to be sure it went through. If it did, then just assume it will continue to work :) |
| 03:27:52 | <Maciej> | Well, I receive respones to my posts, so it just works fine. :-) |
| 03:40:56 | <hjlj> | > take 100 $ fix show |
| 03:40:57 | <lambdabot> | "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\... |
| 03:43:32 | <dmwit> | > fix show -- drop the take |
| 03:43:34 | <lambdabot> | "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\... |
| 03:44:49 | <int-e> | > take 10 . map fst . filter ((=='"') . snd) . zip [1..] $ fix show |
| 03:44:50 | <lambdabot> | [1,3,7,15,31,63,127,255,511,1023] |
| 03:48:05 | <dmwit> | > take 10 . map length . groupBy (const (=='"')) $ fix show |
| 03:48:07 | <lambdabot> | [1,2,1,1,2,1,1,1,1,1] |
| 03:48:44 | <dmwit> | > take 10 . map length . groupBy (const (=='\\')) $ fix show |
| 03:48:45 | <lambdabot> | [2,4,8,16,32,64,128,256,512,1024] |
| 03:51:58 | <DaveS123> | A quick question: Is there any way to get the type of an expression to be used for comparison? I.e. (typeOf a) == (typeOf b) |
| 03:52:16 | <vixey> | DaveS123: I didn't understand that. |
| 03:52:31 | <vixey> | :t typeOf |
| 03:52:32 | <lambdabot> | forall a. (Typeable a) => a -> TypeRep |
| 03:52:33 | <vixey> | you mean this? |
| 03:52:35 | <dmwit> | Types are known at compile-time, there's no need to compare them. |
| 03:52:38 | <DaveS123> | well... everything has a type... and I'm trying to compare things by type |
| 03:52:43 | <DaveS123> | i know you can use :t in the interpreter |
| 03:52:51 | <DaveS123> | but that doesn't help me for comparing things in code |
| 03:53:01 | <vixey> | DaveS123: No I don't get it |
| 03:53:02 | <EvilTerran> | do you have a use case for this? |
| 03:53:24 | <vixey> | DaveS123: For one thing, |
| 03:53:28 | <vixey> | data Bool = True | False |
| 03:53:34 | <vixey> | data Flip = Heads | Tails |
| 03:53:42 | <vixey> | DaveS123: Is Bool == Flip? or not? |
| 03:54:13 | <DaveS123> | mm no |
| 03:54:32 | <dmwit> | I'm with EvilTerran. |
| 03:54:34 | <dmwit> | What's the use case? |
| 03:54:41 | <vixey> | DaveS123: How do you know they aren't equal? |
| 03:54:46 | <DaveS123> | I'm trying to use a groupBy function |
| 03:54:48 | <dmwit> | We might be able to help you if we know a bit more about what you're trying to do. |
| 03:55:03 | <dmwit> | DaveS123: Higher-level; tell us in English the goal. |
| 03:55:48 | <DaveS123> | hmm... actually I've realized a bit of an oversight |
| 03:56:41 | <DaveS123> | I'll be back to expand on my question if I realize that its still relevant |
| 03:56:44 | <DaveS123> | :) |
| 03:56:59 | <DaveS123> | regardless, thanks for the prompt replies |
| 03:56:59 | <koninkje> | DaveS123: In order to "compare" types in code, you'll need to develop some type-level equality predicate. There are a few different ways to do so implementation-wise, not to mention semantics-wise |
| 03:57:48 | <DaveS123> | what do you mean by type-level equality predicate? |
| 03:58:00 | <vixey> | DaveS123: How do you know that Bool and Flip aren't equal? |
| 03:58:01 | <dmwit> | He means you don't want to do that. ;-) |
| 03:58:08 | <DaveS123> | haha fair enough |
| 03:58:28 | <dmwit> | DaveS123: In most cases, it is enough to have a sum type with just a few constructors, and just make an Ord instance for that instead. |
| 03:58:49 | <dmwit> | For example, there's a totally reasonable Ord instance for (Either Bool Int). |
| 03:58:59 | <koninkje> | DaveS123: well (==) only works on the value level to say whether two values of type t are the same. Going higher-order one could define a type class (:==:) that detects whether two types of the same kind are "equal" |
| 03:59:25 | <DaveS123> | hmm interesting |
| 03:59:37 | <vixey> | ACTION just wants DaveS123 to say "because they have different names" :/ |
| 03:59:46 | <koninkje> | DaveS123: Chances are doing that would be using an autocannon for a flyswatter for your purposes |
| 04:00:15 | <koninkje> | vixey: But does that really mean they're different? they're within an isomorphism from each other... |
| 04:00:32 | <dmwit> | koninkje: I think that's exactly vixey's point. |
| 04:00:57 | <vixey> | (it's not but I didn't want to define type (dis)equality) |
| 04:00:58 | <DaveS123> | yes, sounds like it would be - just experimenting with ideas in my head. I'm quite new to Haskell if you couldn't tell, it takes quite a different mindset to give types this much consideration. |
| 04:01:16 | <DaveS123> | but I like it. |
| 04:01:45 | <DaveS123> | makes sense in the functional paradigm |
| 04:01:56 | <koninkje> | If you're worrying about the definition of equality on types then you've left Haskell and joined the fine art of category theory :) |
| 04:02:46 | <DaveS123> | Ok, well thanks all for your help. |
| 04:05:07 | <koninkje> | vixey: I found a paper you might like: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.48.3615 |
| 04:05:08 | <lambdabot> | Title: What is unification? A categorical view of substitution, equation and solution - ... |
| 04:05:32 | <vixey> | koninkje: Thank you |
| 04:05:37 | <koninkje> | :) |
| 04:15:32 | <mmorrow> | ddarius: ping |
| 04:15:45 | <ddarius> | mmorrow: ? |
| 04:16:17 | <mmorrow> | ddarius: if you had to install one forth interpreter (on linux), which would it be |
| 04:16:28 | <mmorrow> | (ie, which should i get) |
| 04:16:42 | <vixey> | gforth |
| 04:16:55 | <mmorrow> | cool |
| 04:17:04 | <vixey> | btw mmorrow: If you are bored read jones forth was posted on ltu |
| 04:17:11 | <bwr> | can i still use putStr etc when using nanocurses? |
| 04:17:23 | <vixey> | it's basically heavily commented assembly but very interesting |
| 04:17:30 | <mmorrow> | vixey: heh, i think i have that printed out somewhere... |
| 04:17:43 | <mmorrow> | (if i'm thinking of the same thing) |
| 04:17:55 | <mmorrow> | ddarius, vixey: what about common lisp |
| 04:18:24 | <mmorrow> | ..."if you could have only one" |
| 04:18:27 | <vixey> | haha |
| 04:18:34 | <mmorrow> | err, i meant |
| 04:18:43 | <vixey> | SBCL and SLIME with paredit in Emacs |
| 04:18:45 | <mmorrow> | "only one common lisp implem" |
| 04:18:57 | <mmorrow> | ok, thx |
| 04:19:58 | <mmorrow> | oh, i guess i should have said s/forth interpreter/forth environment/ |
| 04:20:12 | <lispy> | I had this one application in lisp, I recall starting a compile + run, in both sbcl and clisp at the same time. sbcl took twice as long to compile but the app finished first in sbcl :) |
| 04:20:36 | <lispy> | I was quite enamored to sbcl after that :) |
| 04:20:39 | <mmorrow> | sbcl it is |
| 04:20:55 | <lispy> | also, sbcl is more to the standard, clisp intentionally violates it |
| 04:21:05 | <vixey> | sbcl is written in lisp |
| 04:21:13 | <vixey> | clisp is written in C |
| 04:21:24 | <vixey> | so.. I prefer sbcl :) |
| 04:21:32 | <lispy> | sbcl is just a lot cooler too :) |
| 04:21:57 | <vixey> | yeah you can hack the compiler while it's running |
| 04:22:11 | <vixey> | if you have slime and so on |
| 04:22:11 | <ddarius> | SBCL would be one of the first choices. |
| 04:22:30 | <hml> | :t 1.0 |
| 04:22:33 | <lambdabot> | forall t. (Fractional t) => t |
| 04:22:39 | <hml> | :t 1.0 ::Float |
| 04:22:40 | <lambdabot> | Float |
| 04:22:45 | <hml> | :t 1.0 ::Double |
| 04:22:46 | <lambdabot> | Double |
| 04:22:59 | <mmorrow> | ACTION just did sudo yum install -y *sbcl* *gforth* |
| 04:23:19 | <dsrogers> | greetings. |
| 04:23:34 | <dsrogers> | HOC and mac os 10.5 are a match in heaven waiting to happen. |
| 04:23:48 | <ddarius> | mmorrow: gforth is probably one of the most featureful forths available for Linux, but forth is a strange beast. |
| 04:24:01 | <dsrogers> | apple has made writing language bindings so -- very -- easy |
| 04:24:34 | <vixey> | dsrogers: hey have you thought about interacting with objc? |
| 04:24:35 | <mmorrow> | ddarius: ha, it's appearing that way from the small bit i've read so far. it looks really interesting.. |
| 04:24:47 | <dsrogers> | vixey: in what sense? |
| 04:25:07 | <vixey> | dsrogers: I wonder what happens with haskells GC and objcs GC, having two of them... wont they fight? |
| 04:25:25 | <ddarius> | vixey: They shouldn't. |
| 04:25:36 | <dsrogers> | well, depends on how haskell implements their GC, but objc plays nice. |
| 04:25:56 | <dsrogers> | it only collections objects allocated in the zone dedicated to garbage collection |
| 04:26:06 | <dsrogers> | it doesn't collect things allocated with straight malloc |
| 04:27:17 | <dsrogers> | and apple has included libffi by default (which is good because the one included in HOC doesn't compile anymore) |
| 04:27:46 | <dsrogers> | and apple has also included xml descriptions of every single framework they install. |
| 04:27:56 | <dsrogers> | and a tool for generating more of these descriptions |
| 04:28:02 | <vixey> | oh that should make thisg easy |
| 04:28:39 | <dsrogers> | it's stuff called BridgeSupport |
| 04:28:49 | <vixey> | that's weird |
| 04:28:54 | <vixey> | apple didn't implement BridgeSupport |
| 04:28:57 | <dsrogers> | apparently apple is trying to encourage support for language bindings. |
| 04:29:05 | <dsrogers> | no, not originally. |
| 04:29:08 | <dsrogers> | it's open source. |
| 04:30:18 | <dsrogers> | actually, I think they may have implemented it. |
| 04:30:19 | <dsrogers> | http://bridgesupport.macosforge.org/ |
| 04:30:22 | <lambdabot> | Title: BridgeSupport |
| 04:32:39 | <ttmrichter> | I'm trying to build cabal-install 0.5.1. The configuration step is borking because I don't have zlib of a particular version nor HTTP of a particular version. I can find zlib, but... what is this HTTP library it's talking about and where is it to be found? It's not in the GHC sources and it's not on HackageDB. |
| 04:33:33 | <int-e> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP |
| 04:33:34 | <lambdabot> | Title: HackageDB: HTTP-3001.0.4 |
| 04:34:47 | <hjlj> | > concat $ map ((++ "\"") . (`take` repeat '\\') . (+ (-1)) . (2^)) [0..] |
| 04:34:53 | <lambdabot> | "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\... |
| 04:35:05 | <int-e> | (+ (-1)) === pred |
| 04:35:13 | <hjlj> | thanks |
| 04:35:22 | <mmorrow> | > fix show |
| 04:35:23 | <lambdabot> | "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\... |
| 04:35:28 | <int-e> | @type pred |
| 04:35:28 | <lambdabot> | forall a. (Enum a) => a -> a |
| 04:35:46 | <int-e> | (not quite, this is in a different type class as you can see. but it works for integral types) |
| 04:36:00 | <int-e> | with limited range (Int) |
| 04:36:29 | <int-e> | @src pred |
| 04:36:29 | <lambdabot> | Source not found. Do you think like you type? |
| 04:36:57 | <hjlj> | Integer isn't a Enum? |
| 04:37:02 | <hml> | http://hpaste.org/9501 ... why is there an error in this pattern? |
| 04:37:15 | <int-e> | > pred (2^70) |
| 04:37:16 | <lambdabot> | 1180591620717411303423 |
| 04:37:17 | <hml> | on the x:[] line |
| 04:38:07 | <int-e> | oh. integer must have its own 'pred' implementation then. the default implementation is pred = toEnum . (`minusInt` oneInt) . fromEnum and the range of Int is limited. |
| 04:38:29 | <hjlj> | ok |
| 04:39:31 | <hml> | why do i get a parse on the third line for the following: http://hpaste.org/9502 |
| 04:39:40 | <mmorrow> | > ([1,2]++) . filter (>2) . fmap ((+1) . length) . group $ fix show |
| 04:39:48 | <lambdabot> | [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,2... |
| 04:39:53 | <mmorrow> | > fix (scanl (+) 1) |
| 04:39:55 | <lambdabot> | [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,2... |
| 04:40:11 | <vixey> | > extendSequence [1,2,4,8] |
| 04:40:14 | <lambdabot> | [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,2... |
| 04:40:30 | <mmorrow> | > fix ((1:) . scanl (+) 1) |
| 04:40:31 | <lambdabot> | [1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17... |
| 04:40:51 | <hjlj> | hml |
| 04:41:04 | <hjlj> | i think you might need brakets around x:xs |
| 04:41:24 | <int-e> | hml: my_output_helper x:[] gets parsed as (my_output_helper x) : [] -- hjlj is right. |
| 04:41:28 | <ttmrichter> | Hmmmm. Odd. Maybe I didn't let the Hackage page load fully. When I searched on HTTP I couldn't find it, but it is there now. |
| 04:41:33 | <ttmrichter> | Thanks, int-e |
| 04:43:58 | <bwr> | how can i get input until tab is pressed? |
| 04:44:13 | <bwr> | i am trying to figure out how to do this with System.Console.Readline... but it is a little confusing |
| 04:45:16 | <ttmrichter> | OK, next issue. Trying to build yi-gtk gives me problems with not finding appropriate versions of gtk (>=0.9.11) and sourceview (>=0.9.11). I also note that the hackage logs show the same problem. Whereabouts does one find these libraries in the right version? |
| 04:45:39 | <dsrogers> | back... |
| 04:45:55 | <dsrogers> | anyways, that eliminates a ton of code from HOC for scanning header file.s |
| 04:46:09 | <dsrogers> | and GC eliminates even more code. |
| 04:46:30 | <int-e> | ttmrichter: gtk2hs is what you need. http://www.haskell.org/gtk2hs/ |
| 04:46:31 | <lambdabot> | Title: Gtk2Hs |
| 04:46:43 | <int-e> | (not yet cabalized, so it can't be found on hackage) |
| 04:47:02 | <ttmrichter> | Ah! GTK2HS is... Yeah, what you just said. Thanks again, int-e. |
| 04:48:10 | <int-e> | ttmrichter: be sure to check the configure output that sourceview is being built; it depends on whether the C library is installed or not. |
| 04:49:02 | <bwr> | anybody? / |
| 04:49:03 | <bwr> | :/ |
| 04:49:21 | <ttmrichter> | I just ran the configure script. Sourceview is being installed, but a few other libraries aren't that I can't find immediately. Time to hunt through aptitude. |
| 04:50:06 | <ttmrichter> | The libraries missing are svgcairo, gtkglext, mozembed, gstreamer and "documentation". I imagine that latter one is a configure script option. |
| 04:50:31 | <dons> | is that for gtk2hs, ttmrichter |
| 04:50:32 | <dons> | ? |
| 04:50:48 | <ttmrichter> | Yes. I'm trying to build gtk2hs so I can build yi-dtk, Don. |
| 04:50:55 | <ttmrichter> | yi-gtk, that is. |
| 04:51:02 | <dons> | on arch, those dependencies are, gconf, gtkglext, gtksourceview, libglade, librsvg |
| 04:51:05 | <dons> | http://aur.archlinux.org/packages.php?ID=14890 |
| 04:51:06 | <lambdabot> | Title: AUR (en) - gtk2hs |
| 04:51:09 | <dons> | so maybe similarly named on debian. |
| 04:52:00 | <dons> | this is really nice, http://www.reddit.com/r/programming/comments/6vnxe/a_tutorial_on_information_visualization_and/ |
| 04:52:01 | <lambdabot> | Title: A tutorial on information visualization and visual analytics in Haskell [PDF] : ..., http://tinyurl.com/6jnneh |
| 04:52:23 | <dons> | looks like jefferson's creating something rather beautiful here, with opengl and gtk2hs/cairo |
| 04:52:45 | <dons> | shapr: ^ check that out. isn't that awesome? |
| 04:53:42 | <ttmrichter> | Which version of sourceview should I be installing? I have 1 and 2 available. |
| 04:54:29 | <dons> | hmm. i'm using 1.8.5 |
| 04:54:44 | <dons> | 2. is "gtksourceview2" on my system. |
| 04:55:23 | <ttmrichter> | I just installed both dev packages for safety. :) |
| 04:57:51 | <humasect> | interesting, dons |
| 04:58:28 | <ddarius> | His readDatafile function does not seem like it would give nice streaming behaviour. |
| 04:58:28 | <dons> | jefferson's giving a talk on this at defun, http://www.deinprogramm.de/defun-2008/abstracts/heard-abstract.txt |
| 04:58:30 | <lambdabot> | http://tinyurl.com/56e66y |
| 04:58:38 | <dons> | but he could even be writing a book, by the looks of it.. |
| 04:59:42 | <bwr> | anyone know of a guide for using nanocurses? |
| 04:59:48 | <ttmrichter> | Weird that gtk2hs doesn't want to install the gstreamer support despite the libs being installed. |
| 04:59:57 | <dons> | dcoutts: you might want to blog about it, if he's using gtk2hs, http://bluheron.europa.renci.org/docs/BeautifulCode.pdf |
| 04:59:58 | <lambdabot> | Title: cache:http://bluheron.europa.renci.org/docs/BeautifulCode.pdf - Google Search |
| 05:29:30 | <dsrogers> | am I missing something or is Language.Haskell.TH almost completely undocumented? |
| 05:29:47 | <heatsink> | Documenting TH has not been a high priority, unfortunately. |
| 05:30:07 | <heatsink> | The TH paper is a good start, and if you want to do something specific, you can ask here. |
| 05:30:08 | <catechu> | heatsink: What is TH? |
| 05:30:14 | <heatsink> | catechu, Template Haskell |
| 05:30:26 | <catechu> | heatsink: OK, thanks |
| 05:30:27 | <dsrogers> | where there isn't even a link to the TH paper at the top of the TH haddock documentation. |
| 05:30:31 | <dsrogers> | so, where is it? |
| 05:31:10 | <heatsink> | http://research.microsoft.com/~simonpj/papers/meta-haskell/ |
| 05:31:11 | <lambdabot> | Title: Template metaprogramming for Haskell |
| 05:31:40 | <heatsink> | There's also a page on the wiki that might be useful, http://www.haskell.org/haskellwiki/Template_Haskell |
| 05:31:41 | <lambdabot> | Title: Template Haskell - HaskellWiki |
| 05:32:35 | <bwr> | I am trying to do command line input like program prints <a b=" and then the user enters text and hits enter and the program does " ... and so on. I have looked at several libraries but i can't figure it out. Any help? |
| 05:33:03 | <sjanssen> | bwr: sounds like you just want getLine |
| 05:33:04 | <heatsink> | @t interact |
| 05:33:04 | <lambdabot> | Maybe you meant: tell thank you thanks thx ticker time tiny-url todo todo-add todo-delete topic-cons topic-init topic-null topic-snoc topic-tail topic-tell type . ? @ ft v |
| 05:33:05 | <sjanssen> | @type getLine |
| 05:33:07 | <lambdabot> | IO String |
| 05:33:10 | <heatsink> | @type interact |
| 05:33:10 | <lambdabot> | (String -> String) -> IO () |
| 05:33:21 | <bwr> | sjanssen: but i want to fill in parts of the line for the user |
| 05:33:39 | <humasect> | putStr >> flush |
| 05:33:59 | <sjanssen> | bwr: you probably want hSetBuffering stdout NoBuffering |
| 05:34:09 | <sjanssen> | (or explicitly flush after putting strings) |
| 05:34:10 | <bwr> | ok |
| 05:34:26 | <bwr> | but how do i have getLine end on tab instead of new line |
| 05:34:48 | <bwr> | oops |
| 05:34:49 | <dmwit> | You have to write your own. |
| 05:34:50 | <heatsink> | oh, you want to implement tab-completion? |
| 05:34:53 | <bwr> | i said enter above... i meant tab |
| 05:35:06 | <dmwit> | But really, you probably want readline. =) |
| 05:35:09 | <heatsink> | Sounds like you want the readline library |
| 05:35:27 | <bwr> | i don't really want tab completion either |
| 05:35:55 | <bwr> | i just want to end input on tab |
| 05:36:13 | <bwr> | just like getLine but end on tab |
| 05:37:06 | <ttmrichter> | Has anybody here had any success building gtk2hs 0.9.13? Specifically with mozembed? I'm getting the error "can't find file: mozembed/Graphics/UI/Gtk/MozEmbed.hs" while building it and am getting the feeling that MozEmbed isn't supported or something. |
| 05:39:18 | <heatsink> | bwr: I think you'll have to build that out of low-level operations in System.IO. That means you'd have to write your own code for backspace and echoing. |
| 05:39:31 | <bwr> | heatsink: ok thanks |
| 05:42:32 | <bos> | does bjorn buckwalter hang out here? |
| 05:43:11 | <dons> | hmm, don't think so. |
| 05:43:19 | <dons> | he's an email guy |
| 05:43:41 | <bos> | yeah. |
| 05:44:03 | <bos> | i'm trying to think if it's worthwhile adding another functional data structure to chapter 14. |
| 05:44:08 | <bos> | it's kind of a skinny chapter. |
| 05:44:19 | <bos> | maybe i should write about Data.Sequence. |
| 05:44:52 | <rwbarton> | bwr: On a unix system you'll also have to change the terminal mode, as by default, your program will only receive input one line at a time (because the user has a chance to edit the line using backspace) |
| 05:45:09 | <dons> | Sequence is fairly important. IntMap is important. |
| 05:55:26 | <bwr> | rwbarton: thanks |
| 05:55:43 | <bwr> | i did hSetBuffering stdin NoBuffering |
| 05:55:45 | <noohgodno> | how harrowing is the task of writing a language engine in haskell |
| 05:56:13 | <heatsink> | what's a language engine? |
| 05:56:21 | <rwbarton> | Was that sufficient? |
| 05:56:36 | <dons> | noohgodno: pretty straightforward, i guess you mean an interpreter? |
| 05:56:51 | <bwr> | well, as far as the accepting a character before hitting enter, yea |
| 05:57:08 | <dons> | perl6 seems to have found it easy in haskell. and there's a lot of references, http://haskell.org/haskellwiki/Applications_and_libraries/Compilers_and_interpreters |
| 05:57:11 | <lambdabot> | Title: Applications and libraries/Compilers and interpreters - HaskellWiki, http://tinyurl.com/2dt77g |
| 05:57:31 | <rwbarton> | bwr: Oh, I guess so, neat. |
| 05:57:46 | <bwr> | then i am trying... |
| 05:57:49 | <bwr> | getOption = do c <- getChar cs <- if c == '\t' then getOption else return [] return (c:cs) |
| 05:57:53 | <bwr> | oops |
| 05:58:20 | <bwr> | imagine new lines in appropriate places |
| 05:59:22 | <bwr> | oops |
| 05:59:26 | <bwr> | i have the logic backwards |
| 05:59:27 | <bwr> | haha |
| 06:00:00 | <bwr> | looks like it works if i change that to /= '\t' |
| 06:00:00 | <rwbarton> | bwr: hSetBuffering stdin NoBuffering doesn't do what you want if you compile with ghc |
| 06:00:14 | <bwr> | really? i am using runghc |
| 06:00:32 | <rwbarton> | Yeah, I meant ghc as opposed to ghci=runghc |
| 06:00:44 | <bwr> | seems to work for me with ghc |
| 06:01:27 | <bwr> | i need to turn off character echo though |
| 06:02:19 | <dons> | http://www.reddit.com/r/programming/comments/6vo4p/fully_distributed_revision_control_a_pullonly/ interesting |
| 06:02:20 | <lambdabot> | Title: Fully distributed revision control: a pull-only workflow : programming, http://tinyurl.com/668hs5 |
| 06:03:56 | <bwr> | rwbarton: http://hpaste.org/9503 |
| 06:04:30 | <rwbarton> | Ah, silly me. I forgot about output buffering :) |
| 06:05:09 | <heatsink> | dons: git and mercurial seem to have overtaken darcs in popularity. |
| 06:06:06 | <dons> | heatsink: really? |
| 06:06:30 | <dons> | i must have my head under a rock, in the sand, on mars :) |
| 06:08:46 | <stepcut> | damn linus and his pratical, unprincipled hacks |
| 06:08:56 | <stepcut> | I hear linux is overtaking minix too |
| 06:09:05 | <dons> | no, srsly? |
| 06:09:16 | <dons> | but minix is so clean and well documented! |
| 06:09:44 | <dons> | bah, worse is somehow ... better. |
| 06:09:48 | <araujo> | ACTION thinks we need a Haskell OS |
| 06:09:48 | <stepcut> | and, you can do kill -9 on your drive controller, and it will recover gracefully |
| 06:09:52 | <heatsink> | That's my impression anyway. I've overheard people talking about the DVCS concept with those two as exemplars. |
| 06:09:54 | <stepcut> | araujo: another Haskell OS ? |
| 06:10:07 | <stepcut> | dons: no, just more popular ;) |
| 06:10:10 | <dons> | heatsink: :) i think you missed the huge debate this week about ghc switching to git. |
| 06:10:14 | <araujo> | stepcut, there is never enough Haskell apps |
| 06:10:29 | <dons> | and the corresponding big resurgence of darcs activity |
| 06:11:07 | <stepcut> | ACTION vowes to not check out ghc until it's back in darcs again ;) |
| 06:11:16 | <heatsink> | dons: Indeed I did. Though I saw a message about it on the mailing list. Is it in git now? |
| 06:11:25 | <dons> | stepcut: hah |
| 06:11:38 | <dons> | heatsink: yeah |
| 06:11:51 | <heatsink> | somehow dissatisfying. |
| 06:12:21 | <araujo> | ACTION would prefer darcs, but can see the git advantages |
| 06:12:23 | <stepcut> | heatsink: unless GHC developers hate git more than darcs, then it will be funny ;) |
| 06:12:37 | <stepcut> | though, I don't have any reason to believe that will happen |
| 06:12:50 | <heatsink> | http://en.wikipedia.org/wiki/Abilene_paradox |
| 06:12:51 | <lambdabot> | Title: Abilene paradox - Wikipedia, the free encyclopedia |
| 06:13:07 | <stepcut> | git's fuzzy file rename support grates on my soul, but I don't think that is going to affect GHC much |
| 06:13:45 | <heatsink> | Can you point me to a log of the debate? |
| 06:14:54 | <bos> | i look forward to all the heated rants from people who shoot themselves in the foot with git's idiosyncratic ways of handling branches and rebasing and so on. |
| 06:15:51 | <dons> | ah rebase. there's a paper in explaining that one. |
| 06:16:05 | <stepcut> | ACTION can not honestly recommend any revision control systems |
| 06:17:12 | <bos> | there's little incentive to develop one that's both fast, flexible, and friendly now. |
| 06:17:42 | <dogbite_> | does haskell have a 'split' function build in? |
| 06:17:46 | <dogbite_> | to split strings? |
| 06:17:47 | <stepcut> | bos: both usually takes two arguments, not three.. |
| 06:17:54 | <tehgeekmeister> | what's the best haskell library to use for some really simple xml parsing on a nearly 4 gig file (just need to grab the contents of each of the articles in a wikipedia dump)? |
| 06:18:05 | <bos> | stepcut: it's okay, english isn't h-m typed. |
| 06:18:06 | <dogbite_> | string -> char -> [string] |
| 06:18:26 | <dons> | tehgeekmeister: hmm. 4G ? |
| 06:18:29 | <bos> | dogbite: not really. |
| 06:18:37 | <ttmrichter> | Building yi-gtk now gives me this message: Yi.hs:56:7: Could not find module `System.Posix.Signals': it is a member of package unix-2.3.0.1, which is hidden |
| 06:18:41 | <dons> | that's a tough one. haxml does lazy bytestrings. |
| 06:18:43 | <dogbite_> | okay i'll write it myself then. should be easy. |
| 06:18:52 | <humasect> | -package unix |
| 06:18:54 | <tehgeekmeister> | dons: yeh, it's nearly 4g after unzipping, the french wikipedia dump |
| 06:18:58 | <dons> | dogbite_: there's on in bytestring. |
| 06:19:00 | <ttmrichter> | I tried this with cabal-install. I'm not sure how to get that unix-2.3.0.1 library. |
| 06:19:01 | <dons> | split, that is. |
| 06:19:17 | <humasect> | ttmrichter: try to find a place to add -package unix to ghc arguments |
| 06:19:19 | <bos> | dogbite_: yeah, it's one of those surprising omissions from Prelude |
| 06:19:20 | <dons> | tehgeekmeister: so look on hackage for one of the xml parsers, that must support lazy bytestrings |
| 06:19:25 | <dogbite_> | dons: okay. and don't worry, i'm not diving into some csv things. just working on a euler |
| 06:19:32 | <dons> | dogbite_: :) |
| 06:19:39 | <dons> | dogbite_: csv works now though, remember! |
| 06:19:50 | <dogbite_> | dons: oh, it does. i know that all too well, ha |
| 06:19:52 | <Quadrescence> | Bleh, figuring out user input and bla bla bla is hard. :((( |
| 06:19:54 | <bos> | dealing with a 4GB XML file isn't trivial. |
| 06:20:23 | <bos> | something like tagsoup would be perfect, if it wasn't string-based. |
| 06:20:36 | <dons> | yeah, a lazy bytestring tagsoup. hmm. |
| 06:20:42 | <dons> | alex can lex lazy bytestrings now, btw. |
| 06:20:46 | <dons> | so easy to roll efficient lexers |
| 06:21:54 | <stepcut> | ACTION wonders if it's too late to hype tla for ghc |
| 06:23:16 | <Quadrescence> | ?hoogle IO () -> String |
| 06:23:17 | <lambdabot> | No matches, try a more general search |
| 06:23:28 | <Quadrescence> | ?hoogle IO -> String |
| 06:23:28 | <lambdabot> | No matches, try a more general search |
| 06:23:55 | <bos> | of course, a lazy bytestring tagsoup wouldn't really be sensible either, due to character set issues. |
| 06:24:09 | <stepcut> | Quadrescence: good luck with that |
| 06:24:15 | <bos> | XML being one of those document types where non-ASCII data is really rather likely. |
| 06:24:27 | <catechu> | dogbite_: How have you implemented string splitting? I am new to Haskell and am trying it as an exercise. |
| 06:24:45 | <dogbite_> | i'm just about to do it |
| 06:25:03 | <paczesiowa> | is there strict hGetContents? |
| 06:25:13 | <dogbite_> | i consider myself new too, so it'll be an exercise for me too |
| 06:25:17 | <dons> | paczesiowa: yeah. both for bytestrings, and in the strict package for String. |
| 06:25:32 | <dons> | bos, i wonder if the utf8-string bytestring ops are enough for utf8 lexing |
| 06:25:35 | <Quadrescence> | stepcut: I don't even know what I'm doing/looking for really. |
| 06:25:57 | <dons> | http://hackage.haskell.org/packages/archive/utf8-string/0.3.1.1/doc/html/Data-ByteString-Lazy-UTF8.html |
| 06:25:59 | <lambdabot> | Title: Data.ByteString.Lazy.UTF8, http://tinyurl.com/65luua |
| 06:26:08 | <mmorrow> | @src fix |
| 06:26:08 | <lambdabot> | fix f = let x = f x in x |
| 06:26:08 | <dons> | basically, you need uncons for utf8 for the lexer. so that might be enough. |
| 06:26:15 | <stepcut> | Quadrescence: that particular function is (mostly) impossible in Haskell -- it's why Haskell is cool ;) |
| 06:26:28 | <paczesiowa> | dons: strict package for String? |
| 06:26:45 | <dons> | paczesiowa: yeah, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/strict |
| 06:26:46 | <bos> | dons: that would work, but UTF-8 isn't the only valid encoding for XML. |
| 06:26:47 | <lambdabot> | Title: HackageDB: strict-0.3.2 |
| 06:26:59 | <tehgeekmeister> | i assume HXT's DOM implementation won't be useful;; DOM doesn't work for larger files, right? |
| 06:27:06 | <dons> | bos, yep. so we'd need a suite of uncons' per-encoding |
| 06:27:21 | <Quadrescence> | stepcut: To get user input as a string? That's nowhere near impossible. |
| 06:27:21 | <paczesiowa> | dons: thanks |
| 06:27:39 | <bos> | dons: yes, and i pity the poor bugger who'd have to implement all that. it's pretty much years of work. |
| 06:27:56 | <dons> | so, we have this encodings package. hmm. |
| 06:28:10 | <stepcut> | Quadrescence: you can use getLine for that. But the type is, getLine :: IO String |
| 06:28:24 | <Quadrescence> | stepcut: Then maybe I meant to say IO String |
| 06:28:35 | <Quadrescence> | As I said, I wasn't sure what I was looking for. |
| 06:28:36 | <bos> | dons: those are all the easy 8-bit encodings. the asian ones will make your eyes bleed. |
| 06:28:39 | <stepcut> | Quadrescence: I suspect so |
| 06:28:52 | <dons> | decodeLazy :: enc -> ByteString -> String is an interesting interface. |
| 06:29:15 | <stepcut> | Quadrescence: it's a sensible thing to search for if you don't know better |
| 06:29:20 | <dons> | ah yes. so we've an ad hoc mixture of encodings and ways to get at them. |
| 06:29:38 | <Quadrescence> | stepcut: I suppose so. |
| 06:29:41 | <dons> | so maybe the solution is to find a C lib that can give us the next char. |
| 06:29:50 | <dons> | then do an alex lexer that calls those guys. |
| 06:30:58 | <stepcut> | Quadrescence: types for functions that do I/O operations will always end with, IO <something> |
| 06:31:30 | <dogbite_> | http://hpaste.org/9504 |
| 06:31:42 | <dogbite_> | i'm going to bed but that's my quick attempt at split |
| 06:31:53 | <dogbite_> | oh it's flawed |
| 06:31:57 | <dogbite_> | but it's close |
| 06:32:46 | <dogbite_> | hmm... scratch that |
| 06:32:54 | <paczesiowa> | why not represent strings as arrays of boxed chars? wouldn't that help with multibyte encodings? |
| 06:34:01 | <luqui> | it outlaws infinite strings, of course |
| 06:34:02 | <ddarius> | Wow, the Abilene paradox actually does refer to Abilene, TX. |
| 06:34:49 | <ttmrichter> | Is there a summary page somewhere that explains why Darcs was rejected in favour of Git? |
| 06:35:08 | <ttmrichter> | (And that talks about what other options were looked into.) |
| 06:35:16 | <stepcut> | ttmrichter: there is a wiki page |
| 06:35:53 | <tehgeekmeister> | there's the hexpat library on hackage that uses lazy bytestrings and interfaces to the c expat library;; this looks like it should be perfect for my needs, but looking over the documentation real quick I don't see any way of extracting the results of the parse, here's the documentation I'm looking at: http://hackage.haskell.org/packages/archive/hexpat/0.2/doc/html/Text-XML-Expat-IO.html |
| 06:35:55 | <lambdabot> | Title: Text.XML.Expat.IO, http://tinyurl.com/6l5fda |
| 06:35:57 | <paczesiowa> | luqui: lazy lists of arrays of course |
| 06:36:17 | <bos> | tehgeekmeister: there's also a libxml2 binding. |
| 06:36:20 | <stepcut> | ttmrichter: http://hackage.haskell.org/trac/ghc/wiki/DarcsEvaluation |
| 06:36:21 | <lambdabot> | Title: DarcsEvaluation - GHC - Trac |
| 06:36:29 | <tehgeekmeister> | bos: that could do, too |
| 06:36:35 | <ttmrichter> | Thanks, stepcut. |
| 06:37:14 | <tehgeekmeister> | can anyone see a way to get the results of the parse from that documentation? |
| 06:37:21 | <ttmrichter> | OK, looks like yi *STILL* can't be built by mere mortals. I give up. |
| 06:37:24 | <paczesiowa> | tehgeekmeister: you don't |
| 06:37:34 | <rwbarton> | tehgeekmeister: you have to write a callback in the IO monad that will get called for each element |
| 06:37:48 | <paczesiowa> | tehgeekmeister: it's based on callbacks |
| 06:38:20 | <tehgeekmeister> | ah, okay |
| 06:39:08 | <bos> | if you want a DOM, expat should give it to you. |
| 06:39:51 | <dogbite_> | http://hpaste.org/9504#a1 |
| 06:39:52 | <bos> | then again, i guess not. |
| 06:39:57 | <bos> | it's more SAX-like. |
| 06:40:09 | <bos> | still, that might be more appropriate for a huge XML file. |
| 06:40:28 | <dogbite_> | probably not the cleanest or the best split |
| 06:40:47 | <tehgeekmeister> | okay, i still don't see anywhere in the arguments to any of the handler registering functions or any of the other functions that you can register your callback function |
| 06:41:07 | <dogbite_> | actually i still see flaws in it |
| 06:41:09 | <tehgeekmeister> | bos: that's why i was looking at it, sax seems more appropriate, especially since i just want to grab the contents of each article |
| 06:41:20 | <dogbite_> | i'll work on it in the morning .. haskell is so much fun |
| 06:46:33 | <tehgeekmeister> | oh, in parseChunk :: Parser -> ByteString -> Bool -> IO (Bool) is the ByteString -> Bool a function, not two arguments to parseChunk? |
| 06:46:58 | <tehgeekmeister> | would that be where you pass in the callback? |
| 06:49:37 | <adamvo> | Hi, I'm trying to use Data.Vec to solve some linear systems, but it only seems to work properly when I annotate the sizes of matrix and vector |
| 06:51:08 | <adamvo> | that isn't as useful as I hoped, since I want to use variable sized lists as sources for the vectors |
| 06:51:22 | <rwbarton> | tehgeekmeister: see setStartElementHandler, etc. |
| 06:51:29 | <adamvo> | where the size of vector changes the matrix..... |
| 06:52:14 | <tehgeekmeister> | rwbarton: oh! i'm sorry, should've understood that quicker |
| 06:52:20 | <tehgeekmeister> | that's what i get for not having touched haskell in months |
| 06:53:32 | <tehgeekmeister> | that's exactly what i need, now i can get to work |
| 06:55:12 | <paczesiowa> | adamvo: if you wanted to use variable sized lists, why don't you just use [] ? |
| 06:56:08 | <adamvo> | since I'm quite lazy, and elimination is a problem for another day |
| 06:58:45 | <Quadrescence> | How can this be fixed? --> http://hpaste.org/9505 |
| 06:59:25 | <Quadrescence> | (I didn't state the type of getPuzzle because, well, I don't know how) |
| 07:00:03 | <rwbarton> | getPuzzle :: IO [(String, something, something)] |
| 07:00:14 | <rwbarton> | The compiler can't guess what those something's are, and neither can I :) |
| 07:00:21 | <Quadrescence> | They should be Ints |
| 07:01:10 | <rwbarton> | Oh, also "read . wut x m" is wrong, "wut x m" is a value so you want "read (wut x m)" |
| 07:01:36 | <Quadrescence> | Arg, I always get that wrong. |
| 07:01:56 | <rwbarton> | You can either write (read (wut x m)) :: Int, or give a type annotation getPuzzle :: IO [(String, Int, Int)] |
| 07:03:18 | <Quadrescence> | I did the latter. |
| 07:04:38 | <dons> | here's a rather interesting archive, http://www.macs.hw.ac.uk/~dsg/gph/nofib/ |
| 07:04:39 | <lambdabot> | Title: Glasgow Parallel Haskell Algorithms Repository |
| 07:04:56 | <sbahra> | cool dons |
| 07:05:24 | <dons> | a lot of those old programs will likely run out of the box on smp ghc. |
| 07:05:46 | <sbahra> | dons, how would we know if ghc was compiled with SMP support? |
| 07:06:05 | <dons> | ghc is by default :) |
| 07:06:06 | <sbahra> | I think mine is, since I have seen it spike to 100% CPU usage on this dual-core. |
| 07:06:14 | <sbahra> | dons, figured, ok. |
| 07:06:20 | <dons> | oh, you have to run parallel programs with +RTS -N2 |
| 07:06:23 | <dons> | to use the extra cores |
| 07:06:30 | <sbahra> | Oh. |
| 07:06:33 | <dons> | or some other value than 2, if you've more cores. |
| 07:06:50 | <dons> | and programs are compiled with the -threaded flag |
| 07:08:36 | <slava> | dons: shouldn't those be the default? |
| 07:09:11 | <dons> | -threaded is slated to be the default soon, yes. |
| 07:09:18 | <dons> | picking the right value of N is harder. |
| 07:09:42 | <dons> | i think simon's keen to have only -threaded |
| 07:10:26 | <bos> | can't blame him. maintaining two subtly incompatible runtimes can't be fun. |
| 07:11:03 | <bos> | on the other hand, the non-threaded RTS is blazingly fast for concurrent operations, and the threaded RTS is much slower. |
| 07:11:17 | <dons> | yeah, i think that's the main thing staying his hand. |
| 07:11:35 | <dons> | i'm not sure how the parallel GC tips things |
| 07:11:40 | <dons> | probably a bit more in favour of -threaded |
| 07:12:25 | <bos> | of course, the concurrent performance with non-threaded doesn't matter much in practice, since usability for networking apps is hobbled by the use of select in the bowels of the RTS. |
| 07:12:34 | <Quadrescence> | Couldn't match expected type `IO [(String, Int, Int)]' against inferred type `[(String, Int, Int)]' |
| 07:12:38 | <Quadrescence> | Not cool man, not cool. |
| 07:12:56 | <slava> | return? |
| 07:12:58 | <heatsink> | Quadrescence, return! |
| 07:13:09 | <dons> | slava debugs a haskell newbie, awesome. |
| 07:13:17 | <dons> | ;) |
| 07:13:23 | <Quadrescence> | Obviously there is something I am not seeing. |
| 07:13:55 | <heatsink> | You're using some function in IO, so you need to make it an IO computation. |
| 07:14:05 | <dons> | :t return 'x' |
| 07:14:08 | <lambdabot> | forall (m :: * -> *). (Monad m) => m Char |
| 07:14:08 | <dons> | :t 'x' |
| 07:14:09 | <lambdabot> | Char |
| 07:16:24 | <hml> | http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast5 looks like a really cool article |
| 07:16:25 | <lambdabot> | Title: Haskell hacking |
| 07:16:29 | <hml> | dons: are you the same as the above dones? |
| 07:16:37 | <hml> | anyone else know of good haskell optimization gujides |
| 07:16:44 | <dons> | unless don syme switched teams, yes. |
| 07:17:00 | <dons> | :) |
| 07:17:07 | <hml> | good article |
| 07:17:28 | <dons> | what did you learn from it? |
| 07:17:58 | <hml> | that tail recursion is good; as is strictness in inner loops |
| 07:18:01 | <paczesiowa> | you're famous:) |
| 07:18:05 | <hml> | there's this niced summar at the end |
| 07:18:12 | <dons> | hml, cool. that's a pretty good lesson to take away |
| 07:18:33 | <hml> | concrning lesson 3 |
| 07:18:42 | <hml> | so ghc currently compiles haskell to C |
| 07:18:46 | <hml> | then passes it to the c compuiler? |
| 07:18:50 | <dons> | and to assembly as well. |
| 07:18:54 | <dons> | but one route is via gcc |
| 07:19:07 | <hml> | so what's this 'new bleeding edge native code generator' ? |
| 07:19:13 | <hml> | asm or machine code ? |
| 07:19:20 | <luqui> | it's not bleeding anymore is it? |
| 07:19:25 | <dons> | there's a new one, luqui |
| 07:19:28 | <luqui> | ah |
| 07:19:35 | <hml> | where cna i read more about this |
| 07:19:48 | <hml> | (the new backend) |
| 07:19:50 | <dons> | hmm, the community report had some details, and ghc-cvs has discussion |
| 07:19:55 | <dons> | but it hasn't be formally released yet |
| 07:20:15 | <dons> | the existing native code generator you can read about on haskell.org/ghc |
| 07:20:18 | <dons> | under the dev wiki |
| 07:21:16 | <hml> | random thought: so does hasxkell's use of lists help it do bc better? |
| 07:21:26 | <hml> | since lists tends to have this very 'stream' like interface |
| 07:21:45 | <dons> | bc? |
| 07:22:07 | <dons> | lazy lists are the essence of streams, i suppose. |
| 07:22:54 | <hml> | dunno with some lists operations |
| 07:23:09 | <hml> | i (naibely) think it should be possible to do reference counting on them at compile time |
| 07:23:36 | <hml> | i.e. to lsee that list a --f--> list b; but list b isn't used for anythinng else except for listb --g--> list c |
| 07:23:55 | <heatsink> | you mean, stream fusion? :) |
| 07:23:57 | <hml> | so as i create list b elements; i can pass it to g; then throw them away? |
| 07:24:06 | <hml> | ACTION googles stream fusionn |
| 07:24:35 | <heatsink> | actually, I think 'deforestation' is the more common term. |
| 07:24:46 | <heatsink> | Less environmentally friendly though. |
| 07:25:09 | <hml> | can ppl get a PhD thesis working on thesis these days? |
| 07:25:42 | <heatsink> | It's hard to get a PhD thesis working on anything else. |
| 07:26:15 | <heatsink> | ...thesis? |
| 07:26:34 | <hml> | sorry; phd thesis working on haskell |
| 07:26:54 | <adamvo> | > pred 1.1 |
| 07:26:56 | <lambdabot> | 0.10000000000000009 |
| 07:27:17 | <heatsink> | adamvo, weird. |
| 07:28:28 | <Quadrescence> | Here is my not-working source, but this time I commented it up stating what it's supposed to do/what I want. http://hpaste.org/9506 |
| 07:28:28 | <adamvo> | Ord doesn't make that much sense on non-integers |
| 07:28:53 | <luqui> | hml, ndm is, I know someone locally who is, so I'd say yes |
| 07:29:00 | <idnar> | @type pred |
| 07:29:01 | <lambdabot> | forall a. (Enum a) => a -> a |
| 07:29:07 | <idnar> | > pred 5 |
| 07:29:08 | <lambdabot> | 4 |
| 07:29:15 | <idnar> | oh, I was thinking predicate |
| 07:29:21 | <hml> | what are the big research problems concerning functional programming / haskell |
| 07:29:22 | <adamvo> | s/Ord/Enum |
| 07:29:56 | <Quadrescence> | > pred "heatsink" |
| 07:29:57 | <lambdabot> | add an instance declaration for (Enum [Char]) |
| 07:29:57 | <lambdabot> | In the expression: pred "... |
| 07:30:02 | <sbahra> | ACTION thought PHd students working on their thesis do the research first |
| 07:30:21 | <Quadrescence> | heatsink: I guess nothing precedes you. You must be the lowest of the low. :D |
| 07:30:39 | <rwbarton> | Quadrescence: you need "IO" before the second [(String, Int, Int)] in the type signature |
| 07:30:48 | <Quadrescence> | rwbarton: Okay. |
| 07:30:50 | <heatsink> | Quadrescence, Nothing precedes me because I am first in everything! |
| 07:30:59 | <hml> | sbahra: i'm a newb to functional programming; and am just trying to understand the field |
| 07:31:13 | <adamvo> | > fromEnum 4.2 |
| 07:31:14 | <lambdabot> | 4 |
| 07:31:33 | <sbahra> | hml, http://www.haskell.org/, http://scholar.google.com/, ACM, etc.. would be a better first step. |
| 07:31:33 | <lambdabot> | Title: Haskell - HaskellWiki |
| 07:32:02 | <sbahra> | hml, you shouldn't expect an objective answer here, because people have different preferences in research. I'm a newbie to functional programming too, I'm just talking about research in general :-) |
| 07:32:12 | <idnar> | @src length |
| 07:32:12 | <lambdabot> | Source not found. |
| 07:32:19 | <Quadrescence> | rwbarton: But, since the function will recur, the second argument's type [(String,Int,Int)] doesn't match IO [(String,Int,Int)] |
| 07:32:26 | <idnar> | so I'm looking at that blog post by dons again |
| 07:32:50 | <idnar> | "I've written these in a direct worker/wrapper transformed, recursive style." -- why write it that way instead of "directly" recursing? |
| 07:32:52 | <rwbarton> | Quadrescence: Oh, also you don't want the "return $" |
| 07:33:15 | <Quadrescence> | rwbarton: I think that has to do with my lack of understanding of do-blocks. |
| 07:34:48 | <idnar> | eg. length Empty = 0 ; length Cons _ xs = 1 + length xs |
| 07:34:57 | <idnar> | er, with some extra () probably |
| 07:35:28 | <luqui> | Quadrescence, do you know how to convert between do notation and bind notation? |
| 07:35:51 | <Quadrescence> | luqui: No. :( |
| 07:36:18 | <Quadrescence> | What is the difference? |
| 07:36:36 | <luqui> | Quadrescence, do notation is fancy syntax sugar. bind notation is ordinary haskell (with infix operators) |
| 07:36:38 | <dobblego> | do notation is "special sugar" that corresponds to bind notation |
| 07:36:46 | <rwbarton> | Quadrescence: the short-cut rules of thumb are (a) in 'x <- action', x has type a and action has type IO a; (b) if x has type a then 'return x' has type IO a; (c) the type of a do block is the type of its last line |
| 07:36:53 | <Quadrescence> | luqui: Oh, I am aware of this. |
| 07:37:58 | <luqui> | rwbarton, hmm, I like that explanation. Gets you flying quickly. |
| 07:38:34 | <ddarius> | do-notation is very simple syntactic sugar. |
| 07:39:00 | <Quadrescence> | rwbarton: As I see it, do-blocks are a sugary way of doing stuff in a procedural fashion. |
| 07:39:08 | <heatsink> | idnar: There's two things about this transformation. One is the worker/wrapper transformation, which avoids redundant parameter passing. The other is that by making the worker tail-call itself, there is no need to build a stack during the recursion. |
| 07:39:44 | <idnar> | heatsink: oh right, tail calls |
| 07:41:17 | <idnar> | heatsink: hmm, so can't the compiler do that transformation automatically? ;) |
| 07:41:24 | <Quadrescence> | I don't quite understand how a value is "returned" to the function (e.g., for | n > 0 = ..., what will the function actually /equal/? Or how do I make it equal what I want in a do-block) |
| 07:41:53 | <sbahra> | Quadrescence, whatever is after =. |
| 07:42:13 | <Quadrescence> | sbahra: Right, but if you have a do-block after the = then... |
| 07:42:28 | <luqui> | Quadrescence, then it's the last thing in the block |
| 07:42:45 | <Quadrescence> | That's probably what I needed to know. |
| 07:42:45 | <rwbarton> | A do block is just another kind of expression. It doesn't actually *do* stuff |
| 07:43:02 | <Quadrescence> | What is "return" for, then? |
| 07:43:04 | <luqui> | hmm, good name for it |
| 07:43:09 | <luqui> | return :: a -> IO a |
| 07:43:18 | <sbahra> | return :: (Monad m) => a -> m a |
| 07:43:37 | <heatsink> | rwbarton: be { x <- getLine; putStrLn x } |
| 07:43:50 | <luqui> | heheh. |
| 07:44:09 | <luqui> | ACTION thinks seq might have been a good name for it |
| 07:44:37 | <heatsink> | That would make backward state monads even more confusing. |
| 07:44:38 | <newsham> | > return 5 :: [Int] |
| 07:44:40 | <lambdabot> | [5] |
| 07:44:44 | <newsham> | > return 5 :: Maybe Int |
| 07:44:44 | <lambdabot> | Just 5 |
| 07:44:48 | <newsham> | > return 5 :: IO Int |
| 07:44:50 | <lambdabot> | <IO Int> |
| 07:44:52 | <baaba> | return is a really poor name imo |
| 07:44:59 | <luqui> | heatsink, backward state? |
| 07:45:04 | <luqui> | baaba, agreed |
| 07:45:35 | <baaba> | i guess it was an attempt at making programmers from imperative languages more comfortable? |
| 07:45:39 | <heatsink> | luqui: A state monad where each computation sees the state produced by the computation that runs _after_ it. |
| 07:45:51 | <baaba> | but it seems it kinda backfired :P |
| 07:46:15 | <luqui> | baaba, what would you call it? |
| 07:46:24 | <baaba> | unit |
| 07:46:28 | <baaba> | wrap? |
| 07:46:29 | <newsham> | pure? |
| 07:46:33 | <luqui> | pure is good |
| 07:46:33 | <baaba> | lift? |
| 07:46:41 | <baaba> | yeah pure would be nice too |
| 07:46:54 | <sbahra> | baaba, hrm, how would you express some series of functions with no dependency on each other? |
| 07:46:56 | <sbahra> | ACTION likes do |
| 07:46:56 | <luqui> | ACTION loathes the names "Monad", "unit", etc. |
| 07:47:08 | <sbahra> | But I'm used to the TLA notion of "actions" now, so do makes sense. |
| 07:47:19 | <luqui> | mostly because I think category theorists name things poorly |
| 07:47:26 | <sbahra> | s/no dep/no necessary dep/ |
| 07:47:30 | <luqui> | not because they should be renamed to something more evocative. just less scary. |
| 07:48:13 | <luqui> | sbahra, what do you mean? |
| 07:49:01 | <newsham> | i was a sucker for do-notation when i started. |
| 07:49:08 | <Quadrescence> | :t getLine |
| 07:49:09 | <lambdabot> | IO String |
| 07:49:14 | <newsham> | but i'm coming around to (.) (>>=) (<$>) and (<*>) |
| 07:49:23 | <newsham> | much better |
| 07:49:30 | <sbahra> | luqui, well, in "pure", you have a clearly defined set of dependencies: f(o(o(d(x)))). An "action" in do simply defines a state transition (in my mind, at the least) from sAt (where s is old state, A is the action in do, t is new state) |
| 07:49:35 | <newsham> | (or =<< for consistent direction) |
| 07:49:43 | <baaba> | dirty? ;) |
| 07:49:54 | <paczesiowa> | if smth stopped scaring you, you can always prefix it with "co" and voila - tremble in fear again |
| 07:49:54 | <baaba> | do { x <- foo; dirty x } |
| 07:50:09 | <sbahra> | luqui, the dependency isn't necessarily "clear" as purely functional. |
| 07:50:39 | <luqui> | does this generalize to other monads? |
| 07:50:42 | <newsham> | func = someact =<< f . g . h <$> someact <*> someact |
| 07:51:12 | <sbahra> | luqui, I don't know enough about monads to answer this. I'm still new to haskell. |
| 07:52:41 | <heatsink> | paczesiowa, quite true. |
| 07:52:48 | <ddarius> | It was designed to mimic imperative notation, but it wasn't designed to make imperative programmers more comfortable. |
| 07:56:20 | <Quadrescence> | Could someone tell me exactly what x <- getLine means/is doing? |
| 07:56:44 | <Zao> | It "binds" the result of getLine to x. |
| 07:56:55 | <Zao> | To simplify it way much. |
| 07:57:20 | <baaba> | getLine >>= \x -> {- rest of do block -} |
| 07:58:15 | <baaba> | where >>= for the IO monad takes the left argument which is an IO action and the right argument which is a function that accepts the result of said action, and passes the result |
| 07:58:27 | <baaba> | (and indeed, for any monad at that) |
| 07:59:48 | <Quadrescence> | I want to get input from the user at runtime, and store the input as a string to x. |
| 08:00:09 | <baaba> | that's what it does, sorta :) |
| 08:00:24 | <Quadrescence> | So, hm. |
| 08:00:26 | <baaba> | just the way of storing the input to 'x' is not quite your usual assignment, but effectively a callback |
| 08:00:43 | <Quadrescence> | Right |
| 08:00:46 | <baaba> | you give your \x -> ... ie. the rest of the do block as a callback to >>= |
| 08:05:04 | <Quadrescence> | So does x have type IO String? |
| 08:05:17 | <baaba> | no, x is just String |
| 08:05:30 | <paczesiowa> | "<-" eats IO |
| 08:05:32 | <rwbarton> | Quadrescence: by the way, if you're trying to play with something *other* than IO, there are easier ways to do this, using interact and lines and so on |
| 08:05:37 | <ddarius> | luqui: The names "monad" and "unit" are very sensible in the categorical context. |
| 08:05:45 | <baaba> | the function on the right side of >>= accepts the result value of the action on the left side |
| 08:05:58 | <baaba> | hence: |
| 08:05:59 | <baaba> | :t >>= |
| 08:06:04 | <luqui> | ddarius, okay, 'splain. why 'unit'? |
| 08:06:06 | <Quadrescence> | rwbarton: I am just trying to do IO right now. |
| 08:06:07 | <baaba> | erm, :type? |
| 08:06:21 | <baaba> | or what as it, i haven't used lambdabot much |
| 08:06:26 | <rwbarton> | :t (>>=) |
| 08:06:27 | <lambdabot> | forall (m :: * -> *) a b. (Monad m) => m a -> (a -> m b) -> m b |
| 08:06:33 | <baaba> | ah right :) |
| 08:06:36 | <Quadrescence> | baaba: infix |
| 08:06:37 | <Quadrescence> | yeah |
| 08:06:50 | <baaba> | the (a -> m b) is your \x -> ... |
| 08:07:18 | <ayumilove> | wow |
| 08:07:20 | <ayumilove> | many people |
| 08:07:31 | <ayumilove> | hey guys, when I type #haskell, it leads me to a blank page |
| 08:07:33 | <luqui> | ACTION is not playing with backward state, thanks to heatsink |
| 08:07:36 | <luqui> | *now |
| 08:07:42 | <ayumilove> | i had to use the "find channels" and type #haskell, then it works |
| 08:08:06 | <luqui> | ayumilove, /join #haskell? |
| 08:08:08 | <baaba> | sounds like an issue with your irc client |
| 08:08:12 | <baaba> | (or your usage of it) |
| 08:08:19 | <ayumilove> | i tried that but it leads me to a blank page, |
| 08:08:25 | <ayumilove> | anyways |
| 08:08:30 | <ayumilove> | good to see humans ^_^ |
| 08:08:37 | <ddarius> | luqui: Because it is the unit of the "multiplication" represented by mu (join). |
| 08:08:40 | <baaba> | recommend getting an actual client instead of an in-browser one :P |
| 08:08:49 | <ayumilove> | where to get client? |
| 08:08:52 | <luqui> | ayumilove, actually, this is the channel where all the robots who have passed the turing test come |
| 08:08:53 | <ayumilove> | im currently using browser |
| 08:09:01 | <sbahra> | ayumilove, http://www.xchat.org/ |
| 08:09:01 | <lambdabot> | Title: XChat: Multiplatform Chat Program |
| 08:09:08 | <baaba> | there's tons available |
| 08:09:11 | <ayumilove> | hi sbahra |
| 08:09:15 | <ddarius> | Indeed, a monad is a monoid object in a (endo)functor category and the unit of the monad is the unit of the multiplication. |
| 08:09:19 | <jeffz`> | mibbit is pretty restrictive, as far as licensing goes... last I checked their license agreement prohibits you from studying the clients source code |
| 08:09:32 | <sbahra> | ayumilove, I am a computer program written by mux to serve users new to IRC. |
| 08:09:37 | <Quadrescence> | baaba: Mind taking a look? --> http://hpaste.org/9507 |
| 08:09:49 | <luqui> | ddarius, okay, but that's rather circular. why 'unit' for multiplication? |
| 08:10:43 | <baaba> | Quadrescence, you're not passing all the behind-the-scenes stuff of IO into getPuzzle |
| 08:10:52 | <rwbarton> | The unit of a ring R can be identified with the map Z -> R sending 1 to 1, which is the unit map of R viewed as a monoid object in abelian groups |
| 08:10:59 | <ddarius> | luqui: It's not circular at all. Monoids existed before monads and the name unit comes from 1. |
| 08:11:20 | <baaba> | er sorry, yes you are |
| 08:11:23 | <ddarius> | The unit of a monoid behaves like 1 does under multiplication. |
| 08:11:41 | <ddarius> | I don't know where the name "monoid" comes from though. |
| 08:11:50 | <baaba> | Quadrescence, tell me what you expect the type of getPuzzle to be? |
| 08:11:52 | <luqui> | Quadrescence, when n == 0, the result of your function is a list, not an IO list |
| 08:11:56 | <ddarius> | Abstract algebra is full of seemingly meaningless names. |
| 08:12:17 | <Quadrescence> | luqui: baaba: I want the result to be a list. |
| 08:12:32 | <luqui> | Quadrescence, that's impossible, since your function is effectful |
| 08:12:37 | <rwbarton> | Quadrescence: It can't be, because you want to do IO when n > 0 |
| 08:12:39 | <luqui> | only pure functions can return lists :-) |
| 08:12:51 | <luqui> | (sorry for being so cryptic) |
| 08:13:04 | <ayumilove> | hey guys, i have installed the xchat, so how do i use that to connect to mibbit? |
| 08:13:08 | <baaba> | Quadrescence, the do block has to end in an expression of type IO x |
| 08:13:19 | <baaba> | (which will also be the type of the whole block) |
| 08:13:42 | <baaba> | so in your case IO [Puzzle] or whatever |
| 08:14:06 | <luqui> | ddarius, yeah, I guess unit isn't obviously related to 1 to me. but I will revise my earlier statement: mathematicians are bad at naming things, since it's probably not possible to be good |
| 08:14:06 | <baaba> | which means that you have to fix your first case in the match to get 'xs' into IO |
| 08:14:29 | <luqui> | "mathematics is about giving different things the same name" -- so what do you call two different things? |
| 08:15:38 | <ayumilove> | hey guys, i have installed the xchat, so how do i use that to connect to mibbit? |
| 08:15:46 | <ayumilove> | or connect to this haskell channel |
| 08:15:59 | <baaba> | you connect to irc.freenode.net |
| 08:16:05 | <baaba> | which is the server we're on |
| 08:16:17 | <baaba> | i haven't used xchat but there's probably a tutorial on their site |
| 08:16:31 | <ayumilove> | the xchat tutorial says connect to oznet |
| 08:16:39 | <baaba> | connect to freenode instead :) |
| 08:16:47 | <ayumilove> | ok |
| 08:17:15 | <Quadrescence> | baaba: This feels contradictory /to me/. x <- getLine. x is a string. Now I pass x into getPuzzle (recursive) and it repeats until n == 0, in which case it "returns" xs, a list. |
| 08:17:24 | <ayumilove1> | yay im login , thanks baaba |
| 08:17:37 | <ayumilove1> | wow thats pretty tough for a irc newbie -_- |
| 08:17:41 | <baaba> | Quadrescence, the thing is that your getPuzzle is also an IO action |
| 08:18:00 | <baaba> | or rather, must be, because it uses getLine |
| 08:18:07 | <ayumilove1> | > 1+1 |
| 08:18:08 | <lambdabot> | 2 |
| 08:18:19 | <baaba> | and it also has to have an IO type |
| 08:18:32 | <Quadrescence> | baaba: So could I separate the IO from the parsing and everything's good? :D |
| 08:18:38 | <baaba> | sure |
| 08:18:45 | <baaba> | the quick fix is to insert 'return' in the first case |
| 08:18:53 | <baaba> | n == 0 = return xs |
| 08:18:58 | <Quadrescence> | hmm |
| 08:19:16 | <baaba> | oh, and you'll have to change getPuzzle a bit |
| 08:19:52 | <ayumilove1> | > map even [1,2[ |
| 08:19:52 | <lambdabot> | Parse error at end of input |
| 08:19:55 | <ayumilove1> | > map even [1,2] |
| 08:19:56 | <lambdabot> | [False,True] |
| 08:19:59 | <baaba> | so in the recursive case it gets the value via <- and then concatenates it with xs |
| 08:20:07 | <baaba> | (and then you return that result) |
| 08:20:29 | <baaba> | x <- getPuzzle (...) (...); return (x:xs) |
| 08:20:59 | <luqui> | runRState (mdo { put (x+1); x <- get; return x }) 42 -- > (42,43) |
| 08:21:01 | <luqui> | my head a splode |
| 08:21:05 | <baaba> | but yeah separating IO from parsing is probably easier |
| 08:21:17 | <hml> | this simon peyton jones guy is pretty cool; this awkward squard paper starts out with my favorite explaination of monads |
| 08:21:31 | <hml> | just the right amount of technical detail with practical, real world example |
| 08:22:00 | <luqui> | spj is quite good at explaining things |
| 08:22:22 | <Quadrescence> | baaba: In BASIC this would just be ... it doesn't even matter. I'll try separating them |
| 08:22:35 | <baaba> | haha, this isn't quite basic as you may have noticed ;) |
| 08:22:36 | <hml> | is the type T equiv to () -> T ? |
| 08:22:54 | <Quadrescence> | baaba: Yes I realized that. :D |
| 08:23:16 | <luqui> | technically no, hml, but almost |
| 08:23:28 | <hml> | luqui: can you expand on that? |
| 08:23:32 | <baaba> | separating them would be a good thing regardless of language though, since then you immediately gain the option of alternative input mechanisms |
| 08:23:38 | <luqui> | these two functions are different: tFunc _ = t ; tFunc () = t |
| 08:23:50 | <luqui> | scuse me, tFunc' () = t |
| 08:24:01 | <luqui> | because tFunc undefined = t, but tFunc' undefined = undefined |
| 08:24:42 | <luqui> | intuitively, tFunc' checks that its argument is actually () before returning (because in Haskell, pattern matching is defined to be strict) |
| 08:25:03 | <ayumilove1> | hey guys, is it possible to use iterate + list to do fibonacci |
| 08:25:03 | <rwbarton> | @src () |
| 08:25:03 | <lambdabot> | data () = () |
| 08:25:07 | <ayumilove1> | i want to place the fibonacci numbers into a list |
| 08:25:19 | <luqui> | ayumilove1, yes |
| 08:25:25 | <ayumilove1> | generate and place them simultaneously until it reaches nth fibonacci |
| 08:25:37 | <ayumilove1> | i tried recursion it works o_o |
| 08:25:59 | <luqui> | ayumilove1, iterate using the function \(x,y) -> (y,x+y) |
| 08:26:01 | <luqui> | and go from there |
| 08:26:18 | <Deewiant> | > fix ((0:) . scanl (+) 1) |
| 08:26:19 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,... |
| 08:26:38 | <luqui> | wow, that's the most concise one I've seen yet |
| 08:26:47 | <ayumilove1> | i dont understand deewiant code, me newbie |
| 08:27:00 | <luqui> | ayumilove1, don't worry about it :-) |
| 08:27:43 | <rwbarton> | It's using a different recurrence for the fibonacci numbers |
| 08:28:31 | <Deewiant> | > let f = 0 : scanl (+) 1 f in f :: [Expr] |
| 08:28:35 | <lambdabot> | [0,1,1 + 0,1 + 0 + 1,1 + 0 + 1 + (1 + 0),1 + 0 + 1 + (1 + 0) + (1 + 0 + 1),1... |
| 08:28:43 | <ayumilove1> | could someone explain how this iterate works? iterate :: (a -> a) -> a -> [a] |
| 08:28:49 | <Deewiant> | > iterate (+1) 0 |
| 08:28:50 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,2... |
| 08:29:04 | <ayumilove1> | what does (a->a) means? |
| 08:29:19 | <Deewiant> | a function from type a to a |
| 08:29:32 | <ayumilove1> | then the next a refers to? |
| 08:29:35 | <luqui> | ayumilove1, a function that takes a value of a type 'a' and returns a value of that same type. for example \x -> x+1 |
| 08:29:37 | <Deewiant> | the same a |
| 08:29:46 | <rwbarton> | the next a is for the initial value |
| 08:30:10 | <luqui> | iterate f x = [x,f(x),f(f(x)),f(f(f(x))), ...] |
| 08:30:16 | <Deewiant> | > iterate f x |
| 08:30:17 | <lambdabot> | [x,f x,f (f x),f (f (f x)),f (f (f (f x))),f (f (f (f (f x)))),f (f (f (f (f... |
| 08:30:24 | <luqui> | haha |
| 08:31:33 | <hml> | wow, so im on page 8 of hte awkard squard, and it just gets better |
| 08:32:47 | <ayumilove1> | im stil puzzled with this function (x,y) -> (y,x+y) |
| 08:33:53 | <rwbarton> | In order to compute the next fibonacci number, you need to know the previous two. That's why you need to keep a pair |
| 08:33:53 | <hml> | does the following loko correct? |
| 08:33:54 | <hml> | putLine :: [Char] -> IO() |
| 08:33:54 | <hml> | putLine [] = return () |
| 08:33:54 | <hml> | putLine (c:cs) = putChar c >> putLine cs |
| 08:34:16 | <hml> | and that switch of the y into the front is to keep the bigger as the latter and the smaller ikn the front |
| 08:34:21 | <rwbarton> | If x = f_n and y = f_{n+1}, then y = f_{n+1} and x+y = f_{n+2} |
| 08:34:24 | <paczesiowa> | hml: ask ghc:) |
| 08:35:03 | <ayumilove1> | umm my first 2 initial values is 0 and 1 |
| 08:35:13 | <ayumilove1> | iterate (0,1) (0) ? |
| 08:35:51 | <Quadrescence> | the first argument has to be of type a->a |
| 08:36:14 | <Deewiant> | > fix ((0:).(1:).ap (zipWith (+)) tail) |
| 08:36:17 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,... |
| 08:36:41 | <sbahra> | ayumilove1, you should learn about the golden ratio (there is a formula that allows you to find out Fibonacci numbers at O(1)) |
| 08:37:01 | <sbahra> | ayumilove1, but it is dependent on fractionals, iirc, so you will have either precision issues or performance issues. |
| 08:37:03 | <hml> | hmm, is {} good notation for do, or shoudl i just use pure whitespace |
| 08:37:18 | <ayumilove1> | iiirc means? |
| 08:37:33 | <sbahra> | if i recall correctly |
| 08:40:54 | <ayumilove1> | hmm |
| 08:40:58 | <ayumilove1> | still can't get it |
| 08:41:17 | <TSC> | hml: Most people use the layout rule, but some people prefer {;} |
| 08:41:28 | <sbahra> | ayumilove1, I suggest a good book |
| 08:41:48 | <sbahra> | ayumilove1, I am currently reading "Haskell: The Craft of Functional Programming" by simon thompson |
| 08:41:58 | <sbahra> | ayumilove1, you can even download it (illegally) online for free if you're poor. |
| 08:42:38 | <luqui> | ayumilove1, don't let that suggestion discourage you from asking questions. we'll do our best to help you. |
| 08:43:08 | <Quadrescence> | ayumilove1: #haskell is one of the most assisting channels :} |
| 08:43:25 | <Quadrescence> | That's why they're so easy to troll. :D |
| 08:43:35 | <ayumilove1> | what is troll? |
| 08:43:40 | <Quadrescence> | Nothing, nevermind. |
| 08:43:51 | <luqui> | ACTION wishes he weren't known, because then he could do |
| 08:43:53 | <sbahra> | ChanServ is a troll. |
| 08:43:56 | <ayumilove1> | sbahra what is troll? |
| 08:43:59 | <luqui> | hey guys, what's a functor? |
| 08:44:28 | <ivanm> | ayumilove1: a troll is someone who hangs around deliberately provoking arguments, or else trying to spam people with useless garbage |
| 08:44:40 | <ayumilove1> | thanks ivarm |
| 08:44:42 | <ivanm> | or else it's a fictional creature from Tolkenesque fantasy |
| 08:44:46 | <ivanm> | ;-) |
| 08:44:54 | <luqui> | or something that hangs around under bridges |
| 08:45:08 | <ivanm> | only if there's goats around though |
| 08:45:23 | <luqui> | or a small creature with big poofy colorful hair |
| 08:46:57 | <Quadrescence> | How nice, I just made an equivalent to zipWith. >_> |
| 08:47:15 | <Quadrescence> | !src zipWith |
| 08:47:30 | <Quadrescence> | is it `!' ? |
| 08:47:37 | <ivanm> | luqui: no, that's not trolls... |
| 08:47:45 | <ivanm> | that's trollz IIRC ;-) |
| 08:47:51 | <ivanm> | @src zipWIth |
| 08:47:52 | <lambdabot> | Source not found. You untyped fool! |
| 08:47:55 | <ivanm> | @src zipWith |
| 08:47:56 | <lambdabot> | zipWith f (a:as) (b:bs) = f a b : zipWith f as bs |
| 08:47:56 | <lambdabot> | zipWith _ _ _ = [] |
| 08:47:58 | <luqui> | and what is the singular of trollz? |
| 08:48:07 | <ivanm> | luqui: trollzor? :p |
| 08:48:10 | <luqui> | haha |
| 08:48:33 | <ivanm> | ACTION didn't work out what luqui meant till after he said he was wrong, and is quickly trying to reason why he's right |
| 08:50:05 | <luqui> | I see |
| 08:50:12 | <hml> | @src sequence_ |
| 08:50:13 | <lambdabot> | sequence_ ms = foldr (>>) (return ()) ms |
| 08:50:13 | <luqui> | apology accepted. |
| 08:50:15 | <luqui> | =P |
| 08:50:34 | <hml> | is the point of implementing sequence_ as foldr rather than foldl so that if i send it to an infinite list, it'll produce output along the way? |
| 08:50:37 | <ivanm> | @src sequence |
| 08:50:38 | <lambdabot> | sequence [] = return [] |
| 08:50:38 | <lambdabot> | sequence (x:xs) = do v <- x; vs <- sequence xs; return (v:vs) |
| 08:50:38 | <lambdabot> | --OR |
| 08:50:38 | <lambdabot> | sequence xs = foldr (liftM2 (:)) (return []) xs |
| 08:52:21 | <ayumilove1> | is it possible to use take and interate in winhugs? |
| 08:52:32 | <ayumilove1> | i mean writing it in notepad and run it using winhugs |
| 08:53:00 | <ivanm> | don't see why not... |
| 08:53:10 | <ayumilove1> | i written "take n iterate (x+y)(x)" into notepad, but does not work, it says take not identified |
| 08:53:21 | <rwbarton> | It should be. If it's not working, try adding "import List" to the top of your haskell file |
| 08:53:33 | <ayumilove1> | how do i import? im new to haskell import |
| 08:53:44 | <ayumilove1> | write on top of all functions? |
| 08:53:50 | <rwbarton> | Yeah, on the first line |
| 08:54:04 | <rwbarton> | It shouldn't be necessary though... |
| 08:54:22 | <Deewiant> | take and iterate are both in the Prelude |
| 08:56:02 | <ayumilove1> | umm |
| 08:56:09 | <ayumilove1> | where should i post my notepad codes? |
| 08:56:36 | <rwbarton> | http://hpaste.org/new |
| 08:56:48 | <ayumilove1> | thanks rwbarton |
| 08:58:08 | <ayumilove1> | could someone check for me whats the problem with the code http://hpaste.org/new |
| 08:58:20 | <ayumilove1> | http://hpaste.org/9508 |
| 08:59:18 | <rwbarton> | First of all, it doesn't know you want 'iterate (x+y) (x)' to be a single argument to take, so you should put parentheses around it |
| 08:59:28 | <besiria> | why the new http://shootout.alioth.debian.org/u64q/ doesn't include haskell? |
| 08:59:29 | <lambdabot> | Title: x64 Ubuntu : Intel® Q6600® Computer Language Benchmarks Game |
| 09:00:06 | <ayumilove1> | you mean like this? iterate ((x+y)(x)) ? |
| 09:00:18 | <rwbarton> | No, I mean take n (iterate (x+y) x) |
| 09:00:44 | <rwbarton> | Second, the first argument to iterate needs to be a function. x+y isn't a function |
| 09:02:03 | <Quadrescence> | How do I write a function in lambda notation taking two arguments? |
| 09:02:03 | <ayumilove1> | so i need to make a new function? like abc = x+y ? |
| 09:02:12 | <Deewiant> | Quadrescence: \x y -> x+y |
| 09:02:18 | <Quadrescence> | easy as pie |
| 09:03:31 | <rwbarton> | ayumilove1: I'm not sure how you're expecting this to work. Here's what iterate does: |
| 09:03:35 | <rwbarton> | > iterate f x |
| 09:03:36 | <lambdabot> | [x,f x,f (f x),f (f (f x)),f (f (f (f x))),f (f (f (f (f x)))),f (f (f (f (f... |
| 09:03:54 | <rwbarton> | How can you choose x and f so that this is related to the fibonacci numbers? |
| 09:04:17 | <ayumilove1> | i seen an example it says iterate (+1)(0) so i should put +(x+y) ? |
| 09:05:11 | <hml> | wow, the counter of number of chars written on page 13 of awkward s1uard is awesome |
| 09:05:16 | <Quadrescence> | :t foldl |
| 09:05:16 | <lambdabot> | forall a b. (a -> b -> a) -> a -> [b] -> a |
| 09:05:54 | <rwbarton> | So (+1) means \x -> x + 1 -- the function that adds 1 to a value |
| 09:06:06 | <rwbarton> | What are x and y supposed to be in "+(x+y)"? |
| 09:06:26 | <ayumilove1> | what do you mean rwbarton? |
| 09:06:36 | <rwbarton> | OK, I'm being a little difficult here |
| 09:06:47 | <rwbarton> | You can't find f and x such that iterate f x = [0, 1, 1, 2, 3, 5, ..] |
| 09:07:00 | <rwbarton> | What you can do is find f and x such that iterate f x = [(0, 1), (1, 1), (1, 2), (2, 3), (3, 5), ...] |
| 09:07:13 | <rwbarton> | that's what I was trying to say before about remembering two values of the sequence at a time |
| 09:07:45 | <idnar> | @type catMaybes |
| 09:07:46 | <lambdabot> | forall a. [Maybe a] -> [a] |
| 09:07:48 | <idnar> | @src catMaybes |
| 09:07:49 | <lambdabot> | catMaybes ls = [x | Just x <- ls] |
| 09:07:52 | <idnar> | hmm |
| 09:07:52 | <ayumilove1> | sorry I don;t get you >.< |
| 09:07:54 | <idnar> | @type mconcat |
| 09:07:55 | <lambdabot> | forall a. (Monoid a) => [a] -> a |
| 09:08:09 | <rwbarton> | Clearly x = (0, 1); so you just need to write f such that f (0, 1) = (1, 1), f (1, 1) = (1, 2), f (1, 2) = (2, 3), f (2, 3) = (3, 5), etc. |
| 09:08:13 | <ayumilove1> | you can't find f and x but i can find f and x ? |
| 09:08:14 | <idnar> | @type msum |
| 09:08:15 | <lambdabot> | forall (m :: * -> *) a. (MonadPlus m) => [m a] -> m a |
| 09:08:21 | <rwbarton> | What? |
| 09:08:27 | <idnar> | isn't there a generalised form of catMaybes? |
| 09:08:28 | <rwbarton> | I wrote two different things at the end of those two lines |
| 09:08:42 | <sbahra> | fib n = floor (gold^n / sqrt(5) + 0.5) where gold = (1 + sqrt(5)) / 2 |
| 09:08:55 | <glguy> | > msum [Just 1, Nothing, Just 2] |
| 09:08:56 | <lambdabot> | Just 1 |
| 09:09:04 | <glguy> | not quite :) |
| 09:09:08 | <idnar> | @hoogle [m a] -> [a] |
| 09:09:09 | <lambdabot> | Prelude.tail :: [a] -> [a] |
| 09:09:09 | <lambdabot> | Prelude.init :: [a] -> [a] |
| 09:09:09 | <lambdabot> | Prelude.reverse :: [a] -> [a] |
| 09:11:38 | <ayumilove1> | rwbarton, sorry I still don't understand what you are trying to say with the f(0,1) = (1,1) |
| 09:11:45 | <Quadrescence> | sbahra: [fib x|x <- [1..10]] |
| 09:11:48 | <Quadrescence> | winnar :D |
| 09:11:57 | <Deewiant> | > let f (0,1) = (1,1) in f (0,1) |
| 09:11:58 | <lambdabot> | (1,1) |
| 09:12:08 | <rwbarton> | I can't tell where you're stuck, sorry |
| 09:12:18 | <Quadrescence> | rwbarton: I'm sure it's with the notation |
| 09:12:31 | <Quadrescence> | I think ayumilove1 thinks f is taking two arguments |
| 09:13:04 | <Quadrescence> | Since in math, f(x,y) means x and y are separate parameters for f |
| 09:13:21 | <ayumilove1> | http://hpaste.org/9508#a1 |
| 09:13:32 | <ayumilove1> | i done some correction with the code, and it works |
| 09:14:05 | <rwbarton> | It gives [0,1,2,3,4,5,...] right? |
| 09:14:06 | <Quadrescence> | ayumilove1: In math, we write f(x,y) for a function of x and y. In haskell, we write f x y (or, if x and y are complicated expressions, f (x) (y)) |
| 09:14:55 | <rwbarton> | I think part of the problem is that in ayumilove1's example "iterate (+1) 0", (+1) is written without lambda notation |
| 09:15:02 | <ayumilove1> | rwbarton, yeah, it gives that |
| 09:15:27 | <hml> | hmm, why do people insist on using unsafePerformIO so much? |
| 09:15:36 | <hml> | what's wrong with having the IO tag around? |
| 09:15:37 | <Quadrescence> | rwbarton: I actually think (+1) is clearer for the non-mathematicians. |
| 09:16:17 | <rwbarton> | Well, (+1) looks slightly "magical" ... and (+(x+y)) is clearly hoping for some deep kind of magic :) |
| 09:16:45 | <ayumilove1> | i just place a + sign there hoping it would work, and it works, just recalled something that rwbarton said, function, |
| 09:16:53 | <Quadrescence> | rwbarton: hahahah |
| 09:17:14 | <ayumilove1> | yesterday, a good haskel helper thought be about filter and function |
| 09:17:23 | <rwbarton> | ayumilove1: maybe there's an easier way to approach this |
| 09:17:29 | <ayumilove1> | is it? |
| 09:17:31 | <idnar> | Quadrescence: map fib [1..10] :P |
| 09:17:47 | <Quadrescence> | idnar: list comprehension looks neater. :D |
| 09:17:51 | <rwbarton> | ayumilove1: Let's try to write a function fib x y = [x, y, x+y, y+(x+y), ...] that is it's like a fibonacci sequence except it starts with x, y instead of 0, 1 |
| 09:17:56 | <rwbarton> | Ok? |
| 09:18:09 | <idnar> | Quadrescence: it looks more obscure to me |
| 09:18:15 | <idnar> | Quadrescence: (also it's more typing) |
| 09:18:23 | <Quadrescence> | idnar: To the mathematician it looks neater. :< |
| 09:18:33 | <idnar> | Quadrescence: clearly I'm not a mathematician |
| 09:18:37 | <Quadrescence> | Haha |
| 09:18:40 | <Quadrescence> | Neither am I |
| 09:18:43 | <idnar> | Quadrescence: I think the irony here is that in Python, I would use a list comprehension instead of map() |
| 09:18:56 | <sbahra> | ACTION likes the book he is reading because you end up re-implementing things like iterate, map, etc... |
| 09:19:01 | <idnar> | and I'm not sure I can coherently explain why |
| 09:19:24 | <idnar> | I guess it's because you would usually need a lambda in python |
| 09:20:08 | <olsner> | yeah, lambdas seem overly verbose in python |
| 09:20:32 | <idnar> | well, I'd probably use a list comprehension instead of a lambda in Haskell, too |
| 09:21:04 | <idnar> | [foo x + 5 | x <- xs] seems nicer than map (\x -> foo x + 5) xs |
| 09:21:05 | <luqui> | ACTION too. I only use maps when the function has a nice pointfree form |
| 09:21:26 | <idnar> | but map(lambda x: foo(x) + 5, xs) is definitely awful compared with [foo(x) + 5 for x in xs] |
| 09:21:35 | <idnar> | even worse |
| 09:21:58 | <olsner> | if the function you apply is just a simple pointfree expression, all you're doing with a list comprehension is adding points |
| 09:21:59 | <idnar> | map(lambda x: foo(x) + 5, filter(lambda x: bar(x) < 5, xs)) compared with [foo(x) + 5 for x in xs if bar(x) < 5] |
| 09:22:09 | <idnar> | olsner: yeah |
| 09:22:26 | <luqui> | idnar, is that even right? doesn't it need to be map((lambda x: foo(x) + 5), xs) to keep it from tupling? |
| 09:22:41 | <luqui> | (not sure, haven't done much python) |
| 09:23:07 | <idnar> | luqui: no, if you want a tuple in a lambda "body", you need () around the tuple |
| 09:23:16 | <olsner> | I think lambdas bind closer than argument-list commas |
| 09:23:18 | <hml> | i'm baffled by this: |
| 09:23:20 | <hml> | trace :: String -> a -> a |
| 09:23:24 | <hml> | trace s x = unsafePerformIO (putStrLn s >> return x) |
| 09:23:25 | <luqui> | ok. |
| 09:23:27 | <olsner> | hml: magic :D |
| 09:23:30 | <hml> | so the point is that instead of writing x, which would only give the value of x, |
| 09:23:31 | <idnar> | >>> lambda x: 5, 6 |
| 09:23:32 | <idnar> | (<function <lambda> at 0x7fb8ec3f68c0>, 6) |
| 09:23:34 | <hml> | i wrote trace s x |
| 09:23:48 | <hml> | so in addition to returning the value of x |
| 09:23:54 | <hml> | it also prints out s ? |
| 09:24:01 | <lispy> | hml: yes |
| 09:24:09 | <rwbarton> | s will be printed the first time the value of x is demanded |
| 09:24:10 | <lispy> | hml: it has a side-effect |
| 09:24:13 | <olsner> | @quote trace |
| 09:24:13 | <lambdabot> | chromatic says: My productivity increased when Autrijus told me about Haskell's trace function. He called it a refreshing desert in the oasis of referential transparency. |
| 09:24:16 | <sbahra> | Why is id useful? |
| 09:24:47 | <luqui> | > let countTrue = length . filter id in countTrue [True,False,False,True,True,False,True] |
| 09:24:48 | <lambdabot> | 4 |
| 09:24:54 | <lispy> | sbahra: why is 0 useful in the presence of (+) ? |
| 09:24:56 | <rwbarton> | ACTION was also about to write "length . filter id" :) |
| 09:25:00 | <hml> | i don't see why trace would increase productivity, lol |
| 09:25:12 | <idnar> | what's the point of filter id? |
| 09:25:13 | <olsner> | useful debugging tool |
| 09:25:17 | <Quadrescence> | sbahra: When a function requires another function, but you just want a value, you use id |
| 09:25:23 | <idnar> | oh right, I see |
| 09:25:31 | <idnar> | I was thinking map id |
| 09:25:33 | <hml> | ACTION writes (1) flawless haskell code and (2) haskell code that doesnt compile |
| 09:25:42 | <luqui> | sbahra, id gets more and more useful as you write more abstract code |
| 09:25:48 | <lispy> | ACTION tries to darcs get cabal-install and notices that it's taking way too long. What's up with darcs.haskell.org? |
| 09:25:52 | <olsner> | hml: what other kinds of haskell code are there? :P |
| 09:26:04 | <idnar> | I guess the main thing about id is that it's useful if you need it :P |
| 09:26:10 | <luqui> | sbahra, because it is more mathematically important than practically important |
| 09:26:33 | <thoughtpolice> | lispy: it's finnicky it seems. it can take a while for e.g. ./darcs-all to run (if it even finishes, ever) in the GHC HEAD |
| 09:26:33 | <ayumilove1> | brb taking a break from fibonacci |
| 09:27:27 | <olsner> | thoughtpolice: shouldn't it be zomg fast now that you've switched ghc over to git? or maybe the switchover is still in-progress |
| 09:27:38 | <thoughtpolice> | olsner: darcs is still required |
| 09:27:45 | <thoughtpolice> | ghc switched over to git |
| 09:27:48 | <thoughtpolice> | not all the libraries |
| 09:27:55 | <olsner> | aah |
| 09:27:57 | <lispy> | It's not darcs |
| 09:28:04 | <lispy> | It's that darcs.haskell.org is being flaky |
| 09:28:04 | <Quadrescence> | sbahra: If I have f :: (Int -> Int) -> Int, or something, the (Int -> Int) probably signifies some function. If I already know the value, let's say v, of this function, then I can pass `id v' into it. |
| 09:28:27 | <idnar> | so they already switched? |
| 09:28:42 | <lispy> | idnar: not officialy, but I think someone put up a mirror |
| 09:28:51 | <thoughtpolice> | they haven't made the official switch |
| 09:28:57 | <thoughtpolice> | it's going to happen sometime before 6.10 |
| 09:29:00 | <lispy> | idnar: a swich is planned in about 4-5 weeks though |
| 09:29:03 | <thoughtpolice> | right now there's a mirror on darcs.haskell.org |
| 09:29:05 | <thoughtpolice> | and github |
| 09:29:36 | <thoughtpolice> | which are updated auto-magically |
| 09:29:36 | <paczesiowa> | Quadrescence: don't you mean const |
| 09:29:36 | <idnar> | ACTION takes a bash at Project Euler 23 again |
| 09:29:56 | <Quadrescence> | paczesiowa: Maybe. I'm pretending I know what I'm talking about. |
| 09:30:06 | <thoughtpolice> | lispy: imo the actual server probably has something to do with it; many times when I grab stuff it can go super fast (that goes for ./darcs-all too) |
| 09:30:11 | <thoughtpolice> | other times it slows to a crawl |
| 09:30:13 | <idnar> | const is sort of the opposite of id |
| 09:30:19 | <lispy> | thoughtpolice: right |
| 09:30:47 | <idnar> | @type swap id |
| 09:30:47 | <lambdabot> | Plugin `type' failed with: invalid ghci output: no type signature |
| 09:31:02 | <idnar> | uhm |
| 09:31:13 | <paczesiowa> | id is useful to write constrained versions of id |
| 09:31:24 | <lispy> | :t id id |
| 09:31:25 | <lambdabot> | forall a. a -> a |
| 09:31:26 | <sioraiocht> | :t flip id |
| 09:31:26 | <lambdabot> | forall b c. b -> (b -> c) -> c |
| 09:31:29 | <idnar> | flip! |
| 09:31:32 | <luqui> | Quadrescence, yeah, id v == v, so you probably didn't mean that |
| 09:31:32 | <idnar> | that's the one I wanted |
| 09:31:36 | <sioraiocht> | :) |
| 09:31:56 | <ayumilove1> | rwbarton I think part of the problem is that in ayumilove1's example "iterate (+1) 0", (+1) is written without lambda notation |
| 09:32:02 | <Quadrescence> | luqui: Probably not. I know what I mean, I just can't put it into words. :> |
| 09:32:10 | <ayumilove1> | what do you mean by lambda notation? |
| 09:32:11 | <paczesiowa> | > let id' = id :: Num a => a -> a in id' 2 |
| 09:32:12 | <lambdabot> | 2 |
| 09:32:17 | <paczesiowa> | > let id' = id :: Num a => a -> a in id' "" |
| 09:32:18 | <lambdabot> | add an instance declaration for (Num [Char]) |
| 09:32:18 | <lambdabot> | In the expression: let id'... |
| 09:32:19 | <rwbarton> | ayumilove1: \x -> x + 1 |
| 09:32:25 | <idnar> | @unpl flip id |
| 09:32:26 | <lambdabot> | (\ b c -> c b) |
| 09:32:28 | <thoughtpolice> | ayumilove1: for example, f = \x -> x*2 |
| 09:32:43 | <luqui> | > flip id 1 (+1) |
| 09:32:44 | <lambdabot> | 2 |
| 09:32:46 | <lispy> | man, cabal-install should come bundled with its deps for easy bootstrapping |
| 09:33:06 | <thoughtpolice> | lispy: that would be pretty nice. |
| 09:33:20 | <ayumilove1> | what does the slash do? before the x >>> example: \x |
| 09:33:24 | <luqui> | @unpl (+1) |
| 09:33:25 | <lambdabot> | (\ a -> a + 1) |
| 09:33:34 | <thoughtpolice> | imo cabal-install needs to come with GHC, it's just a matter if HQ wants to include zlib and http in source |
| 09:33:44 | <rwbarton> | "\x -> x + 1" means "the function which takes an argument x and returns x + 1" |
| 09:33:54 | <thoughtpolice> | ayumilove1: it's what makes it a 'lambda' |
| 09:33:59 | <thoughtpolice> | a lambda abstraction like that is a function |
| 09:34:13 | <thoughtpolice> | you can think of the \ as saying "it takes the parameters" and the -> designating the actual function |
| 09:34:25 | <rwbarton> | Right, \ is supposed to resemble the Greek letter lambda (λ) |
| 09:34:27 | <sioraiocht> | > (\x -> x + 1) 4 |
| 09:34:28 | <lambdabot> | 5 |
| 09:34:57 | <Quadrescence> | I think I might try project euler to get better with haskell |
| 09:35:07 | <Botje> | please do :) |
| 09:35:12 | <Botje> | i've learned a lot that way |
| 09:35:16 | <thoughtpolice> | in the very very very very few problems I did |
| 09:35:27 | <thoughtpolice> | I found you can come up with some pretty nice solutions, many very elegant |
| 09:36:13 | <Quadrescence> | Maybe I'll start with #201 |
| 09:36:14 | <Quadrescence> | :} |
| 09:36:30 | <thoughtpolice> | Quadrescence: one way I like to think I've gotten better, is taking every little misc. piece of code I find and running it, modifying it, examining it, etc. etc. |
| 09:36:47 | <thoughtpolice> | my ~/code/haskell/misc directory has a bunch of random stuff in there I've collected :) |
| 09:36:58 | <Quadrescence> | :)) |
| 09:37:15 | <ayumilove1> | what is the full link for this? ~/code/haskell/mis |
| 09:37:15 | <idnar> | man, what the *hell*; I just read http://www.haskell.org/haskellwiki/Talk:Euler_problems |
| 09:37:17 | <lambdabot> | Title: Talk:Euler problems - HaskellWiki |
| 09:37:18 | <Quadrescence> | I was playing with GHCi a little earlier, because I was frustrated with my program I'm working on. |
| 09:37:40 | <thoughtpolice> | ayumilove1: it's on my computer |
| 09:38:04 | <ayumilove1> | oh ok, thanks thoughtpolice and rwbarton for the lambda explanation :D newbie-friendly |
| 09:38:15 | <thoughtpolice> | np |
| 09:38:18 | <Quadrescence> | idnar: what? |
| 09:38:47 | <thoughtpolice> | hehe, that dir has everything in there though from sorting stuff to things that make GHC mad, like rwbarton's generics code that can't compile |
| 09:39:10 | <idnar> | Quadrescence: I'm just boggling at all the comments going "OMG YOU ARE RUINING PROJECT EULER FOR EVERYONE DELETE THESE PAGES *NOW*!#%!#%!#%" |
| 09:39:10 | <thoughtpolice> | i pifler from everywhere. :) |
| 09:39:43 | <rwbarton> | thoughtpolice: my what? :) |
| 09:39:45 | <dobblego> | haha, is that still going? |
| 09:40:00 | <thoughtpolice> | rwbarton: you were the one with the generics code that exposed a bug in 6.8.3's code generator weren't you? |
| 09:40:02 | <Quadrescence> | idnar: Silly. |
| 09:40:12 | <rwbarton> | uh... not that I recall :P |
| 09:40:36 | <thoughtpolice> | hm must've mistaken names :p |
| 09:40:44 | <Quadrescence> | idnar: If someone doesn't want PE to be spoiled for him/herself, then he/shouldn't be looking online. |
| 09:40:45 | <idnar> | maybe I should just give up on Project Euler, though; it seem to be a lot more about maths than programming |
| 09:41:44 | <Quadrescence> | idnar: Give me an example problem that seems too "mathy" |
| 09:42:04 | <DrSyzygy> | I think the people who complain don't do it because they might be spoiled, but because the publication disrupts the Project Euler subculture. |
| 09:42:09 | <ayumilove1> | <rwbarton> ayumilove1: Let's try to write a function fib x y = [x, y, x+y, y+(x+y), ...] that is it's like a fibonacci sequence except it starts with x, y instead of 0, 1 |
| 09:42:09 | <ayumilove1> | <rwbarton> Ok? |
| 09:42:16 | <idnar> | Quadrescence: well, for example, I'm on problem 23 at the moment |
| 09:42:19 | <ayumilove1> | write a new function? |
| 09:42:22 | <ayumilove1> | o_o |
| 09:42:34 | <DrSyzygy> | And I can believe and agree with that - I'm not certain that I think it merits striking it from the HaskellWiki though... |
| 09:43:03 | <rwbarton> | ayumilove1: It'll be easier |
| 09:43:24 | <Quadrescence> | DrSyzygy: Disrupts the subculture? How? |
| 09:43:26 | <idnar> | Quadrescence: I don't see any way to solve it in a reasonable amount of time given the knowledge I have of the mathematical properties of abundant numbers (that is to say, basically nothing) |
| 09:43:27 | <ayumilove1> | could you guide me on how to write that? |
| 09:43:42 | <rwbarton> | OK. Do you know about the : operator? |
| 09:43:48 | <rwbarton> | > 3 : [4,4,4,4,4] |
| 09:43:49 | <lambdabot> | [3,4,4,4,4,4] |
| 09:43:59 | <DrSyzygy> | Quadrescence: Because it opens up for people to "solve by search engine", thus making "being able to solve" and thus getting access to the solution forum less of an exclusive action. |
| 09:44:06 | <Quadrescence> | idnar: Since they define what an abundant number is, they probably assume you don't know any properties. |
| 09:44:25 | <idnar> | Quadrescence: they define what it is, yes, but that's not enough to limit the problem space |
| 09:44:33 | <idnar> | Quadrescence: I dunno, maybe I'm just missing something here |
| 09:44:36 | <Quadrescence> | Let me read it in full. |
| 09:44:59 | <ayumilove1> | yeah i know about that, basics ^_^ like 3:4:4 = [3,4,4] |
| 09:45:09 | <DrSyzygy> | > 3:4:4 |
| 09:45:09 | <Heffalump> | no, 3:4:4:[] = [3,4,4] |
| 09:45:10 | <lambdabot> | add an instance declaration for (Num [t]) |
| 09:45:10 | <idnar> | Quadrescence: but I implemented a "brute-force" solution that doesn't take into account any mathematical knowhow, and it wasn't going to run to completion any time soon |
| 09:45:14 | <DrSyzygy> | Thought so. |
| 09:45:52 | <rwbarton> | OK. So we want fib x y to return a list that starts with x, so let's begin by writing fib x y = x : ... |
| 09:46:08 | <ayumilove1> | the weird thing is i could not put the number 3 at the back of the other number in the list (example: 3:4:4:[] -> [4,4,3] |
| 09:46:33 | <ayumilove1> | fib x y = x : ... ok |
| 09:46:35 | <idnar> | > 3:4:4:[] |
| 09:46:37 | <lambdabot> | [3,4,4] |
| 09:46:38 | <rwbarton> | (Why is that weird? 3:4:4:[] can't be both [3,4,4] and [4,4,3]) |
| 09:46:51 | <ayumilove1> | the order of the number o_o |
| 09:47:27 | <rwbarton> | OK. So what do we know about what's supposed to go in the ...? It's supposed to be another fibonacci-like sequence, but it starts with different values |
| 09:47:52 | <ayumilove1> | yeah |
| 09:48:09 | <ayumilove1> | it would keep adding the 2 numbers together |
| 09:48:10 | <Quadrescence> | idnar: Have you discounted prime numbers? |
| 09:48:13 | <rwbarton> | So, we just need an appropriate call to fib |
| 09:48:26 | <ayumilove1> | ok |
| 09:48:26 | <rwbarton> | what are the first two numbers of the rest of the sequence? |
| 09:48:29 | <DrSyzygy> | ayumilove1: Try something like > let (.:.) a as = as ++ [a] |
| 09:48:45 | <ayumilove1> | the first 2 numbers 0 and 1? |
| 09:48:45 | <DrSyzygy> | No guarantees for efficiency. |
| 09:49:06 | <rwbarton> | No, I mean we want fib x y = [x, y, x+y, y+(x+y), ...] |
| 09:49:24 | <rwbarton> | And we want to write that as x : fib (...) (...) |
| 09:49:48 | <ayumilove1> | oh |
| 09:50:13 | <sioraiocht> | let fib x y = x : y : zipWith (+) tail fib in fib |
| 09:50:24 | <sioraiocht> | let fib x y = x : y : zipWith (+) tail fib in fib 1 1 |
| 09:50:25 | <rwbarton> | sioraiocht: I don't think this is helpful :P |
| 09:50:25 | <Botje> | fib x y = x : fib y (x+y) |
| 09:50:28 | <Botje> | yay! |
| 09:50:36 | <rwbarton> | Botje: yes, I know *you* know :P |
| 09:50:36 | <pozic> | Is there anyone who used HList? The Hackage package does not export firstLabel so the examples from the paper also don't work. |
| 09:50:56 | <sioraiocht> | rwbarton: then I don't understand h the problem, i guess? |
| 09:51:14 | <rwbarton> | sioraiocht: The problem is that ayumilove1 is trying to figure out how to do this, not me :) |
| 09:51:28 | <ayumilove1> | fib x y = x : fib y (x+y) how does this work o_o ? |
| 09:52:07 | <luqui> | ayumilove1, you can expand it yourself |
| 09:52:10 | <pozic> | ayumilove1: plug in some numbers and try it. |
| 09:52:14 | <ayumilove1> | ok |
| 09:52:33 | <ayumilove1> | fib 0 1 = 1 : fib 1 (0+1) |
| 09:52:49 | <sioraiocht> | rwbarton: ohhh, okay |
| 09:52:57 | <rwbarton> | sioraiocht: np |
| 09:53:02 | <luqui> | ayumilove1, not quite =P |
| 09:53:17 | <ayumilove1> | >.< ??? |
| 09:53:25 | <luqui> | ayumilove1, fib 0 1 = 0 : fib 1 (0+1) |
| 09:53:28 | <sioraiocht> | wow, my solution is SLOW |
| 09:54:10 | <luqui> | sioraiocht, I'm guessing you implemented the zip solution, but put it in a function so it doesn't memoize... |
| 09:54:28 | <sioraiocht> | luqui: yeah |
| 09:54:28 | <ayumilove1> | luqui, fib 0 1 = 0 : fib 1 (0+1) isnt that same like mine? |
| 09:54:54 | <luqui> | you said 1 : ... |
| 09:55:03 | <luqui> | minor error |
| 09:55:15 | <ayumilove1> | oh haha |
| 09:55:20 | <ayumilove1> | ok ok newbie mistake ^_^ |
| 09:55:29 | <pozic> | ones and zero all the same, except to a computer ;) |
| 09:55:34 | <pozic> | zeros* |
| 09:55:40 | <ayumilove1> | how do i make the font size of my xchat become bigger? |
| 09:55:49 | <ayumilove1> | its too small, straining the eyes |
| 09:56:21 | <luqui> | right click -> settings |
| 09:56:25 | <cjs> | It seems odd to me that there's a liftIO, but no liftError :: (Error l, Monad m) => Either l r -> ErrorT l m r |
| 09:57:04 | <luqui> | yeah, that would be a useful function I think... |
| 09:57:11 | <ayumilove1> | thanks luqui |
| 09:57:16 | <ayumilove1> | now its much better =D, big fonts |
| 09:58:28 | <ayumilove1> | fib 0 1 = 0 : fib 1 (0+1), if the user wants Nth Fibonacci number, so how do i stop the loop |
| 09:58:42 | <ayumilove1> | it will keep going on and on right o_o |
| 09:58:51 | <Deewiant> | > [5,6,7,8] !! 2 |
| 09:58:51 | <lambdabot> | 7 |
| 09:58:57 | <Botje> | you just index the list it generates |
| 09:59:05 | <sioraiocht> | take 5 [1..10] |
| 09:59:05 | <Botje> | if you don't ask for the rest it won't make it |
| 09:59:16 | <sioraiocht> | > take 5 [1..10] |
| 09:59:17 | <lambdabot> | [1,2,3,4,5] |
| 09:59:23 | <rwbarton> | > [0..] |
| 09:59:24 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,2... |
| 09:59:28 | <rwbarton> | > [0..] !! 123 |
| 09:59:29 | <lambdabot> | 123 |
| 09:59:33 | <ayumilove1> | what does the !! exclamation mark do |
| 09:59:43 | <luqui> | it's just list index |
| 09:59:55 | <sioraiocht> | [0..] !! 0 |
| 09:59:57 | <Deewiant> | (list !! n) takes the nth element of list, starting from 0 |
| 09:59:59 | <sioraiocht> | > [0..] !! 0 |
| 09:59:59 | <luqui> | > [5,6,2,4,5,7] !! 3 -- the 3rd (0-based) element |
| 10:00:00 | <lambdabot> | 0 |
| 10:00:00 | <lambdabot> | 4 |
| 10:01:17 | <ayumilove1> | ok thanks luqui for explaining =D |
| 10:01:18 | <wolverian> | it's !! because the operation is O(n), i.e. slow :) |
| 10:01:24 | <wolverian> | (it's a warning!) |
| 10:01:52 | <opqdonut> | yeah :) |
| 10:02:01 | <Botje> | ayumilove1: have you read through YAHT or somesuch? |
| 10:02:09 | <ayumilove1> | what is a yaht? |
| 10:02:15 | <Botje> | @where yaht |
| 10:02:16 | <lambdabot> | PDF: http://darcs.haskell.org/yaht/yaht.pdf Wikibook: http://en.wikibooks.org/wiki/Haskell/YAHT |
| 10:02:17 | <opqdonut> | it's !! so that you'd ask what ! is |
| 10:02:17 | <ivanm> | Yet Another Haskell Tutorial |
| 10:02:27 | <Botje> | it's a good starting point to learn haskell |
| 10:03:34 | <ayumilove1> | thanks botje |
| 10:04:15 | <ayumilove1> | > |
| 10:04:15 | <ayumilove1> | fib x y = x : fib y (x+y) |
| 10:04:56 | <ayumilove1> | i place this code |
| 10:04:57 | <ayumilove1> | fib x y = x : fib y (x+y) into my notepad and ran it, it loops non-stop o_o |
| 10:05:11 | <luqui> | printing larger and larger numbers I suspect |
| 10:05:14 | <ayumilove1> | do i need to create another function to stop it |
| 10:05:15 | <rwbarton> | Yes, but it produces output right? |
| 10:05:18 | <ayumilove1> | yeah |
| 10:05:24 | <Botje> | ayumilove1: well, what did you expect? |
| 10:05:25 | <agh9082> | Hey you are English ?? |
| 10:05:25 | <lemming5120> | Hey you are English ?? |
| 10:05:25 | <agh7361> | Hey you are English ?? |
| 10:05:25 | <agh5147> | Hey you are English ?? |
| 10:05:25 | <lemming8790> | Hey you are English ?? |
| 10:05:25 | <agh4771> | Hey you are English ?? |
| 10:05:25 | <agh189> | Hey you are English ?? |
| 10:05:25 | <lemming8845> | Hey you are English ?? |
| 10:05:25 | <lemming6836> | Hey you are English ?? |
| 10:05:25 | <lemming8886> | Hey you are English ?? |
| 10:05:25 | <agh6642> | Hey you are English ?? |
| 10:05:25 | <lemming5548> | Hey you are English ?? |
| 10:05:25 | <lemming5120> | Hey you are English ?? |
| 10:05:25 | <agh9082> | Hey you are English ?? |
| 10:05:25 | <lemming8790> | Hey you are English ?? |
| 10:05:25 | <agh5147> | Hey you are English ?? |
| 10:05:25 | <lemming5548> | Hey you are English ?? |
| 10:05:26 | <agh6642> | Hey you are English ?? |
| 10:05:26 | <agh7361> | Hey you are English ?? |
| 10:05:26 | <agh4771> | Hey you are English ?? |
| 10:05:26 | <agh189> | Hey you are English ?? |
| 10:05:26 | <lemming8845> | Hey you are English ?? |
| 10:05:26 | <lemming6836> | Hey you are English ?? |
| 10:05:26 | <lemming8886> | Hey you are English ?? |
| 10:05:26 | <agh9082> | Hey you are English ?? |
| 10:05:26 | <lemming5120> | Hey you are English ?? |
| 10:05:26 | <lemming8845> | Hey you are English ?? |
| 10:05:26 | <agh189> | Hey you are English ?? |
| 10:05:26 | <lemming8886> | Hey you are English ?? |
| 10:05:26 | <agh4771> | Hey you are English ?? |
| 10:05:26 | <lemming6836> | Hey you are English ?? |
| 10:05:26 | <lemming8790> | Hey you are English ?? |
| 10:05:26 | <agh5147> | Hey you are English ?? |
| 10:05:26 | <lemming5548> | Hey you are English ?? |
| 10:05:27 | <agh6642> | Hey you are English ?? |
| 10:05:27 | <agh9164> | Hey you are English ?? |
| 10:05:27 | <agh9164> | Hey you are English ?? |
| 10:05:27 | <agh9164> | Hey you are English ?? |
| 10:05:27 | <agh9082> | Hey you are English ?? |
| 10:05:27 | <lemming5120> | Hey you are English ?? |
| 10:05:27 | <agh9082> | Hey you are English ?? |
| 10:05:27 | <lemming8790> | Hey you are English ?? |
| 10:05:27 | <lemming8790> | Hey you are English ?? |
| 10:05:27 | <agh189> | Hey you are English ?? |
| 10:05:28 | <lemming8845> | Hey you are English ?? |
| 10:05:28 | <lemming6836> | Hey you are English ?? |
| 10:05:28 | <lemming8886> | Hey you are English ?? |
| 10:05:28 | <lemming5548> | Hey you are English ?? |
| 10:05:28 | <agh5147> | Hey you are English ?? |
| 10:05:28 | <agh5147> | Hey you are English ?? |
| 10:05:28 | <lemming5120> | Hey you are English ?? |
| 10:05:28 | <agh9082> | Hey you are English ?? |
| 10:05:28 | <lemming8790> | Hey you are English ?? |
| 10:05:28 | <agh5147> | Hey you are English ?? |
| 10:05:28 | <agh4771> | Hey you are English ?? |
| 10:05:28 | <agh189> | Hey you are English ?? |
| 10:05:28 | <agh189> | Hey you are English ?? |
| 10:05:28 | <agh189> | Hey you are English ?? |
| 10:05:28 | <lemming5120> | Hey you are English ?? |
| 10:05:28 | <agh9082> | Hey you are English ?? |
| 10:05:28 | <lemming8790> | Hey you are English ?? |
| 10:05:28 | <lemming5120> | Hey you are English ?? |
| 10:05:28 | <agh5147> | Hey you are English ?? |
| 10:05:28 | <lemming8845> | Hey you are English ?? |
| 10:05:28 | <lemming8845> | Hey you are English ?? |
| 10:05:28 | <lemming8845> | Hey you are English ?? |
| 10:05:28 | <lemming8886> | Hey you are English ?? |
| 10:05:28 | <lemming8886> | Hey you are English ?? |
| 10:05:28 | <lemming8886> | Hey you are English ?? |
| 10:05:28 | <lemming6836> | Hey you are English ?? |
| 10:05:28 | <lemming6836> | Hey you are English ?? |
| 10:05:28 | <lemming6836> | Hey you are English ?? |
| 10:05:28 | <agh4771> | Hey you are English ?? |
| 10:05:28 | <agh4771> | Hey you are English ?? |
| 10:05:28 | <agh4771> | Hey you are English ?? |
| 10:05:28 | <lemming5548> | Hey you are English ?? |
| 10:05:28 | <lemming5548> | Hey you are English ?? |
| 10:05:28 | <lemming5548> | Hey you are English ?? |
| 10:05:30 | <agh9663> | Hey you are English ?? |
| 10:05:30 | <agh9663> | Hey you are English ?? |
| 10:05:30 | <agh9663> | Hey you are English ?? |
| 10:05:30 | <agh9663> | Hey you are English ?? |
| 10:05:31 | <agh9663> | Hey you are English ?? |
| 10:05:31 | <luqui> | oh my |
| 10:05:32 | <agh9082> | Hey you are English ?? |
| 10:05:32 | <lemming5120> | Hey you are English ?? |
| 10:05:32 | <agh9082> | Hey you are English ?? |
| 10:05:32 | <lemming8790> | Hey you are English ?? |
| 10:05:32 | <agh5147> | Hey you are English ?? |
| 10:05:32 | <agh5147> | Hey you are English ?? |
| 10:05:32 | <lemming5120> | Hey you are English ?? |
| 10:05:32 | <lemming8790> | Hey you are English ?? |
| 10:05:32 | <agh7361> | Hey you are English ?? |
| 10:05:32 | <agh7361> | Hey you are English ?? |
| 10:05:32 | <agh7361> | Hey you are English ?? |
| 10:05:32 | <agh7361> | Hey you are English ?? |
| 10:05:32 | <agh7361> | Hey you are English ?? |
| 10:05:32 | <agh4771> | Hey you are English ?? |
| 10:05:32 | <agh189> | Hey you are English ?? |
| 10:05:32 | <lemming8845> | Hey you are English ?? |
| 10:05:32 | <lemming6836> | Hey you are English ?? |
| 10:05:32 | <lemming8886> | Hey you are English ?? |
| 10:05:32 | <lemming8845> | Hey you are English ?? |
| 10:05:32 | <agh189> | Hey you are English ?? |
| 10:05:32 | <Botje> | wtf |
| 10:05:32 | <lemming8886> | Hey you are English ?? |
| 10:05:32 | <lemming5548> | Hey you are English ?? |
| 10:05:32 | <lemming5548> | Hey you are English ?? |
| 10:05:32 | <agh4771> | Hey you are English ?? |
| 10:05:33 | <lemming6836> | Hey you are English ?? |
| 10:05:33 | <agh9082> | Hey you are English ?? |
| 10:05:33 | <lemming5548> | Hey you are English ?? |
| 10:05:33 | <lemming8790> | Hey you are English ?? |
| 10:05:33 | <agh5147> | Hey you are English ?? |
| 10:05:33 | <agh9663> | Hey you are English ?? |
| 10:05:33 | <agh7361> | Hey you are English ?? |
| 10:05:33 | <lemming5120> | Hey you are English ?? |
| 10:05:34 | <luqui> | chanserv!!! |
| 10:05:34 | <agh4771> | Hey you are English ?? |
| 10:05:34 | <agh189> | Hey you are English ?? |
| 10:05:34 | <lemming8845> | Hey you are English ?? |
| 10:05:34 | <lemming6836> | Hey you are English ?? |
| 10:05:34 | <lemming8886> | Hey you are English ?? |
| 10:05:35 | <agh9082> | Hey you are English ?? |
| 10:05:35 | <lemming8790> | Hey you are English ?? |
| 10:05:35 | <agh9663> | Hey you are English ?? |
| 10:05:35 | <agh7361> | Hey you are English ?? |
| 10:05:35 | <lemming5548> | Hey you are English ?? |
| 10:05:35 | <agh5147> | Hey you are English ?? |
| 10:05:35 | <lemming5120> | Hey you are English ?? |
| 10:05:36 | <agh4771> | Hey you are English ?? |
| 10:05:36 | <agh189> | Hey you are English ?? |
| 10:05:36 | <lemming8845> | Hey you are English ?? |
| 10:05:36 | <lemming6836> | Hey you are English ?? |
| 10:05:36 | <lemming8886> | Hey you are English ?? |
| 10:05:37 | <agh6642> | Hey you are English ?? |
| 10:05:37 | <agh6642> | Hey you are English ?? |
| 10:05:37 | <agh6642> | Hey you are English ?? |
| 10:05:37 | <agh6642> | Hey you are English ?? |
| 10:05:37 | <agh6642> | Hey you are English ?? |
| 10:05:37 | <agh9164> | Hey you are English ?? |
| 10:05:37 | <agh9164> | Hey you are English ?? |
| 10:05:37 | <agh9164> | Hey you are English ?? |
| 10:05:37 | <agh9164> | Hey you are English ?? |
| 10:05:37 | <agh9164> | Hey you are English ?? |
| 10:05:37 | <agh9082> | Hey you are English ?? |
| 10:05:37 | <agh6642> | Hey you are English ?? |
| 10:05:37 | <agh9164> | Hey you are English ?? |
| 10:05:37 | <lemming5120> | Hey you are English ?? |
| 10:05:37 | <agh5147> | Hey you are English ?? |
| 10:05:37 | <agh9663> | Hey you are English ?? |
| 10:05:37 | <agh7361> | Hey you are English ?? |
| 10:05:37 | <lemming5548> | Hey you are English ?? |
| 10:05:39 | <agh9164> | Hey you are English ?? |
| 10:05:39 | <agh7361> | Hey you are English ?? |
| 10:05:43 | <opqdonut> | ops! |
| 10:05:44 | <Zao> | cute. |
| 10:05:46 | <ayumilove1> | wow what hapepn just now |
| 10:05:58 | <ayumilove1> | hack? |
| 10:06:00 | <ayumilove1> | o_O |
| 10:06:04 | <luqui> | I've never seen that before. some kind of evil bot |
| 10:06:06 | <sioraiocht> | > let fib x y = x: fib y (x+y) in take 10 (fib 4 5) |
| 10:06:07 | <opqdonut> | botnet, probably |
| 10:06:07 | <lambdabot> | [4,5,9,14,23,37,60,97,157,254] |
| 10:06:09 | <luqui> | or army of bots |
| 10:06:10 | <rwbarton> | ... You said you wanted a list of fibonacci numbers. If you just want n of them, you can use take n |
| 10:06:17 | <lemming7597> | Hey you are English ?? |
| 10:06:17 | <lemming469> | Hey you are English ?? |
| 10:06:18 | <lemming7597> | Hey you are English ?? |
| 10:06:18 | <lemming469> | Hey you are English ?? |
| 10:06:20 | <lemming7597> | Hey you are English ?? |
| 10:06:20 | <lemming469> | Hey you are English ?? |
| 10:06:21 | <lemming7597> | Hey you are English ?? |
| 10:06:21 | <lemming469> | Hey you are English ?? |
| 10:06:22 | <Deewiant> | @where ops |
| 10:06:22 | <lambdabot> | shapr Cale glguy dons sjanssen sorear dcoutts Saizan allbery_b dibblego conal Phillipa bos arjanb psnl lispy xerox vincenz davidhouse Heffalump kosmikus wli Pseudonym Igloo musasabi quicksilver |
| 10:06:22 | <lemming7597> | Hey you are English ?? |
| 10:06:22 | <lemming469> | Hey you are English ?? |
| 10:06:37 | <sioraiocht> | oh dear |
| 10:06:44 | <opqdonut> | indeed |
| 10:06:45 | <Zao> | ACTION hugs Starnes |
| 10:06:55 | <lemming9309> | Hey you are English ?? |
| 10:06:55 | <lemming8981> | Hey you are English ?? |
| 10:06:55 | <lemming2788> | Hey you are English ?? |
| 10:06:57 | <lemming2788> | Hey you are English ?? |
| 10:06:57 | <lemming9309> | Hey you are English ?? |
| 10:06:57 | <lemming8981> | Hey you are English ?? |
| 10:06:58 | <lemming17> | Hey you are English ?? |
| 10:06:59 | <lemming9309> | Hey you are English ?? |
| 10:06:59 | <lemming7597> | Hey you are English ?? |
| 10:06:59 | <lemming469> | Hey you are English ?? |
| 10:06:59 | <lemming8981> | Hey you are English ?? |
| 10:06:59 | <lemming2788> | Hey you are English ?? |
| 10:07:26 | <ayumilove1> | Igloo is a haskell staff? |
| 10:07:33 | <ayumilove1> | or a bot too |
| 10:07:47 | <Heffalump> | Igloo is a person :-) |
| 10:07:49 | <luqui> | no, Igloo is not a bot |
| 10:07:58 | <Igloo> | An op in #haskell |
| 10:08:03 | <luqui> | as far as I know :-) |
| 10:08:53 | <Heffalump> | well, he didn't look like a bot when I saw him on Friday.. |
| 10:09:24 | <idnar> | is there a more memory-friendly way to do nub . sort? |
| 10:09:40 | <Botje> | map head . group . sort |
| 10:09:41 | <Deewiant> | sort . nub? |
| 10:09:51 | <ayumilove1> | an op? |
| 10:09:53 | <idnar> | Deewiant: that's not the same thing, is it? |
| 10:09:56 | <Heffalump> | nub is silly if you'll be sorting |
| 10:10:01 | <luqui> | idnar, Set.toList . Set.fromList |
| 10:10:08 | <Deewiant> | @check 1 == 1 -- broken? |
| 10:10:09 | <luqui> | (where Set is Data.Set) |
| 10:10:09 | <lambdabot> | Not in scope: `myquickcheck'' |
| 10:10:12 | <Deewiant> | meh |
| 10:10:13 | <Heffalump> | since squeezing adjacent duplicates is all you need |
| 10:10:24 | <idnar> | Heffalump: I thought that's what nub did |
| 10:10:25 | <Deewiant> | idnar: it should be the same thing |
| 10:10:30 | <idnar> | oh wait |
| 10:10:34 | <Heffalump> | no, it does a quadratic scan |
| 10:10:34 | <Deewiant> | > nub [1,2,1] |
| 10:10:35 | <lambdabot> | [1,2] |
| 10:10:37 | <idnar> | right |
| 10:11:02 | <Deewiant> | map head . group is the faster nub, for when you have an Ord instance |
| 10:11:06 | <idnar> | so I could just do nub, I don't need the nub |
| 10:11:07 | <nicoo1101> | What is lemming ?? |
| 10:11:09 | <Deewiant> | + .sort |
| 10:11:14 | <nicoo1101> | Clones ?? :o |
| 10:11:14 | <idnar> | *the sort |
| 10:11:17 | <idnar> | except maybe I do need the sort |
| 10:11:27 | <idnar> | let me try Botje's one |
| 10:11:32 | <Deewiant> | if you can sort, you should use map head.group.sort |
| 10:11:56 | <Deewiant> | nub is only for when you don't have an Ord instance or when you care more about typing fast than running fast :-P |
| 10:12:04 | <Zao> | I'd say that lemming is someone that managed to embed IO in STM. |
| 10:12:19 | <luqui> | lol |
| 10:13:20 | <pozic> | Why would a botnet pick #haskell to gather? |
| 10:13:34 | <idnar> | is there a shorter way to write zip [1..] xs? |
| 10:13:44 | <rwbarton> | @users |
| 10:13:44 | <lambdabot> | Maximum users seen in #haskell: 490, currently: 452 (92.2%), active: 26 (5.8%) |
| 10:13:45 | <Botje> | isn't it short enough? :) |
| 10:13:49 | <luqui> | pozic, what do you mean gather? |
| 10:14:02 | <pozic> | luqui: to meet |
| 10:14:02 | <idnar> | Botje: I was just curious, since python has enumerato() |
| 10:14:02 | <Zao> | pozic: Relatively high population, many snubbed trolls. |
| 10:14:05 | <ayumilove1> | could someone check this out ? http://hpaste.org/9509 |
| 10:14:05 | <idnar> | err, enumerate() |
| 10:14:15 | <ayumilove1> | why is it not working o_o ? |
| 10:14:32 | <pozic> | Zao: they could also go to #nobodyishere. |
| 10:14:36 | <Botje> | ayumilove1: uh, because x and y aren't defined? |
| 10:14:49 | <luqui> | > length "zip [0..]" `compare` length "enumerate" |
| 10:14:49 | <Botje> | pozic: you think spammers are THAT considerate? :) |
| 10:14:50 | <lambdabot> | EQ |
| 10:14:56 | <Botje> | lol |
| 10:15:06 | <ayumilove1> | Botje: so i replace x and y with 0 and 1 ? |
| 10:15:17 | <Botje> | but only in "in take n (fib x y)" |
| 10:15:19 | <Botje> | yes |
| 10:15:19 | <Deewiant> | > length "zip[0..]" `compare` length "enumerate" |
| 10:15:20 | <lambdabot> | LT |
| 10:15:22 | <int-e> | ayumilove1: let (fib x y) <-- those parentheses are too much |
| 10:15:28 | <pozic> | Botje: it seems a waste of CPU time to let the bots go to places where they will be kicked anyway. |
| 10:15:43 | <Botje> | i don't think those guys care |
| 10:15:48 | <Botje> | they just want to annoy at all costs |
| 10:16:06 | <pozic> | Botje: they don't earn money by annoying, or do they? |
| 10:16:06 | <luqui> | ACTION can't fathom what other goal that would have accomplished |
| 10:16:10 | <ayumilove1> | thanks guys |
| 10:16:12 | <ayumilove1> | it work snow |
| 10:16:16 | <ayumilove1> | it works now* |
| 10:16:18 | <ayumilove1> | =D |
| 10:16:33 | <Botje> | all of the agh* ones were from the same host in .pl |
| 10:16:44 | <idnar> | pozic: I don't think they're trying to earn money :P |
| 10:16:45 | <nicoo1101> | I speack French x) I don't uderstand |
| 10:18:16 | <ayumilove1> | http://hpaste.org/9509#a2 (correction) ^_^ |
| 10:18:52 | <ayumilove1> | kinda fun to do learn haskell in irc |
| 10:19:05 | <luqui> | s/haskell// |
| 10:19:12 | <int-e> | ayumilove1: now why don't you let it return an infinite list? |
| 10:20:03 | <ayumilove1> | why i dont o_o |
| 10:20:09 | <ayumilove1> | it will not stop? |
| 10:20:36 | <ayumilove1> | int-e: is this message in red |
| 10:20:44 | <pozic> | ayumilove1: int-e means that you can delay that decision to a later point. |
| 10:20:49 | <Deewiant> | > let fibonacci = let fib x y = x : fib y (x+y) in fib 0 1 in take 20 fibonacci |
| 10:20:49 | <int-e> | you can write take 10 fibs where you need it. |
| 10:20:50 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181] |
| 10:21:17 | <pozic> | ayumilove1: so the function can return an infinite number of values, but some other logic will decide how much you actually need. |
| 10:21:36 | <thoughtpolice> | ayumilove1: a particularly nice thing about haskell is that it is very lazy. nothing is evaluated until it is needed, so infinite lists are practical |
| 10:21:37 | <int-e> | ayumilove1: it's not red, but it's hilighted, yes. (depends on the IRC client) |
| 10:21:47 | <pozic> | ayumilove1: (and thus will be computed) |
| 10:21:48 | <ayumilove1> | i written it as n fibs so the user could input different n |
| 10:21:58 | <ayumilove1> | so is my function lazy? |
| 10:22:10 | <ayumilove1> | i do not know how haskell says its functions are lazy o_o |
| 10:22:18 | <thoughtpolice> | ayumilove1: everything is lazy by default |
| 10:22:27 | <thoughtpolice> | > [1..] |
| 10:22:28 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,... |
| 10:22:40 | <ayumilove1> | so the dot dot dot = lazy? |
| 10:22:40 | <luqui> | > let x = 1:x in x |
| 10:22:41 | <lambdabot> | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... |
| 10:22:51 | <thoughtpolice> | ayumilove1: no, that specifies a range |
| 10:22:53 | <luqui> | ayumilove1, that's lambdabot cutting off the output |
| 10:22:55 | <thoughtpolice> | > [1..10] |
| 10:22:57 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10] |
| 10:23:08 | <Deewiant> | > [1,undefined] |
| 10:23:09 | <lambdabot> | [1,Exception: Prelude.undefined |
| 10:23:11 | <Deewiant> | > head [1,undefined] |
| 10:23:11 | <luqui> | what lambdabot does, more or less, is: |
| 10:23:12 | <lambdabot> | 1 |
| 10:23:22 | <ayumilove1> | but w[1..10] << how is this define as lazy? |
| 10:23:24 | <luqui> | > take 80 (show [1..]) ++ "..." |
| 10:23:26 | <lambdabot> | "[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28... |
| 10:23:34 | <luqui> | > take 30 (show [1..]) ++ "..." |
| 10:23:35 | <lambdabot> | "[1,2,3,4,5,6,7,8,9,10,11,12,13..." |
| 10:23:39 | <thoughtpolice> | ayumilove1: you don't need to expliclty specify something as lazy |
| 10:23:44 | <int-e> | ayumilove1: what lambdabot does there is, essentially, take 76 (show result) ++ "..." |
| 10:23:46 | <thoughtpolice> | *all* values are lazy by default |
| 10:24:10 | <ayumilove1> | sorry, i still don't get the lazy part |
| 10:24:19 | <thoughtpolice> | ayumilove1: for example, the value 'undefined' is just that: undefined. if you try to use it in any meaningful way |
| 10:24:19 | <Deewiant> | > const [1..] 5 -- would loop forever if [1..] were evaluated |
| 10:24:20 | <lambdabot> | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,... |
| 10:24:22 | <thoughtpolice> | it will throw an error |
| 10:24:27 | <thoughtpolice> | > undefined |
| 10:24:28 | <lambdabot> | Exception: Prelude.undefined |
| 10:24:33 | <thoughtpolice> | ^^ see? |
| 10:24:48 | <int-e> | > let fibs = fib 0 1; fib x y = x : fib y (x+y) in take 10 fibs -- even though fibs is an infinite list, taking a finite prefix of that list terminates |
| 10:24:49 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34] |
| 10:24:51 | <thoughtpolice> | now, if you don't try to use it or don't use it in a meaningful way |
| 10:24:53 | <int-e> | that's laziness. |
| 10:24:53 | <thoughtpolice> | it doesn't matter |
| 10:25:02 | <int-e> | or an effect of laziness |
| 10:25:18 | <thoughtpolice> | for example, the 'const' function takes two values, and it always returns the first value |
| 10:25:24 | <thoughtpolice> | no matter what |
| 10:25:27 | <thoughtpolice> | > const 1 undefined |
| 10:25:28 | <lambdabot> | 1 |
| 10:25:32 | <ayumilove1> | thoughtpolice: underfined?? |
| 10:25:48 | <thoughtpolice> | in the above, the 'undefined' value is not used |
| 10:25:51 | <thoughtpolice> | so it is not evaluated |
| 10:25:54 | <luqui> | undefined means "die horribly if you try to evaluate this" |
| 10:25:54 | <thoughtpolice> | so no error is ever thrown |
| 10:26:05 | <Darkness3477> | Hi all, I've decided to have another play around with Haskell. Any suggestions on a good ide? Am using windows at the moment, but usually am on a linux distro |
| 10:26:25 | <thoughtpolice> | Darkness3477: there is a haskell IDE you might be interested in |
| 10:26:28 | <thoughtpolice> | http://leksah.org |
| 10:26:29 | <lambdabot> | Title: Leksah - Haskell IDE in Haskell |
| 10:26:30 | <luqui> | uh... ide? Apparently Visual Haskell is a good bad ide |
| 10:26:58 | <Darkness3477> | Thanks for the link =] |
| 10:27:00 | <thoughtpolice> | ayumilove1: undefined means just that, undefined. it has no meaningful value, for example, what does '1+undefined' mean? |
| 10:27:11 | <idnar> | uhm |
| 10:27:20 | <rwbarton> | Darkness3477: a lot of people just use emacs with haskell-mode. It's quite convenient if you're an emacs user already |
| 10:27:21 | <ayumilove1> | 1? |
| 10:27:25 | <idnar> | I have "import Data.Set as Set" and "import Data.List" in my code |
| 10:27:31 | <ayumilove1> | >1+undefined |
| 10:27:36 | <idnar> | and I'm getting this error: |
| 10:27:37 | <idnar> | Ambiguous occurrence `filter' |
| 10:27:38 | <idnar> | It could refer to either `Data.List.filter', imported from Data.List at problem0023.hs:1:0-15 |
| 10:27:38 | <Darkness3477> | I do use Emacs quite a bit. |
| 10:27:40 | <thoughtpolice> | > 1+undefined |
| 10:27:41 | <lambdabot> | Exception: Prelude.undefined |
| 10:27:41 | <idnar> | or `Set.filter', imported from Data.Set at problem0023.hs:3:0-21 |
| 10:27:45 | <rwbarton> | idnar: import qualified Data.Set as Set |
| 10:27:55 | <idnar> | rwbarton: oh right, duh |
| 10:28:01 | <rwbarton> | idnar: I don't even know what "import Data.Set as Set" does :P |
| 10:28:10 | <idnar> | ACTION blames the Data.Set docs for confusing him |
| 10:28:23 | <lambdapants> | it means you can call things in Data.Set with the prefix Set.blah |
| 10:28:26 | <lambdapants> | like an oo language |
| 10:28:31 | <pozic> | ayumilove1: 1 : 2 : [3] basically means 1: (Delay(2:(Delay(3:(Delay Nil <close parens> |
| 10:28:59 | <thoughtpolice> | ayumilove1: like I said, all values are always lazy. nothing is evaluated until it is *absolutely needed* |
| 10:29:06 | <idnar> | although it seems I was looking at outdated docs too |
| 10:29:06 | <pozic> | ayumilove1: when you later process it the Delay nodes are stripped off, by the run-time system. |
| 10:29:14 | <thoughtpolice> | ayumilove1: when something is absolutely needed it, the value is 'forced' |
| 10:29:16 | <thoughtpolice> | so for example |
| 10:29:19 | <pozic> | ayumilove1: that's how it conceptually works. |
| 10:29:23 | <ayumilove1> | thanks pozic for explaining that, |
| 10:29:36 | <thoughtpolice> | if you want to print 'x' to the screen, 'x' must be forced, since, well, print has to know what it is printing |
| 10:29:38 | <ayumilove1> | now it makes sense :D |
| 10:29:44 | <pozic> | ayumilove1: operationally it could work by proving that the delay nodes are not necessary. |
| 10:29:59 | <pozic> | ayumilove1: and then it could run faster. |
| 10:30:13 | <ayumilove1> | thoughtpolice: thanks, that example is newbie friendly :D |
| 10:30:33 | <thoughtpolice> | ayumilove1: just remember nothing is evaluated until absolutely necessary. |
| 10:30:39 | <thoughtpolice> | which is why we can have infinite lists |
| 10:30:40 | <lambdapants> | > let ( x : xs ) = [ 1 , 2 ,3 ] |
| 10:30:40 | <lambdabot> | Parse error at end of input |
| 10:31:02 | <pozic> | > let ( x : xs ) = [ 1 , 2 ,3 ] in x |
| 10:31:04 | <lambdabot> | 1 |
| 10:31:11 | <Darkness3477> | Thanks for the help. Toodles, all |
| 10:31:25 | <ayumilove1> | hmm have you guys used zipWidth before?? |
| 10:31:35 | <luqui> | zipWith you mean? |
| 10:31:36 | <int-e> | zipWith, yes, plenty |
| 10:31:42 | <ayumilove1> | how does it zipWith works? |
| 10:31:43 | <lambdapants> | ahhh, cheers pozic. I've never used the lambdabot before. |
| 10:32:03 | <int-e> | > let fibs = 0 : 1 : zipWith (+) fibs (tail fibs) in fibs |
| 10:32:05 | <lambdabot> | [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,... |
| 10:32:15 | <ayumilove1> | wow we can use zipWith for fibonacci o_o ? |
| 10:32:16 | <lambdapants> | > zipWith ( \ x y -> x + y ) [ 1 ,2 ,3 ] [ 1 ,1 ,1 ] |
| 10:32:17 | <lambdabot> | [2,3,4] |
| 10:32:20 | <luqui> | int-e, I wouldnt' call that the best example |
| 10:33:11 | <cjs> | How you do you pronounce "<-"? |
| 10:33:11 | <ayumilove1> | could someone explain how zipWith works in this code ? let fibs = 0 : 1 : zipWith (+) fibs (tail fibs) in fibs |
| 10:33:14 | <lambdapants> | I love that definition of fibs. seen it before. It's sort of poetic in how declaritive it is. |
| 10:33:36 | <int-e> | luqui: it's a fun example though, and worth trying to understand. |
| 10:33:39 | <ayumilove1> | there is a funny (+) plus sign too |
| 10:33:49 | <rwbarton> | (+) means plus :) |
| 10:33:54 | <int-e> | ( \ x y -> x + y ) and (+) are the same |
| 10:33:57 | <lambdapants> | it makes it not infix |
| 10:34:16 | <int-e> | right, x + y and (+) x y are also the same |
| 10:34:28 | <ayumilove1> | how about zipWith? |
| 10:34:46 | <lambdapants> | I was attempting to demonstrate that zipWith takes a function of two arguments, then takes two lists. it sort of maps the two lists together with the function |
| 10:34:57 | <idnar> | zipWith [x..] [yxx] |
| 10:34:59 | <idnar> | oops |
| 10:35:07 | <idnar> | actually, that probably doesn't work anyway |
| 10:35:15 | <idnar> | > [x..] |
| 10:35:17 | <lambdabot> | [Exception: not a number |
| 10:35:22 | <lambdapants> | > zipWith (*) [ 1 , 2 ,3 ] [ 1 , 2 ,3 ] |
| 10:35:23 | <lambdabot> | [1,4,9] |
| 10:35:34 | <luqui> | > zip [x..] [y,x,x] |
| 10:35:34 | <PeakerWork> | @src zipWith |
| 10:35:35 | <lambdabot> | zipWith f (a:as) (b:bs) = f a b : zipWith f as bs |
| 10:35:35 | <lambdabot> | zipWith _ _ _ = [] |
| 10:35:35 | <lambdabot> | [(Exception: not a number |
| 10:35:55 | <int-e> | ayumilove1: think about what the third elemebt of fibs is: it's the first element of fibs (i.e. 0) plus the first element of the tail of fibs (i.e. 1), that is, it's 1. then you can think about the fourth element, and so on. |
| 10:35:56 | <idnar> | > zipWith (+) [x,x,x] [y,y,y] |
| 10:35:57 | <lambdabot> | [x + y,x + y,x + y] |
| 10:36:25 | <int-e> | ayumilove1: there are no circular dependencies, so lazy evaluation will make the whole process work and produce the fibonacci numbers. |
| 10:36:43 | <idnar> | > let xs = [x,y,z] in zipWith (+) xs (tail xs) |
| 10:36:45 | <lambdabot> | [x + y,y + z] |
| 10:36:52 | <idnar> | ^^^ perhaps that's more explanatory |
| 10:36:58 | <PeakerWork> | > let zipWith' f a b = map (f . uncurry) (zip a b) in zipWith' (+) [1,2,3] [3,2,1] |
| 10:36:59 | <lambdabot> | Couldn't match expected type `a -> b -> c' |
| 10:37:07 | <idnar> | s/explanatory/demonstrative/ |
| 10:37:18 | <int-e> | PeakerWork: uncurry f |
| 10:37:40 | <PeakerWork> | > let zipWith' f a b = map (uncurry f) (zip a b) in zipWith' (+) [1,2,3] [3,2,1] |
| 10:37:41 | <lambdabot> | [4,4,4] |
| 10:37:44 | <PeakerWork> | ah, thanks |
| 10:38:21 | <ayumilove1> | idnar: sorry, I don't understand the results [x + y,y + z] |
| 10:38:56 | <idnar> | ayumilove1: okay, uhm, maybe a concrete explanation might make more sense |
| 10:39:22 | <ayumilove1> | int-e: he/she says 3rd element is 1st element from list (0) + 1st element from tail list(1), 4th element? o_O |
| 10:39:39 | <idnar> | ayumilove1: do you understand how zipWith works? |
| 10:39:43 | <int-e> | ayumilove1: maybe I shouldn't skip the first two elements |
| 10:39:45 | <idnar> | (in general, not in this specific problem) |
| 10:39:46 | <ayumilove1> | no >.< |
| 10:39:57 | <idnar> | do you understand how zip works? |
| 10:40:06 | <ayumilove1> | i havent touch zip before |
| 10:40:11 | <idnar> | okay, zip is fairly easy |
| 10:40:21 | <idnar> | it takes two lists, and gives you a list of pairs: |
| 10:40:25 | <idnar> | > zip [1,2,3] [4,5,6,] |
| 10:40:26 | <lambdabot> | Parse error at "]" (column 20) |
| 10:40:27 | <Quadrescence> | Is there a way to make GHCi not output infinite lists...infinitely? |
| 10:40:27 | <idnar> | > zip [1,2,3] [4,5,6] |
| 10:40:29 | <lambdabot> | [(1,4),(2,5),(3,6)] |
| 10:40:32 | <DrSyzygy> | :t (,) |
| 10:40:33 | <lambdabot> | forall a b. a -> b -> (a, b) |
| 10:40:33 | <int-e> | ayumilove1: what's the first list element of 0 : 1 : zipWith fibs (tail fibs) ? remeber that x : xs is a list with first element x followed by the elements of xs. |
| 10:40:35 | <Quadrescence> | Like what lambdabot does? |
| 10:40:54 | <ayumilove1> | zip [1,2,3] [4,5,6] |
| 10:40:55 | <ayumilove1> | <lambdabot> [(1,4),(2,5),(3,6)] >> this makes sense to me :D |
| 10:40:59 | <idnar> | Quadrescence: take N . print :P |
| 10:41:03 | <int-e> | > (42 : undefined) !! 0 |
| 10:41:05 | <lambdabot> | 42 |
| 10:41:05 | <Quadrescence> | psh |
| 10:41:11 | <lambdapants> | Quadrescence... why not "take" |
| 10:41:19 | <idnar> | ayumilove1: okay, so zipWith is similar to zip, except that it also takes a function |
| 10:41:25 | <Quadrescence> | Just for general...experimenting |
| 10:41:30 | <DrSyzygy> | > [42,undefined,12]!!2 |
| 10:41:31 | <lambdabot> | 12 |
| 10:41:36 | <Quadrescence> | so I don't have to ctrl-C it all the time |
| 10:41:47 | <int-e> | > let stranfe_fibs = x : y : zipWith (+) fibs (tail strange_fibs) in strange_fibs -- sorry |
| 10:41:48 | <lambdabot> | Not in scope: `strange_fibs' |
| 10:41:52 | <idnar> | ayumilove1: zipWith f [1,2,3] [4,5,6] == [f 1 4, f 2 5, f 3 6] |
| 10:41:54 | <int-e> | > let strange_fibs = x : y : zipWith (+) fibs (tail strange_fibs) in strange_fibs -- sorry |
| 10:41:55 | <lambdabot> | Not in scope: `fibs' |
| 10:41:57 | <idnar> | so for example, if we use (+) |
| 10:42:00 | <int-e> | ACTION sighs |
| 10:42:05 | <idnar> | > zipWith (+) [1,2,3] [4,5,6] |
| 10:42:06 | <lambdabot> | [5,7,9] |
| 10:42:09 | <int-e> | > let strange_fibs = x : y : zipWith (+) strange_fibs (tail strange_fibs) in strange_fibs -- third time's a charm? |
| 10:42:11 | <lambdabot> | [x,y,x + y,y + (x + y),x + y + (y + (x + y)),y + (x + y) + (x + y + (y + (x ... |
| 10:42:15 | <DrSyzygy> | ayumilove1: zipWith recognizes that the function (,) that builds pairs is just a 2-ary function, and allows you to replace it by any other 2-ary function. |
| 10:42:26 | <idnar> | that's [1+4, 2+5, 3+6] |
| 10:42:33 | <ayumilove1> | idnar: oh!!! ok I understand your example, newbie friendly :D |
| 10:42:42 | <idnar> | so now, in the fibs code |
| 10:42:51 | <idnar> | our two lists are "fibs" and "tail fibs" |
| 10:43:22 | <idnar> | do you understand what "tail" does? |
| 10:43:34 | <ayumilove1> | idnar: tail is without the head (1st element) ? |
| 10:43:39 | <idnar> | right |
| 10:43:44 | <ayumilove1> | idnar: ok |
| 10:43:51 | <Deewiant> | > iterate tail [0..] |
| 10:43:52 | <lambdabot> | [[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,... |
| 10:44:00 | <idnar> | so we're adding the first element to the second element, the second element to the third element, the third element to the fourth element, and so on |
| 10:44:01 | <lambdapants> | ( I don't mean to distract but I rather love zipWithM ) |
| 10:44:03 | <Deewiant> | hmm, right, bad example :-P |
| 10:44:13 | <Deewiant> | > map head . iterate tail $ [0..] |
| 10:44:14 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,2... |
| 10:44:34 | <idnar> | the "magic trick" is that we're defining the list recursively |
| 10:44:47 | <idnar> | we only write out the first two elements explicitly |
| 10:45:17 | <lambdapants> | I Have a question. I cannot get Data.Derive to compile. It configures without problem, then builds the first two modules, then dies silently. |
| 10:45:26 | <idnar> | but since Haskell has lazy evaluation, we don't have to calculate the whole list a tonce |
| 10:46:29 | <idnar> | so the first element in the result of zipWith is the third element of fibs; in order to calculate it, we add the first element of fibs to the second element of fibs |
| 10:46:59 | <idnar> | the second element in the result of zipWith is the fourth element of fibs; in order to calculate it, we add the second element of fibs to the third element of fibs; and since we just calculated the third element, that's no problem |
| 10:50:01 | <ayumilove1> | idnar: umm trying to digest those words |
| 10:50:35 | <idnar> | ayumilove1: okay, let me know where I lost you if you can't follow all of that |
| 10:51:47 | <lambdapants> | idnar: the beauty of that definition over more imperative forms is - you can see clear that you start with 0 then 1 , and then you see the zipWith, one list starts at the start of the fib set ( ie the variable fib ), the next list starts an element up ( ie, tail fib )....... so when they are zipWithed+ the first element is added to the second element.... it is soooo close to the mathematical description it just really. |
| 10:52:15 | <ayumilove1> | idnar: ok i understand the 2 sentences |
| 10:52:33 | <ayumilove1> | i have written it into my notepad and ran my winhugs, it keeps looping |
| 10:52:33 | <idnar> | lambdapants: yes, I think that's probably my favourite definition |
| 10:52:49 | <idnar> | ayumilove1: well, it's a list of every fibonacci number |
| 10:52:55 | <idnar> | ayumilove1: and there are an infinite number of fibonacci numbers |
| 10:53:03 | <idnar> | ayumilove1: try printing "take 50 fibs" or something like that |
| 10:53:08 | <idnar> | (that'll give you only the first 50) |
| 10:53:10 | <ayumilove1> | ok |
| 10:53:42 | <ayumilove1> | [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,1134903170,1836311903,2971215073,4807526976,7778742049] |
| 10:53:47 | <ayumilove1> | :D it works |
| 10:53:48 | <lambdapants> | weeee. |
| 10:53:56 | <ayumilove1> | wow take is kinda useful |
| 10:54:14 | <ayumilove1> | today i learned so much stuff o_o |
| 10:54:19 | <idnar> | :) |
| 10:54:23 | <lambdapants> | ayumilove: maybe it would help you understand if the calc is further up the set |
| 10:54:34 | <ayumilove1> | fibonacci can be done using recursion, iteration, operator and zipWith |
| 10:54:51 | <luqui> | oh no! I just realized zip is not symmetrical. Stupid bottoms... |
| 10:54:53 | <lambdapants> | > let fib = 1 : 2 : withZip fib ( tail fib ) in fib |
| 10:54:53 | <lambdabot> | Not in scope: `withZip' |
| 10:54:59 | <lambdapants> | heh |
| 10:55:22 | <lambdapants> | let fib = 1 : 2 : zipWith fib ( tail fib ) in fib |
| 10:55:25 | <luqui> | > zip (1:2:3:[]) (4:5:6:undefined) |
| 10:55:26 | <lambdabot> | [(1,4),(2,5),(3,6)] |
| 10:55:32 | <luqui> | > zip (4:5:6:undefined) (1:2:3:[]) |
| 10:55:34 | <lambdabot> | [(4,1),(5,2),(6,3)Exception: Prelude.undefined |
| 10:55:37 | <lambdapants> | heh |
| 10:55:39 | <rwbarton> | @src zip |
| 10:55:39 | <lambdabot> | zip (a:as) (b:bs) = (a,b) : zip as bs |
| 10:55:39 | <lambdabot> | zip _ _ = [] |
| 10:55:41 | <lambdapants> | I forgot the plus |
| 10:55:43 | <lambdapants> | nevermind |
| 10:55:50 | <lambdapants> | I need to build Data.Derive |
| 10:56:02 | <rwbarton> | I see |
| 10:56:10 | <lambdapants> | let fib = 1 : 2 : zipWith (+) fib ( tail fib ) in fib |
| 10:56:33 | <lambdapants> | aye.... |
| 10:56:34 | <lambdapants> | but |
| 10:56:41 | <lambdapants> | Data.Derive won't build! |
| 10:56:44 | <lambdapants> | it dies silently |
| 10:56:49 | <lambdapants> | after making two modules. |
| 10:57:01 | <idnar> | > let fib = 1 : 2 : zipWith (+) fib (tail fib) in fib |
| 10:57:02 | <lambdabot> | [1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,1771... |
| 10:57:04 | <luqui> | ACTION needs to write Data.DWIM |
| 10:57:14 | <idnar> | luqui: what about Control.DWIM? |
| 10:57:21 | <idnar> | actually, screw DWIM |
| 10:57:22 | <luqui> | oh yeah, Data.BWIM |
| 10:57:23 | <int-e> | > oeis [0,1,1,2,3,5] |
| 10:57:24 | <lambdabot> | Not in scope: `oeis' |
| 10:57:25 | <idnar> | I want Control.DWIW |
| 10:57:36 | <Zao> | Control.Parallel.Strategies.DWIM? |
| 10:57:40 | <luqui> | Relationship.BWIW |
| 11:02:14 | <lambdapants> | shit! |
| 11:02:25 | <lambdapants> | I just fucked my virtual server with ghc |
| 11:02:47 | <lambdapants> | that means it has probably fucked a bunch of other people's too! |
| 11:02:50 | <lambdapants> | aaaaaaahhh! |
| 11:03:40 | <luqui> | ? |
| 11:03:50 | <lambdapants> | I tried building derive-0.1 |
| 11:03:52 | <lambdapants> | it halted |
| 11:03:55 | <lambdapants> | well |
| 11:03:57 | <lambdapants> | no it didn;t |
| 11:04:01 | <lambdapants> | it halted the system |
| 11:04:04 | <lambdapants> | I can't even ping it |
| 11:04:08 | <Quadrescence> | lambdabot: wait, derive the CAS? |
| 11:04:22 | <luqui> | probably Data.Derive |
| 11:04:23 | <Quadrescence> | (probably not) |
| 11:04:26 | <Quadrescence> | Okay |
| 11:04:29 | <lambdapants> | Data.Derive. |
| 11:04:29 | <Quadrescence> | :> |
| 11:04:36 | <Quadrescence> | Hah, you got me excited for a second. |
| 11:04:44 | <idnar> | lambdapants: sounds like a hardware issue |
| 11:04:47 | <luqui> | that's.... odd and unlikely seeming... |
| 11:04:55 | <idnar> | unless your virtual server is just horribly CPU-starved |
| 11:05:07 | <lambdapants> | phew... it works again.... |
| 11:05:12 | <lambdapants> | I can ping. |
| 11:05:16 | <lambdapants> | I very nearly peed there. |
| 11:05:23 | <luqui> | peeing is healthy |
| 11:05:29 | <lambdapants> | not on the sofa |
| 11:05:34 | <luqui> | not for the sofa |
| 11:05:40 | <idnar> | ACTION flanics and attempts to pee |
| 11:06:00 | <luqui> | ACTION ceases to exist |
| 11:09:18 | <lambdapants> | maybe they rebooted it :@ |
| 11:09:44 | <ayumilove1> | <luqui> peeing is healthy o_o |
| 11:10:24 | <Armored_Azrael> | Is there a haskell SNMP lib? |
| 11:12:37 | <lambdapants> | let pee = repeat "I seriously broke a computer hundreds of miles away in england. peeing is a good option right now" in pee |
| 11:19:59 | <Armored_Azrael> | Is there a haskell SNMP lib? |
| 11:21:01 | <Botje> | no(t yet) |
| 11:22:30 | <rwbarton> | <dons>write one</dons> |
| 11:22:34 | <ayumilove1> | lol lambdapants funny |
| 11:22:52 | <ayumilove1> | hey guys, is it possible to sort the order of the number within a list? |
| 11:23:04 | <rwbarton> | > sort [3, 1, 5, 2] |
| 11:23:05 | <ayumilove1> | example: [1,2,3] becomes [3,2,1] ? |
| 11:23:05 | <lambdabot> | [1,2,3,5] |
| 11:23:15 | <dobblego> | @type sortBy |
| 11:23:15 | <lambdabot> | forall a. (a -> a -> Ordering) -> [a] -> [a] |
| 11:23:18 | <ayumilove1> | >sort [9,1] |
| 11:23:25 | <ayumilove1> | > sort [9,1] |
| 11:23:26 | <lambdabot> | [1,9] |
| 11:23:46 | <rwbarton> | > reverse (sort [3, 1, 5, 2]) |
| 11:23:48 | <lambdabot> | [5,3,2,1] |
| 11:23:52 | <ayumilove1> | wow thanks |
| 11:24:06 | <ayumilove1> | > reverse [1,3,5] |
| 11:24:07 | <lambdabot> | [5,3,1] |
| 11:24:10 | <ayumilove1> | cool :D |
| 11:24:18 | <ayumilove1> | this is fun |
| 11:24:20 | <Botje> | > sortBy (flip compare) [3,1,5,2] |
| 11:24:21 | <lambdabot> | [5,3,2,1] |
| 11:24:48 | <ayumilove1> | Botje: what does this do? > sortBy (flip compare) [3,1,5,2] , is it the same as reverse? |
| 11:24:52 | <Botje> | yes |
| 11:24:58 | <Botje> | except it doesn't do the reverse at the end |
| 11:25:14 | <ayumilove1> | what do you mean by doesnt do reverse at the end? |
| 11:25:20 | <Botje> | i wonder if GHC is smart enough to rewrite reverse . sort to sortBy (flip compare) |
| 11:25:21 | <lambdapants> | remember it's inefficient |
| 11:25:21 | <lambdapants> | when I need a lot of things sorted, ( frequently some data is associated with a number ) I use Data.Map to store them and then just query for the max and min values. |
| 11:25:40 | <Botje> | ayumilove1: reverse . sort does a sort O(n log n) first |
| 11:25:46 | <Botje> | and then an O(n^2) reverse |
| 11:25:57 | <Botje> | whereas sortBy (flip compare) only does an O(n log n) sort |
| 11:26:03 | <Botje> | (you know big-O notation, right?) |
| 11:26:05 | <rwbarton> | reverse . sort /= sortBy (flip compare) when == is not equality |
| 11:26:21 | <rwbarton> | > length (reverse [1..10^6]) |
| 11:26:23 | <lambdabot> | 1000000 |
| 11:26:25 | <ayumilove1> | i heard that big O describes how efficient is the code |
| 11:26:31 | <rwbarton> | ^^ I don't think reverse is O(n^2) :) |
| 11:26:42 | <ayumilove1> | 2n or n ^ 2 is not efficient = big |
| 11:26:42 | <lambdapants> | I concur |
| 11:26:52 | <Botje> | @src reverse |
| 11:26:53 | <lambdabot> | reverse = foldl (flip (:)) [] |
| 11:27:00 | <Botje> | hmm |
| 11:27:04 | <Botje> | so it isn't |
| 11:27:05 | <Botje> | OR IS IT |
| 11:27:12 | <andun> | no, it's not |
| 11:27:15 | <Heffalump> | that's O(n) |
| 11:27:24 | <Botje> | ah |
| 11:27:26 | <Botje> | cool |
| 11:27:40 | <Heffalump> | it's the accumulating parameter version |
| 11:27:50 | <rwbarton> | Still, sortBy (flip compare) is better if you're only going to use a few elements of the result |
| 11:27:50 | <idnar> | @do [x | x <- xs, x /= 5] |
| 11:27:51 | <lambdabot> | [x | x <- xs, x /= 5] not available |
| 11:27:58 | <idnar> | oh meh |
| 11:28:07 | <EvilTerran> | @undo [x | x <- xs, x /= 5] |
| 11:28:08 | <lambdabot> | concatMap (\ x -> if x /= 5 then [x] else []) xs |
| 11:28:13 | <EvilTerran> | @. redo undo [x | x <- xs, x /= 5] |
| 11:28:13 | <lambdabot> | concatMap (\ x -> if x /= 5 then [x] else []) xs |
| 11:28:16 | <EvilTerran> | hm |
| 11:28:27 | <idnar> | well, anyhow, what's the do-syntax equivalent of that? |
| 11:28:40 | <Botje> | do { x <- xs; x /= 5; return x } |
| 11:28:44 | <rwbarton> | do { x <- xs ; guard (x /= 5) ; return x } |
| 11:28:50 | <dmhouse> | > do (x <- [1..5]; guard (x /= 5); return x) |
| 11:28:50 | <lambdabot> | Parse error at "<-" (column 7) |
| 11:28:51 | <Botje> | oh yeah |
| 11:28:54 | <idnar> | oh, guard |
| 11:28:54 | <Quadrescence> | Is there a site like http://en.literateprograms.org/Category:Programming_language:Haskell |
| 11:28:56 | <lambdabot> | Title: Category:Programming language:Haskell - LiteratePrograms, http://tinyurl.com/57nmlo |
| 11:28:58 | <Botje> | need more caffeine :( |
| 11:28:59 | <idnar> | @type guard |
| 11:29:00 | <lambdabot> | forall (m :: * -> *). (MonadPlus m) => Bool -> m () |
| 11:29:05 | <Quadrescence> | which has small codes of haskell |
| 11:29:07 | <Quadrescence> | ? |
| 11:29:14 | <idnar> | @index guard |
| 11:29:14 | <lambdabot> | Control.Monad, Control.Monad.Reader, Control.Monad.Writer, Control.Monad.State, Control.Monad.RWS, Control.Monad.Identity, Control.Monad.Cont, Control.Monad.Error, Control.Monad.List |
| 11:29:28 | <dmhouse> | List comprehensions used to be generalised to all monads (I think they used fail rather than guard). |
| 11:32:44 | <idnar> | ACTION ponders |
| 11:33:26 | <ayumilove1> | Botje not sleepy? |
| 11:33:37 | <Botje> | not sleepy just tired |
| 11:33:44 | <ayumilove1> | night? |
| 11:33:46 | <Botje> | getting up before 12 is not my thing(tm) |
| 11:34:05 | <ayumilove1> | sleep early and wake up early = good for health :D |
| 11:34:18 | <ayumilove1> | caffeine not good for health o_o |
| 11:35:03 | <ayumilove1> | > reverse [9,8,7,6] |
| 11:35:03 | <lambdabot> | [6,7,8,9] |
| 11:35:12 | <ayumilove1> | > reverse [a,b,c,d] |
| 11:35:13 | <lambdabot> | [d,c,b,a] |
| 11:35:23 | <ayumilove1> | > reverse [d,c,b,a] |
| 11:35:24 | <lambdabot> | [a,b,c,d] |
| 11:35:28 | <ayumilove1> | cool o_o |
| 11:35:39 | <ayumilove1> | so this reverse function is the most efficient? |
| 11:35:49 | <ayumilove1> | @ reverse |
| 11:35:55 | <Botje> | for reversing lists? sure |
| 11:36:02 | <Botje> | that's what it's made for :) |
| 11:36:10 | <ayumilove1> | how do you guys make the lambdabot pops up some weird functions |
| 11:36:18 | <Botje> | @src reverse |
| 11:36:18 | <ayumilove1> | using the @ symbol or something like that |
| 11:36:18 | <lambdabot> | reverse = foldl (flip (:)) [] |
| 11:36:39 | <ayumilove1> | what is that foldl doing there? |
| 11:36:44 | <ayumilove1> | fold left? |
| 11:37:06 | <Botje> | it's "fold towards the left" |
| 11:37:14 | <ayumilove1> | example? |
| 11:37:22 | <ayumilove1> | simple one would do ^_^ " |
| 11:37:37 | <Botje> | > foldl f 0 [a,b,c,d] :: Expr |
| 11:37:38 | <lambdabot> | f (f (f (f 0 a) b) c) d |
| 11:37:47 | <ayumilove1> | @src fold |
| 11:37:47 | <lambdabot> | Source not found. Do you think like you type? |
| 11:37:53 | <ayumilove1> | @src foldl |
| 11:37:54 | <lambdabot> | foldl f z [] = z |
| 11:37:54 | <lambdabot> | foldl f z (x:xs) = foldl f (f z x) xs |
| 11:37:55 | <Botje> | > foldl (flip (:)) [] [a,b,c,d] :: Expr |
| 11:37:56 | <lambdabot> | Couldn't match expected type `Expr' against inferred type `[Expr]' |
| 11:38:03 | <Botje> | > foldl (flip (:)) [] [a,b,c,d] :: [Expr] |
| 11:38:04 | <lambdabot> | [d,c,b,a] |
| 11:38:10 | <Botje> | aww it doesn't show |
| 11:38:52 | <ayumilove1> | > foldr f 0 [a,b,c,d] :: Expr |
| 11:38:54 | <lambdabot> | f a (f b (f c (f d 0))) |
| 11:39:12 | <ayumilove1> | > foldr +1 0 [a,b,c,d] :: Expr |
| 11:39:13 | <lambdabot> | Couldn't match expected type `Expr' |
| 11:39:19 | <ayumilove1> | o_o |
| 11:39:31 | <ayumilove1> | foldr f 0 , what is f there? is it a function? |
| 11:39:38 | <ayumilove1> | > foldr (+1) 0 [a,b,c,d] :: Expr |
| 11:39:39 | <lambdabot> | Couldn't match expected type `b -> b' against inferred type `Expr' |
| 11:39:46 | <Taggnostr> | hello |
| 11:40:00 | <ziman> | > [a, b, c, d] :: [Expr] |
| 11:40:01 | <lambdabot> | [a,b,c,d] |
| 11:40:05 | <ziman> | > [a, b, c, d] :: Expr |
| 11:40:06 | <lambdabot> | Couldn't match expected type `Expr' against inferred type `[a]' |
| 11:40:17 | <Taggnostr> | how can i check if a string starts with another substring? |
| 11:40:22 | <rwbarton> | ayumilove1: f is a function with two arguments--like in "f d 0" in the middle of that expression above |
| 11:40:59 | <ayumilove1> | rwbarton: ok |
| 11:41:10 | <ayumilove1> | what is Expr means? |
| 11:41:18 | <ayumilove1> | express? |
| 11:41:32 | <rwbarton> | expression, it's lambdabot magic. |
| 11:41:53 | <ayumilove1> | what is a lambdabot magic? weird lambdabot gets its name from a lamb? |
| 11:42:00 | <ayumilove1> | robot lamb ? |
| 11:42:23 | <ayumilove1> | lambdabot = lamb the bot? |
| 11:42:32 | <Taggnostr> | lambda bot |
| 11:42:36 | <ziman> | interesting :) |
| 11:42:52 | <ayumilove1> | what is a lambdabot magic? |
| 11:43:38 | <ayumilove1> | how do you guys calculate how efficient is a code using the big-o notation? |
| 11:45:13 | <idnar> | is there an example somewhere of how to use STUArray? |
| 11:45:57 | <lambdapants> | ayumilove: haskell is based on a thing called the lambda calculus |
| 11:46:25 | <ayumilove1> | lambdapants: ok , oh i see |
| 11:46:32 | <lambdapants> | the lambda calculus provides a foundation for compution, a - universal turing machine |
| 11:46:42 | <Taggnostr> | are your pants based on that too? |
| 11:46:43 | <ayumilove1> | does it provide to java , c++ and others? |
| 11:46:56 | <ayumilove1> | lol taggnostr |
| 11:47:09 | <chrisdone> | @seen chr1s |
| 11:47:09 | <lambdabot> | chr1s is in #haskell. I last heard chr1s speak 16h 12m 29s ago. |
| 11:47:20 | <ayumilove1> | @seen ayumilove1 |
| 11:47:20 | <lambdabot> | You are in #haskell. I last heard you speak just now. |
| 11:47:33 | <ayumilove1> | @seen john |
| 11:47:33 | <lambdabot> | I haven't seen john. |
| 11:47:38 | <ayumilove1> | @seen lambdabot |
| 11:47:38 | <lambdabot> | Yes, I'm here. I'm in #japanese, #macosx, #arch-haskell, #haskell-hac4, #gentoo-uy, #friendly-coders, #dreamlinux-es, #thunks, #haskell-hac07, #haskell_ru, #haskell.cz, #haskell.dut, #haskell.de, # |
| 11:47:38 | <lambdabot> | haskell.es, #haskell.fi, #haskell.fr, #haskell.hr, #haskell.it, #haskell.jp, #haskell.no, #haskell.ru, #haskell.se, #haskell-books, #rosettacode, #scannedinavian, #gentoo-haskell, ##logic, #xmonad, # |
| 11:47:38 | <lambdabot> | unicycling, #perl6, #parrot, #jtiger, #haskell-soc, #haskell-overflow, #haskell-blah, #scala, #darcs, #jhc, #ghc and #haskell |
| 11:47:46 | <ayumilove1> | wow o_o |
| 11:48:00 | <idnar> | sheesh |
| 11:48:11 | <ayumilove1> | i did not know lambdabot is so active in all channels |
| 11:48:22 | <chrisdone> | because sometimes unicyclists really need a purely functional programming language |
| 11:48:25 | <ayumilove1> | yay learned something new with @ |
| 11:48:28 | <Axman6> | it sure does get around a bit |
| 11:48:42 | <ayumilove1> | what is universal turing machine? |
| 11:48:55 | <ayumilove1> | do you meaning turning as in cycling? |
| 11:49:03 | <thoughtpolice> | @go Universal Turing Machine |
| 11:49:04 | <lambdabot> | http://en.wikipedia.org/wiki/Turing_machine |
| 11:49:04 | <lambdabot> | Title: Turing machine - Wikipedia, the free encyclopedia |
| 11:49:10 | <thoughtpolice> | ^^ read that |
| 11:49:17 | <ayumilove1> | http://google.com |
| 11:49:17 | <lambdabot> | Title: Google |
| 11:49:22 | <ayumilove1> | o_O |
| 11:49:28 | <ayumilove1> | http://john.com |
| 11:49:48 | <thoughtpolice> | ayumilove1: turing machines are simple abstract devices that can emulate and do anything a regular computer can. |
| 11:50:00 | <thoughtpolice> | it's a little computer science stuff although wikipedia should be able to help |
| 11:50:00 | <ayumilove1> | man, red fonts scares me -_- |
| 11:50:20 | <ayumilove1> | thoughtpolice: thanks :D |
| 11:50:36 | <ayumilove1> | @seen thoughtpolice |
| 11:50:36 | <lambdabot> | thoughtpolice is in #ghc, #haskell-blah and #haskell. I last heard thoughtpolice speak 35s ago. |
| 11:50:57 | <ayumilove1> | why there is no #winhugs? |
| 11:51:10 | <thoughtpolice> | the lambda calculus is a foundation for many functional programming languages, and we call it a 'universal turing machine' because the lambda calculus too can compute anything a regular computer can |
| 11:51:52 | <thoughtpolice> | ayumilove1: most people use GHC |
| 11:52:05 | <Botje> | Taggnostr: if you still need it, smallstr `isPrefixOf` bigstr |
| 11:52:09 | <ayumilove1> | oh, someone recommended me winhugs because newbie friendly interface |
| 11:52:17 | <Taggnostr> | Botje, thanks |
| 11:52:18 | <ayumilove1> | and its windows :D |
| 11:52:19 | <thoughtpolice> | ayumilove1: it does. ghc is just more feature complete |
| 11:52:25 | <Botje> | ayumilove1: how is that a good thing? |
| 11:52:35 | <chrisdone> | chr1s: yaay you made it monadic. I'm going to try it out on my project ^___^! |
| 11:52:53 | <chr1s> | chrisdone: cool! |
| 11:53:05 | <chr1s> | chrisdone: let me know how it works out for you |
| 11:53:05 | <thoughtpolice> | Botje: if nothing else hugs gives better type-related errors which may be better for a newbie |
| 11:53:11 | <chrisdone> | chr1s: sure! |
| 11:53:12 | <thoughtpolice> | GHC's type errors can be a little scarier |
| 11:53:16 | <Botje> | it used to be |
| 11:53:22 | <Botje> | now i'm not so sure |
| 11:53:36 | <ayumilove1> | botje is a staff for haskell/ |
| 11:53:38 | <ayumilove1> | ? |
| 11:53:45 | <ayumilove1> | you seem so experience in haskell o_o |
| 11:53:53 | <Botje> | not really |
| 11:53:54 | <Axman6> | staff? |
| 11:53:59 | <lambdapants> | hehe |
| 11:54:01 | <Botje> | i'm celebrating my one-year-of-haskell soon :P |
| 11:54:12 | <thoughtpolice> | Botje: you as well? :) |
| 11:54:19 | <thoughtpolice> | actually I think I hit my one year sometime around march |
| 11:54:21 | <Botje> | yeah :) |
| 11:54:21 | <thoughtpolice> | can't remember |
| 11:54:37 | <lambdapants> | I hit year two next month :D |
| 11:54:37 | <Botje> | hmm |
| 11:54:44 | <Botje> | i seem to have passed it as well |
| 11:54:58 | <chrisdone> | I started january |
| 11:55:01 | <lambdapants> | then again I have anonymouse pants |
| 11:55:02 | <Botje> | my first stored haskell program was may 1 2007 |
| 11:55:11 | <Axman6> | i started in feburary i think |
| 11:55:11 | <Taggnostr> | Botje, <interactive>:1:6: Not in scope: `isPrefixOf' |
| 11:55:17 | <chrisdone> | “new year? new language!” |
| 11:55:19 | <Botje> | Taggnostr: yeah, it's in Data.List |
| 11:55:20 | <lambdapants> | haskell was the second programming language I learned. I'm only 19. |
| 11:55:23 | <thoughtpolice> | Tobsan: import Data.List |
| 11:55:28 | <Axman6> | @hoogle isPrefixOf |
| 11:55:28 | <lambdabot> | Data.List.isPrefixOf :: Eq a => [a] -> [a] -> Bool |
| 11:55:28 | <lambdabot> | Data.ByteString.isPrefixOf :: ByteString -> ByteString -> Bool |
| 11:55:28 | <lambdabot> | Data.ByteString.Char8.isPrefixOf :: ByteString -> ByteString -> Bool |
| 11:55:30 | <thoughtpolice> | lambdabot: the first being? |
| 11:55:36 | <lambdapants> | php :p |
| 11:55:40 | <chrisdone> | lambdapants: me too omfg, except I know other languages |
| 11:55:45 | <Botje> | ACTION is up to 14 or so |
| 11:55:49 | <dmhouse> | lambdapants: nice, that's exactly the same route as me. |
| 11:55:50 | <thoughtpolice> | lambdabot: hehe, php was my first language as well |
| 11:55:52 | <thoughtpolice> | back in like |
| 11:55:53 | <thoughtpolice> | 2002 |
| 11:55:54 | <Axman6> | lambdapants: only your second? |
| 11:56:02 | <dmhouse> | I'm now playing with C for a university project. |
| 11:56:02 | <lambdapants> | I know 7 now. |
| 11:56:07 | <thoughtpolice> | when I was like 12 :p |
| 11:56:10 | <idnar> | @mapM |
| 11:56:10 | <lambdabot> | http://www.haskell.org/hawiki/HaskellUserLocations |
| 11:56:14 | <idnar> | err |
| 11:56:17 | <idnar> | @type mapM |
| 11:56:18 | <lambdabot> | forall a (m :: * -> *) b. (Monad m) => (a -> m b) -> [a] -> m [b] |
| 11:56:19 | <EvilTerran> | my first language was AcornBasic on a BBC Micro |
| 11:56:28 | <lambdapants> | that's old skool. |
| 11:56:33 | <Axman6> | i'm not even sure what my first one was :o |
| 11:56:36 | <Axman6> | logo? ha |
| 11:56:42 | <thoughtpolice> | logo is fun stuff |
| 11:56:47 | <Axman6> | playing with that when i was like 6 |
| 11:56:54 | <idnar> | Could not deduce (MArray (STUArray s) e (GHC.ST.ST s)) |
| 11:56:55 | <idnar> | from the context () |
| 11:56:56 | <idnar> | argh |
| 11:57:02 | <thoughtpolice> | my path was something like php -> perl -> c -> ??? -> haskell |
| 11:57:14 | <lambdapants> | I used to really like ruby. |
| 11:57:14 | <lambdapants> | I had to use python to make some money, earlier this year. |
| 11:57:19 | <lambdapants> | haskell couldn't hack it :( |
| 11:57:20 | <thoughtpolice> | you may be wondering what exactly I learned and messed with in that '???' period |
| 11:57:23 | <thoughtpolice> | so am i |
| 11:57:35 | <dmhouse> | Everyone's paths seem to stop at Haskell. :) |
| 11:58:04 | <Axman6> | i've done some ruby, C, C++, forth, (HTML? does that count? CSS?), erlang, haskell and java |
| 11:58:06 | <lambdapants> | it's near perfect for writing interpreters for other languages |
| 11:58:10 | <thoughtpolice> | i have still never made a dime off of any code I have written. |
| 11:58:24 | <lambdapants> | erlang I'd like to learn |
| 11:58:27 | <dmhouse> | HTML/CSS are markup languages, not programming languages. |
| 11:58:42 | <lambdapants> | I had an idea to make an OO language in haskell |
| 11:58:46 | <Axman6> | lambdapants: i really like erlang, but i miss haskell's type checking soo much :( |
| 11:58:48 | <ayumilove1> | i started haskell just like 3 weeks o_o |
| 11:58:50 | <dmhouse> | I'd like to play with Forth. |
| 11:58:57 | <thoughtpolice> | lambdabot: erlang is very interesting, to learn some of it a while back I tried implementing a rudimentary game server |
| 11:59:01 | <ayumilove1> | so many serniors here |
| 11:59:05 | <thoughtpolice> | in 300 lines of code I had some very nice functionality :) |
| 11:59:15 | <Axman6> | dmhouse: we used it to program some robots in year 10 |
| 11:59:23 | <lambdapants> | thoughtpolice: mmm, I might give it a try |
| 11:59:53 | <idnar> | what's the best way to fold over an Array? |
| 12:00:05 | <thoughtpolice> | in particular I managed (somehow) to hack up: load balancing, servers/nodes could be added on the fly, some statistical stuff and fairly okay fault tolerance using OTP |
| 12:00:12 | <thoughtpolice> | which isn't bad for 300 loc i think |
| 12:00:15 | <idnar> | repeated (!) or something? |
| 12:00:22 | <dmhouse> | http://prog21.dadgum.com/33.html really intrigued me. |
| 12:00:23 | <lambdabot> | Title: prog21: Understanding What It's Like to Program in Forth |
| 12:00:52 | <idnar> | oh, I guess elems is fine |
| 12:00:57 | <thoughtpolice> | hehe, I actually downloaded Thinking Forth today, was thinking of giving it a try. most people describe it as a very low-floor high-ceiling language |
| 12:01:00 | <Axman6> | dmhouse: i read that. and remembered why i like erlang :P |
| 12:01:12 | <idnar> | hrm, except that's not in IArray |
| 12:01:13 | <Axman6> | well i read the code, totally forgot to read the article, ha |
| 12:01:13 | <idnar> | ACTION is confused |
| 12:01:40 | <thoughtpolice> | ayumilove1: do not worry, just keep working at it and you will get better at haskell. we are here to help :) |
| 12:01:47 | <dmhouse> | ?instances Foldable |
| 12:01:47 | <lambdabot> | Couldn't find class `Foldable'. Try @instances-importing |
| 12:01:55 | <dmhouse> | ?instances-importing Data.Foldable Foldable |
| 12:01:55 | <lambdabot> | Maybe, [] |
| 12:02:00 | <dmhouse> | ?instances-importing Data.Foldable Data.Array Foldable |
| 12:02:00 | <lambdabot> | Array i, Maybe, [] |
| 12:02:09 | <Axman6> | also, why are haskellers all so nice? it's awesome |
| 12:02:11 | <dmhouse> | idnar: use the Foldable instance? |
| 12:02:20 | <thoughtpolice> | Axman6: 'cause we use haskell |
| 12:02:27 | <Axman6> | oh yeah |
| 12:02:32 | <thoughtpolice> | :) |
| 12:02:53 | <lambdapants> | haskell is a good language, everyone learns to love her bondage :p |
| 12:03:30 | <lambdapants> | I'm going to go and work on this little interpreter I've been making, seeing as my website has been shelled by nazis or something |
| 12:03:39 | <lambdapants> | bye! |
| 12:03:43 | <thoughtpolice> | lambdapants: later |
| 12:03:44 | <Taggnostr> | let count s1 s2 n = if s1 == "" then n else count (tail s1) s2 (if s2 `isPrefixOf` s1 then n+1 else n) <- how bad is this function? (it probably already exists, just playing around) |
| 12:03:54 | <ayumilove1> | oh yeah, forgotten something, what does this do? !! << example fibs !! n |
| 12:04:02 | <Deewiant> | > [5,4,3,2] !! 1 |
| 12:04:04 | <lambdabot> | 4 |
| 12:04:04 | <thoughtpolice> | ayumilove1: array index |
| 12:04:09 | <ayumilove1> | ok |
| 12:04:14 | <ayumilove1> | just remembered |
| 12:04:15 | <ayumilove1> | thanks |
| 12:04:30 | <rwbarton> | ayumilove1: http://www.haskell.org/hoogle/?q=%21%21 |
| 12:04:32 | <lambdabot> | Title: !! - Hoogle |
| 12:04:47 | <Botje> | Taggnostr: if you replace "" by [] it's a bit more general |
| 12:05:07 | <Botje> | also, i'd use pattern matching instead of a "" check |
| 12:05:32 | <Taggnostr> | how? |
| 12:05:43 | <Botje> | count [] s2 n = n |
| 12:05:47 | <thoughtpolice> | count [] _ n = n |
| 12:05:55 | <ayumilove1> | thanks rwbarton for the link, useful site :D |
| 12:06:00 | <thoughtpolice> | i always get beaten to the punch :) |
| 12:06:02 | <ayumilove1> | bookmarked |
| 12:06:15 | <Botje> | count s1 s2 n = count (tail s1) s |
| 12:06:19 | <Taggnostr> | yep |
| 12:06:22 | <chrisdone> | hayoo is behaving odd recently. I wouldn't mind if they ditched the ajax |
| 12:06:28 | <Botje> | count s1 s2 n = count (tail s1) s2 (fromEnum $ s1 `isPrefixOf` s2) |
| 12:06:46 | <Botje> | meh |
| 12:06:52 | <dmhouse> | Botje: +n |
| 12:06:52 | <Botje> | swap s2 and s1 in the fromEnum |
| 12:06:52 | <rwbarton> | count s1 s2 n = length . filter (isPrefixOf s1) $ tails s2 |
| 12:06:56 | <Botje> | +n, yeah |
| 12:07:12 | <Taggnostr> | what is fromEnum? |
| 12:07:18 | <thoughtpolice> | :t fromEnum |
| 12:07:18 | <lambdabot> | forall a. (Enum a) => a -> Int |
| 12:07:28 | <Botje> | > map fromEnum [False, True] |
| 12:07:30 | <lambdabot> | [0,1] |
| 12:07:31 | <Botje> | :o) |
| 12:08:26 | <Axman6> | > 2^9 :: Int8 |
| 12:08:28 | <lambdabot> | 0 |
| 12:08:28 | <Taggnostr> | ok |
| 12:08:33 | <Axman6> | > 2^8 :: Int8 |
| 12:08:34 | <lambdabot> | 0 |
| 12:08:37 | <Axman6> | > 2^7 :: Int8 |
| 12:08:38 | <lambdabot> | -128 |
| 12:08:58 | <Axman6> | > 2^6 :: Int8 |
| 12:09:00 | <lambdabot> | 64 |
| 12:09:13 | <Taggnostr> | > 2^8-1 ::Int8 |
| 12:09:15 | <lambdabot> | -1 |
| 12:09:29 | <Axman6> | > [64..128] :: [Int8] |
| 12:09:30 | <lambdabot> | [] |
| 12:09:59 | <Axman6> | > [32..65]] :: [Int8] |
| 12:09:59 | <lambdabot> | Parse error at "]" (column 9) |
| 12:10:03 | <Axman6> | > [32..65] :: [Int8] |
| 12:10:04 | <lambdabot> | [32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,... |
| 12:10:19 | <Axman6> | > [40..65] :: [Int8] |
| 12:10:20 | <lambdabot> | [40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65] |
| 12:10:24 | <ayumilove1> | > 2^8 |
| 12:10:26 | <lambdabot> | 256 |
| 12:10:36 | <ayumilove1> | what does Int8 do? |
| 12:10:42 | <Deewiant> | > [125..] :: [Int8] |
| 12:10:43 | <lambdabot> | [125,126,127] |
| 12:10:45 | <Axman6> | it's a data type |
| 12:10:50 | <Botje> | it's a signed 8-bit number |
| 12:10:50 | <ayumilove1> | oh |
| 12:11:03 | <ayumilove1> | >[125..]::[Int7] |
| 12:11:08 | <Axman6> | 8 bit signed integer |
| 12:11:09 | <ayumilove1> | >[125..]::[Int6] |
| 12:11:10 | <Botje> | > [(minBound,maxBound |
| 12:11:10 | <lambdabot> | Unbalanced parentheses |
| 12:11:12 | <Botje> | argh |
| 12:11:12 | <chrisdone> | `::' means "has type" |
| 12:11:15 | <ayumilove1> | > [125..]::[Int6] |
| 12:11:16 | <lambdabot> | Not in scope: type constructor or class `Int6' |
| 12:11:18 | <Botje> | > [minBound,maxBound] :: [Int8] |
| 12:11:20 | <lambdabot> | [-128,127] |
| 12:11:24 | <Axman6> | there is no Int6 |
| 12:11:27 | <Botje> | ayumilove1: no, those don't exist :) |
| 12:11:30 | <ayumilove1> | only Int8 ? |
| 12:11:42 | <Axman6> | and Int16, 32, 64 |
| 12:11:46 | <Axman6> | and Integer |
| 12:12:00 | <Axman6> | [minBound,maxBound] :: Integer |
| 12:12:07 | <Axman6> | > [minBound,maxBound] :: Integer |
| 12:12:08 | <lambdabot> | Couldn't match expected type `Integer' against inferred type `[a]' |
| 12:12:15 | <Axman6> | > [minBound,maxBound] :: [Integer] |
| 12:12:16 | <lambdabot> | add an instance declaration for (Bounded Integer) |
| 12:12:16 | <lambdabot> | In the expression: mi... |
| 12:12:19 | <Botje> | :) |
| 12:12:23 | <Axman6> | heh, excellent |
| 12:12:24 | <Botje> | Integer knows no bounds! |
| 12:12:28 | <Axman6> | :o |
| 12:12:44 | <Axman6> | thar be dragons thar! |
| 12:13:53 | <Axman6> | anyone know how functions like sin are actually written? |
| 12:14:18 | <Axman6> | (in any language really, C would proobably be most helpful) |
| 12:14:30 | <rwbarton> | Using the processor's sin instruction I think |
| 12:14:52 | <Axman6> | heh, ok. any idea how that works? |
| 12:15:08 | <ivanm> | magic! |
| 12:15:13 | <Axman6> | oh good |
| 12:15:16 | <Botje> | Axman6: lookup tables are cheap |
| 12:15:19 | <ayumilove1> | > [125..]::[Int8] |
| 12:15:20 | <lambdabot> | [125,126,127] |
| 12:15:23 | <Axman6> | yeah |
| 12:15:25 | <ayumilove1> | > [125..]::[Float8] |
| 12:15:26 | <Botje> | but taylor approximation works too |
| 12:15:26 | <lambdabot> | Not in scope: type constructor or class `Float8' |
| 12:15:32 | <ayumilove1> | > [125..]::[Double8] |
| 12:15:33 | <lambdabot> | Not in scope: type constructor or class `Double8' |
| 12:15:36 | <ayumilove1> | o_o |
| 12:15:49 | <Botje> | there's no such thing, i tell you :) |
| 12:15:54 | <rwbarton> | Float8, heh |
| 12:15:59 | <Axman6> | i was reading yesterday about the pentium lookup table bug |
| 12:16:21 | <Twey_> | > 127 :: Int8 |
| 12:16:22 | <lambdabot> | 127 |
| 12:16:24 | <Twey_> | > 128 :: Int8 |
| 12:16:25 | <lambdabot> | -128 |
| 12:16:32 | <Twey_> | Overflow. Nice. |
| 12:16:45 | <ayumilove1> | > 1 :: Int8 |
| 12:16:47 | <lambdabot> | 1 |
| 12:16:52 | <ayumilove1> | > -1 :: Int8 |
| 12:16:53 | <lambdabot> | -1 |
| 12:16:58 | <ayumilove1> | > -128 :: Int8 |
| 12:16:59 | <lambdabot> | -128 |
| 12:17:00 | <Twey_> | Thought it might throw an error. |
| 12:17:06 | <ayumilove1> | > 128 :: Int8 |
| 12:17:07 | <lambdabot> | -128 |
| 12:17:14 | <ayumilove1> | why my 128 becomes -128 |
| 12:17:36 | <Axman6> | it's 1000000 |
| 12:17:37 | <Botje> | as i said, it's a signed 8 bit number |
| 12:17:42 | <Axman6> | 10000000* |
| 12:17:47 | <ayumilove1> | what is 8 bit number? |
| 12:17:48 | <Axman6> | which is -128 |
| 12:17:51 | <ayumilove1> | 128/8? |
| 12:17:52 | <Twey_> | ayumilove1: http://en.wikipedia.org/wiki/Arithmetic_overflow |
| 12:17:53 | <lambdabot> | Title: Arithmetic overflow - Wikipedia, the free encyclopedia |
| 12:19:03 | <Axman6> | ayumilove1: do you know how numbers are representewd in binary? |
| 12:19:04 | <Axman6> | -w |
| 12:19:49 | <Axman6> | > maxBound :: Double |
| 12:19:49 | <lambdabot> | add an instance declaration for (Bounded Double) |
| 12:19:50 | <lambdabot> | In the expression: max... |
| 12:19:54 | <Axman6> | :o |
| 12:20:08 | <Axman6> | > maxBound :: Float |
| 12:20:09 | <lambdabot> | add an instance declaration for (Bounded Float) |
| 12:20:09 | <lambdabot> | In the expression: maxB... |
| 12:20:13 | <Deewiant> | > showIntAtBase 2 intToDigit 16 "" |
| 12:20:14 | <lambdabot> | "10000" |
| 12:20:16 | <pozic> | What form does a newtype need to have so that newtype deriving works for MonadTrans? |
| 12:20:33 | <Deewiant> | Axman6: floats aren't bounded since they can represent infinity |
| 12:20:35 | <BONUS> | > maxBound (4::Int) |
| 12:20:36 | <lambdabot> | add an instance declaration for (Bounded (Int -> a)) |
| 12:20:42 | <BONUS> | what the heck!!! |
| 12:20:47 | <Deewiant> | ?ty maxBound |
| 12:20:47 | <lambdabot> | forall a. (Bounded a) => a |
| 12:20:52 | <Deewiant> | > maxBound :: Int |
| 12:20:53 | <lambdabot> | 2147483647 |
| 12:20:57 | <BONUS> | oooh |
| 12:20:58 | <Axman6> | Deewiant: so infinity isn't the bound? |
| 12:20:58 | <BONUS> | i see |
| 12:21:06 | <BONUS> | lol |
| 12:21:07 | <BONUS> | stupid me |
| 12:21:19 | <Twey_> | Axman6: That's basically what's meant by 'unbounded' :) |
| 12:21:25 | <Axman6> | pfft |
| 12:21:26 | <Deewiant> | Axman6: well, they can't represent every value between their "practical maximum" and infinity |
| 12:22:10 | <Axman6> | argh, it's so cold! |
| 12:22:21 | <Axman6> | it was -4 to 5C today |
| 12:22:31 | <Axman6> | 2.7C right now |
| 12:22:35 | <Deewiant> | that's not very cold :-) |
| 12:22:47 | <Axman6> | it is if you're australian :P |
| 12:23:01 | <Axman6> | even if i have lived here all my life, it's damn cold! |
| 12:23:17 | <Deewiant> | below -20 is cold |
| 12:23:28 | <Axman6> | the LHC is cold |
| 12:24:03 | <Axman6> | http://www.boston.com/bigpicture/2008/08/the_large_hadron_collider.html some damn impressive pictures for anyone interested |
| 12:24:04 | <lambdabot> | Title: Large Hadron Collider nearly ready - The Big Picture - Boston.com, http://tinyurl.com/5ov94h |
| 12:24:53 | <Axman6> | > return 10 :: Maybe |
| 12:24:54 | <lambdabot> | `Maybe' is not applied to enough type arguments |
| 12:24:54 | <lambdabot> | Expected kind `?', b... |
| 12:25:04 | <Axman6> | > return 10 :: Maybe Integer |
| 12:25:05 | <Deewiant> | > return 10 :: Maybe Int |
| 12:25:06 | <lambdabot> | Just 10 |
| 12:25:06 | <lambdabot> | Just 10 |
| 12:25:15 | <Twey_> | Deewiant: ... in Fahrenheit! |
| 12:25:30 | <Axman6> | > return 2147483647 :: Maybe Integer |
| 12:25:31 | <lambdabot> | Just 2147483647 |
| 12:25:35 | <Axman6> | > return 2147483648 :: Maybe Integer |
| 12:25:36 | <lambdabot> | Just 2147483648 |
| 12:25:36 | <Axman6> | even |
| 12:25:42 | <Axman6> | > return 2147483648 :: Maybe Int |
| 12:25:43 | <lambdabot> | Just (-2147483648) |
| 12:28:07 | <Axman6> | @src (>>) |
| 12:28:08 | <lambdabot> | m >> k = m >>= \_ -> k |
| 12:28:23 | <Axman6> | @src (>>=) |
| 12:28:23 | <lambdabot> | Source not found. And you call yourself a Rocket Scientist! |
| 12:30:57 | <ziman> | Axman6, (>>=) is defined for each monad separately (and differently) |
| 12:31:08 | <Axman6> | oh yeah, right |
| 12:31:16 | <Axman6> | @src (>>=) :: Maybe a |
| 12:31:17 | <lambdabot> | Source not found. You speak an infinite deal of nothing |
| 12:31:23 | <ziman> | @src Maybe (>>=) |
| 12:31:23 | <lambdabot> | (Just x) >>= k = k x |
| 12:31:24 | <lambdabot> | Nothing >>= _ = Nothing |
| 12:31:28 | <ziman> | @src [] (>>=) |
| 12:31:28 | <lambdabot> | xs >>= f = concatMap f xs |
| 12:31:46 | <ziman> | @src ((->) e) (>>=) |
| 12:31:46 | <lambdabot> | Source not found. Where did you learn to type? |
| 12:32:26 | <Axman6> | [1..10] >>= (+1) |
| 12:32:31 | <Botje> | f >>= g = \r -> f r (g r) |
| 12:32:35 | <Axman6> | > [1..10] >>= (+1)a |
| 12:32:35 | <lambdabot> | Couldn't match expected type `t -> [b]' |
| 12:32:40 | <Axman6> | > [1..10] >>= (+1) |
| 12:32:41 | <lambdabot> | add an instance declaration for (Enum [b], Num [b]) |
| 12:33:06 | <Axman6> | > [1..10] >>= ((+1):[]) |
| 12:33:07 | <lambdabot> | Couldn't match expected type `t -> [b]' |
| 12:33:11 | <Axman6> | meh |
| 12:33:20 | <ziman> | > [1..10] >>= ((:[]) . (+1)) |
| 12:33:21 | <lambdabot> | [2,3,4,5,6,7,8,9,10,11] |
| 12:34:20 | <ziman> | the list monad is useful for nondeterministic computations |
| 12:34:31 | <ziman> | and a fancy powerset definition |
| 12:34:43 | <ziman> | > filterM (const [True, False]) [1..5] |
| 12:34:44 | <lambdabot> | [[1,2,3,4,5],[1,2,3,4],[1,2,3,5],[1,2,3],[1,2,4,5],[1,2,4],[1,2,5],[1,2],[1,... |
| 12:34:55 | <thoughtpolice> | i still don't totally get the list monad |
| 12:35:08 | <thoughtpolice> | ACTION is a bad haskeller :( |
| 12:36:00 | <olsner> | @quote list |
| 12:36:00 | <lambdabot> | Cale says: I spent a whole summer being paid to write a nondeterministic search program like this, in the list monad in Haskell |
| 12:36:08 | <olsner> | @quote list |
| 12:36:08 | <lambdabot> | ghc says: Can't match unequal length lists |
| 12:37:39 | <vixey> | > mapM (const [True, False]) [1..5] |
| 12:37:40 | <lambdabot> | [[True,True,True,True,True],[True,True,True,True,False],[True,True,True,Fals... |
| 12:37:52 | <vixey> | > mapM (\x -> [(x,True), (x,False)]) [1..5] |
| 12:37:53 | <lambdabot> | [[(1,True),(2,True),(3,True),(4,True),(5,True)],[(1,True),(2,True),(3,True),... |
| 12:38:22 | <vixey> | > filterM (const [True, False]) [1..5] |
| 12:38:24 | <lambdabot> | [[1,2,3,4,5],[1,2,3,4],[1,2,3,5],[1,2,3],[1,2,4,5],[1,2,4],[1,2,5],[1,2],[1,... |
| 12:38:55 | <vixey> | > sequence ["abc","xyz","123"] |
| 12:38:57 | <lambdabot> | ["ax1","ax2","ax3","ay1","ay2","ay3","az1","az2","az3","bx1","bx2","bx3","by... |
| 12:41:03 | <lambdapants> | something that may amuse you: |
| 12:41:03 | <lambdapants> | compiling Data.Derive on my vserver led to an excessive use of memory, not only destroying my server, but half of the subnet including http://linuxvps.org. in essence, I used ghc to shut down a datacentre. |
| 12:41:07 | <lambdabot> | Title: Linux VPS |
| 12:41:15 | <ayumilove1> | @seen arnar |
| 12:41:15 | <lambdabot> | arnar is in #haskell. I don't know when arnar last spoke. |
| 12:41:24 | <ayumilove1> | @seen vixey |
| 12:41:25 | <lambdabot> | vixey is in #scala, #perl6, #haskell and ##logic. I last heard vixey speak 2m 29s ago. |
| 12:41:39 | <byorgey> | lambdabot: impressive! |
| 12:41:50 | <byorgey> | er, lambdapants =) |
| 12:42:11 | <thoughtpolice> | lambdapants: nice |
| 12:43:12 | <byorgey> | seems like a pretty poor setup if excessive memory use on one virtual server can take down a whole datacentre, though... |
| 12:43:17 | <Axman6> | lambdabot: i cn h4z codz 4 2 do dis? |
| 12:43:22 | <Axman6> | uhm, lambdapants |
| 12:43:28 | <byorgey> | you'd think they would have safeguards to prevent those sorts of things |
| 12:43:33 | <lambdapants> | That's what I thought1 |
| 12:43:56 | <lambdapants> | surely a user level process on one computer should not be able to shut down everything including the webserver! |
| 12:44:10 | <lambdapants> | maybe they wrote it all in bash and awk and it runs in their garage. |
| 12:44:57 | <lambdapants> | oh theres programming language snobbery again, I apologise |
| 12:44:58 | <byorgey> | that's...kinda what it looks like, judging by their website =) |
| 12:45:35 | <vixey> | lambdapants: Don't worry, You'll see what happens when somebody mentions java |
| 12:45:51 | <pozic> | lambdapants: most operating systems can be brought down by a user other than root. |
| 12:46:25 | <lambdapants> | pozic: I have never tried ;) |
| 12:47:52 | <Axman6> | vixey: is it bad that after using java for only a little while, i no longer hate it? |
| 12:48:18 | <vixey> | Axman6: Just means you're at least slightly sensible |
| 12:48:27 | <byorgey> | Axman6: no, that's normal. it's after using it for more than a little while that you start to hate it. |
| 12:48:34 | <Axman6> | heh, ok, good |
| 12:48:42 | <chrisdone> | chr1s: your runFormState takes an action Monad m => Form xml m a, but then inside you use evalState. how are other monads supposed to run inside it? can you explain this please? |
| 12:49:01 | <ayumilove1> | even[1..25] |
| 12:49:04 | <ayumilove1> | > even[1..25] |
| 12:49:05 | <lambdabot> | add an instance declaration for (Integral [t]) |
| 12:49:05 | <lambdabot> | In the expression: even ... |
| 12:49:08 | <Axman6> | our Java assignment this term is to write one of three games. my friend and i are going to do asteroids, which should be fun |
| 12:49:12 | <ayumilove1> | > Integeral even[1..25] |
| 12:49:12 | <lambdabot> | Not in scope: data constructor `Integeral' |
| 12:49:21 | <ayumilove1> | > filterl even[1..25] |
| 12:49:22 | <lambdabot> | Not in scope: `filterl' |
| 12:49:23 | <Axman6> | > filter even [1..25] |
| 12:49:24 | <lambdabot> | [2,4,6,8,10,12,14,16,18,20,22,24] |
| 12:49:26 | <ayumilove1> | > filter even[1..25] |
| 12:49:27 | <lambdabot> | [2,4,6,8,10,12,14,16,18,20,22,24] |
| 12:49:31 | <chrisdone> | chr1s: I'd expect runStateT |
| 12:49:36 | <ayumilove1> | > map even[1..25] |
| 12:49:37 | <lambdabot> | [False,True,False,True,False,True,False,True,False,True,False,True,False,Tru... |
| 12:49:41 | <ayumilove1> | oh ok |
| 12:50:02 | <ayumilove1> | filter (<2)[1..25] |
| 12:50:05 | <byorgey> | Axman6: nice. I suppose I shouldn't tell you that there's a version of asteroids on hackage already. ;) |
| 12:50:08 | <ayumilove1> | > filter (<2)[1..25] |
| 12:50:09 | <lambdabot> | [1] |
| 12:50:33 | <byorgey> | Axman6: and even if I did tell you, that's no reason you can't write your own of course =) |
| 12:50:40 | <Axman6> | byorgey: probably wouldn't make much difference, being java n' all |
| 12:50:48 | <ayumilove1> | > sum[1..25] |
| 12:50:50 | <lambdabot> | 325 |
| 12:50:57 | <byorgey> | oh! I... completely missed the 'Java' part of your sentence =) |
| 12:51:03 | <Axman6> | heh |
| 12:51:08 | <ayumilove1> | hmm |
| 12:51:10 | <ayumilove1> | guys |
| 12:51:14 | <byorgey> | hi ayumilove1 |
| 12:51:22 | <ayumilove1> | what are the other prhases that i can use for list? like sum , product |
| 12:51:29 | <ayumilove1> | > product [1..25] |
| 12:51:31 | <lambdabot> | 15511210043330985984000000 |
| 12:51:36 | <ayumilove1> | > division[1..25] |
| 12:51:38 | <lambdabot> | Not in scope: `division' |
| 12:51:45 | <ayumilove1> | > subtraction[1..25] |
| 12:51:46 | <lambdabot> | Not in scope: `subtraction' |
| 12:51:57 | <byorgey> | well, there are folds |
| 12:52:04 | <Axman6> | > foldl1 (/) [1..25] |
| 12:52:05 | <lambdabot> | 6.446950284384474e-26 |
| 12:52:08 | <byorgey> | > foldl' (-) 0 [1..25] |
| 12:52:09 | <Axman6> | whoot |
| 12:52:09 | <lambdabot> | -325 |
| 12:52:14 | <lambdapants> | I wrote half a multiplayer game in haskell..... with random maps, and "a star" and all sorts of crap. But it needs a 3d engine to be cool and i wrote most of it while stoned so it's about 2000 lines |
| 12:52:28 | <Axman6> | lol |
| 12:52:32 | <Axman6> | > foldl1 (/) [1..100] |
| 12:52:33 | <lambdabot> | 1.071510288125467e-158 |
| 12:52:39 | <byorgey> | > concatMap (\n -> replicate n n) [1..25] |
| 12:52:41 | <lambdabot> | [1,2,2,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,9,9... |
| 12:52:46 | <ayumilove1> | >@src foldl |
| 12:52:50 | <ayumilove1> | > @src foldl |
| 12:52:51 | <lambdabot> | Parse error at "@src" (column 1) |
| 12:52:55 | <ayumilove1> | > @src fold |
| 12:52:55 | <lambdabot> | Parse error at "@src" (column 1) |
| 12:52:59 | <ayumilove1> | o_O |
| 12:53:00 | <Axman6> | @src foldl1 |
| 12:53:00 | <lambdabot> | foldl1 f (x:xs) = foldl f x xs |
| 12:53:00 | <lambdabot> | foldl1 _ [] = undefined |
| 12:53:09 | <Axman6> | @src foldl |
| 12:53:10 | <lambdabot> | foldl f z [] = z |
| 12:53:10 | <lambdabot> | foldl f z (x:xs) = foldl f (f z x) xs |
| 12:53:22 | <Axman6> | @src foldr |
| 12:53:22 | <lambdabot> | foldr f z [] = z |
| 12:53:22 | <lambdabot> | foldr f z (x:xs) = f x (foldr f z xs) |
| 12:53:33 | <ayumilove1> | @src foldr |
| 12:53:34 | <lambdabot> | foldr f z [] = z |
| 12:53:34 | <lambdabot> | foldr f z (x:xs) = f x (foldr f z xs) |
| 12:53:38 | <ayumilove1> | oh |
| 12:53:42 | <ayumilove1> | @src foldr |
| 12:53:43 | <lambdabot> | foldr f z [] = z |
| 12:53:43 | <lambdabot> | foldr f z (x:xs) = f x (foldr f z xs) |
| 12:53:46 | <ayumilove1> | ah i see |
| 12:53:51 | <ayumilove1> | when using @, we dont need > |
| 12:54:00 | <Axman6> | yes |
| 12:54:05 | <ayumilove1> | no one told me -_- |
| 12:54:11 | <Axman6> | > evaluates a haskell expression |
| 12:54:21 | <Axman6> | @ is used for lambdabot commands |
| 12:54:49 | <vixey> | @run 1+1 |
| 12:54:51 | <lambdabot> | 2 |
| 12:54:51 | <ayumilove1> | anyone used php and asp before? |
| 12:55:07 | <ayumilove1> | to make website |
| 12:55:07 | <vixey> | ayumilove1: I have used PHP but not ASP |
| 12:55:27 | <ayumilove1> | i would like to make a simple website, but dont know which 1 to choose, |
| 12:55:34 | <chrisdone> | use haskell, duh |
| 12:55:34 | <ayumilove1> | many say php is free |
| 12:55:40 | <ayumilove1> | haskell for website o_O |
| 12:55:40 | <Axman6> | it is |
| 12:55:43 | <vixey> | ayumilove1: to be quite honest I suggest not using either |
| 12:55:50 | <chrisdone> | !!Haskell For Web Site!! |
| 12:55:53 | <ayumilove1> | visey recommendation? |
| 12:55:59 | <Axman6> | yeah, neither are all that easy |
| 12:55:59 | <vixey> | ayumilove1: common lisp |
| 12:56:01 | <lambdapants> | I've known php for years and I'd rather write a website with my arse. |
| 12:56:16 | <kryptiskt> | all the cool kids are using ruby now |
| 12:56:18 | <ayumilove1> | common lisp, is it popular? |
| 12:56:33 | <ayumilove1> | ruby is for website? |
| 12:56:35 | <chrisdone> | kryptiskt: haskell kids were cool before cool was cool |
| 12:56:36 | <lambdapants> | ruby on rails is good if you are new to web development |
| 12:56:39 | <vixey> | ayumilove1: ruby sucks |
| 12:56:59 | <ayumilove1> | what makes common lisp > php asp.net |
| 12:57:04 | <vixey> | >> x = 666; puts "x was #{x}"; 1.times {|x| 2}; puts "x is #{x}" |
| 12:57:04 | <vixey> | x was 666 |
| 12:57:04 | <vixey> | x is 0 |
| 12:57:16 | <lambdapants> | vixey: you're right. why do blocks have to be the last argument to a method??? why not have first class functions??? |
| 12:57:33 | <vixey> | ayumilove1: because it sucks less |
| 12:57:44 | <ayumilove1> | thats not a very good reason ^_^ " |
| 12:57:57 | <chrisdone> | "not sucking less" is the best reason to use anything |
| 12:58:03 | <chrisdone> | uh, s/not// |
| 12:58:03 | <vixey> | I thought it was a good reason |
| 12:58:04 | <Axman6> | i didn't find rails all that easy to use actually |
| 12:58:08 | <Axman6> | it confused me -_- |
| 12:58:17 | <lambdapants> | I think the people at edinburgh university make a version of lisp for web development... theres others too |
| 12:58:20 | <Axman6> | i don't like i when i'm learning something, and i suddenly fit a wall |
| 12:58:37 | <ayumilove1> | you mean hit a wall? |
| 12:58:40 | <ivanm> | chrisdone: why isn't it? surely you'd use the tool that is least unsuitable for the job? |
| 12:58:44 | <chrisdone> | yeah, I read the first page of Why's annoying tutorial and decided it would be less laborous to write a library for haskell |
| 12:58:48 | <Axman6> | speaking of lisp: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ is pretty cool |
| 12:58:50 | <ivanm> | lambdapants: you mean wadler's links project? |
| 12:58:53 | <lambdapants> | Axman6: I like ruby on rails for simple apps, but I tried to write an extension to active record once and it was like brushing my teeth with a rake. |
| 12:58:54 | <ivanm> | it's not lisp IIRC... |
| 12:59:36 | <Axman6> | chrisdone: i was quite entertained by Why's thing actually |
| 12:59:37 | <chrisdone> | ivanm: I said "sucking the least" is the best reason to use anything |
| 12:59:50 | <chrisdone> | Axman6: well, I'd expect some people would be |
| 13:01:16 | <kryptiskt> | I do my web programming in C (no, I'm not perverted, I do embedded stuff :-)) |
| 13:01:50 | <lambdapants> | that's a fine like lryptiskt :p |
| 13:02:27 | <lambdapants> | you mean, for the web apps that run on routers and stuff? |
| 13:02:39 | <chrisdone> | chr1s: ping? |
| 13:03:01 | <kryptiskt> | configuration pages for devices you can attach to your LAN. |
| 13:03:09 | <ayumilove1> | > print 1 |
| 13:03:10 | <lambdabot> | <IO ()> |
| 13:03:13 | <ayumilove1> | > print 2 |
| 13:03:14 | <lambdabot> | <IO ()> |
| 13:03:20 | <ayumilove1> | what does it mean? |
| 13:03:23 | <chrisdone> | the same happens for `print 3' |
| 13:03:27 | <ayumilove1> | print2 |
| 13:03:27 | <tibbe_> | which one i preferred: c2hs or hcs@hs ? |
| 13:03:29 | <Twey_> | ACTION laughs. |
| 13:03:30 | <lambdapants> | most interesting :) |
| 13:03:30 | <chrisdone> | it means `print x' is an IO action |
| 13:03:31 | <ayumilove1> | > print2 |
| 13:03:32 | <lambdabot> | Not in scope: `print2' |
| 13:03:39 | <ivanm> | chrisdone: ahh, I misread your s/not// as you saying that it _isn't_ the best reason :s |
| 13:03:39 | <ayumilove1> | > print(2) |
| 13:03:39 | <Twey_> | ayumilove1: It means you're getting an IO monad back. |
| 13:03:40 | <tibbe> | I need to wrap C structs using FFI |
| 13:03:41 | <lambdabot> | <IO ()> |
| 13:03:46 | <idnar> | @hoogle Integer -> Char |
| 13:03:47 | <lambdabot> | No matches, try a more general search |
| 13:03:51 | <Twey_> | Which is what's expected. |
| 13:03:54 | <ayumilove1> | Twey_ what is an IO monad? |
| 13:03:56 | <idnar> | @hoogle Int -> Char |
| 13:03:57 | <lambdabot> | Data.Char.intToDigit :: Int -> Char |
| 13:03:57 | <lambdabot> | Data.Char.chr :: Int -> Char |
| 13:03:57 | <lambdabot> | Data.PackedString.indexPS :: PackedString -> Int -> Char |
| 13:03:57 | <lambdapants> | I'm away! time to try happs without crashing the data-centre again...... |
| 13:04:05 | <kryptiskt> | tibbe. c2hs is your friend |
| 13:04:21 | <tibbe> | kryptiskt: what are the pros/cons vs hcs2hs? |
| 13:04:29 | <Twey_> | ayumilove1: http://www.haskell.org/haskellwiki/Introduction_to_IO |
| 13:04:30 | <lambdabot> | Title: Introduction to IO - HaskellWiki |
| 13:04:41 | <ayumilove1> | thanks twey! |
| 13:04:52 | <ayumilove1> | imma rest ^_^ |
| 13:05:21 | <chrisdone> | twey: you make people sleepy |
| 13:05:24 | <kryptiskt> | tibbe. eh, I know it better. I guess that's not a good reason... |
| 13:05:31 | <tibbe> | ok |
| 13:06:11 | <tibbe> | is it c2hs that the SoC guy is extracting the C API from? |
| 13:17:09 | <Axman6> | > sqrt(2) + log 5 - 1 / (3 + sqrt(7)) |
| 13:17:10 | <lambdabot> | 2.846527130339491 |
| 13:18:05 | <Axman6> | > (sqrt(2) + log 5 - 1 / (3 + sqrt(7)))**2 |
| 13:18:06 | <lambdabot> | 8.102716703758777 |
| 13:18:26 | <ski> | > exp pi - pi |
| 13:18:27 | <lambdabot> | 19.999099979189474 |
| 13:18:33 | <feifei> | > 1+1 |
| 13:18:35 | <lambdabot> | 2 |
| 13:24:29 | <heavensrevenge> | hello |
| 13:27:03 | <Axman6> | o/ |
| 13:27:15 | <esteth> | Does anyone know if there's a debian package for Graphics.UI.GLUT? I've got the Graphics.Rendering.OpenGL one, but I'd rather not go from source if I can help it. |
| 13:29:25 | <gwern> | libghc6-glut-dev ? |
| 13:30:01 | <esteth> | D'oh. I can't beleive I didn't see that in my apt-cache search! Thanks a lot :) |
| 13:30:47 | <pozic> | gwern: HList on Hackage does not export Data.HList even though it is the exposed modules list. |
| 13:33:39 | <dafra> | anyone using archlinux out there ? |
| 13:35:09 | <gwern> | pozic: dunno, darcs hlist exports Data.HList fine for me |
| 13:35:18 | <esteth> | dafra, I have it on my laptop |
| 13:35:22 | <gwern> | dafra: annoyingly many of you arch users, yes |
| 13:35:34 | <dafra> | esteth: how did you install it ? |
| 13:35:44 | <dafra> | esteth: ftp install failed for me |
| 13:35:52 | <esteth> | I used the offline installation |
| 13:36:00 | <dafra> | esteth: dependency cycle, something like that |
| 13:36:12 | <dafra> | esteth: i shold try it then |
| 13:36:34 | <esteth> | Once it's installed and you're online, a pacman -Syu will get you up to date anyway |
| 13:36:36 | <TomMD> | dafra: There is alsa #arch-haskell, just fyi |
| 13:36:53 | <pozic> | gwern: yes, but the darcs version does not export firstLabel. |
| 13:37:28 | <dafra> | TomMD: the is #archlinux too, but myproblems do not interest them at all ! |
| 13:37:35 | <gwern> | does it make sense to? it's defined in multiple places |
| 13:38:15 | <TomMD> | dafra: As a rule, arch users don't seem interested in helping with problems. They seem to try hard to maintain the RTFM / do it yourself environment. |
| 13:38:20 | <pozic> | gwern: how do you make a record with that library? |
| 13:38:30 | <gwern> | I have no idea |
| 13:38:38 | <pozic> | gwern: the examples from the paper don't work, since they depend on first label. Ok. |
| 13:38:42 | <esteth> | #archlinux was very helpful with my wireless problem :) |
| 13:38:50 | <pozic> | firstLabel* |
| 13:39:27 | <TomMD> | esteth: I am speaking only from my one experience, of coarse. Glad to see it isn't always so. |
| 13:39:56 | <dafra> | TomMD: does the overlay work only with x86_64 ? |
| 13:40:07 | <dafra> | TomMD: haskell overlay |
| 13:43:36 | <thoughtpolice> | yes, when I used arch they were also very helpful with a few of the problems I had |
| 13:45:03 | <vixey> | it says "The workaround is to register at least one package in the user package db" |
| 13:45:09 | <vixey> | how do you do that with ghc-pkg? |
| 13:46:50 | <byorgey> | vixey: workaround for what? |
| 13:47:05 | <thoughtpolice> | vixey: ghc head? |
| 13:47:21 | <thoughtpolice> | uh, I can't quite remember how I got at least one thing registered with cabal there |
| 13:47:39 | <vixey> | Configuring ivor-0.1.7... |
| 13:47:40 | <vixey> | Setup.lhs: ghc-pkg describe * failed |
| 13:47:46 | <vixey> | and it's called ghc bug #2201 |
| 13:47:53 | <thoughtpolice> | i poked around until I found a file somewhere that satisified the input necessary for 'ghc-pkg register' |
| 13:48:06 | <thoughtpolice> | which is basically the output from ghc-pkg describe |
| 13:48:08 | <thoughtpolice> | iirc |
| 13:48:13 | <int-e> | find the supposed location of the package.conf file and write [] into the file |
| 13:49:49 | <dcoutts> | thoughtpolice: we've fixed it in the darcs version of Cabal |
| 13:50:06 | <dcoutts> | thoughtpolice: waern implemented support for ghc-pkg dump |
| 13:50:41 | <thoughtpolice> | dcoutts: cool beans, maybe time to rebuild HEAD :) |
| 13:53:56 | <thoughtpolice> | dcoutts: I was thinking of maybe tackling or working on some of the minor cabal/cabal-install bugs, I was wondering if you have any general working conventions you follow to make sure your stable stuff doesn't get cluttered up? (typically I just prefix the installation somewhere like ~/ghc-head) |
| 13:54:10 | <thoughtpolice> | (with everything else in ~/bin) |
| 14:02:52 | <vixey> | hey why does ghc use Makefiles and all that crap? |
| 14:02:57 | <lambdapants> | greetings fair citizens |
| 14:03:21 | <lambdapants> | anyone got happs working on debian? |
| 14:05:53 | <lambdapants> | I run my app in ghci. It loads the packages, then segfaults before I can type anything. |
| 14:07:47 | <vixey> | ok |
| 14:07:52 | <lambdapants> | the weirdest thing is, I can actually run a happs application |
| 14:07:54 | <vixey> | this is the full error message, |
| 14:07:55 | <vixey> | cabal-bin: ghc-pkg describe * failed. If you are using ghc-6.9 and have an |
| 14:07:55 | <vixey> | empty user package database then this is probably due to ghc bug #2201. The |
| 14:07:55 | <vixey> | workaround is to register at least one package in the user package db. |
| 14:08:03 | <vixey> | How do you solve it? |
| 14:08:31 | <vixey> | inside ghc-6.9.20080719/libraries/bootstrapping.conf is just: [] |
| 14:08:42 | <lambdapants> | sounds disgusting.... over my head anyway |
| 14:08:53 | <dcoutts> | vixey: that's now fixed in the latest Cabal |
| 14:08:53 | <dcoutts> | vixey: or use the workaround it suggests |
| 14:09:15 | <vixey> | Can I install the latest cabal and this will just disappear? |
| 14:09:22 | <vixey> | oh |
| 14:09:26 | <vixey> | I don't know how to do the workaround |
| 14:10:27 | <vixey> | dcoutts, does that mean: darcs get --partial http://darcs.haskell.org/cabal/ |
| 14:10:28 | <vixey> | ? |
| 14:10:28 | <lambdabot> | Title: Index of /cabal |
| 14:11:05 | <dino-> | I have a couple of questions about cabal. I've been using the 1.2.3.0 that came with ghc 6.8.2. But I see shiny cli examples showing usage of cabal-setup instead of `runhaskell Setup.lhs` or similar. I don't seem to have that program, cabal-setup.. |
| 14:11:05 | <ertai> | I've written a parsec parser and the error message seems a little obsucure "expecting white-space, carriage return followed by linefeed, comment or <some>" since I don't have tokens and layouts, so no comments... |
| 14:11:09 | <thoughtpolice> | if you just do ./darcs-all pull -a in the head's ./ it should pull the latest cabal for you |
| 14:11:34 | <dino-> | Is it fairly safe for me to just install something stable like 1.4.0.1 and run with that? |
| 14:11:43 | <vixey> | I don't have darcs-all |
| 14:11:45 | <thoughtpolice> | dino-: install cabal 1.4.0.1 |
| 14:11:45 | <Axman6> | @src quot |
| 14:11:45 | <lambdabot> | Source not found. That's something I cannot allow to happen. |
| 14:11:53 | <vixey> | So I must get GHC from darcs instead of HEAD |
| 14:11:53 | <thoughtpolice> | then you can build and use cabal-install |
| 14:11:54 | <vixey> | ? |
| 14:12:09 | <thoughtpolice> | vixey: if you pulled GHC from darcs i.e. http://darcs.haskell.org/ghc or whatever |
| 14:12:10 | <dcoutts> | vixey: were you using the latest darcs HEAD ? If so I guess that means the fix hasn't migrated into the branch of Cabal that ghc uses yet, and you'd have to use the HEAD branch of Cabal which is not guaranteed to work with ghc. |
| 14:12:10 | <lambdabot> | Title: Index of /ghc |
| 14:12:13 | <thoughtpolice> | it should have the darcs all script |
| 14:12:28 | <thoughtpolice> | dcoutts: oh? hm |
| 14:12:32 | <vixey> | :SS.... |
| 14:12:44 | <dcoutts> | dino-: it's not cabal-setup. The cabal-install package provides a command line program 'cabal'. |
| 14:14:40 | <dino-> | dcoutts: Ok. I only mentioned it after seeing it in Cabal docs like: "The type of build used by this package. Build types are the constructors of the BuildType type, defaulting to Custom. If this field is given a value other than Custom, some tools such as cabal-setup will be able to build the package without using the setup script." |
| 14:15:10 | <dino-> | So, I should get cabal 1.4.0.1 and cabal-install 0.5.1 ? |
| 14:15:24 | <dcoutts> | dino-: yep, I've updated the docs to refer to cabal-install (which replaces the earlier cabal-setup) |
| 14:15:30 | <dcoutts> | dino-: yes. |
| 14:15:39 | <dino-> | Great, thank you. |
| 14:17:36 | <dino-> | btw, the data-files and data-dir thing is very cool with the Paths_<pkg> module. We had something similar to this way back in Java for locating static resources stored in .jar files. It's very civilized to have this ability to locate data files without resorting to something creepy like finding the bin path at runtime. |
| 14:18:18 | <dcoutts> | dino-: :-) |
| 14:18:24 | <dino-> | Which still may not even help you if data is stored far away, like not near /usr/share/bin or whatever |
| 14:26:43 | <lambdapants> | I have a really odd problem |
| 14:27:14 | <TomMD> | If I use a different compiler with cabal (ex: hugs instead of ghc) will cabal atomatically change the library locations accordingly? |
| 14:29:50 | <lambdapants> | In ghci I can type |
| 14:29:50 | <lambdapants> | simpleHTTP nullConf [ method GET $ ok $ toResponse "hiya!" ] and it'll work just fine |
| 14:29:56 | <vixey> | yeah we should replace build systems with AIs |
| 14:30:07 | <vixey> | maybe they can figure out all these silly workarounds and such for you |
| 14:30:07 | <lambdapants> | but if I put it in a file and ask ghci or ghc to compile it, I get a segmentation fault |
| 14:33:20 | <thoughtpolice> | lambdapants: does GHC seg fault or does the resulting application? |
| 14:33:28 | <lambdapants> | ghc segfaults |
| 14:33:35 | <lambdapants> | wait, I wasn't quite accurate there |
| 14:33:42 | <lambdapants> | but theres still something weird afoot! |
| 14:33:46 | <lambdapants> | wait a wee second... |
| 14:33:57 | <thoughtpolice> | lambdapants: can you paste the result of trying to compile with ghc --make? |
| 14:34:13 | <thoughtpolice> | if GHC throws some 'impossible' err or it actually segfaults then it is a bug that needs to be reported |
| 14:34:15 | <dino-> | TomMD: There is a switch for configure: --ghc, --nhc, --hugs |
| 14:35:08 | <lambdapants> | oooh, I get a different error sometimes... |
| 14:35:22 | <dino-> | I'm no cabal-master, but this seems like in the neighborhood of setting up to build against the proper things. |
| 14:35:38 | <lambdapants> | sorry for noobing but please remind me how to pastebin again |
| 14:35:45 | <dcoutts> | @hpaste |
| 14:35:45 | <lambdabot> | Haskell pastebin: http://hpaste.org/new |
| 14:35:49 | <lambdapants> | thankyou |
| 14:36:24 | <dcoutts> | TomMD: the default install paths depend on the compiler you configure with. |
| 14:36:47 | <dino-> | TomMD: The docs say this defaults to the impl under which the script was compiled or interpreted. i.e. what runhaskell just pointed to to run Setup.[l]hs |
| 14:36:52 | <lambdapants> | http://hpaste.org/9514 |
| 14:37:15 | <dcoutts> | TomMD: and doing configure again (eg with a different compiler) forgets any previous configuration you used (including any manually specified paths etc) |
| 14:37:43 | <dino-> | dcoutts: ah, no need to clean explicitly to re-configure. Good to know |
| 14:37:53 | <dcoutts> | right |
| 14:38:02 | <dcoutts> | and you can clear without cleaning the config too |
| 14:38:07 | <dcoutts> | erm clean |
| 14:38:26 | <dino-> | Oh? I need that kind of often. |
| 14:38:32 | <dcoutts> | cabal clean -s or --save-configure |
| 14:38:35 | <dcoutts> | see --help |
| 14:38:35 | <thoughtpolice> | run clean with the -s option |
| 14:38:37 | <dino-> | nice! |
| 14:38:57 | <dcoutts> | some people think that should be the default |
| 14:39:42 | <dino-> | I almost want to say this is what's meant sometimes by clean vs distclean |
| 14:39:58 | <dino-> | But that sounds like not a good analogy maybe |
| 14:40:04 | <dino-> | dist != configuration |
| 14:40:09 | <chrisdone> | chr1s: ping |
| 14:40:55 | <dino-> | But yeah, I guess I would lean towards it being keep config as default, switch for more serious clean blowing away config |
| 14:41:15 | <dino-> | Regardless, it's good to have the option now. yay |
| 14:43:49 | <vixey> | How does GHC build process work? |
| 14:43:53 | <lambdapants> | here's a ghc error http://hpaste.org/9515a |
| 14:44:27 | <lambdapants> | sorry http://hpaste.org/9515 |
| 14:44:43 | <chrisdone> | vixey: it conjures the spirits of the computer with its spells |
| 14:45:36 | <lambdapants> | I believe it translates the normal haskell you write into just let and case statements, then to c, then to assembler |
| 14:45:39 | <TomMD> | dcoutts: Thanks! I see GHC, NHC, Hugs and JHC are all supported. Can't wait to see more compilers added to the mix as they become available. |
| 14:46:00 | <EvilTerran> | "KillerSmurf"?! |
| 14:46:43 | <dino-> | So, to clarify, the cli tool 'cabal' is part of cabal-install and it uses your Cabal registered with the compiler. And I can do things like `cabal configure` `cabal build` and so on now instead of runhaskell Setup.hs ? |
| 14:47:16 | <lambdapants> | EvilTerran: I thought KillerSmurf was a fine name for a functional programming journal :p |
| 14:47:20 | <thoughtpolice> | lambdapants: are you using ghc 6.6 or ghc 6.8? the native code gen is the default for 6.8 and it skips the entire 'generate C' stage |
| 14:47:26 | <TomMD> | dino-: I think thats correct except the Cabal used is statically linked when you compile cabal-instal. |
| 14:47:28 | <dino-> | There are no longer things like cabal-install and cabal-setup CLI tools? |
| 14:47:31 | <thoughtpolice> | dino-: yes |
| 14:47:46 | <chrisdone> | EvilTerran: ‽ |
| 14:47:46 | <thoughtpolice> | dino-: yes, everything has been merged into cabal-install |
| 14:47:50 | <thoughtpolice> | as well there is also cabal-upload |
| 14:47:54 | <thoughtpolice> | and other various things |
| 14:48:04 | <TomMD> | cabal upload is a great time saver. |
| 14:48:09 | <thoughtpolice> | TomMD: seriously |
| 14:48:11 | <EvilTerran> | chrisdone, er, what? |
| 14:48:12 | <dino-> | Ok. Thank you. |
| 14:48:15 | <dino-> | This is great stuff |
| 14:48:30 | <chrisdone> | EvilTerran: the interrobang is the pinnacle of optimisation |
| 14:48:35 | <lambdapants> | thoughtpolice: I'm using 6.8, but actually I was attempting to answer vixey's question which you have now so well answered. |
| 14:48:46 | <EvilTerran> | chrisdone, ah, i see. not when my font doesn't have it, unfortunately =/ |
| 14:49:04 | <lambdapants> | Anyone got a clue how I broke ghc? the debian packages must be ge******en. |
| 14:49:28 | <chrisdone> | EvilTerran: oh ;_; |
| 14:51:41 | <guenni> | hi, anybody doing lots of FFI stuff? |
| 14:53:20 | <dino-> | And at this time `cabal install <FOO>` doesn't do this progression of targets: configure build test haddock install ? |
| 14:53:37 | <chr1s> | chrisdone: pong |
| 14:53:43 | <gwern> | doesn't do haddock |
| 14:53:45 | <gwern> | really, yet |
| 14:53:47 | <thoughtpolice> | dino-: it will do all that if you use it to install something off hackage |
| 14:54:01 | <thoughtpolice> | i.e. 'cabal install hnop' or whatever |
| 14:54:06 | <thoughtpolice> | if you are in a local dir, then no |
| 14:54:07 | <gwern> | dino-: I mean, it'll do haddock soon, hopefully. pieces are being put into place recently |
| 14:54:42 | <thoughtpolice> | it can't generate haddock docs automatically for things installed off hackage, although if you're using cabal to replace the whole 'runhaskell Setup...' stuff you can do 'cabal haddock' and it'll take care of it |
| 14:55:31 | <dino-> | hm, but the resulting haddock docs get installed (I thought) during the install target |
| 14:55:46 | <dino-> | But the point maybe is: this stuff is being worked on now |
| 14:56:13 | <thoughtpolice> | dino-: no, haddock is explicit |
| 14:57:02 | <dino-> | thoughtpolice: Huh, doing that command goes all the way out to writing into /usr/local/share/doc ? |
| 14:57:10 | <dino-> | Sounds like it must be configured to know that location |
| 14:57:25 | <chrisdone> | chr1s: hey. I don't understand how runFormState is supposed to be used, would it be possible to have e runFormStateT? it would be nice for a checkM function to read from file or a DB, if you see what I mean |
| 14:58:42 | <dcoutts> | thoughtpolice: darcs version of cabal-install has --enable-documentation (ie generates haddock docs) |
| 14:59:20 | <chrisdone> | dcoutts: cool |
| 15:00:07 | <gwern> | dcoutts: did you add the configu option yet? |
| 15:00:22 | <dcoutts> | thoughtpolice: btw, it does it in a local dir too, "cabal install" in a local dir will do configure, build and install for the current package (and download and install deps too) |
| 15:00:28 | <dcoutts> | gwern: not to the config file |
| 15:00:39 | <gwern> | bah |
| 15:01:01 | <gwern> | is there no clever solution where adding an option automatically creates a CLI option and a config option? |
| 15:01:01 | <thoughtpolice> | dcoutts: oh it does? how nice. :) |
| 15:01:29 | <thoughtpolice> | i thought it would only do that for things of hackage |
| 15:02:09 | <chr1s> | chrisdone: the runFormState gives you a tuple of three things: |
| 15:02:27 | <chr1s> | an extractor function, which takes CGI input and gives you something of Failing a |
| 15:02:50 | <dcoutts> | gwern: yes, there is a clever solution, which is half implemented |
| 15:02:53 | <chr1s> | the resulting html (in case you're using Text.XHtml.Strict.Formlets |
| 15:03:08 | <gwern> | oh the pain of knowing so close yet so far |
| 15:03:16 | <gwern> | ACTION tears up |
| 15:03:17 | <chr1s> | and the form-encoding type (which changes if you use a file-input) |
| 15:03:32 | <dcoutts> | gwern: mnislaih got 2/3rds of the way there. |
| 15:03:50 | <gwern> | dcoutts: and then he got eaten by a grue? |
| 15:03:54 | <dcoutts> | heh heh |
| 15:03:59 | <chr1s> | chrisdone: so you just need to choose the right monad to read from the DB. |
| 15:04:04 | <mnislaih> | gwern: what's up ? |
| 15:04:10 | <chr1s> | dcoutts: how was the AngloHaskell presentation? |
| 15:04:16 | <chr1s> | any slides? |
| 15:04:24 | <dcoutts> | gwern, mnislaih: http://hackage.haskell.org/trac/hackage/ticket/223 |
| 15:04:25 | <lambdabot> | Title: #223 (allow per-package configuration options in config file) - Hackage - Trac |
| 15:04:26 | <gwern> | mnislaih: no haddock option in .cabal/config is what is up |
| 15:04:32 | <gwern> | it makes me has a sad |
| 15:04:34 | <dino-> | Ok. My situation is I'm working on kind of a large project in Haskell at work. I need to set up developer systems with the proper environment (which means I'd like them to have API docs too) and also servers that will run this software. It would be great to use `cabal install ...` to do the apt-like thing everywhere. But I do need local API docs most of the time. |
| 15:05:09 | <mnislaih> | oh I should take a look at that gwern |
| 15:05:12 | <dcoutts> | chr1s: it went well, there's audio. No slides, we only did a 10min demo. |
| 15:05:22 | <mnislaih> | but I'm rather too busy now :S |
| 15:05:28 | <dino-> | It sounds like at this time with cabal-install 0.5.1 I need to do the target steps manually to get haddock. I'm sorry to belabor this, but am still confused. |
| 15:05:45 | <chr1s> | dcoutts: cool! |
| 15:05:48 | <gwern> | dino-: I would personally write a shell script |
| 15:06:15 | <gwern> | 'alias cabal-install="cabal install --enable-documentation'; cabal-install foo && cabal-install ...' |
| 15:06:24 | <chrisdone> | chr1s: hmm, thanks. let me try it |
| 15:06:29 | <gwern> | or wait, cabal install takes multiple package names, no? |
| 15:06:45 | <dino-> | --enable-documentation is in 0.5.1? |
| 15:06:47 | <gwern> | so I guess 'cabal install --enable-documentation foo bar baz quux...' would suffice |
| 15:07:16 | <dcoutts> | dino-: that's correct. The 'cabal install --enable-documentation' will be in the next version. |
| 15:07:58 | <dcoutts> | dino-: ie it'll be in 0.5.2, it's not in 0.5.1 |
| 15:08:07 | <dino-> | dcoutts: Ok |
| 15:08:23 | <dino-> | gwern: I think I will make a shell script, yeah. For now. |
| 15:09:08 | <gwern> | whoa, -Wall is not happy on cabal-install |
| 15:09:42 | <gwern> | and haddock is broken on darcs cabal-install, hum |
| 15:10:04 | <dcoutts> | gwern: released version or devel? released only has 2 -Wall warnings. |
| 15:10:12 | <BONUS> | in head :: [a] -> a |
| 15:10:14 | <gwern> | darcs if course |
| 15:10:28 | <BONUS> | is it correct to say that a is a type parameter |
| 15:10:33 | <dcoutts> | gwern: we hacked build reporting in for AngloHaskell demo, so no time to fix -Wall |
| 15:10:35 | <BONUS> | or is it more correct to say its a polymorphic type |
| 15:10:36 | <vixey> | BONUS: no |
| 15:10:42 | <vixey> | BONUS: a is a type variable |
| 15:10:45 | <BONUS> | oh yeah |
| 15:10:47 | <dcoutts> | gwern: we got it working 10 min before our presentation :-) |
| 15:10:56 | <gwern> | 'Distribution/Client/Dependency/Naive.hs:122:45: Kind error: `InstallPlan.PlanPackage' is applied to too many type arguments In the type `InstallPlan.PlanPackage a' In the type `[InstallPlan.PlanPackage a]' In the type `Progress String String [InstallPlan.PlanPackage a] <document comment>'' |
| 15:11:03 | <gwern> | dcoutts: did it go well? |
| 15:11:15 | <dcoutts> | gwern: yes :-) |
| 15:11:27 | <gwern> | any video? |
| 15:11:31 | <dcoutts> | gwern: audio |
| 15:11:53 | <dcoutts> | it was interactive, we had a server running on Lemmih's laptop and had people connect |
| 15:12:12 | <dcoutts> | and demoed generating and uploading build reports, with build logs |
| 15:13:26 | <jinjing> | what is the best way to purely generate a list of random Int, from a seed? |
| 15:13:55 | <dino-> | Thanks again, everyone. For helping with my many questions. |
| 15:14:13 | <vixey> | the best? |
| 15:14:16 | <vixey> | :t random |
| 15:14:19 | <lambdabot> | forall g a. (RandomGen g, Random a) => g -> (a, g) |
| 15:14:21 | <vixey> | :t unfoldr random |
| 15:14:29 | <vixey> | :t unfoldr |
| 15:14:29 | <lambdabot> | forall b a. (b -> Maybe (a, b)) -> b -> [a] |
| 15:14:33 | <dino-> | lambdapants: If you're still having that problem: yikes. I've never seen that before in Debian. But I don't install it with apt for some time now. |
| 15:14:36 | <vixey> | :t unfoldr (Just . random) |
| 15:14:37 | <lambdabot> | forall a b. (RandomGen b, Random a) => b -> [a] |
| 15:14:44 | <vixey> | :t take ?n . unfoldr (Just . random) |
| 15:14:47 | <lambdabot> | forall a b. (RandomGen b, Random a, ?n::Int) => b -> [a] |
| 15:15:10 | <lambdapants> | dino: I've managed to narrow it down.... happs is not the problem |
| 15:15:18 | <lambdapants> | happs is the only part that works |
| 15:15:18 | <vixey> | > take 6 . unfoldr (Just . random) 42 |
| 15:15:26 | <vixey> | > take 6 . unfoldr (Just . random) $ 42 |
| 15:15:27 | <lambdapants> | all other libraries cause segfault |
| 15:15:29 | <lambdabot> | add an instance declaration for (Random [a]) |
| 15:15:29 | <lambdabot> | Add a type signature |
| 15:15:33 | <vixey> | :/ |
| 15:15:53 | <jinjing> | :/ |
| 15:15:55 | <lambdapants> | I get a linker error trying to make the smallest application too... :( |
| 15:16:29 | <chrisdone> | one is (take 6 . (unfoldr (Just . random) 42)) the other is ((take 6 . unfoldr (Just . random)) 42) |
| 15:16:32 | <lambdapants> | not enough memory, sadly |
| 15:16:54 | <vixey> | @hogle random |
| 15:16:55 | <lambdabot> | System.Random.random :: (Random a, RandomGen g) => g -> (a, g) |
| 15:16:55 | <lambdabot> | System.Random :: module |
| 15:16:55 | <lambdabot> | System.Random.Random :: class Random a |
| 15:17:02 | <chrisdone> | ha, hogle? |
| 15:17:20 | <chrisdone> | @tpe map |
| 15:17:20 | <lambdabot> | forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b |
| 15:17:23 | <chrisdone> | haha |
| 15:17:26 | <EvilTerran> | ?type \f -> unfoldr (Just . f) |
| 15:17:27 | <lambdabot> | forall a b. (b -> (a, b)) -> b -> [a] |
| 15:17:30 | <vixey> | > take 6 . unfoldr (Just . random) $ mkStdGen 42 |
| 15:17:31 | <lambdabot> | [-1673289139,1483475230,-825569446,1208552612,104188140,84572631] |
| 15:17:39 | <vixey> | > take 6 . unfoldr (Just . random) $ mkStdGen 42 :: [Bool] |
| 15:17:41 | <lambdabot> | [True,True,True,False,False,True] |
| 15:17:49 | <vixey> | > take 6 . unfoldr (Just . random) $ mkStdGen 42 :: [Either Bool Integer] |
| 15:17:50 | <lambdabot> | add an instance declaration for (Random (Either Bool Integer)) |
| 15:17:53 | <vixey> | boooo |
| 15:18:16 | <vixey> | > take 6 . unfoldr (Just . random) $ mkStdGen 42 :: String |
| 15:18:17 | <lambdabot> | "\41423\368463\206725\161530\914412\1094711" |
| 15:18:25 | <vixey> | > take 6 . filter alphanum . unfoldr (Just . random) $ mkStdGen 42 :: String |
| 15:18:26 | <lambdabot> | Not in scope: `alphanum' |
| 15:19:46 | <vixey> | :t random |
| 15:19:47 | <lambdabot> | forall g a. (RandomGen g, Random a) => g -> (a, g) |
| 15:19:57 | <jinjing> | thanks vixey |
| 15:20:26 | <Deewiant> | > take 10 $ randomRs (0,10) (mkStdGen 42) |
| 15:20:28 | <lambdabot> | [4,9,3,3,5,8,6,5,4,8] |
| 15:21:12 | <jinjing> | thanks Deewiant |
| 15:21:45 | <Deewiant> | > take 10 $ randoms (mkStdGen 2) :: [Int] |
| 15:21:47 | <lambdabot> | [-1154341369,688281713,1285055969,1919848627,429236652,-307810364,9606349,12... |
| 15:23:34 | <tibbe> | I'm getting an error from hsc2hs when using #poke, anyone have experience using hsc2hs? |
| 15:24:01 | <Botje> | try #prod or #jab instead :) |
| 15:35:44 | <TomMD> | tibbe: Post some code, I've been using hsc2hs lately. |
| 15:37:23 | <tibbe> | TomMD: http://hpaste.org/9516 |
| 15:37:36 | <tibbe> | TomMD: error at the bottom |
| 15:40:03 | <tibbe> | TomMD: hmm, maybe I'm missing a "struct" keyword |
| 15:40:57 | <tibbe> | TomMD: looks like that was it |
| 15:40:59 | <TomMD> | That sounds like a good guess. The hsc file itself looks good, so long as the .h file matches up properly |
| 15:41:09 | <TomMD> | Good |
| 15:45:32 | <thoughtpolice> | hi tibbe, working on your new io lib? |
| 15:45:41 | <tibbe> | thoughtpolice: yes |
| 15:46:03 | <tibbe> | TomMD: the hsc2hs example I looked at used a typedef for its struct which kevent doesn't |
| 15:46:42 | <TomMD> | Yeah, I got that. My xen bindings are mostly to typedefs, but I think there are one or two odd balls. |
| 15:47:06 | <gwern> | dcoutts: still around? zooko has suggested a 'unix-compat' package, and I was wondering how that would work |
| 15:47:35 | <gwern> | dcoutts: since darcs apparently reimplments a good chunk of 'unix' (System.Posix.*) but for windows, he thought it'd be useful to split those out |
| 15:48:31 | <Igloo> | unix-compat already exists |
| 15:48:40 | <TomMD> | ?hackage unix-compat |
| 15:48:40 | <lambdabot> | http://hackage.haskell.org/cgi-bin/hackage-scripts/package/unix-compat |
| 15:49:54 | <gwern> | TomMD: yeah, but that requires you change your imports |
| 15:50:13 | <gwern> | I was thinking perhaps a true unix-compat would export the same exact modules as unix |
| 15:50:20 | <gwern> | or maybe unix would be portable in and of itself |
| 15:50:28 | <gwern> | (that'd be good for yi, among others) |
| 15:56:16 | <gwern> | for every line of code you delete, god resurrects a kitten |
| 15:56:23 | <gwern> | please, won't someone think of the kittens? |
| 15:56:25 | <adekoba> | I'm having trouble getting a haskell program to work with bash shell pipes. What am I doing wrong? here's a pastebin: http://hpaste.org/9517 |
| 15:56:26 | <esteth> | When I try to use the -make option for ghc, it claims there is no -make flag. This is probably just me trying to follow along with a guide that's way out of date, but what flag, if any, replaces it in more recent versions of ghc? |
| 15:56:34 | <adekoba> | esteth: --make |
| 15:56:51 | <esteth> | adekoba, Ah, silly me. Thanks :) |
| 15:56:55 | <adekoba> | yep :D |
| 15:58:59 | <Cale> | adekoba: I'm guessing that the output is being buffered. |
| 15:59:34 | <adekoba> | Cale: I'll try setting stdout to NoBuffering then? |
| 15:59:35 | <Cale> | adekoba: add System.IO to the imports, and hSetBuffering stdout NoBuffering and see if that changes things. |
| 15:59:36 | <Cale> | yeah |
| 16:00:34 | <adekoba> | Cale: that's it! Thanks, man. |
| 16:00:42 | <Cale> | No problem :) |
| 16:02:19 | <gwern> | @seen bringert |
| 16:02:19 | <lambdabot> | I saw bringert leaving #ghc, #haskell.se and #haskell 2h 27m 9s ago, and . |
| 16:02:43 | <gwern> | gah |
| 16:05:03 | <gwern> | @ask bringert For unix-compat - have you looked at the emulation of System.Posix.Files & System.Posix.IO which Darcs has bundled in it under src/win32? it's giving me trouble cabalizing, and it'd be neat if unix-compat could be comprehensive and more drop-in. as it is, I can only use PosixCompat.Files |
| 16:05:03 | <lambdabot> | Consider it noted. |
| 16:05:06 | <tibbe> | TomMD: is it possible to wrap a macro using the FFI / hsc2hs? |
| 16:06:10 | <gwern> | @tell bringert Oh, and darcs also does System.Posix, and something called CtrlC, though I don't know if that has a unix counterpart |
| 16:06:11 | <lambdabot> | Consider it noted. |
| 16:07:15 | <thoughtpolice> | tibbe: currently I do not think so. |
| 16:09:20 | <olsner> | woah, *reverse* state monad? |
| 16:09:40 | <dmhouse> | Etats? |
| 16:10:02 | <Botje> | l'Etats, c'est moi. |
| 16:10:11 | <tibbe> | thoughtpolice: darn |
| 16:10:34 | <vixey> | why not have -O2 by default? |
| 16:10:37 | <thoughtpolice> | tibbe: yeah, it generally means you have to duplicate a lot of shit because people are pretty keen on using macro's for that kind of stuff |
| 16:10:47 | <tibbe> | thoughtpolice: yeah :( |
| 16:10:48 | <thoughtpolice> | especially in things like system headers |
| 16:10:53 | <tibbe> | yup |
| 16:11:43 | <thoughtpolice> | plus it can totally screw backwards compatibility since those macros are there (generally) to hide the stuff that may change |
| 16:11:47 | <thoughtpolice> | it would really be a nice feature |
| 16:12:06 | <tibbe> | yeah |
| 16:12:11 | <thoughtpolice> | i'm not sure if c2hs supports it either |
| 16:12:35 | <tibbe> | probably not |
| 16:12:53 | <tibbe> | I have basic bindings to kqueue now, lets see if they work :) |
| 16:13:32 | <tibbe> | I need to get a file handle from a haskell Socket, hmm |
| 16:13:37 | <tibbe> | file descriptor I mean |
| 16:15:25 | <thoughtpolice> | there's the Fd type (newtype wrapped around CInt) in System.Posix.Types but I don't know if there's a function Handle -> Fd |
| 16:16:49 | <vixey> | :/ |
| 16:17:07 | <vixey> | I don't understand this cabal stuff |
| 16:17:16 | <vixey> | is this anything to do with ghc -package <name> |
| 16:17:17 | <mmorrow> | a javascript quasiquoter: http://hpaste.org/9518 |
| 16:17:28 | <mmorrow> | :)))) |
| 16:17:44 | <vixey> | cool |
| 16:17:53 | <mmorrow> | it uses the WebBits parser/prettyprinter |
| 16:17:55 | <vixey> | mmorrow: I have lots of trouble trying to compile things |
| 16:18:06 | <mmorrow> | vixey: uhoh. like what in particular? |
| 16:18:11 | <vixey> | I was trying to get Ivor so I could do something like id = [$ivor| forall a. a -> a |] |
| 16:18:28 | <mmorrow> | ok |
| 16:18:49 | <mmorrow> | a really handy function is this: |
| 16:19:02 | <mmorrow> | unQ :: Q a -> a = unsafePerformIO . runQ |
| 16:19:12 | <tibbe> | is there a way to load .hsc file from within ghci |
| 16:19:13 | <tibbe> | ? |
| 16:19:18 | <thoughtpolice> | mmorrow: you're all about the quasiquoting huh? :) |
| 16:19:19 | <tibbe> | files* |
| 16:19:35 | <thoughtpolice> | tibbe: you have to run them over with hsc2hs first iirc |
| 16:19:47 | <tibbe> | thoughtpolice: that's annoying :( |
| 16:19:54 | <tibbe> | C-c C-l is what I'm all about |
| 16:19:59 | <thoughtpolice> | word |
| 16:20:00 | <tibbe> | for quick turnaround time |
| 16:20:06 | <mmorrow> | thoughtpolice: i think that it'll make some things massively easy (like saving me from doing work ;)) |
| 16:20:12 | <thoughtpolice> | emacs for life! :) |
| 16:20:35 | <thoughtpolice> | mmorrow: i still haven't taken time to look at QQ or really TH although your QQ magic lately has gotten me thinking |
| 16:20:41 | <thoughtpolice> | :) |
| 16:21:13 | <mmorrow> | heh, i'm trying to spread my enthusiasm |
| 16:21:59 | <mmorrow> | maybe soon, we'll have a QuasiQuoters that cooks toast for us! |
| 16:22:06 | <mmorrow> | s/s// |
| 16:22:41 | <olsner> | oooh, cooks toast? is that before or after it solves the halting problem? :P |
| 16:22:52 | <mmorrow> | i think during ... |
| 16:22:53 | <thoughtpolice> | before |
| 16:22:59 | <thoughtpolice> | because you are going to need a lot of toast while you wait |
| 16:22:59 | <mmorrow> | heh, all of the above |
| 16:23:07 | <EvilTerran> | it makes coffee while it's solving the halting problem |
| 16:23:12 | <mmorrow> | it better!! |
| 16:23:35 | <thoughtpolice> | can it give me a massage? |
| 16:23:42 | <vixey> | stringQQ = QuasiQuoter (litE . stringL) (litP . stringL) |
| 16:23:51 | <olsner> | an endless supply of coffee and toast while solving the halting problem, that's your whole life taken care of |
| 16:24:46 | <mmorrow> | there better be jam |
| 16:24:55 | <mmorrow> | vixey: exactly |
| 16:25:31 | <mmorrow> | vixey: so, then what datatype do you want the [$ivor||] QQ to spit out |
| 16:26:02 | <vixey> | I wanted to a djinn like thing |
| 16:26:18 | <vixey> | cabal or something is broken though, so I can't atm |
| 16:27:07 | <mmorrow> | first, you have an AST datatype that you parse to. then derive Lift for that AST, and Quasiquoter (lift =<< parseMyLangQ) (return . someThingBootlegProbablyToPatQ =<< parseMyLangQ) |
| 16:28:43 | <mmorrow> | err |
| 16:28:49 | <mmorrow> | i'll paste some stuff |
| 16:29:04 | <vixey> | mostly I want to mix QQ with view patterns though |
| 16:31:29 | <mmorrow> | vixey: pk, here's a lighttpd config-file qq: http://code.haskell.org/~morrow/quasiquotes/Lighttpd-Conf-QQ.hs.html |
| 16:31:30 | <lambdabot> | Title: Haskell Code by HsColour, http://tinyurl.com/5qpuzu |
| 16:32:13 | <mmorrow> | in addition to whats there, i autogenerated the Lift instances for all the datatypes that make up the top-level ast type |
| 16:33:39 | <mmorrow> | the auto-deriver involves plugins and all kind of circus hacks, but i'm working on getting it together to hackage .. it uses plugins + th-lift, but you may be able to use th-lift to do the same (th-lift is by Igloo and on hackage) |
| 16:33:43 | <vixey> | ughhhhhh |
| 16:33:46 | <vixey> | this is annoying |
| 16:33:52 | <mmorrow> | heh |
| 16:33:54 | <vixey> | the view patterns don't do tupling yet |
| 16:34:01 | <vixey> | (foo -> x y z) is a parse error |
| 16:34:08 | <vixey> | it should be equiv. to (foo -> (x,y,z)) |
| 16:34:17 | <mmorrow> | i haven't spent any time with view patterns yet |
| 16:34:28 | <mmorrow> | i know just barely more than nothing about them |
| 16:34:34 | <chrisdone> | > join (<|>) $ [1..10] >>= return . join (*) |
| 16:34:35 | <lambdabot> | [1,4,9,16,25,36,49,64,81,100,1,4,9,16,25,36,49,64,81,100] |
| 16:34:40 | <mmorrow> | i recall you explained it to me though ... |
| 16:34:45 | <vixey> | ACTION is annoyed about thisoae |
| 16:35:00 | <vixey> | split [] = [] |
| 16:35:00 | <vixey> | split ('_':y) = Nothing : split y |
| 16:35:00 | <vixey> | split (break (=='_') -> (x,y)) = Just x : split y |
| 16:36:27 | <mmorrow> | uhh, it worked for me :) |
| 16:36:34 | <mmorrow> | (i think) |
| 16:36:43 | <mmorrow> | i had to do |
| 16:36:44 | <mmorrow> | :set -XViewPatterns |
| 16:36:46 | <vixey> | that works but I would rather write (break (=='_') -> x y) |
| 16:36:46 | <mmorrow> | in ghci |
| 16:37:00 | <centrinia> | mmorrow: Just because a program works doesn't mean that it is correct. ;) |
| 16:37:11 | <mmorrow> | centerinia: :) |
| 16:37:46 | <mmorrow> | vixey: ah, i see what you're going for. that seems like you're intending to apply the x to the y or something, though |
| 16:38:38 | <chrisdone> | wow that pattern is cool |
| 16:38:46 | <mmorrow> | i don't see what that's supposed to mean ... other that you're "turning the func of one arg into one of two args in the pattern match" or something |
| 16:39:24 | <mmorrow> | ACTION needs to rtfm |
| 16:39:38 | <chrisdone> | could you have a function which can fail and thus the pattern matching would proceed to the next one? |
| 16:39:49 | <vixey> | mmorrow: It's just that when you have something like, |
| 16:40:20 | <vixey> | foo ([$|http://(.*)/(.*)|] -> (body,page)) = ... |
| 16:40:22 | <vixey> | or |
| 16:40:26 | <vixey> | foo ([$|http://(.*)/(.*)|] -> [body,page]) = ... |
| 16:40:28 | <vixey> | or whatever it is |
| 16:40:43 | <vixey> | You have to know the result is a tuple or a list, which is not relevant.. to matching |
| 16:40:51 | <vixey> | foo ([$|http://(.*)/(.*)|] -> body page) = ... |
| 16:41:41 | <vixey> | but I thought I read they had that in the manual it seems like it's not done though |
| 16:41:53 | <mmorrow> | ok, i see what you're saying, but since you've named the subpieces, it seems like you're not losing anything by having the (,)/[]/whatever, and possibly gaining the ability to do |
| 16:42:47 | <mmorrow> | foo ([$|http://(.*)/(.*)|] -> a@(body,b@(page,c@(body++page)))) = (((a,b),c),body,page) |
| 16:42:54 | <vixey> | eee |
| 16:43:02 | <mmorrow> | (i don't know if that's allowed) |
| 16:44:03 | <mmorrow> | so you get to deconstruct, reconstruct, then again decostruct before getting to the func body |
| 16:45:42 | <mmorrow> | ohhh, i see. |
| 16:46:09 | <mmorrow> | that's definitely not allowed just like let f a@(body,b@(page,c@(body++page)))) = ... isn't |
| 16:54:07 | <EvilTerran> | well, you can't use ++ in patterns |
| 16:54:15 | <newsham> | let (body++page) = "testing" ?! |
| 16:54:54 | <newsham> | [("t","testing"),("te","sting"),("tes","ting"),...] |
| 16:55:01 | <EvilTerran> | you could make something like [$list|"prefix"++str++"suffix"|] usable as a pattern |
| 16:55:56 | <newsham> | does that really buy you much? to have the pattern compiler deal with it instead of a guard? |
| 16:56:39 | <newsham> | f s | "test" `isPrefixOf` s = let s' = drop 4 s in ... |
| 16:57:35 | <EvilTerran> | view patterns could do the same job, too |
| 16:57:47 | <EvilTerran> | ?hoogle stripPrefix |
| 16:57:48 | <lambdabot> | Data.List.stripPrefix :: Eq a => [a] -> [a] -> Maybe [a] |
| 16:57:56 | <EvilTerran> | foo (stripPrefix "test" -> str) |
| 16:58:04 | <EvilTerran> | er, foo (stripPrefix "test" -> Just str) |
| 16:58:12 | <EvilTerran> | or even |
| 16:58:31 | <EvilTerran> | er... not sure how you'd do suffixes |
| 16:58:47 | <newsham> | just make a primitive for it.. |
| 16:58:52 | <EvilTerran> | indeed |
| 16:59:41 | <EvilTerran> | stripSuffix suffix str = <something painful> |
| 17:00:17 | <newsham> | hasPreSuffix :: String -> String -> String -> Maybe String |
| 17:00:27 | <chrisdone> | chr1s: wehey I have it working: http://hpaste.org/9519 ^___^! |
| 17:00:29 | <EvilTerran> | reverse <$> stripPrefix (reverse suffix) (reverse str) -- quick and dirty solution |
| 17:00:58 | <chrisdone> | chr1s: ( runnable example: http://chrisdone.com:3000/register ) |
| 17:01:06 | <newsham> | what's the <$> do in that? for ((->)r) ? |
| 17:01:16 | <chrisdone> | <$> is a synonym for fmap |
| 17:01:29 | <newsham> | so for [a] |
| 17:01:33 | <EvilTerran> | for Maybe |
| 17:01:36 | <newsham> | ahh |
| 17:01:37 | <newsham> | danke |
| 17:03:24 | <chrisdone> | ah, wtf |
| 17:03:25 | <chrisdone> | Ambiguous occurrence `password' |
| 17:03:25 | <chrisdone> | It could refer to either `X.password', imported from Kibro at src/Main.hs:3:0-33 |
| 17:03:28 | <chrisdone> | or `Text.XHtml.Strict.Formlets.password', imported from Text.XHtml.Strict.Formlets at src/Main.hs:6:0-32 |
| 17:03:50 | <chrisdone> | X is Text.XHtml.Strict qualified |
| 17:03:58 | <chrisdone> | why would that even be looked at |
| 17:04:24 | <mmorrow> | hmm |
| 17:04:28 | <EvilTerran> | chrisdone, did you "import qualified Text.XHtml.Strict as X", or just "import Text.XHtml.Strict as X"? |
| 17:04:40 | <mmorrow> | did you actually ad "qualified" to the import line |
| 17:04:40 | <EvilTerran> | with the latter version, the unqualified version is still imported |
| 17:04:43 | <chrisdone> | import qualified Text.XHtml.Strict as X |
| 17:04:45 | <mmorrow> | s/ad/add/ |
| 17:04:45 | <EvilTerran> | hm |
| 17:04:46 | <newsham> | is there a duplicate import thats not qualified? |
| 17:04:58 | <chrisdone> | perhaps another module has re-exported Text.XHtml.Strict |
| 17:05:01 | <chrisdone> | let me see |
| 17:05:10 | <chrisdone> | that would cause this, right? |
| 17:05:16 | <mmorrow> | yeah |
| 17:05:25 | <EvilTerran> | also, if Kibro has "module X" in its export list, i think it may get imported unqualified |
| 17:05:27 | <chrisdone> | and GHC just calls it X.foo instead of <full module>.foo |
| 17:05:48 | <EvilTerran> | regardless of whether you imported it to Kibro qualified or otherwise. not sure. |
| 17:05:52 | <chrisdone> | ah, I think that will be it |
| 17:06:46 | <mmorrow> | vixey: wow, view patterns look really useful |
| 17:07:08 | <chrisdone> | yep, that was it. thanks guys |
| 17:08:02 | <EvilTerran> | mmorrow, indeed - they feel a lot cleaner to me than QQs do, too |
| 17:09:02 | <PeakerWork> | qualified imports should be the default... |
| 17:09:35 | <dogbite_> | what's the Set data structure in haskell? |
| 17:09:44 | <dogbite_> | just something so i can test membership efficiently |
| 17:09:49 | <EvilTerran> | although less versatile, given that you could construct something like view patterns with QQs |
| 17:09:52 | <EvilTerran> | dogbite_, Data.Set |
| 17:09:57 | <EvilTerran> | ?docs Data.Set |
| 17:09:58 | <lambdabot> | http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Set.html |
| 17:10:07 | <EvilTerran> | DOH |
| 17:10:09 | <dogbite_> | EvilTerran: heh |
| 17:10:16 | <dogbite_> | how do people name these things |
| 17:10:25 | <EvilTerran> | http://www.haskell.org/ghc/docs/latest/html/libraries/containers/Data-Set.html |
| 17:10:27 | <lambdabot> | Title: Data.Set, http://tinyurl.com/ynl5nk |
| 17:10:28 | <dogbite_> | :-) |
| 17:10:53 | <EvilTerran> | dogbite_, i find it helps to always have a window with http://www.haskell.org/ghc/docs/latest/html/libraries/index.html open when i'm haskelling |
| 17:10:54 | <lambdabot> | Title: Haskell Hierarchical Libraries |
| 17:12:20 | <RayNbow> | hmm, so there's a proposal to shrink the Prelude for Haskell'... |
| 17:14:57 | <olsner> | @src on |
| 17:14:57 | <lambdabot> | (*) `on` f = \x y -> f x * f y |
| 17:15:50 | <dogbite_> | EvilTerran: thanks for the tip |
| 17:17:04 | <mmorrow> | EvilTerran: yeah, the pattern side of QQs is definitely not straightforward (in the sense that there's not one clear-cut things to do in pattern context) |
| 17:17:32 | <mmorrow> | (... clear-cut way to do things ...) |
| 17:21:13 | <mmorrow> | no wonder there's no [p||] in template-haskell ;) |
| 17:21:31 | <RayNbow> | hmm, and the arrow syntax proposal is rejected... |
| 17:21:53 | <EvilTerran> | ACTION wants [p|...|] |
| 17:22:01 | <vixey> | I am kind of annoyed by Haskell' |
| 17:22:17 | <sbahra> | vixey, why? |
| 17:22:17 | <dons_> | what's to be annoyed by? |
| 17:22:24 | <mmorrow> | EvilTerran: you can have it with an hs QQ |
| 17:22:33 | <vixey> | GHC is fine :/ |
| 17:22:43 | <dons> | compared to the situation prior to standardisation, we now have a clear set of extensions, with known portability, and you can make an informed choice about what and which you use. |
| 17:22:54 | <sbahra> | I was really turned off by functional programming with Scheme, spent years doing C. I don't regret starting to learn haskell. |
| 17:23:14 | <sbahra> | I think I might reach a point where if I'm not doing C, and I am doing RAD or prototyping, it will be in haskell for sure. |
| 17:23:14 | <Heffalump> | vixey: if you're happy with the language defined by GHC, you can just ignore the existence of Haskell' |
| 17:23:26 | <vixey> | Heffalump: but everyone keeps talking about it :... |
| 17:23:31 | <thoughtpolice> | vixey: right, but there are a lot of extensions to GHC that would be really useful to have standardized |
| 17:23:37 | <sbahra> | vixey, oh, what is "Haskell'"? |
| 17:23:43 | <sbahra> | vixey, versus "Haskell" |
| 17:23:46 | <dons> | vixey: its the difference between -fglasgow-exts, and -XPatternGuards -XFFI and so on. |
| 17:23:49 | <vixey> | sbahra: In progress restandardization of the language |
| 17:23:49 | <thoughtpolice> | sbahra: new haskell standard |
| 17:23:53 | <sbahra> | ah |
| 17:23:55 | <dons> | in the olden days we only had -fglasgow-exts |
| 17:24:02 | <sbahra> | ACTION googles |
| 17:24:07 | <dons> | but now you can find out and choose precisely what extensions you wish for. |
| 17:24:26 | <vixey> | dons: But it's not just a list of extensions and descriptions of what they do |
| 17:24:30 | <vixey> | that would be good ... |
| 17:24:42 | <dons> | well, it is, really. |
| 17:24:54 | <dons> | that and tool support for handling the flags. |
| 17:24:56 | <newsham> | "I dont starting to learn haskell"... how deep are you into it so far? ;-) |
| 17:25:13 | <newsham> | its kinda like crack... it seems innocent enough at first ;-) |
| 17:25:27 | <thoughtpolice> | dons: oh yeah, I wanted to mention to you for ghc-core, having it use -O2 by default isn't awesome primarily when you want to see the difference between .e.g -O and -O2, or -O0 and -O1/-O2 |
| 17:25:32 | <newsham> | then you're up all night reading academic papers and you wonder where your life has gone |
| 17:25:35 | <newsham> | but you just cant quit |
| 17:25:44 | <RayNbow> | newsham: Haskell is a mental drug :) |
| 17:25:52 | <newsham> | crystal math |
| 17:26:10 | <Heffalump> | vixey: well, everyone keeps talking about the Olympics, I just ignore them |
| 17:26:18 | <dons> | thoughtpolice: use the ghc-core released yesterday |
| 17:26:22 | <dons> | thoughtpolice: you can override the flags |
| 17:27:04 | <thoughtpolice> | dons: so just 'ghc-core -- -O0' would work? |
| 17:27:40 | <dons> | with ghc-core 0.4, yeah, it should. |
| 17:28:46 | <thoughtpolice> | ah yes, seems to be so :) |
| 17:37:27 | <swiert> | coq |
| 17:40:41 | <laz0r> | what does it actually mean if some module is flagged as 'non-portable' in the docs? |
| 17:40:54 | <dmhouse> | laz0r: that its portability isn't guaranteed. |
| 17:41:04 | <EvilTerran> | usually that it relies on some GHC extensions |
| 17:41:06 | <dons> | this is neat, http://www.reddit.com/r/programming/comments/6vplm/programs_that_run_backwards_a_reverse_state_monad/ |
| 17:41:07 | <lambdabot> | Title: Programs that run backwards: a *reverse* state monad : programming, http://tinyurl.com/633aoo |
| 17:41:17 | <dmhouse> | So, really, nothing. It may or may not be portable. Probably that its maintainer hasn't bothered to check it. |
| 17:41:20 | <dons> | laz0r: basically , you may not be able to run it in hugs or nhc. |
| 17:41:29 | <dons> | the key is to check the .cabal file |
| 17:41:39 | <dmhouse> | dons: yeah, saw that earlier. It's pretty nice. |
| 17:41:53 | <laz0r> | ah, ok |
| 17:47:43 | <Heffalump> | ACTION attempts to build GHC yet again |
| 17:48:30 | <sbahra> | Looking at the GHC map implementation, in my implementation I use map f [] = [] for termination. GHC uses map _ [] = [] for termination. |
| 17:48:38 | <sbahra> | Is there a reason why? Is it faster? |
| 17:49:13 | <BONUS> | terminology question: are overloaded function only those that are defined in typeclasses or all functions that have class constraints? |
| 17:49:20 | <BONUS> | functions* |
| 17:50:01 | <gwern> | @tell bringert btw, is unix-compat being BSD4 intentional? |
| 17:50:02 | <lambdabot> | Consider it noted. |
| 17:50:19 | <ddarius> | sbahra: It makes it cleare that f isn't used, but it is not faster in any way. |
| 17:50:28 | <olsner> | can you run parsec in the list monad and get a nondeterministic all-alternatives parser? |
| 17:50:29 | <sbahra> | ddarius, ah, yes. |
| 17:51:05 | <BONUS> | anyone know about the overloaded functions? |
| 17:51:22 | <sbahra> | ddarius, thanks. |
| 17:51:26 | <dmhouse> | BONUS: what about them? |
| 17:51:53 | <dmhouse> | Oh, you just asked. Depends on context, it's not standard Haskell terminology. |
| 17:52:01 | <BONUS> | aha |
| 17:52:03 | <dons> | Heffalump: if it doesn't build, complain on the lists. |
| 17:52:27 | <EvilTerran> | olsner, that sounds like what ReadP does |
| 17:53:22 | <EvilTerran> | you might be able to get a similar effect with Parsec, but it might need Parsec 3's ParseT (or whatever it's called) |
| 17:53:40 | <olsner> | that's what I was thinking about |
| 17:54:48 | <olsner> | maybe I'll end up having to actually think about this before writing down the solution |
| 17:54:57 | <olsner> | ... how boring |
| 17:55:37 | <EvilTerran> | i suspect it won't even be directly possible with that |
| 17:56:26 | <EvilTerran> | considering how parsec treats choices |
| 17:57:00 | <chr1s> | chrisdone: cool! |
| 17:57:27 | <chr1s> | however, for non-monadic actions, you can use check and ensure instead of checkM and ensureM |
| 17:57:41 | <gwern> | ACTION reads reddit. oh, so Glasgow Parallel Haskell did get merged into GHC proper. that's good |
| 17:58:05 | <chr1s> | chrisdone: username = input Nothing `check` ensure validUsername "Not a valid username" |
| 17:58:36 | <chr1s> | chrisdone: validUsername = isJust . matchRegex .... |
| 17:59:25 | <olsner> | maybe if I use another parser monad, this'll just pop out when I get the grammar down ... but it's no normal grammar this... hmm |
| 18:00:05 | <EvilTerran> | olsner, you could do something similar without using monad transformers or anything |
| 18:00:20 | <EvilTerran> | but you'd probably have to do things more explicitly |
| 18:00:25 | <ddarius> | You could use ReadP or ReadS as EvilTerran suggested. |
| 18:00:32 | <paczesiowa> | some guy on reddit just discovered haskell.org:/ |
| 18:00:49 | <chrisdone> | chr1s: ahh yeah. sweet :) |
| 18:01:01 | <EvilTerran> | (|||) :: GenParser tok st [a] -> GenParser tok st [a] -> GenParser tok st [a] -- or something |
| 18:01:34 | <EvilTerran> | but you'd need to fork the parser state somehow. not sure how you do that. |
| 18:01:36 | <gwern> | @tell Igloo I'm sending you my lcs patches; I haven't gotten relicensing permission, but I'd like them backed up somewhere and also for you to see what I've been doing |
| 18:01:36 | <lambdabot> | Consider it noted. |
| 18:01:55 | <TomMD> | Is there any planned date that I should stop darcs pulling GHC and start git pulling it? |
| 18:02:41 | <EvilTerran> | olsner, i think you'd have to do something with getInput and setInput |
| 18:03:00 | <bwr> | http://hpaste.org/9520 -- would this be a use for the Maybe monad to make this nicer? |
| 18:03:08 | <olsner> | oh well, my brain is shutting down due to lack of food... gonna have to go eat before continuing on this problem :) |
| 18:03:10 | <jcreigh> | How can I get the number of milliseconds (or picoseconds, or whatever) since the program has started? I've tried useing getClockTime and diffClockTimes, but it appears that tdPicosec is not the total difference in picoseconds, but merely the "remainder" after the years/months/days/hours/etc are figured it. |
| 18:03:19 | <Igloo> | TomMD: At the moment it's not even clear we'll be moving to git after all |
| 18:03:20 | <lambdabot> | Igloo: You have 1 new message. '/msg lambdabot @messages' to read it. |
| 18:03:30 | <jcreigh> | What? GHC is switching to git? |
| 18:03:38 | <chrisdone> | Igloo: oh, problems in paradise? |
| 18:03:51 | <Igloo> | See g-h-u@ for the discussion |
| 18:03:53 | <EvilTerran> | olsner, something like: x ||| y = do input <- getInput; xs <- x; setInput input; ys <- y; return (xs ++ ys) |
| 18:04:03 | <TomMD> | Igloo: It just seems that way from the weekly meetings. I'll just keep waiting ;-) |
| 18:04:12 | <EvilTerran> | olsner, but the behaviour of any implementation like that would be a bit weird if you had something like (x ||| y) >> z |
| 18:07:35 | <dmwit> | Why not separate the input gathering from the input processing? |
| 18:07:41 | <dmwit> | Then you don't even need (|||). |
| 18:08:01 | <EvilTerran> | i'm not sure i follow |
| 18:08:05 | <dmwit> | x ||| y = do input <- getInput; return (x input ++ y input) |
| 18:08:40 | <dmwit> | i.e. don't let x and y be monadic actions that gather the input themselves. |
| 18:08:49 | <EvilTerran> | well, the idea was kludging something so you could easily get a list of all possible parses instead of just one from a parsec parser |
| 18:08:53 | <dmwit> | Let them expect to be handed the input on a (pure) silver platter. |
| 18:09:10 | <EvilTerran> | but, as i said earlier, i don't think there's any easy way of doing that |
| 18:09:34 | <dmwit> | I thought Parsec had an equivalent of Reader's local. |
| 18:12:20 | <TomMD> | @check \x :: [Integer] -> ( > 3) . length . nub $ x |
| 18:12:20 | <lambdabot> | Parse error at "::" (column 4) |
| 18:12:25 | <EvilTerran> | even with that, i don't think it'd work |
| 18:12:51 | <EvilTerran> | you need something that you can use on the LHS of a >>= with sane behaviour |
| 18:12:57 | <dmwit> | ?check \x -> (> 3) . length . nub $ (x :: [Integer]) |
| 18:12:58 | <lambdabot> | Not in scope: `myquickcheck'' |
| 18:13:02 | <TomMD> | @check ( > 3) . length . nub -- Why is this borked? |
| 18:13:03 | <lambdabot> | Not in scope: `myquickcheck'' |
| 18:13:17 | <Deewiant> | @check has been broken for about a week now |
| 18:13:19 | <dmwit> | I think ?check broke a few days ago. |
| 18:13:21 | <mjrosenb> | is there a function like words, but it splits a string when a specific character is found? |
| 18:13:25 | <dmwit> | no |
| 18:13:39 | <encryptio> | splitBy, iirc |
| 18:13:44 | <EvilTerran> | trickery with monad transformers would be a bit more likely to work than trying to just use the GenParser monad, i guess |
| 18:13:45 | <mjrosenb> | or better yet when an (a -> Bool) is found? |
| 18:13:49 | <chrisdone> | splitBy returns a tuple |
| 18:13:52 | <dmwit> | mjrosenb: There are too many choices for the behavior of such a function, so it's never been put in the library. |
| 18:14:05 | <mjrosenb> | dmwit: fair enough |
| 18:14:05 | <dmwit> | mjrosenb: But it's easy to write using splitBy and iterate and friends. |
| 18:14:24 | <mjrosenb> | what is splitBy in? |
| 18:14:34 | <dmwit> | ?index splitBy |
| 18:14:34 | <lambdabot> | bzzt |
| 18:14:35 | <EvilTerran> | do you mean splitAt? |
| 18:14:37 | <mjrosenb> | data.list |
| 18:14:40 | <EvilTerran> | ?hoogle splitAt |
| 18:14:41 | <lambdabot> | Prelude.splitAt :: Int -> [a] -> ([a], [a]) |
| 18:14:41 | <lambdabot> | Data.List.splitAt :: Int -> [a] -> ([a], [a]) |
| 18:14:41 | <lambdabot> | Data.ByteString.splitAt :: Int -> ByteString -> (ByteString, ByteString) |
| 18:14:46 | <dmwit> | No |
| 18:14:47 | <EvilTerran> | ?hoogle split |
| 18:14:47 | <dmwit> | break |
| 18:14:48 | <lambdabot> | Data.ByteString.split :: Word8 -> ByteString -> [ByteString] |
| 18:14:48 | <lambdabot> | Data.Set.split :: Ord a => a -> Set a -> (Set a, Set a) |
| 18:14:48 | <lambdabot> | Data.Map.split :: Ord k => k -> Map k a -> (Map k a, Map k a) |
| 18:14:48 | <dmwit> | :t break |
| 18:14:50 | <lambdabot> | forall a. (a -> Bool) -> [a] -> ([a], [a]) |
| 18:14:50 | <dmwit> | :t span |
| 18:14:51 | <lambdabot> | forall a. (a -> Bool) -> [a] -> ([a], [a]) |
| 18:14:55 | <EvilTerran> | ah, yes, span and break |
| 18:14:59 | <EvilTerran> | those're the ones |
| 18:15:06 | <mjrosenb> | i see |
| 18:15:36 | <dmwit> | > 18 * 18 * 216 |
| 18:15:38 | <lambdabot> | 69984 |
| 18:15:42 | <mjrosenb> | i assume that one eliminates the element that returned true, and the other doesn't |
| 18:15:42 | <chrisdone> | :t splitRegex |
| 18:16:00 | <dmwit> | mjrosenb: no |
| 18:16:13 | <chrisdone> | splitRegex :: Regex -> String -> [String] |
| 18:16:13 | <dmwit> | mjrosenb: span = break . (not .) |
| 18:16:39 | <mjrosenb> | oic |
| 18:16:52 | <TomMD> | quickCheck has been annoying me lately. Why does something so simple (see below) not work? I know it generates lists > 3 fairly often. |
| 18:16:52 | <TomMD> | (\x -> ( ( > 3) . length . nub $ (x :: [Integer]) ) ==> True) |
| 18:18:05 | <chrisdone> | dmwit: maybe there should be a wiki page (if there is not already) about split functions with suggested implementations and such? |
| 18:18:09 | <EvilTerran> | ?src span |
| 18:18:09 | <lambdabot> | Source not found. :( |
| 18:18:11 | <EvilTerran> | ?src break |
| 18:18:12 | <lambdabot> | break p = span (not . p) |
| 18:18:18 | <dmwit> | TomMD: You could use something like (\x -> [1,2,3] ++ x ==> True), maybe. |
| 18:18:21 | <chrisdone> | dmwit: it would be nice to link in this channel because split crops up /all the time/ |
| 18:18:23 | <dmwit> | Depends what you want to test, I guess. |
| 18:18:51 | <dmwit> | chrisdone: Somebody did a blog post about all the different splitBy implementations. |
| 18:18:52 | <TomMD> | dmwit: That is slightly destructive as to the purpose. |
| 18:18:55 | <laz0r> | what should i read when i want to know how/when/where to use Control.Monad.ST? |
| 18:18:57 | <dmwit> | TomMD: /me nods |
| 18:19:34 | <laz0r> | i'm currently trying around with it, but i am somewhat confused |
| 18:19:41 | <chrisdone> | dmwit: oh, I'll look for it |
| 18:19:52 | <laz0r> | i tried using it like Control.Monad.State, but it is... different |
| 18:19:52 | <dmwit> | TomMD: But perhaps also possible: (\w x y z -> ((> 3) . length . nub . concat) [w,x,y,z] ==> True) |
| 18:20:06 | <dmwit> | Just makes it less likely to fail. |
| 18:20:17 | <laz0r> | i think the 'reason' for ST seems to be that you can have STRefs inside of it |
| 18:20:27 | <TomMD> | dmwit: Yeah, I've been considering going that route. It seems to be that or lazy small check. |
| 18:20:33 | <dmwit> | laz0r: Right, the point of ST is to be mutable in a safe way. |
| 18:22:38 | <stulli> | Is it sometimes necessary to use unsafe IO or can you always use "normal" IO? |
| 18:22:40 | <dafra> | hi, anybody running archlinux out there ? |
| 18:22:57 | <dmwit> | stulli: unsafe IO is primarily for the FFI |
| 18:23:06 | <dmwit> | i.e. importing C functions which are, in fact, pure |
| 18:23:14 | <TomMD> | dafra: Sorry I didn't respond earlier, I had stepped out. At any rate, I don't have any archlinux advice, sorry. |
| 18:23:21 | <laz0r> | mmh, i think my main reason for confusion is that ST is very similar defined like State, so like 'ST s a' where s denotes some kind of state... and then you don't get any functions to access that state |
| 18:23:36 | <dmwit> | stulli: It can also be convenient for quick one-off programs that need to read a configuration file or something, but it is never *necessary*. |
| 18:24:17 | <laz0r> | which makes me believe that i should not attempt to change/read the state like i am used to, but then, whats the point of having that state? |
| 18:24:17 | <dmwit> | laz0r: The 's' is for-all'd in a sneaky way... |
| 18:24:35 | <dafra> | TomMD: its OK |
| 18:24:39 | <stulli> | dmwit, Ah, i see. I saw a program using it and i made a version without unsafe, so was unsure about how to use it |
| 18:24:40 | <dmwit> | laz0r: It allows some hacks behind the scenes, basically. |
| 18:25:07 | <dmwit> | ?quote oasis.*referential |
| 18:25:07 | <lambdabot> | chromatic says: My productivity increased when Autrijus told me about Haskell's trace function. He called it a refreshing desert in the oasis of referential transparency. |
| 18:25:15 | <dmwit> | stulli: ^_^ |
| 18:25:38 | <PeakerWork> | Why Haskell' and not Haskell2008? |
| 18:25:49 | <dmwit> | Because it will never come out. |
| 18:25:49 | <dmhouse> | It might not be finished this year. |
| 18:25:55 | <dmhouse> | It certainly wasn't started this year. |
| 18:25:57 | <PeakerWork> | ok, then Haskell0x? :-) |
| 18:26:00 | <dmwit> | Haskell20008 |
| 18:26:20 | <stepcut> | Wasn't it supposed to come out for ICFP 2007 ? |
| 18:26:21 | <EvilTerran> | Haskellω |
| 18:26:29 | <PeakerWork> | Ok, I hope it changes names when it does come out |
| 18:26:42 | <laz0r> | oh, well, i'll go for a walk and think |
| 18:26:45 | <laz0r> | maybe it'll help |
| 18:26:53 | <dafra> | Haskell1x |
| 18:27:03 | <stepcut> | HaskellPro |
| 18:27:05 | <chrisdone> | dmwit: well, I found a mailing list thread. I am surprised how many potential behaviours there are |
| 18:27:20 | <dafra> | IncompatibleHaskell |
| 18:27:42 | <dmwit> | chrisdone: Yeah, there really are a lot of (totally reasonable) possible implementations. |
| 18:30:13 | <vixey> | ACTION wants to make a language called Church |
| 18:30:20 | <chrisdone> | that would be a good name |
| 18:32:27 | <chrisdone> | dmwit: I wonder if a mini-language has ever been considered for it, similar to the “format” of Common Lisp, but for splitting, rather than printing |
| 18:32:50 | <gwern> | splitting has cast me into despair |
| 18:32:54 | <chrisdone> | haha |
| 18:33:02 | <gwern> | I've put it on the sideburner while I try to build up gumption to tackle it |
| 18:33:15 | <dmwit> | I guess Parsec is kind of a "splitting" language in some sense. |
| 18:33:34 | <dmwit> | Also, weren't you the one who suggested splitRegex? |
| 18:33:39 | <gwern> | ACTION regrets that I already used up my Sayonara Zetsubous Sensei joke, since it's so appropriate for splitting |
| 18:33:41 | <chrisdone> | well, I mean something that looks like J |
| 18:33:43 | <dmhouse> | chrisdone: like C's scanf? |
| 18:33:57 | <dmwit> | Yeah, I was thinking of scanf, too. |
| 18:33:57 | <chrisdone> | yeah, splitRegex is alright for strings (if sometimes OTT) |
| 18:34:14 | <chrisdone> | dmhouse: yeah, just pass a string with some symbols that have meaning |
| 18:34:30 | <chrisdone> | a splitex :P |
| 18:34:34 | <dmhouse> | A DSL would be nicer. |
| 18:34:43 | <gwern> | you splittists! |
| 18:34:53 | <gwern> | you're trying to disrupt the harmony of the haskell nation |
| 18:34:54 | <chrisdone> | dmhouse: agreed, but also quite large? |
| 18:35:13 | <dmhouse> | Haskell's good at those, too. So yeah, a bit like Parsec. |
| 18:35:14 | <chrisdone> | dmhouse: in terms of textual size, that is |
| 18:35:39 | <dmhouse> | Perhaps. But it has the advantage that more errors are caught at compile-time. |
| 18:36:05 | <dino-> | Does `cabal configure --program-suffix=' |
| 18:36:06 | <dino-> | bah |
| 18:36:09 | <dino-> | '$version' |
| 18:36:10 | <dino-> | work? |
| 18:36:10 | <chrisdone> | split (do at ","; inc terminators) "a,b,c,d" => ['a',',','b',',','c']? |
| 18:36:18 | <chrisdone> | dmhouse: good point there |
| 18:36:21 | <dino-> | I wonder if I'm using it incorrectly. |
| 18:36:38 | <chrisdone> | s/","/',' |
| 18:37:21 | <dino-> | when I do it, I still get .../bin/foo not .../bin/foo-0.1.1 |
| 18:37:25 | <dmhouse> | That's quite a nice idea. I'd have two different functions, one that included the delimiters and one that didn't, though. |
| 18:38:10 | <dmhouse> | And you could have split (atr ",\s*") "foo, bar, baz,quux" -> ["foo","bar","baz","quux"] |
| 18:39:08 | <chrisdone> | but splitRegex can do that |
| 18:39:16 | <chrisdone> | shouldn't it be generic to work on any list? |
| 18:39:39 | <dmhouse> | I guess the best solution is split (==",") |
| 18:39:55 | <dmhouse> | Then you could do split (=~ ",\s*") |
| 18:40:00 | <gwern> | ACTION watches the discussion amusedly |
| 18:40:27 | <dmhouse> | It'd have to be split :: ([a] -> Bool) -> [a] -> [[a]], though, i.e. not split (==','). |
| 18:40:42 | <chrisdone> | dmhouse: oh, duh. we could just use operators |
| 18:40:59 | <dmhouse> | HOFs ftw. |
| 18:43:17 | <dmwit> | dmhouse: Sounds like you're going to have a very pessimistic algorithm. |
| 18:43:29 | <dmhouse> | dmwit: in what way? |
| 18:43:31 | <dmwit> | n^2 in the length n of the list =/ |
| 18:43:47 | <dmwit> | no... n^3 |
| 18:44:08 | <dmwit> | If you allow ([a] -> Bool), you have to examine *every sublist*. |
| 18:44:13 | <dmhouse> | Yeah, I guess this is the point of L(1). |
| 18:44:30 | <dmhouse> | dmwit: it's necessary in a lot of situations, though. |
| 18:44:47 | <SamB> | dmhouse: use of that type is not necessary |
| 18:44:57 | <dmhouse> | Err, LL(1). |
| 18:45:02 | <dmwit> | But (== ",") would end up considering all these huge long lists, when only sub-lists of size one could possibly match. |
| 18:45:04 | <chrisdone> | hm, that's why a DSL would do nice here |
| 18:45:17 | <chrisdone> | the type would only apply if you use the function to do that kind of thing |
| 18:45:21 | <dino-> | Wow, that's so weird. If I do `cabal configure --program-suffix='$version'` and then look at dist/setup-config I see progSuffix = "$version" in there... |
| 18:45:27 | <dino-> | And then next step: `cabal install` |
| 18:45:48 | <dino-> | does NOT use prog suffix on the binary and the dist/setup-config has progSuffix = "" |
| 18:45:55 | <dino-> | without me redoing config myself |
| 18:45:57 | <dino-> | :/ |
| 18:46:56 | <dino-> | IOW: cabal intall blows away my config |
| 18:49:59 | <Quadrescence> | How would I make a precomputed table of values for fast access? |
| 18:50:14 | <Quadrescence> | Or would this not be necessary since haskell is a lazy-ass language? |
| 18:50:25 | <chrisdone> | a lazy ass-language |
| 18:50:38 | <chrisdone> | you could make a Map |
| 18:50:39 | <Quadrescence> | xkcd thx |
| 18:51:11 | <SamB> | ACTION demands to know which xkcd Quadrescence has found assistance in |
| 18:51:13 | <chrisdone> | wow, xkcd did that joke, too? I can't make any jokes without “xkcd did it”.. similar to the simpsons for episode stories |
| 18:51:19 | <newsham> | any galois people here familiar/involved with the "secure user-centric mashup applications" whitepaper? |
| 18:51:25 | <DukeDav1> | Okay, I'm not amused how many dependancies cabal-install has :| |
| 18:51:41 | <Quadrescence> | chrisdone: Actually, I was about to ask that. |
| 18:51:44 | <chrisdone> | sudo cabal install cabal-install-install |
| 18:51:45 | <SamB> | DukeDav1: is anyone? |
| 18:51:59 | <SamB> | I think it should come with GHC |
| 18:52:15 | <SamB> | or something |
| 18:52:20 | <thoughtpolice> | SamB: word |
| 18:52:23 | <chrisdone> | werd |
| 18:52:26 | <Quadrescence> | How I would make a 1-to-1 lookup table that's not inefficient. |
| 18:52:28 | <thoughtpolice> | that's the best plan for adoption I feel |
| 18:52:41 | <thoughtpolice> | i mean right now it only needs zlib and http since everything else comes stock |
| 18:52:43 | <thoughtpolice> | but still |
| 18:52:57 | <DukeDav1> | chrisdone: Fail :| |
| 18:52:59 | <SamB> | yeah, it's better than it has been |
| 18:53:21 | <DukeDav1> | I have GHC 6.6.1 |
| 18:53:24 | <newsham> | quad: like Data.Map? |
| 18:53:51 | <chrisdone> | DukeDav1: huh? |
| 18:53:59 | <MyCatVerbs> | Quadrescence: Data.Array or Data.Map. If you have dense keys (no gaps between them), Data.Array. |
| 18:54:04 | <Quadrescence> | newsham: Maybe I should look that up. I just want to make precomputed tables for easy lookup. Like, a precomputed table of values for the factorial function. |
| 18:54:11 | <DukeDav1> | I don't have cabal |
| 18:54:19 | <DukeDav1> | At least, I don't have a binary called cabal |
| 18:54:28 | <chrisdone> | DukeDav1: well, that was a joke |
| 18:54:31 | <newsham> | > M.fromList [("test", 4),("this",44),("out",3)] M.! "this" |
| 18:54:32 | <lambdabot> | 44 |
| 18:54:37 | <SamB> | cabal is the binary for cabal-install |
| 18:54:38 | <newsham> | where M is Data.Map |
| 18:54:39 | <DukeDav1> | chrisdone: Oh :'( |
| 18:54:39 | <dino-> | Quadrescence: I was thinking that too: if you're simply calling a pure function over and over with the same args, that's effectively 'memoized' in this language. Is that fair to say everyone? |
| 18:54:56 | <SamB> | chrisdone has in fact stated the easiest way to install cabal-install |
| 18:55:00 | <vixey> | dino-: No that's not true |
| 18:55:08 | <MyCatVerbs> | dino-: not necessarily. Only if you have a single thunk of that function with those arguments. |
| 18:55:13 | <DukeDav1> | I thought someone had written some awesome boot strapper there :) |
| 18:55:14 | <SamB> | however, the easiest way to install cabal-install is with cabal-install |
| 18:55:20 | <Quadrescence> | dino-: I always hear the word "memoize," but I still don't know what it means. :) |
| 18:55:41 | <MyCatVerbs> | dino-: for example, let thunk = f g in ..., and then you use thunk a thousand times -- that's memoized, because thunk is shared in the expression .... |
| 18:55:47 | <chrisdone> | dino-: caching values |
| 18:55:49 | <pjdelport> | Quadrescence: it means just what you described; saving ("memoizing") the results of a function for various inputs |
| 18:55:51 | <SamB> | so it doesn't really do you any good unless you already have installed cabal-install |
| 18:55:54 | <newsham> | memoize just means that if you ask the function for an answer, it remembers it for next time its asked the same question |
| 18:56:07 | <dino-> | yeah, caching |
| 18:56:16 | <Quadrescence> | Does memoize come from the word memorize? :D |
| 18:56:18 | <MyCatVerbs> | dino-: however, independantly calling f g in a hundred places inside an expression, with no shared identifier to denote f g, will suck. |
| 18:56:25 | <waern> | the next ghc version will ship with cabal-install, I think |
| 18:56:35 | <chrisdone> | Quadrescence: it comes from memoization, which in turn comes from memoize |
| 18:57:03 | <MyCatVerbs> | Quadrescence: Immutable arrays are pretty much exactly what you want for constant look-up-tables. |
| 18:57:04 | <dino-> | MyCatVerbs: huh. It doesn't recognize that, if g is always the same value, that it can reduce that? |
| 18:57:10 | <thoughtpolice> | waern: has GHC HQ discussed packaging zlib and cabal with the distribution? |
| 18:57:14 | <SamB> | ACTION throws a <<Loop>> at chrisdone |
| 18:57:14 | <dino-> | I don't really understand this. And I think I had better get with it. |
| 18:57:34 | <waern> | thoughtpolice: I think so |
| 18:57:38 | <thoughtpolice> | since that would be required for cabal-install |
| 18:57:40 | <thoughtpolice> | but if so |
| 18:57:43 | <thoughtpolice> | hell yeah. :) |
| 18:57:48 | <SamB> | thoughtpolice: already packages cabal |
| 18:57:55 | <MyCatVerbs> | dino-: unfortunately, no. Memoization happens on thunks. Functions don't memoize on their own. |
| 18:58:01 | <SamB> | doesn't it? |
| 18:58:20 | <thoughtpolice> | er |
| 18:58:22 | <SamB> | MyCatVerbs: what??? |
| 18:58:24 | <thoughtpolice> | i meant zlib and http |
| 18:58:25 | <thoughtpolice> | :p |
| 18:58:27 | <waern> | thoughpolice: yep, I think the next ghc release will solve a lot of problems |
| 18:58:30 | <SamB> | MyCatVerbs: you've been reading okasaki haven't you! |
| 18:58:41 | <MyCatVerbs> | SamB: heheh, yes. |
| 18:58:46 | <SamB> | okasaki uses the term differently from everyone else |
| 18:58:47 | <newsham> | memoization: http://codepad.org/FLB0PYFL |
| 18:58:55 | <MyCatVerbs> | dino-: if I say, let thingy = fib 100 in thingy + thingy * thingy -- fib 100 will get calculated once. |
| 18:59:07 | <newsham> | ?dict-wn memo |
| 18:59:07 | <lambdabot> | Unknown command, try @list |
| 18:59:12 | <newsham> | ?wn memo |
| 18:59:13 | <lambdabot> | *** "memo" wn "WordNet (r) 2.0" |
| 18:59:13 | <lambdabot> | memo |
| 18:59:13 | <lambdabot> | n : a written proposal or reminder [syn: {memorandum}, {memoranda}] |
| 18:59:23 | <MyCatVerbs> | dino-: if I say, (fib 100) + (fib 100) * (fib 100) -- it's possible that (fib 100) will get calculated three times. |
| 18:59:40 | <Quadrescence> | Can someone point me in the correct direction to install cabal-install in Linux? I did it on windows a few weeks back (a pain in the .), and I forgot what to do, 'specially since I am on lunix. |
| 19:00:06 | <DukeDav1> | Quadrescence: Well I am about to give up :| |
| 19:00:22 | <MyCatVerbs> | dino-: the compiler could, in this case, optimize that to evaluate it only once, but GHC is really bad at common subexpression elimination because CSE is really hard to do without accidentally making functions stricter than they should be. |
| 19:00:27 | <Quadrescence> | DukeDav1: Are you installing it in windows? |
| 19:00:28 | <chrisdone> | > let foo = length $ map id [1..2000000] in foo |
| 19:00:30 | <lambdabot> | 2000000 |
| 19:00:31 | <chrisdone> | > let foo = length $ map id [1..4000000] in foo |
| 19:00:34 | <lambdabot> | Tried to use too much memory |
| 19:00:36 | <thoughtpolice> | waern: hopefully - lots of stuff is getting torn up and redone |
| 19:00:37 | <chrisdone> | > let foo = length $ map id [1..2000000] in (foo,foo) |
| 19:00:38 | <newsham> | quad: runhaskell Setup.hs configure when it complains about missing packages, grab those packages and repeat |
| 19:00:39 | <lambdabot> | (2000000,2000000) |
| 19:00:42 | <tongucyumruk> | Hi all, is there a way to escape a value from a monad? |
| 19:00:42 | <chrisdone> | :) |
| 19:00:45 | <DukeDav1> | Quadrescence: No ubuntu |
| 19:00:46 | <thoughtpolice> | hopefully it is not for nothing ;) I think it *will* benefit a lot though |
| 19:00:50 | <tongucyumruk> | For example |
| 19:00:50 | <chrisdone> | tongucyumruk: never! |
| 19:00:56 | <SamB> | Quadrescence: bug dcoutts to tell you where the latest tarball is for cabal-install, try to install it, install the packages cabal complains about, rinse, repeat |
| 19:01:09 | <Quadrescence> | DukeDav1: Ah. Well, I'll tell you how my installation goes. |
| 19:01:10 | <dino-> | I just installed Cabal 1.4.0.1 and cabal-install 0.5.1 on Debian. With GHC 6.8.2 already present. I did it from the .tar.gz cabalized packages I guess you'd say 'manually' with runhaskell Setup.hs ... |
| 19:01:11 | <chrisdone> | SamB: I think my example is a good one of memoization |
| 19:01:14 | <thoughtpolice> | tongucyumruk: generally speaking no, there isn't a function of type 'm a -> a' |
| 19:01:16 | <tongucyumruk> | If you look at the code at http://tonguc.name/blog |
| 19:01:18 | <SamB> | well, probably you could just find the tarball on cabal ;-) |
| 19:01:19 | <lambdabot> | Title: Tonguç Yumruk'un Weblog'u |
| 19:01:20 | <SamB> | er. |
| 19:01:23 | <dino-> | What problems are you guys having? dependencies? |
| 19:01:24 | <SamB> | hackage |
| 19:01:30 | <SamB> | dino-: what else? |
| 19:01:33 | <chrisdone> | thoughtpolice: fromJust |
| 19:01:37 | <tongucyumruk> | I see |
| 19:01:39 | <DukeDav1> | newsham: I'm current on a dep tree which goes: cabal-install -> unit -> directory -> old-time -> old-locale |
| 19:01:43 | <tongucyumruk> | The thingis |
| 19:01:46 | <thoughtpolice> | chrisdone: touche :p |
| 19:01:48 | <dino-> | SamB: Yeah, probably the deps it needs already there (inadvertantly) |
| 19:01:49 | <chrisdone> | head, etc. |
| 19:01:57 | <chrisdone> | :P |
| 19:02:01 | <SamB> | DukeDav1: unit? |
| 19:02:03 | <SamB> | what's unit? |
| 19:02:11 | <tongucyumruk> | Most of my computations are just pure functional |
| 19:02:18 | <DukeDav1> | Now I just got: Building old-time-1.0.0.0... |
| 19:02:19 | <DukeDav1> | System/Time.hsc:118:7: Could not find module `System.Locale': it was found in multiple packages: old-locale-1.0.0.0 base |
| 19:02:28 | <DukeDav1> | SamB: Sorry, typo, 'unix' |
| 19:02:28 | <dino-> | MyCatVerbs: Thanks for explaining that. I've been under erroneous impressions on this stuff. |
| 19:02:36 | <SamB> | DukeDav1: eh??? |
| 19:02:42 | <SamB> | doesn't GHC come with unix ? |
| 19:02:51 | <DukeDav1> | Well apparently it's in base! |
| 19:03:03 | <SamB> | DukeDav1: possibly you started with an old version of cabal-install? |
| 19:03:09 | <tongucyumruk> | Whatever... Thanks a lot... |
| 19:03:31 | <SamB> | % cabal --version |
| 19:03:31 | <SamB> | cabal-install version 0.4.6 |
| 19:03:31 | <SamB> | using version 1.5.1 of the Cabal library |
| 19:03:45 | <SamB> | what version are you trying to build? |
| 19:03:50 | <chrisdone> | oh, crap. tongucyumruk is going to blog about how ignorant #haskell is |
| 19:04:10 | <DukeDav1> | SamB: The unix I have is 2.1 (according to pkg-list) so I was grabbing a newer one from hackage unix >=2.2&&<2.4, |
| 19:04:41 | <chrisdone> | hai cale |
| 19:04:44 | <SamB> | ACTION tries to cabal install cabal-install |
| 19:04:58 | <SamB> | hmm, 5 is building fine for me |
| 19:05:01 | <MyCatVerbs> | dino-: also, if you have, say, f 0 = fib 100, f n = fib 100 + f (n-1), then it's possible that fib 100 will get calculated n times. (In this case, GHC's optimizer *will* get it, thanks to "let floating", but you can construct more complicated cases where it won't catch it). |
| 19:05:03 | <SamB> | er. 0.5.0 |
| 19:05:14 | <DukeDav1> | SamB: Have the tar for cabal-install 0.5.2 |
| 19:05:25 | <SamB> | DukeDav1: hmm. maybe that's a bit too new? |
| 19:06:10 | <SamB> | ACTION tries pulling an updated package list |
| 19:06:19 | <chrisdone> | haha, he actually has a blog (linked above). I was just joking, but maybe it will happen |
| 19:06:24 | <MyCatVerbs> | dino-: er, much better example: map fib (repeat 100) -- will calculate (fib 100) for every single element of that list! (It's possible to make the optimizer beat this one easily enough, but I don't think anyone has.) |
| 19:06:54 | <Quadrescence> | Oh noes, you guys are talking about what I need to know and I was in my other workspace getting the dependencies. :S |
| 19:07:02 | <MyCatVerbs> | dino-: whereas let thunk = fib 100 in repeat thunk -- will calculate (fib 100) only once, no matter how many elements of the list you look at. |
| 19:07:16 | <Deewiant> | MyCatVerbs: I've been thinking about writing a huge module of rewrite rules which would optimize stuff like that |
| 19:07:31 | <Deewiant> | in that case, map f (repeat x) = repeat (f x) |
| 19:07:33 | <chrisdone> | Deewiant: like list fusion? |
| 19:07:38 | <MyCatVerbs> | Deewiant: *nodnod* |
| 19:07:40 | <DukeDav1> | SamB: Yuck, 0.5.0 gives Cabal >=1.4&&<1.5, network >=1&&<3, HTTP >=3000&&<3002, zlib >=0.4 |
| 19:07:48 | <SamB> | DukeDav1: hmm, when I install with the latest package list, I only get 0.5.1 -- what GHC version are you usiing ? |
| 19:07:56 | <Deewiant> | chrisdone: and stuff like reverse.reverse = id, nub = map head.group.sort |
| 19:08:01 | <MyCatVerbs> | chrisdone: using the same mechanism. :) |
| 19:08:08 | <DukeDav1> | 6.6.1 |
| 19:08:09 | <MyCatVerbs> | chrisdone: but, easier, because these are rather simpler. :) |
| 19:08:24 | <SamB> | DukeDav1: ah. |
| 19:08:28 | <SamB> | I'm on 6.8.2 |
| 19:08:30 | <DukeDav1> | SamB I just realised 0.5.2 isn't in Hackage |
| 19:08:35 | <pianodogg> | i wonder how often rewriting opportunities like this actually occur in "real" programs |
| 19:08:48 | <DukeDav1> | I pulled it with darcs |
| 19:08:49 | <dino-> | MyCatVerbs: I see. I will need to remember this. And Quadrescence: sorry for the bogus information |
| 19:08:56 | <DukeDav1> | Wow |
| 19:08:57 | <dino-> | Luckily people here know better |
| 19:09:02 | <DukeDav1> | Ubuntu repos = behind |
| 19:09:05 | <DukeDav1> | Screw it |
| 19:09:15 | <DukeDav1> | I might just dist-upgrade |
| 19:09:27 | <dino-> | DukeDav1: Ah I just started thiking that: don't use Debian or Ubuntu apt ghc |
| 19:09:27 | <newsham> | duke: did you build ghc from srcs? |
| 19:09:28 | <chrisdone> | A real program has appeared. Chris uses pokeball |
| 19:09:43 | <MyCatVerbs> | Deewiant: that's going to piss off benchmarkers, y'know. "the naïve implementation, on the other hand, performs like... oh, dammit. Bloody compiler optimized it into the fast alternative." |
| 19:09:54 | <SamB> | dino-: what's wrong with apt ghc? |
| 19:09:56 | <DukeDav1> | newsham: Nah from Ubuntu repos |
| 19:09:56 | <newsham> | did you install the ghc-extras? |
| 19:09:59 | <Quadrescence> | dino-: It's alright. :D |
| 19:10:04 | <SamB> | (in Debian, I mean) |
| 19:10:11 | <dino-> | SamB: Well, it may be recent now, but a few months ago it was still 6.6 |
| 19:10:22 | <dino-> | And I suspect when we move up to another ghc, it will lag for months again |
| 19:10:27 | <MyCatVerbs> | Deewiant: BTW, nub = map head . group . sort -- will actually break, because sort is strict in all the elements of the input list, whereas nub manages to work on infinite lists inputted. |
| 19:10:28 | <Deewiant> | MyCatVerbs: well, the idea would be that you could import a module which contains nothing but rewrite rules |
| 19:10:31 | <DukeDav1> | newsham: Can't seen a ghc-extras package |
| 19:10:33 | <dino-> | I stopped letting apt manage my ghc at all |
| 19:10:40 | <Deewiant> | MyCatVerbs: right, bad example :-) |
| 19:10:54 | <chrisdone> | map id = id |
| 19:11:00 | <dino-> | I don't run a sid system if I can avoid it. Too spooky. |
| 19:11:00 | <SamB> | well what distros do you have in your sources.list? |
| 19:11:00 | <newsham> | when building ghc from srcs theres a ghc-extras src tarball that contains a lot of important libraries |
| 19:11:07 | <SamB> | testing, unstable, experimental? |
| 19:11:08 | <chrisdone> | > map id [] |
| 19:11:09 | <lambdabot> | [] |
| 19:11:10 | <dino-> | testing |
| 19:11:12 | <chrisdone> | mmk |
| 19:11:14 | <newsham> | i'm wondering if your debian package is missing those |
| 19:11:14 | <DukeDav1> | newsham: Aha, sounds good |
| 19:11:36 | <DukeDav1> | Considering how cheap space is it's ridiculous not just bundling all these deps |
| 19:11:39 | <MyCatVerbs> | Deewiant: nub is O(k^2) where k is the position of the highest element that gets touched, or something like that. Your method is O(n*log(n)), but n is for the *whole list*, which might be much larger than k. :) |
| 19:11:42 | <dino-> | newsham: Is that really better than installing the generic Linux binary ghc 6.8.2? |
| 19:11:46 | <dino-> | build from src, I mean |
| 19:11:51 | <newsham> | i dont know. |
| 19:12:02 | <newsham> | i never installed the linux bin, and i dont normally run linux |
| 19:12:05 | <Deewiant> | MyCatVerbs: yes, one has to be careful with such things. :-) |
| 19:12:17 | <MyCatVerbs> | Deewiant: but you could give a version that used Data.Set to build up instead. :) |
| 19:12:32 | <TomMD> | In the trivial case, is using 'dupChan' really necessary? IOW, is there a difference between: |
| 19:12:32 | <TomMD> | newChan >>= \c -> forkIO func c >> forkIO func c |
| 19:12:32 | <TomMD> | and |
| 19:12:32 | <TomMD> | newChan >>= \c -> forkIO func c >> dupChan c >>= forkIO func |
| 19:12:45 | <SamB> | DukeDav1: well, honestly I don't have that much space in /usr |
| 19:12:45 | <Quadrescence> | :t nub |
| 19:12:45 | <lambdabot> | forall a. (Eq a) => [a] -> [a] |
| 19:12:55 | <dons> | DukeDav1: as in cabal-install would provide all its own dependencies, other than ghc? |
| 19:13:04 | <newsham> | > nub "now is the time for all good men to come to the aid of their country." |
| 19:13:05 | <lambdabot> | "now isthemfralgdcuy." |
| 19:13:10 | <newsham> | > sort $ nub "now is the time for all good men to come to the aid of their country." |
| 19:13:11 | <lambdabot> | " .acdefghilmnorstuwy" |
| 19:13:26 | <DukeDav1> | dons: Ya |
| 19:13:35 | <DukeDav1> | Like a statically linked one off |
| 19:13:37 | <Quadrescence> | sort $ nub "the quick brown fox jumps over the lazy dog." |
| 19:13:52 | <DukeDav1> | So you could get cabal-install installed quickly |
| 19:13:55 | <pianodogg> | forgot the > |
| 19:14:02 | <Quadrescence> | > sort $ nub "the quick brown fox jumps over the lazy dog." |
| 19:14:03 | <lambdabot> | " .abcdefghijklmnopqrstuvwxyz" |
| 19:14:09 | <Quadrescence> | winrar? I think so. |
| 19:14:14 | <dmwit> | nah |
| 19:14:32 | <pianodogg> | no wonder they use that sentence in font rendering tests |
| 19:14:33 | <chrisdone> | > filter isLetter $ sort $ nub "the quick brown fox jumps over the lazy dog." |
| 19:14:34 | <lambdabot> | "abcdefghijklmnopqrstuvwxyz" |
| 19:14:44 | <dons> | DukeDav1: the plan is to have it as a core part of the haskell platform, meaning every distro has a binary already |
| 19:14:46 | <chrisdone> | pianodogg: O__________O |
| 19:14:49 | <dons> | but removing the deps seems also reasonable. |
| 19:15:21 | <DukeDav1> | Mmm, that would be tasty |
| 19:15:26 | <pianodogg> | hey, i never noticed it before now |
| 19:15:36 | <chrisdone> | hahaha, I lol'd |
| 19:15:42 | <dmhouse> | > sort (nub "Big fjords vex quick waltz nymph") |
| 19:15:43 | <lambdabot> | " Bacdefghijklmnopqrstuvwxyz" |
| 19:16:05 | <dmhouse> | > all (`elem` "Big fjords vex quick waltz nymph") ['a'..'z'] |
| 19:16:06 | <lambdabot> | False |
| 19:16:13 | <dmhouse> | > all (`elem` "big fjords vex quick waltz nymph") ['a'..'z'] |
| 19:16:14 | <lambdabot> | True |
| 19:16:26 | <nominolo> | dons: did you set up the ohloh page for GHC? |
| 19:16:38 | <dmwit> | > length "bigfjordsvexquickwaltznymph" |
| 19:16:40 | <lambdabot> | 27 |
| 19:16:44 | <dmwit> | Pretty close! |
| 19:16:50 | <Deewiant> | two i's |
| 19:16:53 | <dmhouse> | http://en.wikipedia.org/w/index.php?title=Pangram&oldid=224371823#Perfect_pangrams |
| 19:16:55 | <lambdabot> | http://tinyurl.com/5ufv2j |
| 19:17:08 | <dmwit> | > nub (sort "Mr. Jock, TV quiz PH.D., bags few lynx.") |
| 19:17:10 | <lambdabot> | " ,.DHJMPTVabcefgiklnoqrsuwxyz" |
| 19:17:14 | <dmwit> | oops |
| 19:17:26 | <dmwit> | > nub . sort . map toLower $ "Mr. Jock, TV quiz PH.D., bags few lynx." |
| 19:17:28 | <lambdabot> | " ,.abcdefghijklmnopqrstuvwxyz" |
| 19:17:38 | <dmhouse> | > (length &&& \s -> all (`elem` filter isAlpha $ map toLower s) ['a'..'z']) "Jocks find quartz glyph, vex BMW." |
| 19:17:40 | <lambdabot> | The operator `elem' [infix 4] of a section |
| 19:17:40 | <lambdabot> | must have lower prece... |
| 19:17:42 | <dmwit> | > length "mrjocktvquizphdbagsfewlynx" |
| 19:17:44 | <lambdabot> | 26 |
| 19:17:50 | <dmhouse> | > (length &&& \s -> all (`elem` filter isAlpha (map toLower s)) ['a'..'z']) "Jocks find quartz glyph, vex BMW." |
| 19:17:51 | <lambdabot> | (33,True) |
| 19:17:55 | <dmhouse> | Oops. |
| 19:18:02 | <gwern> | faster nub is a difficult problem |
| 19:18:21 | <gwern> | so far the best I've encountered is toList.fromList, but that breaks constraints |
| 19:18:27 | <dmwit> | What constraints? |
| 19:18:42 | <dmwit> | map head . group . sort -- stability? |
| 19:18:47 | <dino-> | I see GHC is up to 6.8.3, does anybody know offhand if that still requires libreadline4? |
| 19:18:50 | <Quadrescence> | What is the typical install process? configure --> ? --> ? |
| 19:18:56 | <Quadrescence> | make --> install> |
| 19:18:57 | <Quadrescence> | ? |
| 19:18:58 | <dmwit> | build, install |
| 19:19:01 | <Quadrescence> | build |
| 19:19:02 | <Deewiant> | dmwit: doesn't work for infinite lists as MyCatVerbs pointed out |
| 19:19:03 | <Quadrescence> | Yeah |
| 19:19:06 | <Quadrescence> | Gracias |
| 19:19:14 | <dmwit> | Deewiant: ah |
| 19:19:15 | <dmhouse> | > let s = filter isAlpha (map toLower "Jocks find quartz glyph, vex BMW.") in (length s, all (`elem` s) ['a'..'z']) |
| 19:19:16 | <lambdabot> | (26,True) |
| 19:19:22 | <nominolo> | Quadrescence: install for what? |
| 19:19:29 | <gwern> | dmwit: also, map head when I've tried it has always been surprisingly slow |
| 19:19:36 | <Deewiant> | dmwit: and also, if you only evaluate part of the list, nub may be faster |
| 19:19:41 | <Quadrescence> | nominolo: I am installing the dependencies for cabal-install |
| 19:19:45 | <dmwit> | Deewiant: right |
| 19:19:49 | <gwern> | > map (+1) [1..100 |
| 19:19:49 | <lambdabot> | Parse error at end of input |
| 19:19:59 | <dmwit> | So, a fold that builds a set, then? |
| 19:20:03 | <Quadrescence> | > map (+1) [1..100] |
| 19:20:04 | <lambdabot> | [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29... |
| 19:20:21 | <nominolo> | Quadrescence: configure, build, install then |
| 19:20:45 | <dmwit> | :t scanl |
| 19:20:46 | <lambdabot> | forall a b. (a -> b -> a) -> a -> [b] -> [a] |
| 19:20:50 | <nominolo> | Quadrescence: but you may want to specify a different --prefix to configure |
| 19:20:53 | <SamB> | it's better to use one that just carries a Set of what it's already seen along the spine |
| 19:21:06 | <dmwit> | SamB: That's what I mean. |
| 19:21:32 | <nominolo> | Quadrescence: http://haskell.org/haskellwiki/Cabal/How_to_install_a_Cabal_package |
| 19:21:34 | <lambdabot> | Title: Cabal/How to install a Cabal package - HaskellWiki, http://tinyurl.com/39kra4 |
| 19:22:15 | <Quadrescence> | nominolo: I have installed before, I just forgot the "three magical words" |
| 19:22:32 | <nominolo> | runghc Setup.hs --help :) |
| 19:22:43 | <SamB> | I have nearly forgotten the "three magic words" myself |
| 19:22:55 | <SamB> | cabal install is so cool -- did you know it worked in source trees as well? |
| 19:23:07 | <nominolo> | ACTION knows |
| 19:23:24 | <gwern> | not really |
| 19:23:29 | <gwern> | how does it work there? |
| 19:23:34 | <SamB> | cabal install |
| 19:24:10 | <dons> | nominolo: i did originally do the ohloh page yes. |
| 19:24:12 | <gwern> | @tell dons I just heard back from the geomalglib guy; he says he'll merge in my changes and upload to hackage by the end of august |
| 19:24:13 | <lambdabot> | Consider it noted. |
| 19:24:18 | <newsham> | how do you use cabal-install to install into the system wide directory instead of in a user-specific directory? |
| 19:24:18 | <dons> | gwern: ok. |
| 19:24:18 | <lambdabot> | dons: You have 2 new messages. '/msg lambdabot @messages' to read them. |
| 19:24:23 | <SamB> | heh |
| 19:24:25 | <nominolo> | dons: can you update the source repo? |
| 19:24:34 | <dons> | ok. url? |
| 19:24:40 | <gwern> | dammit, how do people like dons and dcoutts *do* that? |
| 19:24:48 | <SamB> | gwern: hehehe |
| 19:24:52 | <nominolo> | dons: the github mirror would probabbly best until we have git:// for darcs.haskell.org |
| 19:24:54 | <dmwit> | newsham: Dunno, maybe pass --global? |
| 19:25:04 | <newsham> | also is there a flag for profiling libs? -p? |
| 19:25:04 | <SamB> | gwern: bugged webcam |
| 19:25:11 | <nominolo> | dons: git://github.com/ghc-hq/ghc.git |
| 19:25:17 | <gwern> | ACTION shakes fist at the invisible watchers |
| 19:25:39 | <DukeDav1> | git :o |
| 19:25:40 | <DukeDav1> | Shouldn't we be using that trendy Haskell vcs ? |
| 19:25:51 | <dons> | nominolo: this is another argument in favour of git :) the core libs can be tracked. |
| 19:25:56 | <SamB> | nominolo: he can login to the git-hq command? |
| 19:26:06 | <gwern> | DukeDav1: we should, ideally, and it did |
| 19:26:12 | <nominolo> | SamB: hm? |
| 19:26:14 | <dmhouse> | DukeDav1: GHC switched to git last week. |
| 19:26:18 | <gwern> | (unless you're being humorous and already know that) |
| 19:26:21 | <SamB> | dmhouse: it did? |
| 19:26:21 | <nominolo> | dons: yep. github is cool |
| 19:26:26 | <nominolo> | dmhouse: well, kind of |
| 19:26:26 | <dons> | nominolo: done. |
| 19:26:39 | <dons> | SamB: you didn't get the memo? |
| 19:26:42 | <dons> | doesn't anyone read the news/ |
| 19:26:50 | <SamB> | dons: it looked like you hadn't finished yet |
| 19:26:54 | <SamB> | dons: where is the news/ |
| 19:27:05 | <SamB> | does it have an RSS feed? |
| 19:27:11 | <Igloo> | dmhouse: ghc didn't switch to git yet, and may not do after all |
| 19:27:22 | <SamB> | Igloo: why ever not? |
| 19:27:25 | <nominolo> | dons: you are a bit too eager. ghc *will* switch to git, but until the 6.10 branch we will use darcs |
| 19:27:30 | <Igloo> | See glasgow-haskell-users@ for the discussion |
| 19:27:30 | <dmhouse> | Oh, well, so much for getting your Haskell news from Reddit. |
| 19:27:34 | <dons> | i'm using the git version. |
| 19:27:48 | <nominolo> | dons: does it build? |
| 19:27:49 | <gwern> | dmhouse: reddit did cover it |
| 19:27:49 | <gwern> | twice |
| 19:27:55 | <DukeDav1> | Why the move off darcs? |
| 19:27:56 | <gwern> | the proposal and the announcement |
| 19:28:05 | <dmhouse> | http://www.haskell.org/pipermail/cvs-ghc/2008-August/043999.html -- that was the message I recall reading |
| 19:28:06 | <lambdabot> | Title: Version control systems |
| 19:28:08 | <dons> | nominolo: i've not tried yet :) i'm waiting for the base libs to move into git as well, so there's some hope. |
| 19:28:08 | <pianodogg> | nominolo: the real question is: does it blend? |
| 19:28:22 | <pjdelport> | DukeDav1: http://hackage.haskell.org/trac/ghc/wiki/DarcsEvaluation |
| 19:28:23 | <lambdabot> | Title: DarcsEvaluation - GHC - Trac |
| 19:28:24 | <gwern> | DukeDav1: performance problems, and occasional bugginess. the conflict problem didn't help |
| 19:28:51 | <nominolo> | dons: it should, but only if you pulled from darcs.haskell.org; there's a patch pending to fix that |
| 19:29:05 | <nominolo> | pianodogg: it's quite controversial |
| 19:29:45 | <SamB> | nominolo: darcs.haskell.org is so slow |
| 19:30:07 | <dons> | Igloo: stalling on the move isn't helping. Will JaffaCake issue an order to move? |
| 19:30:17 | <gwern> | it's also throttled, isn't it? |
| 19:30:18 | <DukeDav1> | pjdelport: gwern: I see |
| 19:30:27 | <dons> | gwern: not much. |
| 19:30:42 | <pianodogg> | large projects are foolish if they don't use git :) |
| 19:30:42 | <nominolo> | SamB: it depends. mostly it's darcs that is slow. but git over http isn't fast either. git over ssh is pretty fast |
| 19:31:07 | <nominolo> | gwern: a bit, yes |
| 19:31:22 | <Quadrescence> | Someone give me their favorite package to install via cabal-install |
| 19:31:25 | <SamB> | nominolo: I was talking about git over http from darcs.haskell.org |
| 19:31:36 | <nominolo> | gwern: dons' post to reddit didn't help bandwidth either ;) (many were testing the git repo) |
| 19:31:43 | <SamB> | the fact that there's only one packfile there does NOT help |
| 19:31:47 | <gwern> | heh |
| 19:31:56 | <dons> | nominolo: yeah, we should have had github in place, and other mirrors. |
| 19:32:11 | <nominolo> | SamB: ok. i hope we'll have git:// soon. i sent a request to our admin |
| 19:32:17 | <SamB> | since that means that even if you pull from github first, you still end up having download that whole packfile |
| 19:32:24 | <gwern> | @hoogle map |
| 19:32:24 | <lambdabot> | Prelude.map :: (a -> b) -> [a] -> [b] |
| 19:32:24 | <roconnor> | Backwards state monad programming often confuses me. |
| 19:32:24 | <lambdabot> | Data.List.map :: (a -> b) -> [a] -> [b] |
| 19:32:24 | <lambdabot> | Data.ByteString.map :: (Word8 -> Word8) -> ByteString -> ByteString |
| 19:32:27 | <gwern> | @hoogle Data.Map.map |
| 19:32:27 | <lambdabot> | No matches, try a more general search |
| 19:32:46 | <nominolo> | SamB: no, incremental pulls work fine with the git protocol |
| 19:32:54 | <dino-> | In any case, DukeDav1, I would install GHC 6.8.3 from generic Linux binary from here: http://haskell.org/ghc/download.html |
| 19:32:54 | <lambdabot> | Title: The Glasgow Haskell Compiler |
| 19:33:07 | <SamB> | nominolo: I know that ;-) |
| 19:33:20 | <SamB> | I was still talking HTTP |
| 19:33:23 | <dons> | Igloo: so what's the vote looking like? malcolm and igloo for darcs, chak, dons, rl, iavor, nominolo for git? |
| 19:33:27 | <nominolo> | SamB: ah, you can keep pulling from github. i'm keeping that in sync |
| 19:33:30 | <SamB> | now, a workaround that works for ME is to use SSH instead |
| 19:33:47 | <SamB> | (though I switched it back to github anyway...) |
| 19:33:53 | <nominolo> | dons: dcoutts for darcs for cabal |
| 19:33:55 | <gwern> | oh noes, dons voted for git? |
| 19:34:00 | <dons> | and tibbe for git. |
| 19:34:00 | <gwern> | traitor! |
| 19:34:08 | <dons> | gwern-- |
| 19:34:09 | <dino-> | I'm not sure if it still requires libreadline4 like 6.8.2 does, if so you can get an old .deb that works for us with Debian lenny and Ubuntu Feisty here: http://packages.debian.org/sarge/libreadline4 |
| 19:34:09 | <dmhouse> | Igloo: can you reference the git discussion thread? I can't seem to find it. |
| 19:34:11 | <lambdabot> | Title: Debian -- Details of package libreadline4 in sarge |
| 19:34:11 | <SamB> | I don't honestly care what RCS cabal uses |
| 19:34:24 | <gwern> | @karma gwern |
| 19:34:24 | <lambdabot> | You have a karma of -1 |
| 19:34:25 | <matthew-_> | I voted for bzr. But also, I don't think I have a vote ;) |
| 19:34:39 | <nominolo> | gwern++ let's be friendly |
| 19:34:39 | <gwern> | wait, I was sure I had more karma than that |
| 19:34:47 | <gwern> | ah well. you can't take my reddit comment karma away! |
| 19:34:55 | <dino-> | Sorry, I was wrong, not Fiesty, it's Hardy |
| 19:35:14 | <nominolo> | @karma gwern |
| 19:35:14 | <lambdabot> | gwern has a karma of 0 |
| 19:35:31 | <EvilTerran> | preflex: karma gwern |
| 19:35:31 | <preflex> | karma for gwern: 6 |
| 19:35:36 | <EvilTerran> | there's your karma! |
| 19:35:48 | <gwern> | ACTION munches hungrily on't |
| 19:35:48 | <EvilTerran> | preflex: karma |
| 19:35:48 | <preflex> | karma for EvilTerran: 8 |
| 19:35:58 | <heatsink> | I don't understand the absence of a type error, can someone help? http://hpaste.org/9521 |
| 19:36:09 | <nominolo> | none of the options are perfect |
| 19:36:23 | <SamB> | hmm, someone who's actually subscribed to glasgow-haskll-users should reply that git has better ways to handle such things |
| 19:36:29 | <nominolo> | in the end git mostly won because of the bigger community |
| 19:36:33 | <SamB> | on the git and sync-all thread |
| 19:36:40 | <Igloo> | dmhouse: Starts at http://www.haskell.org/pipermail/glasgow-haskell-users/2008-August/015158.html |
| 19:36:40 | <lambdabot> | Title: Version control systems, http://tinyurl.com/6mnwxj |
| 19:36:58 | <Igloo> | dons: It's not a vote, exactly |
| 19:37:31 | <Igloo> | dons: And your list is wrong anyway, e.g. Manuel says he is not advocating to move in http://www.haskell.org/pipermail/glasgow-haskell-users/2008-August/015178.html |
| 19:37:32 | <lambdabot> | Title: Version control systems, http://tinyurl.com/6pgdzo |
| 19:37:37 | <dons> | yes, I can't see how this is going to resolve. |
| 19:37:49 | <dons> | Igloo: he's advocating one rcs only. |
| 19:37:56 | <gwern> | ACTION is taking 5:2 odds on git |
| 19:38:12 | <Igloo> | dons: and rl says "Maybe investing some time in fixing the most obvious darcs problems would be a better solution?" in http://www.haskell.org/pipermail/glasgow-haskell-users/2008-August/015174.html |
| 19:38:13 | <lambdabot> | Title: Version control systems, http://tinyurl.com/5fv6wd |
| 19:38:26 | <gwern> | finally someone says that |
| 19:38:36 | <dons> | yeah, that's worked well in the past. |
| 19:38:40 | <Igloo> | dons: Misrepresenting people's opinions isn't going to help |
| 19:38:49 | <dons> | i was trying to summarise, Igloo. |
| 19:39:15 | <dons> | given that we appeared to have reached a decision to move the compiler to git. |
| 19:39:26 | <pgavin> | git seems much more stable than darcs, but I haven't used it much |
| 19:39:32 | <pgavin> | darcs likes to get stuck |
| 19:39:33 | <dons> | though you seem to be arguing that move's been suspended? |
| 19:39:50 | <nominolo> | dons: what were the reasons for the broken darcs repos you mentioned? |
| 19:39:57 | <dino-> | To add my devalued US$0.02: I'm saddened it's moving from darcs from the Haskell-solidarity point of view. But any of the other of that style are great (git, bzr, etc..) Just please, for the love of all that is just, not svn. |
| 19:39:59 | <SamB> | Igloo: the most obvious darcs problem is that it's abstraction doesn't seem to work well :-( |
| 19:40:10 | <SamB> | in cases like GHC's, at least |
| 19:40:20 | <dons> | nominolo: darcs breaking on merges, and conflicts, it seems. the causes are unknown, other than that we were working at the time. |
| 19:40:32 | <Igloo> | dons: I think we are back in "undecided" mode, but the Simon's haven't given an opinion since the thread |
| 19:40:50 | <SamB> | and ... wouldn't it make more sense to make the switch on the development branch ??? |
| 19:40:52 | <dons> | ok. so then it's really JaffaCake's call. |
| 19:41:10 | <dons> | that's what i'm trying to work out -- how any decision is going to be made here. ultimately though, it's a ghc HQ question, effectively. |
| 19:41:23 | <dons> | perhaps informed by other people doing big development work. |
| 19:41:41 | <gwern> | the simons must be doing the BDFL thing - lurk and see what everyone says, and then lay down a decree from on high |
| 19:41:44 | <SamB> | well, Linus seems happy, as does X.org |
| 19:41:45 | <dons> | so rl, chak, nr, malcolm. |
| 19:41:49 | <pianodogg> | the issues might be fundamental to the darcs world view. why not reimplement git in haskell :) |
| 19:41:59 | <dons> | Igloo: and nr was strongly in favour of a) moving , and b) moving everything? |
| 19:42:00 | <gwern> | reasonable - hopefully by the time the thread is expired everyone will have vented all their spleen and no surgery would be necessary |
| 19:42:08 | <SamB> | pianodogg: might be? |
| 19:42:26 | <SamB> | I think it's understood that they are fundamental to darcs way of operating by now |
| 19:42:31 | <dons> | while we have some people in the b) if we move => move everything camp. but contingent on the move. |
| 19:42:43 | <Quadrescence> | Is an exponential search the same as an n-ary search? (I just made up the n-ary, but I'm sure it will be understood) |
| 19:42:49 | <SamB> | 'twould be cool if darcs was just a way to manage patches for git ... |
| 19:43:09 | <SamB> | (patches that haven't been committed yet, you know?) |
| 19:43:19 | <Igloo> | dons: Ultimately it is the Simons who decide if the GHC repo moves or not, yes. It's not really clear who has the final say on the libraries |
| 19:43:25 | <pianodogg> | there are already things like stacked git (stgit) |
| 19:43:28 | <nominolo> | SamB: yes, except for interactive push/pull, git is a superset of darcs |
| 19:43:35 | <SamB> | Igloo: upstream, of course |
| 19:43:38 | <pianodogg> | but in general you just want to create a separate branch for each "patch" and manage things that way |
| 19:43:40 | <Quadrescence> | Nevermind, it's not. |
| 19:43:51 | <SamB> | Igloo: meaning whoever actually hacks on them |
| 19:43:52 | <nominolo> | dons: SamB, i wouldn't be surprise if sooner or later git would get darcs' capabilites |
| 19:43:54 | <dons> | Igloo: so didn't JaffaCake say unambiguously that the move was on? |
| 19:44:13 | <SamB> | nominolo: I was thinking that maybe darcs would actually sometime become that |
| 19:44:23 | <dons> | or you're saying that since the discussion continued on the list, maybe that needs to be reaffirmed? |
| 19:44:25 | <SamB> | I think it's been tried before |
| 19:44:41 | <Igloo> | dons: Yes, we decided to definitely move ghc only to git. I imagine that this decision will be revisited given the thread that has happened since. |
| 19:44:50 | <kowey> | darcsgit was discontinued due to lack of hackers |
| 19:44:50 | <SamB> | nominolo: git isn't a superset of darcs |
| 19:44:57 | <dons> | "the GHC team have made a decision: we're going to switch to git" |
| 19:45:01 | <gwern> | nominolo: worse is better; the needs that the Right thing satisfies will eventually be demanded by users of the Worser thing |
| 19:45:10 | <Igloo> | It's possible that it will happen anyway, of course, but it seems unlikely given pretty much everyone seems to think it is the worst of the 3 ways forward |
| 19:45:24 | <nominolo> | gwern: yeah. we get the usual 50% -> 90% |
| 19:45:29 | <Heffalump> | does Simon PJ think that? |
| 19:45:36 | <nominolo> | gwern: but i'm not sure darcs can reach 100%, either |
| 19:45:43 | <Igloo> | The Simons haven't commented since the thread |
| 19:45:44 | <SamB> | git uses a completely different worldview -- which seems to be impractical for ancient history, but much more practical for bleeding-edge code |
| 19:45:47 | <SamB> | er. |
| 19:45:51 | <SamB> | s/git/darcs/ |
| 19:46:19 | <Heffalump> | Igloo: right, so there might be one or two key people who don't think it the worst of the three ways |
| 19:46:21 | <gwern> | it's a good question. I'm not as familiar with git as I'd liked, but everything I've heard strikes me as crude and hacky |
| 19:46:35 | <Igloo> | Yes, true |
| 19:46:36 | <SamB> | what are the other two ways? |
| 19:46:49 | <dons> | a) stay in darcs. b) git + darcs, c) all git. |
| 19:46:56 | <sioraiocht> | I quite like git |
| 19:46:59 | <SamB> | gwern: the crude, hacky stuff is just the implementation |
| 19:47:01 | <dons> | we've people who are for a || c, few for b. some for c) some for a |
| 19:47:04 | <pianodogg> | imho, git is the very elegant version control system. the cmdline ui is crazy though |
| 19:47:17 | <SamB> | the actual concept is strikingly simple |
| 19:47:28 | <pianodogg> | SamB: exactly |
| 19:47:38 | <dons> | and there seems to be pretty good arguments against the b) model. |
| 19:47:39 | <SamB> | and fits projects with a long history extremely well |
| 19:47:46 | <gwern> | if you say so |
| 19:47:59 | <thoughtpolice> | git + darcs just isn't feasible, it raises the barrier to entry, something I've already complained about on cvs-ghc in relation to the new build system infrastructure changes, it simply raises the barrier of entry |
| 19:48:01 | <dons> | leaving us with the bigger step of moving libs to c) if ghc's going to work, or abandoning the move, which seems unlikely. |
| 19:48:11 | <SamB> | does (b) mean use both VCS' for GHC? is that even possible? |
| 19:48:21 | <thoughtpolice> | SamB: git for ghc, darcs for all the core libs |
| 19:48:22 | <nominolo> | well, Git has problems with binary files, has incomplete cherry-pick, and doesn't support partial checkout |
| 19:48:29 | <thoughtpolice> | the problem is the core libs and GHC affect each other deeply |
| 19:48:36 | <SamB> | (b) is fine in thoughtpolice' interpretation |
| 19:48:37 | <nominolo> | but bzr, mtn, hg have other problems |
| 19:48:37 | <dons> | thoughtpolice: and the problem there is that typically we change base in response to ghc. |
| 19:48:38 | <Igloo> | nominolo: What are git's problems with binary files? |
| 19:48:46 | <thoughtpolice> | dons: right |
| 19:48:56 | <SamB> | git stores binary files fine |
| 19:49:14 | <nominolo> | SamB: only if you don't change them a lot |
| 19:49:21 | <dmhouse> | SamB: not really, the two projects are linked quite tightly, aren't they? You don't really want people to be using two VCS systems for hacking on GHC. |
| 19:49:27 | <chrisdone> | why does the degree of change matter? |
| 19:49:33 | <thoughtpolice> | if we could get darcs to work better to the point of using it for GHC that would be nice, I am skeptical it can be done in the time frame before the switch |
| 19:49:36 | <pianodogg> | what binary files are changing all the time in ghc? |
| 19:49:36 | <thoughtpolice> | dmhouse: no, you don't |
| 19:49:37 | <SamB> | dmhouse: well, I think it should be on a library-by-library basis |
| 19:49:55 | <nominolo> | Igloo: not sure exactly; it works, but if you have many, people advise to use SVN for those |
| 19:50:03 | <Heffalump> | a big problem of sticking with darcs is that it keeps breaking for Simon PJ |
| 19:50:05 | <nominolo> | Igloo: but that's the same with darcs, i think |
| 19:50:15 | <waern> | what about giving darcs some more time, perhaps until 6.12? |
| 19:50:19 | <SamB> | whatever the people who actually hack on a particular library want to do, they should do |
| 19:50:21 | <nominolo> | Heffalump: when did he say so? |
| 19:50:22 | <chrisdone> | Heffalump: and when peyton `simon` jones gets mad.. |
| 19:50:24 | <SamB> | waern: no way |
| 19:50:28 | <thoughtpolice> | waern: i'm not sure people are willing to put up with that |
| 19:50:31 | <thoughtpolice> | it already has some bad issues now |
| 19:50:44 | <Quadrescence> | hrm, maybe I should study quantum computer science. |
| 19:50:44 | <dons> | Heffalump: for simonpj, and for merges from chak, rl and nr. |
| 19:50:46 | <SamB> | oh, but is Simon PJ using --hashed format? |
| 19:50:47 | <Heffalump> | nominolo: see the darcs bug reports |
| 19:51:02 | <SamB> | or are the problems more conceptual in nature? |
| 19:51:11 | <nominolo> | Heffalump: the big problem is that GHC still uses darcs1 format |
| 19:51:15 | <dons> | nr's story was a bit distressing. week+ wasted on merging. chak's Fc merge had to be done by hand. and then broken repos scattered through that mess. |
| 19:51:19 | <Heffalump> | I don't understand why (b) is so bad. Can't people just write some shell scripts? |
| 19:51:27 | <nominolo> | the whole point is that we would have to switch the whole repo anyway |
| 19:51:28 | <Heffalump> | nominolo: darcs2 runs slower for some tasks than darcs1 |
| 19:51:29 | <gwern> | you know dons, advocating as few dependencies as possible is the sort of philosophy that made the darcs codebase so redundant and crufty |
| 19:51:33 | <SamB> | (b) is FINE |
| 19:51:43 | <Heffalump> | which is why they haven't switched even to hashed format, which isn't an incompatible change |
| 19:51:46 | <nominolo> | and darcs2 is not enough better than darcs1 |
| 19:51:48 | <dons> | gwern, we're talking about tools, not libraries. |
| 19:51:50 | <SamB> | GHC itself clearly isn't working in darcs |
| 19:52:04 | <thoughtpolice> | if we are going to make a move it needs to be one way or the other |
| 19:52:12 | <gwern> | ACTION refuses to see a distinction between tools and libraries |
| 19:52:13 | <thoughtpolice> | half 'n' half is just going to cause complications |
| 19:52:28 | <thoughtpolice> | and ultimately confuse people and make things harder |
| 19:52:43 | <SamB> | but libraries will not just want to all use the same VCS as GHC -- at the very least, we have to let them switch over when they can manage |
| 19:52:46 | <dons> | gwern, then you're silly. libraries means doubling the amount of code. remove tool deps means halving the number of tools needed. |
| 19:53:08 | <thoughtpolice> | SamB: not all libraries have to switch, it's an issue of the core libs more than anything |
| 19:53:16 | <SamB> | sure |
| 19:53:20 | <Heffalump> | thoughtpolice: asking all the people who are happily using darcs without problems to swich is unreasonable |
| 19:53:43 | <dons> | we did it for cvs though. |
| 19:53:45 | <SamB> | obviously the ones that are primarily developed by "ghc-hq" should switch |
| 19:53:52 | <Heffalump> | but CVS is rubbish, people were happy to get away from it |
| 19:54:13 | <newsham> | there is a whole world out there beyond cvs |
| 19:54:14 | <dons> | right, so the difference here is that darcs' issues affect not all devs. but those it does are doing the big things. |
| 19:54:30 | <SamB> | hey, darcs' issues affected me too |
| 19:54:38 | <SamB> | I wasn't even doing big things |
| 19:54:48 | <thoughtpolice> | re: shell scripts to wrap functionality, it is simply hard to model parts of darcs and git in a way that the wrappers can work bidirectionally |
| 19:54:51 | <thoughtpolice> | at the very least |
| 19:54:56 | <nominolo> | SamB: are you a libraries committer? :) |
| 19:54:59 | <thoughtpolice> | you are going to cut out the more advanced functionality of one or another |
| 19:55:06 | <thoughtpolice> | so you'd have to end up learning darcs AND git anyway |
| 19:55:16 | <SamB> | but only in GHC's repository have I had most of these problems |
| 19:56:03 | <nominolo> | i am for moving the core libraries into GHC for the simple reason that this will solve a lot of GHC/libs consistency issues |
| 19:56:20 | <SamB> | nominolo: GHC or git? |
| 19:56:29 | <nominolo> | well, both |
| 19:56:32 | <SamB> | WHAT? |
| 19:56:40 | <SamB> | git has better facilities for that sort of thing |
| 19:56:52 | <nominolo> | well, you could move it into the ghc.git repo |
| 19:57:08 | <SamB> | which ones do you mean by "core"? |
| 19:57:11 | <nominolo> | or you could move it into separate git repos, and use git modules |
| 19:57:19 | <nominolo> | SamB: the official core-libs |
| 19:57:25 | <nominolo> | the minimal libs to build ghc |
| 19:57:31 | <pianodogg> | except that i don't see a reason not to have all of that in the same git repo |
| 19:57:39 | <pianodogg> | yes, exactly, then you don't need submodules or whatever |
| 19:58:06 | <nominolo> | pianodogg: the disadvantage is that you would have to checkout the whole ghc history to work on a single library |
| 19:58:12 | <nominolo> | e.g. for a small fix |
| 19:58:13 | <Igloo> | nominolo: I don't think that git-bisect (or equivalent) makes sense for something that takes as long as GHC to compile anyway |
| 19:58:20 | <SamB> | nominolo: I can't find the list atm |
| 19:58:24 | <SamB> | can you refresh my memory |
| 19:58:38 | <pianodogg> | but virtually everybody doing even small fixes would have a copy of the whole repo already |
| 19:58:39 | <chrisdone> | dons: hey remember formlets? they are sooo cool. chr1s has made them optionally monadic, see how I check the DB?<333 http://hpaste.org/9522 |
| 19:58:49 | <nominolo> | Igloo: it does. maybe not for git-bisect alone, but for the buildbots at the very least |
| 19:58:49 | <pianodogg> | and other people doing "small fixes" ought to have the whole thing anyway for testing, etc |
| 19:59:02 | <Igloo> | nominolo: How does it help the buildbots? |
| 19:59:03 | <SamB> | nominolo: I do not think that all of those should be tied to GHC in the "merge into ghc.git" manner |
| 19:59:06 | <nominolo> | SamB: which list? |
| 19:59:20 | <SamB> | the list of libs in core-libs |
| 19:59:36 | <SamB> | oh, now I found it |
| 19:59:46 | <nominolo> | Igloo: you can instruct them to build a certain version of the whole tree |
| 19:59:58 | <Heffalump> | can't you just tag to get that effect? |
| 19:59:59 | <SamB> | a lot of those libraries would ideally be useful in other Haskell implementations, some already are |
| 20:00:05 | <nominolo> | Igloo: you don't need to be careful about in-between changes of the libraries |
| 20:00:11 | <Igloo> | nominolo: Why is that useful, though? |
| 20:00:19 | <nominolo> | Heffalump: you'd need cross-repo tags |
| 20:00:26 | <Heffalump> | so? |
| 20:00:26 | <nominolo> | Heffalump: and a lot of those |
| 20:00:50 | <SamB> | I agree that git's modules should be leveraged |
| 20:01:16 | <Igloo> | If we used git modules, you would still be able to get a lib's history without also getting ghc's history, right? |
| 20:01:24 | <SamB> | of course |
| 20:01:29 | <nominolo> | yup |
| 20:01:43 | <SamB> | in fact, you don't even have to check out all of the modules if you don't want to |
| 20:01:44 | <nominolo> | but you must remember to link external repos and current repo |
| 20:02:31 | <nominolo> | ie., a submodule is a pointer to another repo's revision and these pointers are version-controlled |
| 20:02:32 | <sioraiocht> | dcoutts_: ping? |
| 20:03:08 | <chr1s> | chrisdone: thanks B) |
| 20:03:18 | <Igloo> | nominolo: So why is being able to tell teh buildbots to build a certain version useful? |
| 20:03:25 | <chrisdone> | chr1s: ^___^! |
| 20:03:25 | <dcoutts> | sioraiocht: pong |
| 20:04:10 | <nominolo> | to make sure it builds exactly the version you want. then you can automatically run scripts that integrate successful builds into head |
| 20:04:14 | <chr1s> | chrisdone: I also think they're awesome. |
| 20:04:31 | <chrisdone> | chr1s: haha, yes. :P |
| 20:04:34 | <glguy> | breaking a library doesn't break HEAD then |
| 20:04:41 | <nominolo> | Igloo: darcs pull/push is hard to script and push/pull -a is fragile |
| 20:04:44 | <glguy> | it just stops it from advancing HEAD |
| 20:04:53 | <nominolo> | glguy: exactly |
| 20:04:59 | <chr1s> | chrisdone: I hope they're going to write some more papers about it. |
| 20:05:04 | <dcoutts> | dons: my position is that I'd rather not split the community. I'd rather not move Cabal from darcs. I'm not qualified to comment on ghc's problems with darcs since I don't hit the problems (I've never had any problems with conflicts ever). I can see the problem with using a mixture but if ghc really wants to move then that would seem to be the result. |
| 20:05:21 | <Heffalump> | nominolo: what's so hard about tags, though? |
| 20:05:25 | <SamB> | I agree with dcoutts |
| 20:05:34 | <dcoutts> | ideally I'd like to see darcs improved, but that may or may not be possible, especially on the timescales we might want |
| 20:05:42 | <SamB> | hmm. |
| 20:05:49 | <SamB> | I hold two conflicting viewpoints. |
| 20:05:53 | <chrisdone> | chr1s: agreed. it kind of makes you surprised people write web pages any other way |
| 20:05:56 | <dcoutts> | SamB: ;-) |
| 20:06:00 | <chrisdone> | chr1s: at least, willingly |
| 20:06:04 | <SamB> | Obviously, git needs better modules ;-P |
| 20:06:09 | <SamB> | which support darcs too |
| 20:06:20 | <chr1s> | chrisdone: yeah, I know. |
| 20:06:24 | <dcoutts> | SamB: clearly to need support for cleanly merging your two conflicting views, in polynomial time. :-) |
| 20:06:32 | <nominolo> | Heffalump: i think it would just become messy |
| 20:06:50 | <SamB> | anyway, for any libraries that do switch to git, it would be a shame not to use git's modules |
| 20:07:07 | <nominolo> | Heffalump: you'd need to add new tags all the time (or move old tags which may lead to other problems) |
| 20:07:19 | <SamB> | you can't move tags in git OR darcs |
| 20:07:22 | <Heffalump> | I guess it depends how often you want to test |
| 20:07:25 | <SamB> | not really truly |
| 20:07:29 | <Heffalump> | in darcs you just add the same tag again |
| 20:07:34 | <nominolo> | SamB: yes you can |
| 20:07:35 | <Heffalump> | but you can obliterate old ones |
| 20:07:39 | <SamB> | can't |
| 20:07:44 | <nominolo> | SamB: git tag -f |
| 20:07:47 | <Heffalump> | can |
| 20:08:10 | <nominolo> | SamB: and darcs doesn't complain if you add the same tag again |
| 20:08:14 | <SamB> | Heffalump: that would play bloody havoc with the inventories |
| 20:08:16 | <nominolo> | SamB: we have it in the ghc repo |
| 20:08:23 | <Heffalump> | SamB: why? |
| 20:08:30 | <nominolo> | SamB: that's true. the tools still allow it though |
| 20:08:42 | <nominolo> | but in git you have to force it |
| 20:08:46 | <SamB> | Heffalump: you haven't looked at the inventories? |
| 20:09:07 | <glguy> | moving tags in git are called branches |
| 20:09:10 | <chrisdone> | chr1s: input' is really sweet. it's like defining custom widgets. custom _composable_ widgets. |
| 20:09:13 | <SamB> | nominolo: you didn't read the fine print did you ;-) |
| 20:09:47 | <nominolo> | SamB: i know it's bad. i'm just saying it's still possible. in both |
| 20:10:01 | <SamB> | nominolo: you effectively can't |
| 20:10:16 | <nominolo> | why not? |
| 20:10:18 | <ddarius> | After a good chunk of tedium... |
| 20:10:20 | <ddarius> | @wiki QuotesPage |
| 20:10:20 | <lambdabot> | http://www.haskell.org/haskellwiki/QuotesPage |
| 20:10:21 | <SamB> | read the fine print |
| 20:10:26 | <nominolo> | no |
| 20:10:34 | <nominolo> | give me a link |
| 20:10:46 | <SamB> | git-tag(1) |
| 20:11:34 | <nominolo> | SamB: i've read all that! |
| 20:11:39 | <glguy> | Why are we discussing moving tags? |
| 20:12:01 | <Heffalump> | SamB: I know about clean tags and splitting inventories, but I don't see why that's an issue |
| 20:12:03 | <SamB> | But if you have pushed things out (or others could just read your |
| 20:12:07 | <nominolo> | glguy: SamB claims you can't do it. I'm claiming you CAN but SHOULDN'T |
| 20:12:09 | <SamB> | start reading from there |
| 20:12:27 | <glguy> | nominolo: OK, you win |
| 20:12:38 | <nominolo> | do i get a cookie? |
| 20:12:58 | <SamB> | nominolo: you didn't win with me yet |
| 20:12:58 | <glguy> | deleting the locally might not be propagated upstream though |
| 20:13:22 | <nominolo> | SamB: why does the existence of git tag -f invalidate my statement? |
| 20:13:41 | <SamB> | nominolo: not the existance |
| 20:13:52 | <SamB> | the not-changing-behind-peoples-back bit |
| 20:14:01 | <nominolo> | ACTION assumes this is a pointless semantics of "can" issue |
| 20:14:06 | <SamB> | perhaps |
| 20:14:10 | <Quadrescence> | AHhahahahah, one of the funniest things I've seen --> https://addons.mozilla.org/en-US/firefox/addon/3792 |
| 20:14:15 | <glguy> | but my original question why "why are we discussing it" when the right way to do this is with a new branch? |
| 20:14:16 | <SamB> | I did say that you effictively can't |
| 20:14:18 | <glguy> | that just trails another |
| 20:14:24 | <SamB> | glguy: new tag |
| 20:14:28 | <nominolo> | SamB: "can" = "the tools give you the possibility to use it" |
| 20:14:36 | <SamB> | nominolo: define "use" |
| 20:14:48 | <glguy> | have a "builds" branch that follows the "master" branch |
| 20:14:49 | <nominolo> | COME ON! |
| 20:15:09 | <SamB> | basically, what I'm saying is that you could do it but it would basically produce UB |
| 20:15:22 | <SamB> | glguy: we aren't talking about that |
| 20:15:24 | <nominolo> | SamB: i'm not continuing this discussion... it has become pointless minutes ago |
| 20:15:38 | <SamB> | nominolo: remember, I *did* say effectively |
| 20:15:52 | <nominolo> | I *didn't* say effectively |
| 20:15:58 | <waern> | nominolo: how is your ghc api hacking going? |
| 20:16:00 | <Heffalump> | CAN! CAN'T! |
| 20:16:13 | <glguy> | BUY SELL? |
| 20:16:13 | <nominolo> | waern: so-so |
| 20:16:24 | <SamB> | oh, well why didn't you just agree with me when I said you can't effectively ? |
| 20:16:29 | <SamB> | anyway... |
| 20:16:47 | <dons> | nominolo: beware of SamB. he has far too much time on his hands, and enjoys pointless diversion |
| 20:17:00 | <SamB> | I do not have too much time on my hands |
| 20:17:02 | <nominolo> | [x] lesson learned |
| 20:17:11 | <SamB> | I just spend it on the wrong things sometimes |
| 20:17:22 | <waern> | nominolo: ok, well, I guess I will notice soon. I'll be adding support for GHC 6.9 in haddock |
| 20:17:37 | <nominolo> | waern: changing error handling is very cross-cutting, in aspect-oriented programming terms |
| 20:17:51 | <waern> | nominolo: yeah |
| 20:18:01 | <nominolo> | waern: oh, yes, it'll break. but the changes should be straightforward |
| 20:18:20 | <SamB> | what does "cross-cutting concerns" have to do with AOP? |
| 20:19:59 | <nominolo> | SamB: i think it's official AOP terminology. but i guess it's also used generally |
| 20:20:11 | <SamB> | I saw it in the GHC-commentary |
| 20:20:20 | <SamB> | plus it's not even jargon |
| 20:20:29 | <SamB> | it means just what it sounds like |
| 20:20:41 | <nominolo> | http://en.wikipedia.org/wiki/Cross-cutting_concern |
| 20:21:32 | <dons> | don't we call that kind of thing a "non-local transformation" |
| 20:21:38 | <dons> | in felleisen's terms |
| 20:22:31 | <dons> | from `On the Expressive Power of Programming Languages ' |
| 20:22:34 | <nominolo> | dons: could be. however you call it, i have to touch lots of files |
| 20:22:37 | <dons> | :) |
| 20:22:39 | <dons> | right. |
| 20:23:21 | <dons> | http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.51.4656 |
| 20:23:22 | <lambdabot> | Title: On the expressive power of programming languages - CiteSeerX |
| 20:23:45 | <SamB> | dons: usually we call it a cross-cutting concern when we are talking about software we are writing |
| 20:23:57 | <SamB> | non-local transformations are things *compilers* do |
| 20:24:11 | <nominolo> | dons: so glad citeseer is working again |
| 20:24:17 | <chrisdone> | anyone ever made a haskell API for talking to a javascript session in a browser via AJAX? |
| 20:24:23 | <dons> | SamB: no, you should read that paper. |
| 20:24:29 | <SamB> | dons: I did |
| 20:25:22 | <dons> | then you'll know that it talks about transformations programmers have to make when writing code. |
| 20:25:41 | <SamB> | hmm. |
| 20:27:00 | <SamB> | well, in any case, the GHC commentary uses the term "cross-cutting concerns" |
| 20:33:46 | <dino-> | I'm trying to install something with cabal install and it's stubbornly only putting the Haddock in my ~/.cabal Tried a lot of things like configure --global and --prefix=/ |
| 20:35:30 | <dcoutts> | dino-: hmm? you mean it installs everything where you want except the haddock docs? |
| 20:35:53 | <dino-> | No I don't think anything is going to /usr/ nothing |
| 20:36:14 | <dino-> | The package is exif-3000.0.0.tar.gz |
| 20:36:27 | <dino-> | from Hackage, downloaded the .gz and did it local (to be able to get haddock generated) |
| 20:36:44 | <dino-> | I was just experimenting with a possible sh script that does the steps with the cli cabal tool |
| 20:37:27 | <dcoutts> | dino-: it wouldn't go to /usr if you used --prefix=/ |
| 20:37:31 | <dino-> | But even typing the command by hand: cabal configure --global --prefix=/ ; cabal build ; cabal test ; cabal haddock ; sudo cabal install |
| 20:37:41 | <dino-> | No good, only puts in my ~/.cabal |
| 20:37:58 | <dino-> | Ok, also won't go in user with --global alone |
| 20:38:16 | <dcoutts> | dino-: the sudo cabal install is doing the configure step with default settings |
| 20:38:31 | <dcoutts> | dino-: you'd want to do sudo cabal install --global --prefix=/usr |
| 20:38:36 | <dcoutts> | or better:L |
| 20:38:57 | <dcoutts> | cabal install --global --prefix=/usr --root-cmd=sudo |
| 20:39:14 | <dino-> | I guess I'm used to native projects where you do everything but install as not-root and then the install as root. |
| 20:39:15 | <dcoutts> | that way you do the build as you and only install as root |
| 20:39:21 | <SamB> | dcoutts: why isn't sudo the default? |
| 20:39:26 | <dino-> | ah |
| 20:39:36 | <dcoutts> | SamB: some people think it's the wrong default |
| 20:39:43 | <SamB> | what is the default? |
| 20:39:44 | <Heffalump> | because trying to do things as root without permission is bad |
| 20:39:53 | <SamB> | hmm. |
| 20:40:07 | <dcoutts> | SamB: well --user is the default, and for --global it assumes you already have perms |
| 20:40:08 | <SamB> | so is fakeroot the default then? |
| 20:40:13 | <dino-> | But wait, if I want things to go to the normal prefix, is --global alone good for that? |
| 20:40:21 | <SamB> | no that wouldn't make any sense... |
| 20:40:32 | <dcoutts> | dino-: default prefix for --global is /usr/local as it should be. |
| 20:40:35 | <dino-> | I mean, no --prefix |
| 20:40:40 | <dino-> | ok, as per the docs |
| 20:40:45 | <dcoutts> | right :-) |
| 20:41:07 | <dcoutts> | dino-: so the confusing thing was that cabal install foo does everything in one go. |
| 20:41:22 | <dcoutts> | and takes all the configure flags too |
| 20:41:24 | <dino-> | Yes, but I can't use that because I want Haddock in like 95% of my installations. |
| 20:41:40 | <dcoutts> | dino-: then grab the darcs version and use --enable-documentation |
| 20:41:44 | <chrisdone> | sigh. I think I'm going to have to go back to college and take maths |
| 20:42:37 | <chrisdone> | seems pretty sad. twenty year old with a beard. "hey, how do I solved quadratic equations?" |
| 20:42:44 | <trofimovich> | > let !x = 1 in x |
| 20:42:44 | <lambdabot> | Parse error at "!x" (column 5) |
| 20:43:01 | <trofimovich> | > let x = 1 in (1 :: !Int) |
| 20:43:01 | <lambdabot> | Parse error at "!Int)" (column 20) |
| 20:43:20 | <pgavin> | let (!x) = 1 in x |
| 20:43:28 | <pgavin> | > let (!x) = 1 in x |
| 20:43:28 | <lambdabot> | Parse error in pattern at "in" (column 14) |
| 20:43:32 | <matthew-_> | > let (!) x = 1 in x ! undefined |
| 20:43:36 | <lambdabot> | add an instance declaration for (Num (a -> a1)) |
| 20:43:36 | <dmhouse> | They're a GHC extensions, I don't think lambdabot has them on. |
| 20:43:45 | <pgavin> | > let { (!x) = 1 } in x |
| 20:43:45 | <lambdabot> | Parse error in pattern at "}" (column 16) |
| 20:43:55 | <pgavin> | > let { (!x) = 1 ; } in x |
| 20:43:55 | <lambdabot> | Parse error in pattern at ";" (column 16) |
| 20:44:00 | <trofimovich> | > let x = 1 in x `seq` x |
| 20:44:01 | <lambdabot> | 1 |
| 20:44:30 | <pgavin> | > {-# LANGUAGE BangPatterns #-} let !x = 1 in x |
| 20:44:30 | <lambdabot> | Parse error at "!x" (column 35) |
| 20:44:49 | <matthew-_> | cat main.hs | sed -e 's/LANGUAGE/LANGUAGE BangPatterns,/' > main.hs.new && mv main.hs.new main.hs |
| 20:44:51 | <thoughtpolice> | lambdabot doesn't do pragmas |
| 20:45:27 | <trofimovich> | > import System.IO |
| 20:45:27 | <lambdabot> | Parse error at "impor..." (column 1) |
| 20:45:28 | <pgavin> | thoughtpolice: yeah, I didn't really expect that to work :) |
| 20:45:55 | <SamB_XP> | yeah, imagine if we could use {-# TemplateHaskell #-} |
| 20:46:09 | <trofimovich> | @hoogle unsafePerformIO |
| 20:46:10 | <lambdabot> | Foreign.unsafePerformIO :: IO a -> a |
| 20:46:10 | <lambdabot> | System.IO.Unsafe.unsafePerformIO :: IO a -> a |
| 20:46:47 | <dino-> | Do I need to also sudo the install command? I get permission errors with --root-cmd=sudo |
| 20:47:01 | <SamB_XP> | dino-: that's probably a bug? |
| 20:47:08 | <dino-> | beats me |
| 20:47:12 | <matthew-_> | SamB_XP: yeah, there are a few places, I believe, where that can cause security issues |
| 20:47:21 | <SamB_XP> | dino-: ... or you just forgot to delete the root-owned files from before |
| 20:48:07 | <dino-> | mm, that may be. There's a pile of root owned stuff now in my ~<notroot>/.cabal/lib |
| 20:48:19 | <newsham> | Loading package unix-2.3.0.0 ... ghc-6.8.2: can't load .so/.DLL for: util (/usr/lib/libutil.so: Undefined symbol "__mb_sb_limit") |
| 20:48:22 | <tibbe> | @seen dons |
| 20:48:22 | <lambdabot> | dons is in #arch-haskell, #ghc, #xmonad and #haskell. I last heard dons speak 23m ago. |
| 20:48:31 | <dino-> | It's gotten messy in there |
| 20:48:33 | <newsham> | is that something I should file in ghc trac? |
| 20:48:56 | <tibbe> | dons: I'm almost finished wrapping the bsd kqueue API, thought I write a benchmark using that as soon as I have time |
| 20:49:01 | <SamB_XP> | that's a release version of GHC? and the latest on it's branch? |
| 20:49:03 | <matthew-_> | newsham: can you repeat it? |
| 20:49:07 | <tibbe> | dons: when I'm sure it's working I'll push some patches |
| 20:49:08 | <matthew-_> | from a fresh install? |
| 20:49:17 | <dcoutts> | dino-: if it's really bad you can always rm it and the .ghc dir, that'll loose all per-user registered packages. |
| 20:49:25 | <tibbe> | dons: can't test an epoll binding on my laptop |
| 20:49:28 | <newsham> | matthew: yup, but its not a small repro -- build HAppS-Data. |
| 20:49:31 | <trofimovich> | @help ask |
| 20:49:31 | <lambdabot> | ask <nick> <message>. When <nick> shows activity, ask them <message>. |
| 20:50:08 | <matthew-_> | newsham: ok, I don't know happs at all - you think the bug lies with the build for happs? |
| 20:50:12 | <dino-> | dcoutts: The where the registration is contained for user, in the ~/.ghc? That's good to know. |
| 20:50:19 | <newsham> | i have no idea at all, which is why I ask. |
| 20:50:34 | <newsham> | but unix-2.3.0.0 is part of ghc dist (or -extras) right? |
| 20:50:43 | <dcoutts> | dino-: right, use ghc-pkg list to see what's registered and where the package database files are exactly. |
| 20:50:43 | <dino-> | I suppose I could blow away my entire ~/.cabal at this stage |
| 20:50:55 | <newsham> | could also be ghci bug (this is freebsd/amd64 which has ghci problems) |
| 20:50:57 | <Lemmih> | newsham: What happens when you load unix in ghci? |
| 20:51:02 | <dcoutts> | dino-: you could save the packages dir, it's just a cache of downloaded tarballs. |
| 20:51:06 | <newsham> | those "... linking ... done." messages are ghci dynamic loading, yes? |
| 20:51:09 | <newsham> | ie.. TH perhaps? |
| 20:51:31 | <Lemmih> | newsham: Yes, TH. |
| 20:51:39 | <dino-> | dcoutts: ya, I noticed that. I'll have to add that to my nightly backup exclusions list. |
| 20:51:52 | <mauke> | hi |
| 20:51:52 | <newsham> | :module +System.Posix works fine |
| 20:52:07 | <mauke> | I'm using the command |
| 20:52:17 | <Lemmih> | newsham: Try: ghci -package unix |
| 20:52:20 | <tusho> | http://luqui.org/blog/archives/2008/08/10/mindfuck-the-reverse-state-monad/ |
| 20:52:21 | <tusho> | WIIIIIIIIIIIN |
| 20:52:21 | <lambdabot> | Title: Mindfuck: The Reverse State Monad @ The dreams that stuff is made of, http://tinyurl.com/6rl5bw |
| 20:52:29 | <mauke> | I'm using the command 'cabal install ghc-paths' and getting |
| 20:52:30 | <mauke> | ghc-paths-0.1.0.4 failed during the configure step. The exception was: |
| 20:52:30 | <mauke> | exit: ExitFailure 1 |
| 20:52:37 | <newsham> | lemmih: same error |
| 20:52:39 | <Lemmih> | newsham: Just loading a module won't link the package. |
| 20:52:45 | <mauke> | is this a cabal-install bug? |
| 20:52:50 | <Quadrescence> | It would be neat if there was a site where you could submit requests for certain code (or code snippets), and someone could reply with a code snippet as a solution to your request. |
| 20:52:56 | <newsham> | no, build from srcs, not using cabal install. |
| 20:53:07 | <newsham> | oh, sorry, wrong conversation |
| 20:53:10 | <dcoutts> | mauke: probably not |
| 20:53:19 | <trofimovich> | Quadrescence: hpaste? |
| 20:53:22 | <Lemmih> | newsham: Phew, not a HAppS bug then (: |
| 20:53:22 | <mauke> | dcoutts: but why doesn't it show the real error? |
| 20:53:26 | <dcoutts> | mauke: more likely the package does not configure |
| 20:53:46 | <newsham> | lemmih: speaking of happs bugs.. i mentioned on #happs... but some of the darcs commands on the happs.org home page dont work. |
| 20:53:49 | <mauke> | a manual make says: Setup.hs:7:7: Could not find module `Distribution.Simple.PackageIndex' |
| 20:53:50 | <newsham> | ie. wrong versions |
| 20:53:56 | <dcoutts> | mauke: it probably does, higher up. The final message is just a summary of all packages that failed. |
| 20:54:00 | <newsham> | also they dont list all packages (ie. -Util) |
| 20:54:26 | <dcoutts> | mauke: right, and that message is almost certainly there higher up when you did cabal install too |
| 20:54:28 | <mauke> | dcoutts: oh, d'oh. I missed one line :(. thanks! |
| 20:54:43 | <mauke> | dcoutts: no, not that message but The package requires Cabal library version -any && >=1.4 but no |
| 20:54:59 | <Lemmih> | newsham: Right, the HAppS website is quite bad ATM. |
| 20:55:24 | <dcoutts> | mauke: we present the summary because if you install a dozen packages then the failures will have scrolled off the screen (since we keep building other packages that don't dep on the failed ones). |
| 20:55:41 | <SamB> | mauke: so it's a bug in ghc-path's .cabal file, I guess |
| 20:56:07 | <SamB> | er. ghc-paths' |
| 20:56:14 | <newsham> | lemmih: :( |
| 20:56:28 | <dcoutts> | SamB: the Setup.hs needs Cabal-1.4 |
| 20:56:39 | <mauke> | dcoutts: works after 'cabal install Cabal' |
| 20:56:54 | <mauke> | dcoutts: but isn't 'cabal upgrade' supposed to take care of that? |
| 20:56:56 | <dino-> | Hm, I tried both $ cabal install --root-cmd=sudo |
| 20:56:57 | <dcoutts> | mauke: can you run with -v and tell me what version of Cabal it decided to build the Setup using |
| 20:57:05 | <trofimovich> | @type System.IO System.IO.Unsafe.unsafePerformIO (putStrLn "hi") |
| 20:57:06 | <lambdabot> | Plugin `type' failed with: invalid ghci output: no type signature |
| 20:57:06 | <dino-> | and $ sudo cabal insatll --root-cmd=sudo |
| 20:57:10 | <trofimovich> | @type System.IO.Unsafe.unsafePerformIO (putStrLn "hi") |
| 20:57:11 | <lambdabot> | () |
| 20:57:11 | <SamB> | dcoutts: yeah |
| 20:57:13 | <dino-> | And still stubbornly installs to ~ |
| 20:57:14 | <SamB> | that's what I mean |
| 20:57:22 | <SamB> | the .cabal file should have said so! |
| 20:57:26 | <newsham> | lemmih: any reason why happs uses the older version of haxml instead of the version in hackage? |
| 20:57:26 | <trofimovich> | cabal install --global maybe? |
| 20:57:44 | <trofimovich> | > System.IO.Unsafe.unsafePerformIO (putStrLn "hi") |
| 20:57:44 | <lambdabot> | Not in scope: `System.IO.Unsafe.unsafePerformIO' |
| 20:57:48 | <dcoutts> | mauke: I don't think I understand. How did you have cabal-install without Cabal-1.4 ? |
| 20:57:56 | <dino-> | The configure was done --global |
| 20:57:58 | <dino-> | Needs it twice? |
| 20:58:18 | <dcoutts> | dino-: cabal install does all of configure + build (+haddock) + install |
| 20:58:31 | <mauke> | dcoutts: I think I had Cabal-1.4 and now it installed 1.4.0.1, which works |
| 20:58:39 | <Lemmih> | newsham: The version we use /is/ in hackage, it's just not the most recent version. |
| 20:58:51 | <dcoutts> | dino-: so doing cabal configure; cabal install looses the options specified to configure, you have to specify them to install. |
| 20:58:52 | <dino-> | dcoutts: I see, even in the project top level dir. |
| 20:59:12 | <dino-> | So it's not a replacement for runhaskell Setup.hs |
| 20:59:16 | <dino-> | in that case |
| 20:59:18 | <newsham> | lemmih: ahh.. i just didnt spec it right i guess |
| 20:59:18 | <mauke> | dcoutts: so apparently SamB was right; ghc-paths should depend on >=Cabal-1.4.0.1 |
| 20:59:24 | <dcoutts> | mauke: hmm, did you have any other versions of Cabal registered? like 1.5 |
| 20:59:47 | <Lemmih> | newsham: cabal-install will install the correct version for you (: |
| 20:59:53 | <mauke> | or maybe not, hmm |
| 21:00:05 | <newsham> | lemmih: you mean if i cabal-install the happs packages? |
| 21:00:11 | <mauke> | dcoutts: ghc-pkg list Cabal says Cabal-1.2.4.0, Cabal-1.4.0.1 |
| 21:00:12 | <Lemmih> | newsham: Yes. |
| 21:00:22 | <newsham> | is there a master happs package which will install all the minor packages? |
| 21:00:23 | <dcoutts> | mauke: oh, so you didn't have 1.4.0.0 |
| 21:00:59 | <dcoutts> | mauke: in which case yes, cabal-install would have had no choice but to use Cabal-1.2.4.0 to compile the Setup.hs which doesn't have the PackageIndex module |
| 21:01:10 | <dcoutts> | mauke: yes, ghc-paths is missing Cabal-version: >= 1.4 |
| 21:01:11 | <Lemmih> | newsham: HAppS-Server depends on everything, I believe. HAppS-State depends on everything except HAppS-Server. |
| 21:01:21 | <newsham> | danke. |
| 21:01:26 | <mauke> | dcoutts: cabal-version: >= 1.4 |
| 21:01:49 | <newsham> | sweet, that would work if it wasnt for the unix/ghci bug :) |
| 21:01:58 | <dcoutts> | mauke: oh yes, hmm. |
| 21:02:00 | <newsham> | i guess i'll futz with this later. i filed a ghc trac |
| 21:02:06 | <mauke> | the dependency is specified and cabal-install reported a missing dependency |
| 21:02:21 | <mauke> | I'm just used to it automatically installing dependencies |
| 21:02:27 | <SamB_XP> | mauke: do you have any other versions installed in ~ or something? |
| 21:02:28 | <Lemmih> | newsham: What platform are you on? |
| 21:02:39 | <newsham> | freebsd 7.0 ghc-6.8.2/amd64 |
| 21:02:47 | <mauke> | SamB_XP: my entire ghc is in ~; every install is "global" |
| 21:02:55 | <dino-> | I think it's important to be able to do the install step alone with the config that's already there. |
| 21:02:58 | <trofimovich> | @type unsafePerformIO (System.IO.readFile "/etc/fstab" >>= return) |
| 21:02:59 | <lambdabot> | Plugin `type' failed with: invalid ghci output: no type signature |
| 21:03:01 | <SamB_XP> | mauke: oh, it reported a missing dependency ... when was that? |
| 21:03:06 | <dcoutts> | mauke: I'm still confused. You say it reported the missing dep but you also said it compiled the Setup.hs with cabal-1.2 (which failed of course). |
| 21:03:11 | <trofimovich> | @type unsafePerformIO (System.IO.readFile "/etc/fstab" >>= return) :: String |
| 21:03:12 | <lambdabot> | Plugin `type' failed with: invalid ghci output: no type signature |
| 21:03:32 | <trofimovich> | @type System.IO.unsafePerformIO (System.IO.readFile "/etc/fstab" >>= return) |
| 21:03:32 | <lambdabot> | Plugin `type' failed with: invalid ghci output: no type signature |
| 21:03:33 | <newsham> | ?type unsafePerformIO |
| 21:03:34 | <lambdabot> | Plugin `type' failed with: invalid ghci output: no type signature |
| 21:03:56 | <trofimovich> | @type id |
| 21:03:57 | <lambdabot> | forall a. a -> a |
| 21:03:59 | <newsham> | ?type System.IO.Unsafe.unsafePerformIO |
| 21:03:59 | <lambdabot> | forall a. IO a -> a |
| 21:04:09 | <mauke> | dcoutts: ah, no. I tried to build it manually, which is when it failed because of a missing module |
| 21:04:09 | <trofimovich> | @type System.IO.Unsafe.unsafePerformIO (System.IO.readFile "/etc/fstab" >>= return) |
| 21:04:10 | <lambdabot> | String |
| 21:04:11 | <newsham> | ?type System.IO.Unsafe.unsafePerformIO (readFile "/etc/fstab" >>= return) |
| 21:04:11 | <lambdabot> | String |
| 21:04:34 | <gnut> | hi all |
| 21:04:35 | <dcoutts> | mauke: ah ok, good. So it did the right thing except for not automatically installing a later version of the Cabal lib. |
| 21:04:39 | <newsham> | > System.IO.Unsafe.unsafePerformIO $ writeFile "/tmp/gotcha" "gotcha" |
| 21:04:39 | <lambdabot> | Not in scope: `System.IO.Unsafe.unsafePerformIO' |
| 21:04:54 | <mauke> | dcoutts: yes. and also not mentioning the missing Cabal in the failure summary |
| 21:05:21 | <dino-> | Thanks for your help. |
| 21:05:22 | <SamB_XP> | dcoutts: and apparantly having gone on to try and compile Setup.hs |
| 21:05:27 | <SamB_XP> | or run, or whatever |
| 21:05:28 | <mauke> | SamB_XP: no, that was me |
| 21:05:31 | <SamB_XP> | mauke: oh |
| 21:05:37 | <SamB_XP> | nvm then ;-) |
| 21:06:03 | <SamB_XP> | and what does cabal --version say ? |
| 21:06:19 | <mauke> | dcoutts: this is what I got at first: http://rafb.net/p/0swYi564.html |
| 21:06:20 | <lambdabot> | Title: Nopaste - No description |
| 21:07:00 | <dcoutts> | mauke: right, we don't know why Setup.hs failed. I don't see how we can know. |
| 21:07:39 | <dcoutts> | mauke: oh, wait, right, we failed for a known reason but we didn't propagate the message. |
| 21:07:52 | <mauke> | dcoutts: then: http://rafb.net/p/rBn6dV51.html |
| 21:07:52 | <lambdabot> | Title: Nopaste - No description |
| 21:08:00 | <mauke> | this contains a real error message but I missed it at first |
| 21:08:27 | <eu-prleu-peupeu> | hello |
| 21:08:41 | <mauke> | SamB_XP: by now it says: cabal-install version 0.5.1, using version 1.4.0.1 of the Cabal library |
| 21:08:49 | <eu-prleu-peupeu> | check this: http://lambda-the-ultimate.org/node/2926 |
| 21:08:50 | <lambdabot> | Title: Lightweight Monadic Regions | Lambda the Ultimate |
| 21:08:56 | <tibbe> | dons: http://www.youtube.com/watch?v=yNRS1ssLPdQ Haven't watched it yet but it might be of interest |
| 21:08:57 | <lambdabot> | Title: YouTube - The New NIO, aka JSR-203 |
| 21:10:59 | <eu-prleu-peupeu> | what is a "sound type system" ? |
| 21:11:36 | <dons> | thank tibbe. adding links to the wiki page? |
| 21:11:54 | <tibbe> | dons: good idea, I'll just stick them in the reference section for now |
| 21:11:56 | <thoughtpolice> | eu-prleu-peupeu: it's a very interesting paper, I actually have a copy of it up right now :) |
| 21:11:56 | <dons> | yeah |
| 21:13:07 | <dons> | tibbe: interesting they use closures. |
| 21:13:31 | <tibbe> | dons: yes, I have an idea how a fold or map might be a really good callback for async I/O |
| 21:13:40 | <tibbe> | dons: it gets called for every new chunk |
| 21:14:00 | <dons> | yeah, curl works nicely like that. |
| 21:14:31 | <eu-prleu-peupeu> | thoughtpolice: im reading it now... i dont know most of these concepts, but i like the concept of regions and predictable and safe allocation/deallocation |
| 21:15:20 | <tibbe> | dons: added some references |
| 21:15:33 | <eu-prleu-peupeu> | now i feel like i shouldn't have skipped those programming pragmatics classes :/ |
| 21:15:46 | <tibbe> | dons: we can use the userdata void * in the C api to attach a haskell callback to |
| 21:16:53 | <Ninju_> | @hoogle |
| 21:16:54 | <lambdabot> | HOOGLE - Haskell API Search |
| 21:16:54 | <lambdabot> | (C) Neil Mitchell 2004-2008, York University, UK |
| 21:16:54 | <lambdabot> | |
| 21:17:13 | <Ninju_> | @hoogle a -> [a] -> Bool |
| 21:17:14 | <lambdabot> | Prelude.elem :: Eq a => a -> [a] -> Bool |
| 21:17:14 | <lambdabot> | Prelude.notElem :: Eq a => a -> [a] -> Bool |
| 21:17:14 | <lambdabot> | Data.List.elem :: Eq a => a -> [a] -> Bool |
| 21:18:43 | <thoughtpolice> | eu-prleu-peupeu: i've found it to be one of the more approachable of oleg's work |
| 21:18:46 | <thoughtpolice> | his enumerator stuff is also really cool |
| 21:19:46 | <stepcut> | let's say I am implementing a computer algebra system, and I have the term, (a + b) + (a + b). The user wants to apply commute to the second (a + b) to get, (a + b) + (b + a). Any ideas how they might express that in a way the computer could understand ? |
| 21:21:10 | <matthew-_> | stepcut: well hopefully, + will be suitably annotated such that commutivity is understood |
| 21:21:40 | <matthew-_> | and then you just, as an optimiser, apply the bigger arg fist as it'll result in less register spilling |
| 21:21:58 | <mmorrow> | stepcut: check out HERA http://code.haskell.org/HERA/ |
| 21:21:58 | <lambdabot> | Title: Index of /HERA |
| 21:22:43 | <mercury^> | why is there a notElem when not . elem does the job? |
| 21:23:51 | <stepcut> | matthew-_: what do you mean by 'understood' ? |
| 21:23:56 | <dons> | mercury^: that's an odd one, yes. |
| 21:24:01 | <dons> | it's an anomaly |
| 21:26:05 | <matthew-_> | stepcut: um, well, I guess ultimately it would have to be an annotation that would fall right the way through to native code gen if necessary, that the function is commutitive |
| 21:26:44 | <dons> | ghc's primops have those notes. |
| 21:26:58 | <dons> | defaults has_side_effects = False out_of_line = False commutable = False needs_wrapper = False can_fail = False |
| 21:27:25 | <stepcut> | matthew-_: there is no native code gen... |
| 21:27:49 | <matthew-_> | stepcut: ok, so what do you hope to achieve |
| 21:28:02 | <dons> | you're writing an interpreter, stepcut ? |
| 21:28:03 | <stepcut> | computer algebra system is probably not the right description, more like a proof assistant for algebra |
| 21:28:30 | <stepcut> | but, a stupid one that makes you do everything |
| 21:28:37 | <vixey> | stepcut, |
| 21:28:59 | <vixey> | if you were at this state: |
| 21:29:00 | <vixey> | (a + b) + (a + b) |
| 21:29:19 | <vixey> | = (a + b) + (b + a) by commutate |
| 21:29:30 | <vixey> | you could write that ? |
| 21:29:50 | <vixey> | then it could just check that actually is a valid transform |
| 21:30:02 | <matthew-_> | but hopefully, by CSE, = 2 * (a + b) |
| 21:30:13 | <stepcut> | vixey: well I want to have '(a + b) + (a + b)' and the the user issues a command like, 'commute the second (a + b)', and the program produces, (a + b) + (b + a) |
| 21:30:36 | <vixey> | that sounds quite a bit harder to use :) |
| 21:30:38 | <mmorrow> | stepcut: i just took two screenshots to save you the pain of getting HERA to work (took me a month of off-and-on trying) |
| 21:30:41 | <mmorrow> | http://code.haskell.org/~morrow/code/images/hera_0.png |
| 21:30:43 | <mmorrow> | http://code.haskell.org/~morrow/code/images/hera_1.png |
| 21:30:45 | <stepcut> | vixey: it's supposed to be |
| 21:31:00 | <matthew-_> | ok, so you have an expression (G)ADT and you write Plus and then commute swaps the order of the args, no? |
| 21:31:04 | <vixey> | stepcut, but it seems like you could zoom into part of an expression, then do equational transforms on it and step back out |
| 21:31:12 | <chr1s> | stepcut: I'm not sure if this is what you're looking for, but there's an interesting paper from some people @ UU about generic rewriting. |
| 21:31:17 | <chr1s> | http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-020.pdf |
| 21:31:18 | <lambdabot> | Title: A Lightweight Approach to Datatype-Generic Rewriting |
| 21:31:24 | <vixey> | stepcut, ccshan posted some cool stuff like this, maybe you could use the same technquies |
| 21:31:37 | <stepcut> | matthew-_: well, I am concern only with the UI portion of this problem -- how does the user express their desire clearly |
| 21:32:03 | <vixey> | stepcut: Wait do you want it easier or harder to use? |
| 21:32:04 | <stepcut> | mmorrow: so, you are suggesting the user could interactively select the portion of the equation that wish to apply the law to ? |
| 21:32:20 | <mmorrow> | stepcut: yeah, that's hera's strategy |
| 21:32:28 | <mmorrow> | notice the pulldown menu in the second screen shot |
| 21:32:30 | <mmorrow> | http://code.haskell.org/~morrow/code/images/hera_1.png |
| 21:32:52 | <mmorrow> | also, notice in the main frame the "Debugging Info:" |
| 21:32:53 | <chr1s> | stepcut: you might also want to look at http://ideas.cs.uu.nl/genexas/generic.php?exercisekind=Proposition%20to%20DNF |
| 21:32:54 | <lambdabot> | Title: OU Exercise Assistant On-line, http://tinyurl.com/5gyrd8 |
| 21:33:01 | <mmorrow> | 0,0,1,2,0,1,1 |
| 21:33:15 | <mmorrow> | that's the path to the root of the subtree from the root of the main tree |
| 21:33:38 | <stepcut> | ok, I'll look at these and see what I can adopt |
| 21:33:39 | <chr1s> | that's an exercise assistant for generic exercises where you have different domains with different rewriting rules. |
| 21:33:44 | <vixey> | stepcut : ? |
| 21:35:04 | <Ninju_> | @hoogle [[a]] -> [a] |
| 21:35:04 | <lambdabot> | Prelude.concat :: [[a]] -> [a] |
| 21:35:04 | <lambdabot> | Data.List.concat :: [[a]] -> [a] |
| 21:35:04 | <lambdabot> | Data.List.intercalate :: [a] -> [[a]] -> [a] |
| 21:36:05 | <stepcut> | vixey: easy to use in someways, but not in others |
| 21:37:18 | <stepcut> | vixey: one issue with '(a + b) + (b + a) by commute" is that it is easy to type that in in this case. But for more complex equations having to retype the whole thing would be a bit annoying? |
| 21:37:50 | <vixey> | did you miss my other comments? |
| 21:37:56 | <stepcut> | one issue with a graphical equation picker is how to save the steps as a text script which could be replayed later |
| 21:38:20 | <vixey> | http://conway.rutgers.edu/~ccshan/wiki/blog/posts/WalkZip1/ is the post I was referring to |
| 21:38:30 | <stepcut> | vixey: ok, I'll look at that too |
| 21:39:00 | <Halo-> | It's down for me? |
| 21:39:14 | <Ninju_> | @hoogle (a -> Bool) -> [a] -> Maybe a |
| 21:39:22 | <stepcut> | the screenshots on this page show one possibilty, http://mathxpert.com/ |
| 21:42:00 | <Shiruka> | foo f = listToMaybe . filter f? |
| 21:42:13 | <Shiruka> | ACTION tries to imagine what else could sensibly fit that type.. |
| 21:42:55 | <chr1s> | stepcut: seriously, just take a look at that exercise assistant I linked above ;) |
| 21:42:57 | <Shiruka> | (hm, that doesn't do what I intended anyway, on a second thought) |
| 21:43:15 | <ddarius> | Ulisses Costa recently made a point-free calculator that may have some ideas. |
| 21:43:16 | <stepcut> | chr1s: I am looking. So far I have not figured out how to do anything but generate a syntax error ;) |
| 21:43:36 | <chr1s> | there you can let the user rewrite things themselves, and the system will compare the rewritten version with the previous version based on a unification-algorithm |
| 21:43:37 | <Shiruka> | (er, does too :-O I didn't even know listToMaybe works for lists with length > 1) |
| 21:43:51 | <chr1s> | and try to find which rule you are using |
| 21:44:03 | <stepcut> | chr1s: yeah -- something like that could work |
| 21:44:20 | <chr1s> | stepcut: http://www.cs.uu.nl/research/techreps/repo/CS-2007/2007-017.pdf |
| 21:44:33 | <chr1s> | there's a TR on the exercise assistant itself |
| 21:44:41 | <stepcut> | chr1s: cool, that should help |
| 21:44:47 | <Ninju_> | Shiruka: I was trying to find a method that detects the first element in a list which returns true when passed to a predicate |
| 21:45:04 | <chr1s> | stepcut: what are you going to build? |
| 21:45:04 | <ddarius> | http://caos.di.uminho.pt/~ulisses/blog/2008/07/29/pointfree-calculator/ |
| 21:45:11 | <dmhouse> | Ninju_: find |
| 21:45:11 | <Ninju_> | so, detect (> 3) [1,2,3,4,5] = Just 4 |
| 21:45:17 | <Ninju_> | thanks |
| 21:45:18 | <dmhouse> | > find (>3) [1..5] |
| 21:45:39 | <mmorrow> | stepcut: HERA's wiki http://www.haskell.org/haskellwiki/Haskell_Equational_Reasoning_Assistant |
| 21:45:43 | <dmhouse> | Prelude Data.List> find (>3) [1..5] |
| 21:45:43 | <dmhouse> | Just 4 |
| 21:45:45 | <mmorrow> | paper: http://www.ittc.ku.edu/~andygill/papers/IntroHERA06.pdf |
| 21:45:47 | <Shiruka> | .. doh :-) |
| 21:46:00 | <stepcut> | mmorrow: thanks |
| 21:46:02 | <vininim> | @bot |
| 21:46:46 | <Shiruka> | find p = listToMaybe . filter p |
| 21:46:59 | <Shiruka> | close enough ;-) |
| 21:47:21 | <mmorrow> | good luck :) |
| 21:53:25 | <stepcut> | chr1s: is there a place to submit bugs, 'Sorry, unable to fulfill your request: omething went wrong' |
| 21:54:11 | <stepcut> | I don't understand why this isn't just True, 'p || r || q || r || ~r' |
| 21:54:36 | <stepcut> | oh... || is probably not disjunction? |
| 21:55:29 | <stepcut> | ACTION finds the address to submits bugs |
| 21:56:18 | <wjt> | Igloo: there's no chance of having GHC 6.8.3 in Lenny, is there? |
| 21:56:44 | <Igloo> | No, sorry |
| 21:58:17 | <gwern> | @seen nominolo |
| 21:59:11 | <wjt> | Igloo: ah well. |
| 21:59:45 | <gwern> | preflex: seen nomeata |
| 21:59:45 | <preflex> | nomeata was last seen on #xmonad 1 hour, 11 minutes and 28 seconds ago, saying: A keyboard-centric window manager is a bit misplaced on a keyboardless phone |
| 21:59:47 | <gwern> | er. |
| 21:59:49 | <vixey> | stepcut: got any examples you want to do? |
| 21:59:54 | <gwern> | preflex: seen nominolo |
| 21:59:55 | <preflex> | nominolo was last seen on #haskell 1 hour, 35 minutes and 44 seconds ago, saying: dons: so glad citeseer is working again |
| 21:59:55 | <vixey> | like equations to prove or something? |
| 22:00:47 | <stepcut> | vixey: pretty much this, but better, http://mathxpert.com/ |
| 22:00:54 | <vixey> | stepcut: I mean an equation |
| 22:01:02 | <vixey> | to prove using it |
| 22:01:11 | <vixey> | like what would you do with it? |
| 22:01:28 | <vixey> | http://www.apronus.com/provenmath/fields.htm |
| 22:01:31 | <vixey> | stuff like this? |
| 22:01:40 | <gwern> | @ask nominolo You seem to be knowledgeable about the GHC API; is there currently anyway to do something like 'load "Data.Map"; eval "map (+1) [1..10]"' *without* erroring? as it stands, it causes an eval error because it gets conmfused between Data.Map.map and Prelude.map. |
| 22:02:02 | <gwern> | @ask nominolo I guess what I want are fully qualified imports, but I haven't figured out how to do it yet |
| 22:02:19 | <stepcut> | vixey: no, just a tool for beginning algebra students to use to solve simple word problems |
| 22:02:29 | <hml> | is there good documentation of C pointers in the haskell ffi? i'm finding the awkward squard a bit hard to read concerning this issue |
| 22:03:10 | <lispy> | hml: based on the frequency and subject of questions about FFI on haskell-cafe, there must not be a good doc |
| 22:03:47 | <hml> | lispy: let's write one! here's my contribution \begin{document} ... \end{document}; the ... is left up to you |
| 22:03:55 | <lispy> | hehe |
| 22:04:10 | <lispy> | \include{explanation-from-hml} |
| 22:04:20 | <dcoutts> | hml: the FFI spec is reasonably useful |
| 22:04:21 | <lispy> | done! |
| 22:04:34 | <dcoutts> | hml: and the lib docs themselves |
| 22:04:52 | <hml> | \section{Solution} ask #haskell on irc.freenode.net |
| 22:05:03 | <lispy> | er \#haskell |
| 22:05:14 | <lispy> | you have to escape those pesky #s |
| 22:05:15 | <vixey> | ACTION just had a go at this program... and wants to make an example to show |
| 22:05:51 | <hml> | dcoutts: what are the lib docs you're referring to? |
| 22:05:53 | <stepcut> | vixey: ivan works 4 times as many hours as mary. ivan and mary work 75 hours total. How long did each of them work? |
| 22:06:08 | <vixey> | hm |
| 22:06:14 | <vixey> | I was thinking about a totally different program |
| 22:06:28 | <vixey> | something where you have an equation or expression and do equational rewrites on it |
| 22:06:39 | <dcoutts> | hml: the Foreign.* modules |
| 22:06:46 | <lispy> | i = 4m, i + m = 75, 5m = 75, m = 15, i = 60 |
| 22:06:48 | <gwern> | stepcut: sounds like a task for prolog! |
| 22:06:50 | <hml> | dcoutts: http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi.pdf <-- is this the ffi spec you're referring to? |
| 22:06:53 | <dcoutts> | hml: which are the libs specified by the FFI |
| 22:06:54 | <gwern> | or maybe the list monad |
| 22:06:55 | <lispy> | yay! I solved it! |
| 22:07:00 | <gwern> | ACTION is too apathetic to care |
| 22:07:09 | <stepcut> | lispy: yes, but you need to prove each step :) |
| 22:07:12 | <dcoutts> | hml: right, or the html version linked from haskell.org |
| 22:07:22 | <vixey> | ok you actually have sets of equations |
| 22:07:23 | <lispy> | stepcut: er...prove? |
| 22:07:44 | <vixey> | http://joshkos.blogspot.com/2007/11/fold-fusion-strikes-back.html |
| 22:07:52 | <vixey> | That's the kind of thing I was thinking |
| 22:08:09 | <stepcut> | lispy: yeah, like how you got, 5m = 75, from the first two equations |
| 22:08:20 | <mauke> | @bot |
| 22:08:39 | <vininim> | lol at goatse operator |
| 22:08:48 | <lispy> | stepcut: when you say prove, you just mean show my work then? |
| 22:08:49 | <stepcut> | lispy: there is some substitution, some distribution, some simplification. There's bunch a of steps you did in your head ;) |
| 22:09:04 | <mauke> | preflex: seen lambdabot |
| 22:09:04 | <preflex> | lambdabot was last seen on #haskell 33 minutes and 59 seconds ago, saying: Data.List.intercalate :: [a] -> [[a]] -> [a] |
| 22:09:05 | <stepcut> | lispy: yeah, what 'law' you apply at each step |
| 22:10:30 | <lispy> | stepcut: I used, argument by authority, slippery slope and strawman. |
| 22:10:43 | <vixey> | gwern: Started to learn Prolog? |
| 22:10:45 | <stepcut> | lispy: once you level up, you can apply more powerful transforms. 'eliminate i. solve m.' but initially, you have to show every step |
| 22:11:30 | <lispy> | stepcut: cute |
| 22:11:53 | <gwern> | vixey: I wish. it's on my list, after scheme and MMIX |
| 22:12:45 | <lispy> | gwern: two birds, one stone. Write a scheme compiler for MMIX |
| 22:12:58 | <stepcut> | 4m + m = 75 (by substitution), 4m + 1m = 75 (by multiplicative identity), m * (4 + 1) = 75 (by distribution), m * 5 = 75 (by additive simplification), (m * 5) / 5 = 75 / 5 (by <i forget the law>), and so on |
| 22:12:59 | <vixey> | In Prolog |
| 22:13:02 | <vixey> | :D |
| 22:13:03 | <gwern> | learning to write compilers is also on the list :) |
| 22:13:06 | <SamB_XP> | lispy: MMIX is nasty :-( |
| 22:13:09 | <lispy> | vixey: no, that's 3 birds :) |
| 22:13:18 | <SamB_XP> | the MMU is the craziest |
| 22:13:26 | <gwern> | SamB_XP: yeah, but it's what is used in TAOCP. if I'm going to dream... |
| 22:13:39 | <stepcut> | write a scheme compiler in MMIX |
| 22:13:44 | <SamB_XP> | gwern: not yet is it? |
| 22:14:06 | <gwern> | SamB_XP: I thought knuth had updated the volumes for mmix |
| 22:14:25 | <lispy> | oh which one is the original? MIX and then MMIX? |
| 22:14:25 | <Philonous> | Is there any editor/IDE you would suggest for developing haskell code? Maybe emacs? |
| 22:14:31 | <dmhouse> | Philonous: Emacs. |
| 22:14:38 | <SamB_XP> | MIX is the original |
| 22:14:47 | <Philonous> | dmhouse: Thanks |
| 22:14:47 | <vixey> | hm |
| 22:14:54 | <stepcut> | Philonous: get the latest haskell-mode |
| 22:14:57 | <lispy> | Philonous: emacs is fine. I recommend using hasktags. Visual Haskell is great if you're used to visual studio. |
| 22:15:03 | <gwern> | emacs and vim are both supposed to have pretty good support |
| 22:15:07 | <dmhouse> | Philonous: Emacs and Vim are the two most popular editors for Haskell. There is also a Visual Studio plugin if you lean that way. |
| 22:15:13 | <vixey> | I can really see why higher order unification is nice now |
| 22:15:14 | <SamB_XP> | MIX also seems crazy, but at least it isn't terribly overcomplicated the way MMIX is |
| 22:15:29 | <SamB_XP> | and it only seems crazy because it's from the pre-octet era |
| 22:15:33 | <kryptiskt> | Philonous, EclipseFP if you like that |
| 22:16:10 | <lispy> | SamB_XP: I started to write an emulator in Haskell for MIX and it turned out to be a huge mess of instructions. I doubt I'll ever pick up that project again... |
| 22:16:23 | <SamB_XP> | MIX or MMIX? |
| 22:16:36 | <lispy> | SamB_XP: whatever one the books are currently authored for |
| 22:16:41 | <SamB_XP> | oh |
| 22:16:47 | <gwern> | lispy: hm, that's interesting. even brainfuck interpreters look nice in haskell, so I wonder at that mess |
| 22:16:50 | <Philonous> | lispy: Does Visual Haskell require a copy of MS Visial Studio? |
| 22:17:10 | <lispy> | Philonous: yes, I don't know if it works with the express editions |
| 22:17:14 | <SamB_XP> | lispy: well I think MMIX would be even worse |
| 22:17:16 | <stepcut> | simulate MMIX in scheme and write a prolog interpreter in MMIX ? |
| 22:17:22 | <kryptiskt> | Philonous, Don't use visual haskell, it's outdated |
| 22:17:41 | <lispy> | gwern: I wrote an optimizing bf intpreter in haskell and that was fun |
| 22:17:43 | <kryptiskt> | also it doesn't work with express |
| 22:17:44 | <Philonous> | Ah ok, I'm running FreeBSD, so I think I'll stick to emacs then. |
| 22:17:47 | <Philonous> | Thanks all |
| 22:18:23 | <stepcut> | I tried to write a unlambda compiler in Haskell, but put it on hold until the C generation libraries are done |
| 22:18:26 | <lispy> | SamB_XP: oh probably. I just got bored implementing the 100 different instructions |
| 22:18:26 | <Halo-> | Does the apparent increasing C knowledge that comes with growing a big beard also apply to Haskell? |
| 22:18:33 | <stepcut> | though, I could use harpy now I guess |
| 22:18:51 | <chrisdone> | Halo: one cannot grow a haskell |
| 22:19:00 | <kryptiskt> | So when will there be a class action suit against RMS for all RSI Emacs has caused? |
| 22:19:00 | <SamB_XP> | Halo-: of course! |
| 22:19:10 | <SamB_XP> | C knowlege is ever useful when hacking Haskell |
| 22:19:11 | <stepcut> | Halo-: I hope not, http://research.microsoft.com/~simonpj/GIFs/spj-snow.jpg |
| 22:19:15 | <lispy> | kryptiskt: hehe |
| 22:19:43 | <stepcut> | kryptiskt: the real problem is the bastards that moved the control key in favor of capslock |
| 22:20:00 | <gwern> | death is too good for them! |
| 22:20:05 | <chrisdone> | see, there, he's probably just skiiing, but I initially thought he'd be climbing a huge mountain |
| 22:20:34 | <kryptiskt> | stepcut, Good, IBM and RMS then, at least one of those two have money |
| 22:20:47 | <Halo-> | Hm. Conflicting opinions. I might continue my beard adventure and see if it bears fruit. |
| 22:20:48 | <SamB_XP> | stepcut: what??? |
| 22:21:03 | <chrisdone> | what‽ |
| 22:21:24 | <chrisdone> | > f |
| 22:21:33 | <SamB_XP> | stepcut: the Ctrl key used to be where CapsLock is ? |
| 22:21:36 | <SamB_XP> | when was that? |
| 22:21:44 | <chrisdone> | lambdabot: you have rubbish hair |
| 22:21:48 | <kryptiskt> | before IBM PC AT |
| 22:21:50 | <stepcut> | SamB_XP: in the good old days, one moment |
| 22:22:02 | <chrisdone> | > "hello‽" |
| 22:22:03 | <Halo-> | I use capslock instead of shift. I find it faster and requires less stretching |
| 22:22:12 | <chrisdone> | is λb dead or pretending? |
| 22:22:17 | <Draconx> | I always rebind my caps lock ley to control, anyway. |
| 22:22:22 | <Halo-> | I assume that's one of the reasons I've managed to type craploads and not feel any effects |
| 22:22:30 | <chrisdone> | > 1 |
| 22:22:38 | <Ninju_> | @hoogle Ord b => (a -> b) -> [a] -> [a] |
| 22:22:40 | <chrisdone> | vixey: what did you do to lambdabot? |
| 22:22:48 | <stepcut> | of course, there is also this emacs friendly keyboard, http://world.std.com/~jdostale/kbd/SpaceCadet1.jpeg |
| 22:23:01 | <Ninju_> | oh, is lambdabot broken? :( |
| 22:23:33 | <chrisdone> | I blame vixey. she's always making lambdabot do weird stuff |
| 22:23:43 | <chrisdone> | stepcut: nice |
| 22:24:00 | <Halo-> | Are there Emacs foot pedals? |
| 22:24:10 | <lispy> | stepcut: "Rub out" key? |
| 22:24:13 | <chrisdone> | stepcut: is that a shoop or real? |
| 22:24:14 | <stepcut> | SamB_XP: http://ninkendo.org/~ken/images/sun-type-6-detail.jpg |
| 22:24:18 | <stepcut> | chrisdone: real |
| 22:24:37 | <chrisdone> | Halo-: I chuckled |
| 22:24:43 | <stepcut> | chrisdone: it's the keyboard for the symbolics lisp machine |
| 22:25:03 | <chrisdone> | stepcut: I love the thumbsup/thumbsdown |
| 22:25:13 | <ddarius> | So vixey, why is higher order unification nice? |
| 22:25:15 | <chrisdone> | stepcut: "terminate program?" |
| 22:25:24 | <SamB_XP> | stepcut: why is the Alt key to the left of the Windows key on that one? |
| 22:26:07 | <chrisdone> | hahaha, a QUOTE key. amazing |
| 22:26:16 | <vixey> | ddarius: describing rewriting tactics, like for an equational reasoning assistant |
| 22:26:18 | <stepcut> | SamB_XP: I think that keyboard predates windows. That is a meta key |
| 22:26:58 | <chrisdone> | stepcut: the Windows key is usually assigned "Super", IIRC |
| 22:27:00 | <stepcut> | SamB_XP: here is a currently available keyboard which emulates that layout, http://www.fentek-ind.com/hhlite2lrg.jpg |
| 22:27:01 | <SamB_XP> | ACTION was kidding about it being a Windows key ;-) |
| 22:27:20 | <vixey> | stuff like command(rewrite(X = Y), F(X) --> F(Y)). is a lot nicer than command(rewrite(X = Y), F_X --> F_Y) :- search_and_replace(X,Y,F_X,F_Y). |
| 22:27:38 | <SamB_XP> | stepcut: what? no function keys -- F or otherwise? |
| 22:27:45 | <ddarius> | vixey: Yep. Multiset rewriting is an application of linear higher order unification. |
| 22:27:52 | <stepcut> | ACTION uses the windows key for xmonad |
| 22:27:58 | <SamB_XP> | oh, the Fn key |
| 22:28:04 | <SamB_XP> | I thought that was a laptop thing |
| 22:28:10 | <Ninju_> | is there a sort function in the libraries such that I can do things like :- f sum [[2,3], [4,5], [1,1]] -> [[1,1], [2,3], [4,5]] -- sorts the elements by their sum |
| 22:28:11 | <Ninju_> | thanks |
| 22:28:14 | <stepcut> | SamB_XP: on the modern keyboard, you have to hit Fn. A bit annoying, but nice if you want the smaller keyboard form factor |
| 22:28:26 | <pgavin> | anyone happen to know what would happen if there was only one thread holding on to an MVar, and it called takeMVar? |
| 22:28:36 | <pgavin> | does the runtime detect that the thread can never wake up? |
| 22:28:46 | <SamB_XP> | at least they put the F keys on their corresponding numeric keys |
| 22:28:55 | <Halo-> | Do people use function keys much though? |
| 22:29:03 | <Toxaris> | Ninju_: use sortBy with comparing |
| 22:29:13 | <SamB_XP> | hmm, good question ;-) |
| 22:29:25 | <SamB_XP> | depends on the app I guess |
| 22:29:31 | <Ninju_> | which library is it in? |
| 22:29:45 | <stepcut> | SamB_XP: size comparison of sun type 6 vs hhkb, http://comedialabs.com/images-matti/hhkb.jpg |
| 22:29:47 | <Ninju_> | I think I've tried sortBy before - when I was guessing at possible function names |
| 22:29:52 | <matthew-_> | pgavin: yes |
| 22:30:03 | <matthew-_> | it detects that it can't be woken |
| 22:30:06 | <Quadrescence> | Is a priority queue just a way to know "what to do/look for next"? |
| 22:30:07 | <pgavin> | matthew-_: ok |
| 22:30:14 | <matthew-_> | and if that's the main thread ,the program will die |
| 22:30:19 | <matthew-_> | with an error message |
| 22:30:41 | <pgavin> | matthew-_: the MVar docs don't say anything about that |
| 22:30:52 | <Toxaris> | Ninju_: e.g. f = sortBy (comparing sum) does what you want |
| 22:30:56 | <matthew-_> | it's more to do with the ghc garbage collector |
| 22:31:13 | <SamB_XP> | matthew-_: well, it's not by any means guarenteed |
| 22:31:14 | <Toxaris> | Ninju_: Data.List.sortBy, Data.Ord.comparing |
| 22:31:16 | <pgavin> | matthew-_: right, that's the only way it could detect that condition |
| 22:31:24 | <SamB_XP> | but the GC can sometimes tell these things, yes |
| 22:31:29 | <matthew-_> | SamB_XP: oh sure, sorry I should have made that clear. |
| 22:31:30 | <Toxaris> | Ninju_: are you aware of http://www.haskell.org/hoogle/ ? |
| 22:31:41 | <SamB_XP> | er. |
| 22:31:44 | <Ninju_> | thanks |
| 22:31:55 | <SamB_XP> | I should rather have directed my comment to pgavin ;-) |
| 22:31:57 | <stepcut> | and the pro version: http://www.akihabaranews.com/en/news_pics/11373/3.jpg |
| 22:32:03 | <pgavin> | matthew-_, SamB_XP: thanks |
| 22:32:25 | <Ninju_> | Toxaris: I've used it a few times through lambdabot, but didn't realise I could do it elsewhere. Thanks. |
| 22:32:36 | <Halo-> | Quick, someone tell me where Scroll Lock is on that keyboard... |
| 22:32:39 | <tehgeekmeister> | i'm trying to build hexpat, but apparently i'm doing something wrong. I've unpacked the tarball and tried running "ghc --make Setup.lhs -o setup" and it hangs in the linking stage, and "ghc Setup.lhs" and it complains about undefined references. i have libexpat installed in my /usr/local/lib;; where do i go from here? |
| 22:33:09 | <Toxaris> | Ninju_: you can even download hoogle and use it at home |
| 22:33:44 | <SamB_XP> | the only thing I ever use scroll lock for is to swap computers using my KVM |
| 22:33:59 | <Toxaris> | Ninju_: "cabal install hoogle" worked for me, and then "hoogle comparing" gives "Data.Ord comparing :: Ord a => (b -> a) -> b -> b -> Ordering" |
| 22:34:40 | <Ninju_> | Toxaris: I need to install cabal first |
| 22:34:44 | <gwern> | tehgeekmeister: hexpat? is that from hackage? |
| 22:34:49 | <tehgeekmeister> | gwern: yes |
| 22:35:37 | <Toxaris> | Ninju_: hehe yeah unfortunately its not yet included with ghc |
| 22:36:53 | <gwern> | tehgeekmeister: installed fine for me via cabal install |
| 22:36:59 | <gwern> | perhaps the problem is your weird invocation |
| 22:37:17 | <SamB_XP> | so how come sun doesn't still sell type 6s? |
| 22:37:19 | <tehgeekmeister> | that's probably it, i didn't remember the right way to do it |
| 22:37:32 | <tehgeekmeister> | that's what i get for neglecting haskell for months |
| 22:37:40 | <gwern> | runhaskell Setup configure/build/install |
| 22:37:59 | <tehgeekmeister> | ah, i just tried that |
| 22:38:02 | <tehgeekmeister> | and i got this error |
| 22:38:21 | <tehgeekmeister> | ghc-6.8.2: internal error: R_X86_64_32S relocation out of range: (noname) = 0x7f82eece54f8 |
| 22:39:49 | <chrisdone> | stepcut: sweeeet pro version. I longed for Das Keyboard for a long time. 5 minutes to be precise, before I discovered the price, and I shall rhyme in this sentence thrice |
| 22:40:07 | <chrisdone> | hey ashy |
| 22:41:22 | <stepcut> | chrisdone: heh |
| 22:41:30 | <olsner> | chrisdone: you could also get a Model M off the internet, and if you're really into it, you can remove the removable keycaps |
| 22:41:47 | <stepcut> | chrisdone: the DAS is nothing in price compared to the optimus |
| 22:41:54 | <chrisdone> | olsner: I do have a Model M. it's german. got it from Unicomp. I removed the keycaps and it looked amazing, but felt less so :( |
| 22:42:08 | <chrisdone> | olsner: the keys feel really tiny and kind of hurt to type on without the caps |
| 22:42:09 | <stepcut> | chrisdone: http://www.legitreviews.com/article/247/1/ |
| 22:42:15 | <ddarius> | "If arithmetic overflow is a fatal error, some fascist pig with a read-only mind is trying to enforce machine independence. But the very ability to trap overflow is machine dependent." |
| 22:42:35 | <chrisdone> | stepcut: yeah, I bet typing on it feels like crap |
| 22:42:55 | <chrisdone> | ddarius: I laughed |
| 22:42:57 | <stepcut> | also, if you remove (or rearrange) the keys on the model M, you will find that you really do use those little nubs on the F and J keys |
| 22:42:59 | <olsner> | hmm, yeah, the keys would get smaller when removing the caps... clickykeyboards has transparent caps as well btw |
| 22:43:32 | <chrisdone> | olsner: is it possible to buy caps? transparent ones would be nice |
| 22:43:40 | <stepcut> | anyway, rubbing alchohol or something similar will probably remove the labels from just about any keyboard |
| 22:43:57 | <vixey> | why don't you just leave them on? |
| 22:43:57 | <SamB_XP> | my key labels are coming off without any effort on my part as it is |
| 22:44:14 | <chrisdone> | olsner: amusingly, I had a friend round who had typed on my keyboard all night, but when he realised the keys were german he couldn't type on it |
| 22:44:22 | <stepcut> | chrisdone: heh |
| 22:44:33 | <Philonous> | With this keyboard the position of keys wouldn't be an issue any more: http://www.artlebedev.com/everything/optimus-tactus/ |
| 22:44:57 | <EvilTerran> | ... it's like a giant iphone O.o |
| 22:45:01 | <SamB_XP> | I have a Q and Z, and part of the W, U, J, and a sliver of the I |
| 22:45:07 | <stepcut> | ACTION is still waiting for a good bluetooth chord keyboard |
| 22:45:12 | <SamB_XP> | the rest of the letters are quite faded |
| 22:45:18 | <chrisdone> | Philonous: tapping on a hard flat static piece of plastic all day sounds painful? |
| 22:45:29 | <stepcut> | ... and for iPhone to support bluetooth keyboards :( |
| 22:45:44 | <Philonous> | Yeah. But you could place your controll key wherever you want it to be :) |
| 22:45:59 | <olsner> | stepcut: heh, yeah, I usually idle by tugging on those nubs and listning to the sound of the mechanism rumbling around beneath the keys |
| 22:46:25 | <stepcut> | nice Model M conversion, http://steampunkworkshop.com/keyboard.shtml |
| 22:46:43 | <stepcut> | olsner: aside from that, you really do use them to make sure your fingers are in the right position |
| 22:46:48 | <SamB_XP> | hmm, is that optimus tactus what they use in TNG? |
| 22:46:50 | <chrisdone> | stepcut: ace |
| 22:47:49 | <chrisdone> | here is mine: http://i19.ebayimg.com/06/i/000/ae/37/feba_1.JPG |
| 22:48:58 | <adu> | hi |
| 22:49:05 | <chrisdone> | ahoy |
| 22:49:46 | <stepcut> | a slightly less cool keyboard conversion, http://www.multipledigression.com/type/ |
| 22:50:08 | <stepcut> | but, still pretty cool |
| 22:51:02 | <chrisdone> | brilliant present |
| 22:53:54 | <chrisdone> | stepcut: yeah, since getting my model m I have learned to touch type with correct finger positions, so I tend to use the nubs |
| 22:55:00 | <ddarius> | ACTION doesn't understand people who use a computer quite a bit and can't touch type. |
| 22:55:28 | <stepcut> | ACTION doesn't understand people who use a computer quite a bit and can't touch type dvorak and qwerty. |
| 22:55:30 | <chrisdone> | yes, it's certainly very important |
| 22:55:47 | <ddarius> | stepcut: Indeed. |
| 22:56:06 | <olsner> | we should bring back the touch-typing classes in school and universities |
| 22:56:21 | <stepcut> | olsner: plus iPhone typing |
| 22:56:33 | <olsner> | iPhone typing? I don't even know what that is |
| 22:56:34 | <vininim> | ACTION can't touch type dvorak |
| 22:56:35 | <chrisdone> | I suspect dvorak advocates of simply typing dvorak more correctly than qwerty. there doesn't seem to be much real evidence suggesting real benefits |
| 22:57:05 | <stepcut> | chrisdone: depends on what benefits you are looking for |
| 22:57:24 | <Boney> | olsner: we can also teach correct spelling/grammar to kids and teach them to apply this when using MSN. |
| 22:57:27 | <stepcut> | chrisdone: your fingers definitely move less distance total |
| 22:57:40 | <adu> | stepcut: i use dvorak :) |
| 22:58:36 | <Boney> | chrisdone: I've heard that querty can be faster because often as one finger strikes a key, often another finger on the other hand can move into position for the next key. |
| 22:58:36 | <stepcut> | chrisdone: and it feels less mentally chaotic to me :) |
| 22:58:43 | <chrisdone> | Boney: I think if MSN had that terribly annoying spelling notification by default then teens would have to learn to type properly because they would be sick of correcting it |
| 22:58:44 | <vininim> | I don't see why someone (beside a professional typist) needs to type at 1200 wpm when you spend most of the time thinking and reading than typing. |
| 22:59:01 | <adu> | in the year 2051, everyone will use Dvorak, Beta, and AmigaOS |
| 22:59:06 | <olsner> | hmm, but chat is the new speak, so it'll probably never respond well to attempts at fixing it |
| 22:59:07 | <vininim> | at least in the context of general computer use (even programming). |
| 22:59:07 | <chrisdone> | stepcut: I'm not sure mental chaos can be quantified so well for keyboard use |
| 22:59:11 | <Boney> | chrisdone: ah, A technical solution! |
| 22:59:12 | <ddarius> | Boney: With Dvorak I tend to be typing multiple keys at once. |
| 22:59:13 | <stepcut> | chrisdone: :p |
| 22:59:47 | <stepcut> | vininim: many people I know who use dvorak switched because it feels less stressful on the hands, not because they wanted to type faster |
| 22:59:49 | <Boney> | ddarius: neat, |
| 22:59:54 | <Randroid> | ddarius: Another Dvorak typist. I thought I was the only one. Taught myself in the early '90s and now have lost the ability to type QWERTY except by hunt-and-peck. |
| 23:00:07 | <Boney> | btw, I've never tried dvorak, |
| 23:00:10 | <jeffz``> | ACTION looks for the colemak users |
| 23:00:31 | <ddarius> | Randroid: There are quite a few Dvorak users here. I did lose the ability to type QWERTY after I learned Dvorak, but I've since regained it. |
| 23:00:35 | <vixey> | No I think lots of people in #haskell use dvoraj |
| 23:00:36 | <vininim> | stepcut: it wouldn't cut for me though because I have to type both at english and portuguese, and the dvoraks would be quite different. |
| 23:00:49 | <olsner> | vininim: I think it's more a matter of not breaking your hands when actually having to do write something |
| 23:00:51 | <stepcut> | Boney: I suspect that max typing speed hits some other mental obsticle that is independent of the key positions. |
| 23:00:56 | <vixey> | Boney, It is pretty fun to switch layout |
| 23:00:58 | <Randroid> | jeffz``: I looked at Colemak, but at 40 years old, I don't think I've got another keyboard layout in me. |
| 23:01:31 | <Philonous> | It must be painfull to relearn typing after 10 years... Just when you finally manage to find keys without looking ^^ |
| 23:01:35 | <chrisdone> | stepcut: there is a point about hand stress. when I didn't type properly i experienced burning sensations and shooting pains. when touch typing however this is not the case. this is why I kind of suspect people convert to dvorak without trying to type QWERTY properly. but that is just personal experience |
| 23:01:47 | <gwern> | Randroid: oh don't think that way; for all you know you have another 60 years of typing in front of you, or more |
| 23:01:51 | <Boney> | stepcut: that's probably true, for me the bottleneck is my vision. |
| 23:01:53 | <jeffz> | Randroid: I don't blame you, I don't think I'd want to switch from qwerty even at 23. I manage a comfortable 60wpm. |
| 23:02:10 | <ddarius> | chrisdone: I could type QWERTY properly long before I ever tried Dvorak. |
| 23:02:20 | <stepcut> | chrisdone: dunno, I touch typed qwerty for many years before switching. And, I actually switched twice. |
| 23:02:24 | <Randroid> | gwern: Oh, it's not that I think I don't have long on this earth. I'm sure I do. It's that at 40, I don't think I have the patience or time for it. |
| 23:02:37 | <gwern> | ddarius: |
| 23:02:41 | <gwern> | er. |
| 23:03:19 | <gwern> | Randroid: eh. I have the patience for a lot of things if the payoff accrues daily for decades, but that's just me |
| 23:03:52 | <EvilTerran> | anyway, no matter how long you live, the keyboard could be superceded unexpectedly |
| 23:04:18 | <chrisdone> | Microsoft Head Implants |
| 23:04:26 | <ddarius> | EvilTerran: It could be, but it seems clear that it will be lasting for quite a while. |
| 23:04:28 | <gwern> | EvilTerran: not a bet I would like to take, based on how the keyboard has been the major computer interface for the last... 60 years? |
| 23:04:54 | <EvilTerran> | eh. technology advances exponentially. |
| 23:04:59 | <gwern> | as long as we think alphabetically and program alphabetically, I will continue to take the bet that this will not be the year the keyboard is overthrown |
| 23:05:01 | <chrisdone> | gwern: and judging by the cost of (admittedly shitty) keyboards |
| 23:06:06 | <ayumilove> | o_o |
| 23:06:19 | <gwern> | chrisdone: judging? |
| 23:06:26 | <vixey> | @seen ayumilove |
| 23:06:35 | <ayumilove> | @seen vixey |
| 23:07:10 | <mauke> | preflex: seen vixey |
| 23:07:10 | <preflex> | vixey was last seen on #haskell 45 seconds ago, saying: @seen ayumilove |
| 23:07:22 | <gwern> | @seen Zao |
| 23:07:41 | <EvilTerran> | preflex: seen Zao |
| 23:07:41 | <preflex> | Zao was last seen on #haskell 12 hours, 10 minutes and 5 seconds ago, saying: Control.Parallel.Strategies.DWIM? |
| 23:07:44 | <chrisdone> | gwern: keyboards are really cheap. makes sense it would take a technology to be /far/ superior or cheaper to displace it |
| 23:07:46 | <EvilTerran> | heh |
| 23:07:48 | <ayumilove> | what are you guys doing here? |
| 23:07:49 | <ayumilove> | http://hpaste.org/9526 |
| 23:07:52 | <ayumilove> | can someone look into this? |
| 23:08:08 | <ayumilove> | someone said to me that iterate can be used in fibonacci |
| 23:08:22 | <gwern> | chrisdone: I would argue that for precision and bits per second, no other interface has come close except in very limited domains |
| 23:08:41 | <ayumilove> | but it produces [0,1,2,3,4...] |
| 23:08:53 | <ayumilove> | instead of [0,1,1,2,3,5..] |
| 23:08:55 | <mauke> | > iterate (\(x, y) -> (y, x+y)) (0, 1) |
| 23:09:03 | <chrisdone> | gwern: I suppose that is true |
| 23:09:04 | <clkao> | win 4 |
| 23:09:15 | <vininim> | preflex: > 2 |
| 23:09:31 | <chrisdone> | preflex: source |
| 23:09:46 | <gwern> | chrisdone: I mean, for drawing, say, I would not want to argue that keyboards are an easier way of inputing the bits than a pressure sensitive pad and a pen |
| 23:09:47 | <vininim> | mm I don't think preflex is a lambdabot |
| 23:09:51 | <chrisdone> | is preflex available in a repo. anywhere? preferrably darcs, not this new “git” fad? |
| 23:09:51 | <ayumilove> | mauke? o_o |
| 23:09:57 | <mauke> | http://mauke.ath.cx/preflex/ |
| 23:09:59 | <EvilTerran> | preflex: version |
| 23:10:00 | <preflex> | 8.638 |
| 23:10:00 | <gwern> | chrisdone: yes |
| 23:10:01 | <chrisdone> | thanks |
| 23:10:06 | <adekoba> | the `time' package is reporting a time that is incorrect. It's exactly 4 hours off, so it sounds like a timezone issue. How can I fix this? |
| 23:10:09 | <mauke> | ayumilove: yes? |
| 23:10:14 | <gwern> | ?where preflex |
| 23:10:23 | <ayumilove> | mauke: that iterate is for fibonacci? |
| 23:10:25 | <gwern> | @help where |
| 23:10:28 | <mauke> | ayumilove: yes |
| 23:10:37 | <mauke> | ayumilove: you'll probably also want a map fst |
| 23:10:43 | <chrisdone> | gwern: right, but you can provide a lot of meaning with a keyboard, for controlling things and for describing things |
| 23:10:50 | <mauke> | [(0,1),(1,1),(1,2),(2,3),(3,5),(5,8),(8,13),(13,21),(21,34),(34,55)... |
| 23:11:17 | <Shiruka> | ayumilove: you have this: recA x y n = take n (iterate(+(x+y))x), and then call it with recA 0 1 n |
| 23:11:17 | <ayumilove> | how do i write that in my notepad |
| 23:11:42 | <Shiruka> | this doesn't work, because it reduces to (iterate (+(0+1)) 0 == iterate (+1) 0 |
| 23:11:48 | <gwern> | offhand, does anyone know any computational complexity classes like NP, where solutions are easy to check but very hard to compute? *but with the provision that it is known to not be equivalent to any easier class |
| 23:11:56 | <ayumilove> | Shiruka: yeah i know, i just realized that |
| 23:12:03 | <adekoba> | aha, nevermind. I needed to use Data.Time.LocalTime |
| 23:12:20 | <ayumilove> | Shiruka: but could not make it Fibonacci |
| 23:12:52 | <Shiruka> | the idea for fibonacci is to keep a two-tuple of the two previous values as your state |
| 23:13:07 | <vininim> | gwern: isn't the provision a million dollars challenge? |
| 23:13:20 | <Shiruka> | or at least mauke's version does that :-) |
| 23:13:32 | <gwern> | vininim: no, I specifically want an example which is not NP or P |
| 23:14:04 | <gwern> | vininim: I don't believe 'being known to not be equivalent to any easier class' is a outstanding problem for any other classes as important as NP |
| 23:14:18 | <gwern> | from the little I know of computational complexity theory |
| 23:15:14 | <ayumilove> | Shiruka: iterate (\(x, y) -> (y, x+y)) (0, 1) << this is somekind of lambda notation|? |
| 23:15:26 | <vixey> | gwern: turing complete |
| 23:15:28 | <ayumilove> | mauke: (x,y) << is a function? |
| 23:15:32 | <Shiruka> | yes, the initial state is (0, 1) and (x, y) -> (y, x+y) is the transition kernel |
| 23:15:41 | <gwern> | vixey: pardon? |
| 23:15:48 | <gwern> | preflex: seen Zao |
| 23:15:48 | <preflex> | Zao was last seen on #haskell 12 hours, 18 minutes and 11 seconds ago, saying: Control.Parallel.Strategies.DWIM? |
| 23:15:52 | <vixey> | gwern: "does anyone know any computational complexity classes like NP, where solutions are easy to check but very hard to compute" |
| 23:15:58 | <ayumilove> | Shiruka: so I have to make x has (0,1) ? |
| 23:16:06 | <vixey> | gwern: the class turing complete fits that doesn't it? |
| 23:16:11 | <gwern> | vixey: knowing whether something terminates doesn't sound easy to check |
| 23:16:28 | <vixey> | solutions? You just run the program |
| 23:16:33 | <gwern> | > 1 + 1 |
| 23:16:35 | <vixey> | that's easy |
| 23:16:46 | <gwern> | vixey: and what's the Big O for it terminating, exactly? |
| 23:16:52 | <vixey> | what |
| 23:17:05 | <gwern> | as the length of the program increases, how much longer does it take to terminate? |
| 23:17:09 | <vixey> | It's a complexity -class- |
| 23:17:17 | <Shiruka> | so you have (x0, y0) = (0, 1) at first, then (x1, y1) = (y0, x0+y0) = (1, 1), then (x2, y2) = (y1, x1+y1) = (1, 2), and so on |
| 23:17:21 | <gwern> | mauke: does preflex do messages? |
| 23:18:06 | <mauke> | gwern: no |
| 23:18:13 | <gwern> | drat |
| 23:18:16 | <mauke> | gwern: try MemoServ :-) |
| 23:18:21 | <gwern> | I was going to bug Zao over xtris, but lambdabot is down |
| 23:18:39 | <gwern> | ACTION will wait. I am patient. I can wait... foreveeerrrrr..... |
| 23:18:59 | <Shiruka> | ayumilove: all (iterate f s) does is produce the list [s, f s, f (f s), f (f (f s)), ...] |
| 23:19:16 | <chrisdone> | gwern: oh, he's working on that again? ^_^ |
| 23:19:24 | <vixey> | F[0]=0;F[1]=1;F[n+2]=F[n]+F[n+1] (0,1)=(F[0],F[1]), (x,y)=(F[n],F[n+1]) --> (y,x+y)=(F[n+1],F[n]+F[n+1])=(F[n+1],F[n+2]) |
| 23:19:33 | <gwern> | chrisdone: well, it's kind of done, as I understand it |
| 23:19:36 | <chrisdone> | what the hell is that |
| 23:19:37 | <vixey> | --> is the induction hypothesis |
| 23:19:40 | <ayumilove> | Shiruka: stil confused |
| 23:19:41 | <chrisdone> | gwern: sweet. repo.? |
| 23:19:53 | <vininim> | gwern: you want something outside decision problems? |
| 23:19:57 | <gwern> | chrisdone: heck, if I had the repo you think I'd be bothering him? |
| 23:20:06 | <gwern> | I'd be doing one of my infamous NMUs |
| 23:20:15 | <ayumilove> | Shiruka: but i understand that iterate is using the function (+1) to add to the others like s, fs ,f(fs) |
| 23:20:21 | <chrisdone> | gwern: maybe he likes being bothered by people and you're doing in a favour |
| 23:20:31 | <vixey> | gwern: that question doesn't make sense to ask about complexity classes |
| 23:21:11 | <vixey> | ?go complexity zoo |
| 23:21:20 | <Shiruka> | ayumilove: so what's the problem?-) |
| 23:21:33 | <gwern> | vininim: well, the context is: someone is arguing that there's no useful task we could set a superintelligent AI. even if we set it NP problems its answer which we could verify in P, this doesn't test its intelligence adequately, since it could've found a P=NP algorithm and be 'cheating' us. I want a counterexample - 'yes, there is a class from which we could draw questions whose answers we could verify cheaply - it's just not P/NP, ... |
| 23:21:36 | <vixey> | ayumilove: Do you understand that induction proof? |
| 23:21:36 | <ayumilove> | the problem is i do not know how to make this f go along with the s |
| 23:21:41 | <gwern> | ... it's foo/bar' |
| 23:21:41 | <ayumilove> | in the code |
| 23:22:12 | <ayumilove> | vixey: I understand the induction |
| 23:22:20 | <Shiruka> | I'm not sure what you mean by that, but sounds like contrary to the point of iterate |
| 23:23:09 | <ayumilove> | I understand [s, f s, f (f s), f (f (f s)), ...] but not F[0]=0;F[1]=1;F[n+2]=F[n]+F[n+1] (0,1)=(F[0],F[1]), (x,y)=(F[n],F[n+1]) --> (y,x+y)=(F[n+1],F[n]+F[n+1])=(F[n+1],F[n+2]) |
| 23:23:11 | <Shiruka> | with iterate, you separate the computation into an iterative loop, initial state and state transition function |
| 23:23:34 | <vixey> | ayumilove: F[0]=0;F[1]=1;F[n+2]=F[n]+F[n+1] is the definition of the fibonacci function |
| 23:24:29 | <vixey> | ayumilove: the next bit shows that starting with (0,1) and iterating the function (\(x,y) -> (y,x+y)) gives you tuples with the invarient that the next tuple's fst is the next fib |
| 23:24:42 | <vixey> | invariant* |
| 23:24:44 | <gwern> | vininim: was that a clear enough explanation? |
| 23:24:58 | <ayumilove> | F[0]=0; |
| 23:24:58 | <ayumilove> | F[1]=1; how about F[2]= ? |
| 23:25:10 | <vixey> | by the definition |
| 23:25:27 | <vixey> | F[2]=F[0+2]=F[0]+F[0+1]=0+1 |
| 23:26:12 | <ayumilove> | viexy: Sorry I do not understand with this line F[2]=F[0+2]=F[0]+F[0+1]=0+1 |
| 23:26:20 | <ayumilove> | too many equal signs |
| 23:26:39 | <vininim> | gwern: yes, but I'm no expert. =) But for what I know there aren't a lot of problems that can't be reduced to a decision problem(like the halting problem), so "usefull tasks" that doesn't involve interaction end up reducing to optimization, decision and search. |
| 23:26:57 | <vininim> | and they all can be reduced in terms of NP vs P |
| 23:27:00 | <vixey> | ayumilove: a=b=c=d is short for a=b and a=c and b=d |
| 23:27:18 | <ayumilove> | a=d? |
| 23:27:49 | <ayumilove> | F[n+2]=F[n]+F[n+1] I just dont understand this part |
| 23:28:07 | <vixey> | ayumilove: What about it? |
| 23:28:09 | <gwern> | vixey: all of them? I did not know that |
| 23:28:18 | <ayumilove> | F[2] = F[0]+F[1] ? |
| 23:28:30 | <vixey> | yes |
| 23:28:36 | <ayumilove> | please make a simpler example ^_^ " hard for newbies |
| 23:29:36 | <ayumilove> | F[n+2] so if the user makes n as 3 = F[5] ? |
| 23:29:49 | <ayumilove> | doesnt make sense |
| 23:29:54 | <vixey> | why not? |
| 23:32:20 | <byte-> | i have a quick question |
| 23:32:46 | <gwern> | oh noes, those are the worst! |
| 23:32:48 | <EvilTerran> | > let f(0) = 0; f(1) = 1; f(n+2) = f(n) + f(n+1) in map f [0..] |
| 23:32:48 | <byte-> | is there any technical reason against creating Show instances for functions? |
| 23:32:54 | <EvilTerran> | ?bot |
| 23:32:56 | <EvilTerran> | dammit |
| 23:33:26 | <Toxaris> | byte-: no |
| 23:33:26 | <dons> | byte-: read . show == id |
| 23:33:41 | <dons> | > ord -- that said, some instances of show are useful. |
| 23:33:47 | <mauke> | ENOBOT |
| 23:33:48 | <byte-> | dons, good point |
| 23:33:58 | <Quadrescence> | Anyone familiar with the A* search algorithm? |
| 23:34:09 | <EvilTerran> | if there's no Read instance, that wouldn't be a problem, though |
| 23:34:12 | <Toxaris> | dons: this law is only a show stopper for Read *and* Show instances, not for Show alone |
| 23:34:18 | <gwern> | Quadrescence: it's on hackage, a lot of people used it in the last ICFP, and that's it |
| 23:34:28 | <gwern> | oh, and something about Djikstra and it being fast? |
| 23:34:51 | <EvilTerran> | i think the main problem is the overhead of carrying around the textual data that would be necessary |
| 23:34:54 | <Quadrescence> | gwern: It's a generalization of Djikstra's alg. |
| 23:34:56 | <Toxaris> | > imho even this simple instance can be useful: instance Show (a -> b) where showsPrec _ _ = "<function>" |
| 23:35:03 | <ddarius> | byte-: Making a useful instance is essentially impossible if you want to preserve referential transparency. |
| 23:35:26 | <EvilTerran> | Toxaris, that's no good, though, 'cos the output of show is meant to be valid haskell code |
| 23:35:29 | <dons> | well, that instance is already defined in Text.Show.Functions |
| 23:35:32 | <EvilTerran> | that's what it says in the report, iirc |
| 23:35:32 | <byte-> | ddarius, i don't follow |
| 23:35:52 | <ddarius> | byte-: I made an assertion, there is nothing to follow. |
| 23:36:01 | <Toxaris> | EvilTerran: hmm, yeah, that's true, but hey, who cares :) |
| 23:36:19 | <Toxaris> | instance Show (a -> b) where showsPrec _ _ = "undefined" -- for those who care |
| 23:36:24 | <byte-> | ddarius, i don't follow [your train of thought] |
| 23:36:38 | <byte-> | ddarius, you basically just asserted that your "assertion" had nothing to understand |
| 23:36:40 | <byte-> | btw |
| 23:36:43 | <EvilTerran> | byte-, if two functions are equal in behaviour, you shouldn't be able to tell them apart |
| 23:37:01 | <ddarius> | byte-: No, I asserted that my assertion did not include explanation. |
| 23:37:05 | <EvilTerran> | but, if there were a meaningful Show instance for functions, you could construct cases that you *could* tell apart thatway |
| 23:37:07 | <SamB_XP> | ddarius: maybe he wants you to defend it anyway |
| 23:37:22 | <SamB_XP> | EvilTerran: what ? |
| 23:37:23 | <r3m0t> | the output of show is meant to be valid Haskell? so now I know |
| 23:37:23 | <EvilTerran> | even though the functions are exactly equivalent |
| 23:37:34 | <EvilTerran> | SamB_XP, what? |
| 23:37:43 | <Toxaris> | EvilTerran: why? a meaningful show instance could describe the behaviour, couldn't it? |
| 23:37:56 | <byte-> | ddarius, ok, fair enough |
| 23:38:13 | <ayumilove> | vixey: http://hpaste.org/9526#a1 |
| 23:38:21 | <vixey> | Toxaris: What if you go (\x -> x,3) |
| 23:38:22 | <vixey> | ? |
| 23:38:23 | <ddarius> | If you restrict the class of function you want to handle, you can make meaningful instances, but that would be an extreme restriction. |
| 23:38:33 | <vixey> | ayumilove: Can you paste the contents to this channel? |
| 23:38:38 | <EvilTerran> | Toxaris, identifying equivalent programs is an unsolvable problem - there's no way you could have all functions with the same behaviour show to the same thing |
| 23:38:44 | <dons> | the show instance could emit ghc bytecode i suppose :) |
| 23:38:44 | <ayumilove> | f_list2 n = |
| 23:38:45 | <ayumilove> | let recA x y n = take n (iterate (+(abc x y)) (0,0) ) |
| 23:38:45 | <ayumilove> | in recA 0 1 n |
| 23:38:45 | <ayumilove> | where abc x y = (y,x+y) |
| 23:38:47 | <dons> | Clean's does that. |
| 23:38:58 | <vixey> | ayumilove: oh that + is weird |
| 23:38:59 | <Toxaris> | EvilTerran: I have already given such an instance (the "undefined" one) |
| 23:39:00 | <ddarius> | dons: Which would violate referential transparency in all likelihood. |
| 23:39:08 | <Toxaris> | EvilTerran: ok, it is not very meaningful :) |
| 23:39:12 | <EvilTerran> | Toxaris, but it's not a valid one by the report |
| 23:39:17 | <EvilTerran> | or, indeed, meaningful |
| 23:39:21 | <adekoba_> | Whenever I try to profile an app that imports parsec, ghc always complains that it can't find the profiling version of the library. How can I bypass this, without having to manually install every package parsec depends on? |
| 23:39:25 | <Toxaris> | EvilTerran: why? undefined is haskell code, isn't it? |
| 23:39:33 | <marcot> | Hello, how do I make bindings for C functions that expects a pointer to a function, using a Haskell function as a parameter of the binding. I searched about that in gtk2hs code, but I got to connect_BOXED__BOOL, which I couldn't find where is defined. |
| 23:39:42 | <vixey> | ayumilove: how about just f_list2 n = take n (iterate abc (0,0)) where abc x y = (y,x+y) -- ? |
| 23:39:44 | <ayumilove> | i do not know how to implement that stuff into iterate |
| 23:39:46 | <EvilTerran> | it's got to be haskell code that evaluates to the value you passed to show, though |
| 23:39:48 | <byte-> | anyway, thanks guys |
| 23:39:54 | <dons> | marcot: using FunPtr ? |
| 23:39:57 | <dcoutts> | marcot: those functions are generated. |
| 23:40:05 | <Toxaris> | EvilTerran: iirc that is only true if both Show and Read are instantiated |
| 23:40:12 | <Toxaris> | EvilTerran: but not for Show-only types |
| 23:40:20 | <Toxaris> | EvilTerran: but maybe I'm wrong |
| 23:40:24 | <EvilTerran> | no, you're thinking of the read.show = id rule |
| 23:40:40 | <Toxaris> | hmm. yes, eval . show = id is different from read . show = id |
| 23:40:43 | <EvilTerran> | indeed |
| 23:40:50 | <Toxaris> | so basically we have read = eval |
| 23:40:54 | <EvilTerran> | and is how Show is defined to work, iirc |
| 23:40:55 | <vixey> | eval ?? |
| 23:41:01 | <EvilTerran> | vixey, we're being hypothetical |
| 23:41:13 | <vixey> | :t eval |
| 23:41:19 | <dons> | glguy: have you seen yav's $50,000,000 banknote? |
| 23:41:19 | <EvilTerran> | it should probably be called unsafeEvalExpression |
| 23:41:20 | <marcot> | dcoutts: hum... I'll check the compiled code. |
| 23:41:25 | <marcot> | dons: I'll take a look, thanks. |
| 23:41:26 | <EvilTerran> | vixey, it doesn't really exist |
| 23:41:31 | <glguy> | dons: I have |
| 23:41:35 | <vixey> | I still want to know what type it has |
| 23:41:36 | <glguy> | dons: shame that it expired :( |
| 23:41:43 | <EvilTerran> | String -> Maybe a |
| 23:41:44 | <dons> | glguy: yeah, a pity. |
| 23:41:51 | <vixey> | ok |
| 23:41:52 | <Toxaris> | vixey: String -> a |
| 23:41:57 | <EvilTerran> | perhaps Typeable a => String -> Maybe a |
| 23:42:08 | <dcoutts> | marcot: see Graphics.UI.Gtk.Signals |
| 23:42:15 | <EvilTerran> | or you can drop the Maybe if you don't mind blindly propagating exceptions |
| 23:42:31 | <ayumilove> | f_list2 n = take n (iterate abc (0,0) ) |
| 23:42:31 | <ayumilove> | where abc x y = (y,x+y) |
| 23:42:35 | <ayumilove> | o_O |
| 23:43:58 | <ayumilove> | Vixey: f_list2 n = take n (iterate abc (0,1) ) |
| 23:43:58 | <ayumilove> | where abc (x,y) = (y,x+y) |
| 23:44:05 | <ayumilove> | :D |
| 23:44:19 | <vixey> | cool |
| 23:44:25 | <ayumilove> | T_T so difficult |
| 23:44:34 | <vixey> | but does it work? |
| 23:44:36 | <ayumilove> | yeah |
| 23:44:39 | <Botje> | ayumilove: what's difficult about it? :) |
| 23:44:43 | <ayumilove> | ayumilove: how about just f_list2 n = take n (iterate abc (0,0)) where abc x y = (y,x+y) -- ? |
| 23:44:51 | <ayumilove> | sorry wrong stuff |
| 23:44:52 | <ayumilove> | Main> f_list2 5 |
| 23:44:52 | <ayumilove> | [(0,1),(1,1),(1,2),(2,3),(3,5)] |
| 23:44:53 | <Botje> | your "abc" function expresses the recurrence relation very neatly |
| 23:45:09 | <ayumilove> | I always thought that iterate needs some kind of operator like +abc |
| 23:45:21 | <vixey> | take n (iterate abc (0,0)) where abc x y = (y,x+y) |
| 23:45:39 | <vixey> | take n (iterate abc (0,0)) where abc = \x y -> (y,x+y) |
| 23:45:45 | <vixey> | take n (iterate (\x y -> (y,x+y)) (0,0)) |
| 23:45:50 | <vixey> | :t \n -> take n (iterate (\x y -> (y,x+y)) (0,0)) |
| 23:45:54 | <vixey> | <type error> |
| 23:46:23 | <vixey> | oh |
| 23:46:25 | <vixey> | my fault |
| 23:46:31 | <ayumilove> | i am puzzled, how does abc know what to take in? like taking in the (0,1) |
| 23:46:44 | <vixey> | ayumilove: iterative gives it that |
| 23:46:45 | <Botje> | that's what the iterate function does |
| 23:46:47 | <Botje> | @src iterate |
| 23:46:56 | <Botje> | ah, no \bot? |
| 23:47:00 | <ayumilove> | could you explain how this iterate works o_o, |
| 23:47:06 | <adu> | @seen lambdabot |
| 23:47:14 | <dibblego> | @src iterate |
| 23:47:14 | <lambdac> | iterate f x = x : iterate f (f x) |
| 23:47:15 | <EvilTerran> | iterate f x = x : iterate f (f x) |
| 23:47:21 | <EvilTerran> | @bot |
| 23:47:21 | <vixey> | iterate f x = x : iterate f (f x) |
| 23:47:22 | <lambdac> | :) |
| 23:47:32 | <adu> | @seen lambdac |
| 23:47:32 | <Botje> | TWO OF THOSE ARE NOT LAMBDABOT |
| 23:47:32 | <lambdac> | Yes, I'm here. I'm in #haskell, #reductio and #functionaljava |
| 23:47:43 | <EvilTerran> | <.< |
| 23:47:44 | <ayumilove> | @lambdabot |
| 23:47:44 | <lambdac> | Unknown command, try @list |
| 23:47:47 | <ayumilove> | lol |
| 23:48:03 | <MyCatVerbs> | Functional Java? Oh, my. :( |
| 23:48:06 | <ayumilove> | gtg guys, I'll ask more question on this iterate ^_^ " |
| 23:48:08 | <vixey> | @tell ayumilove bye |
| 23:48:09 | <lambdac> | Consider it noted. |
| 23:48:10 | <Shiruka> | something like (+1) is not in any way special, except for the syntax.. it's just a function |
| 23:48:26 | <vininim> | > 1 |
| 23:48:29 | <lambdac> | 1 |
| 23:48:40 | <chrisdone> | > map f [a,b,c] |
| 23:48:44 | <Toxaris> | > iterate f x |
| 23:48:45 | <lambdac> | Add a type signature |
| 23:48:47 | <lambdac> | [x,f x,f (f x),f (f (f x)),f (f (f (f x))),f (f (f (f (f x)))),f (f (f (f (f... |
| 23:48:56 | <chrisdone> | > map f [a,b,c] :: [Expr] |
| 23:48:57 | <lambdac> | [f a,f b,f c] |
| 23:49:00 | <ddarius> | :t map |
| 23:49:01 | <lambdac> | forall a b (f :: * -> *). (Functor f) => (a -> b) -> f a -> f b |
| 23:50:45 | <vininim> | > filter aks_test [1..] |
| 23:50:46 | <lambdac> | Not in scope: `aks_test' |
| 23:51:39 | <vininim> | should be in Prelude, imho ;) |
| 23:52:11 | <Shiruka> | aks would probably be an insanely slow way to generate small primes even compared to naive methods :-) |
| 23:52:24 | <vininim> | not to mention the beginning 1 for extra controversy |
| 23:58:36 | <r3m0t> | how does lambabot's "abstract" behaviour work? |
| 23:58:46 | <r3m0t> | > zipWith (+) [a,b,c] [d,e,f] |
| 23:58:47 | <lambdac> | [a + d,b + e,c + f] |
| 23:58:55 | <EvilTerran> | ?where simplereflect |
| 23:58:55 | <lambdac> | http://twan.home.fmf.nl/blog/haskell/simple-reflection-of-expressions.details |
| 23:58:58 | <mauke> | it's actually not abstract :-) |
| 23:58:59 | <EvilTerran> | with that |
| 23:59:47 | <dons> | a surprising in-language approach. |
Back to channel and daily index: content-negotiated html turtle