00:00:00 --- log: started haskell/02.01.11 01:20:09 --- quit: x99 (Read error: 113 (No route to host)) 02:12:30 --- quit: teek ("Coffee break") 02:52:45 --- quit: dmiles (Read error: 104 (Connection reset by peer)) 03:27:19 --- join: teek (teemu@k72.viikki.hoasnet.fi) joined #haskell 03:32:03 --- quit: teek ("Coffee break") 03:42:12 --- nick: clauZzzen -> clausen 03:54:23 --- join: shapr (~user@p-c2fbab4f.easy.inet.fi) joined #haskell 03:55:22 y0 04:11:12 good morning folks 04:13:31 --- nick: clausen -> clausen_banho 04:13:48 banho? 04:15:15 --- join: bsh (~MasterBot@dsp-202-72-158-119.manjimup.westnet.com.au) joined #haskell 04:15:26 shapr: bath in portuguese 04:15:34 oh, nifty 04:15:46 shapr: (I've been talking to ppl in pt, and sort of interrupt-and-go...) 04:16:22 --- part: bsh left #haskell 04:19:44 ok, I still don't understand this dropWhile and takeWhile stuff 04:19:44 but I got dropVowels working for me 04:19:44 here's what I used: 04:19:44 isVowel c = elem c "aeiou" 04:19:48 dropVowels string = filter (not . isVowel) string 04:20:51 does takeWhile have an advantage over filter? 04:20:53 oh 04:20:56 lemme guess 04:21:00 filter isn't lazy, and take is 04:21:36 they're both lazy 04:21:39 they do different things 04:21:54 filter (>0) [2,3,-1,4,-2] will give you [2,3,4] 04:22:04 takeWhile (>0) [2,3,-1,4,-2] will give you [2,3] 04:22:19 oho!! 04:22:39 so takeWhile *stops* when it hits the first non P ? 04:23:02 yep. 04:23:24 then this other code I wrote *did* work, I just didn't realize that was the right result 04:23:27 aha! 04:24:57 can I do nested where statements? 04:25:18 oh, I can! 04:25:20 nifty 04:25:25 this is funny: 04:25:33 dropVowels string = filter (not . isVowel) string where 04:25:33 isVowel c = elem c vowels where 04:25:33 vowels = "aeiou" 04:26:03 and I'd guess the difference is the 'scope' that these things are defined in... 04:26:18 so I can't reuse vowels in any scope other than isVowel, right? 04:26:24 * shapr tries it 04:34:59 --- nick: clausen_banho -> clausen 04:36:21 --- join: Peaker (peaker@bzq-193-224.red.bezeqint.net) joined #haskell 04:37:28 y0 y0 04:37:37 I wonder if this can get any simpler: 04:37:41 dropVowels string = filter (not . (\x -> elem x "aeiou")) string 04:37:57 I couldn't figure out a way to get rid of some parens 04:38:05 I'd bet I could get the not into the lambda somewhere though 04:38:59 hrm 04:39:13 dropVowels = filter (not . flip elem "aeiou") 04:39:23 what's flip? 04:39:30 * shapr hits the index 04:39:36 flip f x y = f y x 04:39:39 oh! 04:39:41 that's handy 04:39:56 that's elegant! 04:40:36 nice 04:40:38 thanks! 04:42:26 I'm kind of surprised that elem takes the set arg second 04:42:39 I'd expect Haskell functions would always put the most general arg first 04:42:42 * shapr thinks 04:42:57 shapr: yeah, it's obvious to curry it that way 04:43:03 wait, I bet that either arg could be more general, just depends on the situation 04:43:04 you'll always find situations where one way or the other is useful 04:43:07 yeah. 04:45:43 these are my observations: 04:45:52 in general, Haskell is more concise than other languages 04:46:09 it can even beat Perl sometimes, and that can get scary 04:46:20 just wait till you try to write a program that uses a lot of global state :-) 04:46:24 but its use of whitespace improves readability tremendously 04:46:33 I don't do that 04:46:36 :) 04:46:46 you can do it concisely, but you have to use some complicated features to get there 04:46:48 at least, I've always found a way around it so far 04:46:55 that's good, global state is in general bad 04:46:59 but it often can't be avoided 04:47:32 hm, I haven't run into many of those situations 04:50:05 --- join: mustard (~felix@159.180.250.254) joined #haskell 04:50:09 hi mustard 04:50:28 ello! 04:50:32 what's up? 04:51:41 got that friday feeling at work - lots of Java code to re-structure so I'm dreaming of greener programming pastures 04:51:46 heh, I understand that 04:54:41 I'd like to see some lint tools for various languages written in Haskell 04:58:19 --- join: teek (teemu@k72.viikki.hoasnet.fi) joined #haskell 04:58:39 hi teek 04:58:55 hi shapr 05:00:44 Peaker: ok, partial resolution doesn't quite work in Python 05:01:05 in Haskell, every function that takes two args and returns one, is actually two functions 05:01:13 partial resolution? 05:01:25 AutoCurrying T 05:01:26 yah, like (+1) 05:01:27 TM 05:01:28 shapr: But that's under the hood 05:01:47 what is the difference in the code that uses Python currying? 05:01:51 (from Haskell currying) 05:01:57 I thought currying was about changing f :: (a,b) -> c to f :: a -> b -> c ? 05:02:20 def curry(func, *args): return lambda *rest: func(*args, *rest) 05:02:40 that's effictively what haskell does 05:02:44 automagically 05:02:56 okay, and my question was what were the Haskell advantages? 05:03:00 yah, except that the hidden functions are actually executed 05:03:09 which doesn't happen in that Python code 05:03:13 the Haskell syntax is much more concise 05:03:20 shapr: they get executed 05:03:33 and it has a type system so it's harder to write incorrect code 05:03:33 I find that the strong type system catches lots of bugs 05:03:40 Heffalump: exactly! 05:03:42 hehe 05:03:56 Peaker: how so? 05:03:58 it's IMHO completely unrealistic to program anything with higher-order functions without a strong type system 05:04:03 isn't it called partial application ? 05:04:06 clausen: and more than trivial bugs? 05:04:12 Peaker: yes 05:04:20 (things you'd find about first time you unit-test your code anyways :) 05:04:31 Peaker: it often tells you that you are thinking about the problem in the wrong way, etc. 05:04:34 (I find) 05:04:35 I'm not convinced that static typing is an advantage over unit-testing myself 05:04:39 shapr: *a,*b is actually not allowed so that's invalid Python, let me show you real code: 05:04:43 you'd probably find the bugs if your unit-test did exercise the correct code path 05:04:47 >>> def curry(func, *args): return lambda *rest: func(*(args+rest)) 05:04:49 shapr: you find the bugs earlier 05:04:50 but compile-time is much better than test-time 05:04:58 >>> g=curry(f, 1, 2) 05:05:04 >>> g(3) 05:05:05 1 2 3 05:05:08 shapr: it isn't a substitute... but rather a time-saver 05:05:10 (f printing given a,b,c) 05:05:13 Heffalump, clausen: I'm not convinced, :) 05:05:15 (you don't pursue red herrings as much) 05:05:18 Heffalump: why? 05:05:24 well, I'm just saying my experience 05:05:28 ok, same here 05:05:34 Heffalump: why is compile-time better to find those things? 05:05:35 in C, I chase down lots of crappy bugs 05:05:38 peaker/shapr: well, you find them earlier 05:05:39 that I don't do in haskell 05:05:52 which saves you time 05:05:55 Heffalump: only to encourage you to 'it compiles! lets ship it' attitude? :) I mean, you must test it anyhow 05:06:04 not at all 05:06:09 it encourages you to get the design right 05:06:14 peaker: yes, of course. But you still save time because you find bugs earlier. 05:06:18 it's not just about the code "working" 05:06:28 the type system also forces you into a certain amount of cleanliness, IHO 05:06:29 IMHO 05:06:34 yeah 05:06:53 Heffalump: the time you spend compiling, fixing, compiling, ... is spent on hitting enter on exception lines and fixing it in runtime, which is just as quick from my experience, or sometimes even quicker 05:07:06 not in my experience 05:07:07 *shrug* 05:07:15 enter on exception lines? 05:07:22 I agree with Peaker, and I suspect none of us wil change our minds here :) 05:07:26 also, when you find problems during testing, how do you work out exactly where they are? 05:07:28 Heffalump: Just jumping to the faulty code 05:07:38 Heffalump: jumping to where the exception was raised 05:07:44 or to any of the callers of the function 05:07:52 umm, what if an exception wasn't raised, but you just got bad output? 05:07:53 so tell me: 05:08:00 why is C easier than assembler? 05:08:05 ahem 05:08:05 Heffalump: consider the time you spend typing the static typing information that is spent on writing more code in dynamic languages :) 05:08:17 I really want to settle this "can Python really do partial resolution" 05:08:22 hmmmm 05:08:28 probably a red herring... don't answer that 05:08:29 peaker: you don't have to type it in in Haskell, it can infer it 05:08:31 (my q) 05:08:39 clausen: because of its nested-expression syntax, abstraction of stack-framing, and many other abstractions 05:08:46 I only put static types in when they help me understand what a function does - it's kind of documentation 05:08:47 augh 05:08:51 * clausen agrees 05:09:01 also: 05:09:08 if you try to use a function in the wrong way, you hear about it 05:09:13 because EVERYTHING is a function 05:09:29 this type checking, in practice, digs up more dirt, so to speak 05:09:30 umm, that's not strictly true (that everything is a function) 05:09:33 Heffalump: ah. Okay, I believe in type inference to catch problems and optimize too, so I agree there. I just don't always like statically typing as it ends up killing polymoprhism and/or taking lots of valuable time 05:09:39 if you say "x = 5" then x isn't a function 05:09:46 yeah yeah :P 05:10:04 peaker: Haskell has a decent polymorphic type system, so static typing doesn't kill polymorphism 05:10:26 "taking lots of time" ? 05:10:39 (that's a slight simplification cos there are limitations to the polymorphism, but it's basically true) 05:10:43 the way I see it, Python is awesome and the best thing I've found yet, but it's also missing some pieces I'd like to have 05:10:46 Peaker: there are very rare cases, where Haskell's type system doesn't offer enough polymorphism. 05:10:47 * clausen thinks haskell has more polymorphis than, say, C++ in practise 05:10:49 Heffalump: doesn't writing 'string' in your dropVowel code deprive that code from working on lists of objects that can equal vowel characters? 05:10:53 so I'm willing to try Haskell to see if it works for me 05:11:12 peaker: yes. But it could be written to an interface that understood "isVowel" instead, if you wanted to 05:11:24 yah, type classes rock 05:11:30 with the advantage that if you did that, then if you accidentally tried to write it to an interface that didn't, you'd know about it 05:11:38 instead of getting some random result at runtime 05:11:38 Heffalump: but isVowel was written inside your dropVowel function, would that work? 05:11:57 no, you'd have to move it somewhere else if you wanted the interface to be "isVowel" 05:12:09 but if you wanted the interface to be "charOf", for example, then there'd be no problem 05:12:09 Peaker: he's saying, that you could define a type that has a method "isVowel" (effectively) 05:12:17 Heffalump: that seems like a lot more work 05:12:25 right 05:12:25 Peaker: actually it's really nice 05:12:30 peaker: two more lines 05:12:35 but, why would you want to do it? 05:12:38 or rather one more line and move the isVowel line somewhere else 05:12:39 you can add methods to any kind of type 05:12:42 (why would you want to make it polymorphic in this way?) 05:13:01 if you didn't have the type, what would happen if you tried to run dropVowels on a list of integers? 05:13:31 er, what would you call that type class anyway? 05:13:37 CharExts ? 05:13:40 dunno, Vowelable :-) 05:13:41 Heffalump: it'd drop all vowels, and leave the list as it is 05:13:53 class CharExts Char where -- ? 05:14:09 peaker: but it'd try to check if 5 == 'a', for example 05:14:21 Heffalump: which returns false 05:14:23 do you think that should always return false, rather than just being an error? 05:14:23 nope 05:14:28 it depends on the isVowel implementation 05:14:32 for each type 05:14:32 Heffalump: 5 and 'a' are both objects 05:14:45 class CharExts Char where 05:14:45 isVowel :: Char -> Char 05:14:45 isConsonant :: Char -> Char 05:14:46 peaker: there's a run-time penalty for that 05:14:48 Heffalump: ['a', 1, '2', 'b'] will return [1, '2', 'b'], [1,2,3] will return [1,2,3], it makes sense in a dynamic language 05:14:53 shapr: Char -> Bool 05:14:56 but you can set the default to "False" 05:15:02 Heffalump: there's a runtime penalty for pure functionality :) 05:15:03 Heffalump: oh, right, duh.. 05:15:12 (i.e. it's False for everything other than Chars immediately) 05:15:17 (unless they override) 05:15:28 clausen: but you still have to declare the interface 05:15:28 but you still have to say each type derives... 05:15:34 yep 05:16:08 anyway, I see this isVowel example as REALLY ugly 05:16:08 peaker: what do you mean? 05:16:27 (WTF do you want this kind of polymorphism. it's unnatural!) 05:16:33 s/./?!/ 05:16:36 :-) 05:16:56 clausen: look at the dynamic lists example 05:17:31 clausen: It might be useful if I have a list of varying-types 05:18:05 Peaker: why? 05:18:08 Peaker: Usually those varying types have some common property, which should be expressed as a type. Much safer that way 05:18:13 * clausen contends the opposite 05:18:14 Heffalump: pure functionality, as I understand it (which might be wrong :), disallows writing of some algorithms that depend on in-place mutability, and requires using alternative algorithms with far worse BigO time complexities 05:18:15 clausen: isVowel is a random example I came up with this morning from #loty 05:18:17 as a type class 05:18:37 * clausen thinks it's ugly, and never a good idea 05:18:57 peaker: yes, that's true. But the need to have only pure functions is a specific consequence of Haskell's laziness, rather than static typing. 05:19:04 teek: perhaps, but that costs you time and may be hard to 'formalize' without losing support of future changes 05:19:12 Peaker: the compiler can still implement it using an in-place algorithm 05:19:16 if we were talking about ML, for example, then you wouldn't have that penalty but you'd still have static typing 05:19:40 Heffalump: Okay, I meant to say that a performance hit is not always a factor in decisions, and always the last factor in Python decisions 05:19:41 clausen: but no compiler guarantees operational semantics to that extent, so you'd have no guarantees 05:19:49 right 05:19:53 clausen: converting algorithms like that would be solving the Halting Problem 05:20:00 Peaker: in the general case 05:20:07 Peaker: in practice, it's easier 05:20:14 hrm, what am I doing wrong here? 05:20:17 clausen: how would you implement a red-black-tree? 05:20:19 instance Char CharExts where 05:20:20 isVowel a = flip elem "aeiouAEIOU" 05:20:20 isConsonant = flip elem $ filter (not . isVowel ['A'..'Z'] ++ ['a'..'z'] ) 05:20:27 actually, in practice you use mutable stuff in the IO monad when you want the better time complexity :-) 05:20:31 Peaker: dunno... there's a book called "Purely Functional Data Structures" 05:20:38 Peaker: I'll read that first ;) 05:20:50 * clausen has bought it... it's waiting for me in .au 05:21:09 shapr: I suspect some brackets around the [ .. ] ++ [ .. ] would help 05:21:16 oh 05:21:17 clausen: Okasaki's book? 05:21:27 Heffalump: yep 05:21:28 Okasaki's Purely Functional Data Structures is a great reading ! I enjoyed that book a lot. 05:21:42 I need to get round to reading that 05:22:26 using Haskell does sometimes impose some form of algorithmic penalty, but as I've said that's because of its laziness, not the type system 05:22:35 However, it's true that there's many data structures and algorithms, which need destructive updates for simple implementation. Many graph algorithms for example. 05:22:37 clausen: I am not sure of what to make of a Haskell's programmer ability to implement a red black tree, where a procedural programmer can implement it based on algorithmic listings on the web... I mean, is Haskell a lot more difficult for low-level data structures? why wouldn't you want to combine procedural features into the language? 05:23:01 procedural (i.e. mutable values) features interact badly with laziness 05:23:03 rb tree should be quite easy to implement. and inplace and functional updates should have same complexity 05:23:04 However, in many cases, desctrutive updates can be hidden inside the algorithm. 05:23:12 Peaker: well, there are advantages to such "purity" 05:23:17 Peaker: it's easier to analyse 05:23:24 Peaker: easier for the compiler to optimize 05:23:25 Heffalump: don't guarantee laziness to work well when combined with side effects then 05:23:31 Peaker: it "feels" more elegant 05:23:34 (which is what motivates me) 05:23:41 clausen: the ease to optimize cancels out with the inability to do inplace changes 05:23:50 peaker: by "not work well" that means "no guarantee about what will actually happen" 05:23:56 Peaker: how do we know? 05:24:03 * clausen thinks more research... 05:24:05 peaker: and Haskell is fundamentally a lazy language, it's very hard *not* to use it. 05:24:07 rb trees can be implemented using pattern matching very elegantly 05:24:09 Peaker: anyway, like has been already said 05:24:12 Heffalump: Yes, like I'd guess Python laziness modules are implemented :) 05:24:18 Peaker: you can do RB trees, etc. easily in haskell 05:24:21 Peaker: just, you have to use monads 05:24:36 Peaker: (which is essentially a functional way of doing imperative programing) 05:24:41 monads are essentially the way that the semantics of updatable variables in a lazy language can be defined 05:24:54 clausen: okay, then why did you say you didn't know? And how would it work given that you need to make in-place changes? 05:25:32 didn't know what? 05:25:32 look at http://www.ai.univie.ac.at/~markus/ocaml_sources/pure_fun-1.0-2/chp3.ml for an implementation of a purely functional RedBlack set in Ocaml 05:25:52 Heffalump: you can implement lazy evaluation in Python, but I'm not quite sure I understand why you'd want it for any expression, and not only for things like map/filter/etc 05:26:07 teek: Ocaml supports inplace changes though.. 05:26:15 aha 05:26:20 instance CharExts Char where 05:26:20 isVowel a = elem a "aeiouAEIOU" 05:26:20 isConsonant a = elem a (filter (not . flip elem "aeiouAEIOU") ['A'..'Z'] ++ ['a'..'z']) 05:26:24 peaker: that module doesn't use it 05:26:33 clausen: didn't know how to implement a RB tree 05:26:42 peaker: well, you might want it for trees as well, for example 05:26:45 Peaker: in haskell... I did say I didn't know 05:26:51 Peaker: I said I should "read the book" 05:26:54 (remember?) 05:26:54 Peaker: yes, but that's a functional version 05:27:06 arghh 05:27:08 clausen: yeah, but then you said: you can do RB trees, etc. easily in haskell just, you have to use monads 05:27:10 Peaker: you can have pointers in haskell as well 05:27:13 clausen: which I find contraductory 05:27:21 Peaker: well, it's obvious you can use monads 05:27:30 Peaker: (which are really "non-functional" in a sense) 05:27:30 You have to hide them in a monad, or even use pointers that is in the IO-monad 05:27:34 dennisb: what are references useful for, when you might as well use a copy of the value? 05:27:40 Peaker: however, it turns out you don't need monads 05:27:47 anyway 05:27:49 Peaker: its about speed 05:27:50 what is a monad? 05:27:51 * clausen going back to hacking 05:28:01 gotta go 05:28:04 --- quit: teek ("Coffee break") 05:28:11 umm 05:28:11 a ds that might be harder to implement in functional languages is hashtable 05:28:14 dennisb: yes, but why would I want a pointer in the language level of a purely functional language 05:28:18 aha 05:28:19 got it 05:28:30 ok, here it is: 05:28:35 class CharExts a where 05:28:36 isVowel :: a -> Bool 05:28:36 isConsonant :: a -> Bool 05:28:37 a monad is an algebraic structure that amongst other things lets you encapsulate the use updatable values in a purely functional way 05:28:41 instance CharExts Char where 05:28:41 isVowel a = elem a "aeiouAEIOU" 05:28:42 isConsonant a = elem a (filter (not . flip elem "aeiouAEIOU") ['A'..'Z'] ++ ['a'..'z']) 05:28:45 smkl: or the simplest case of a hashtable, a mere array? 05:28:46 yay! and it even works! 05:28:47 s/use/use of/ 05:28:50 smkl: (mutable one) 05:28:55 shapr: cool :-) 05:29:07 sure 05:29:12 Peaker: for some problems you just need pointer, and there is a pure way to add them 05:29:19 shapr: why not reuse isVowel in isConsonant? 05:29:32 Heffalump: because I couldn't figure out how to do that :) 05:29:36 I'll try that, hang on 05:29:41 dennisb: I don't understand how it is possible you would need a pointer when the dereferenced object is always the same.. 05:29:58 one use of a pointer is for a quick equality test 05:30:03 dennisb: Couldn't you use a read-only-reference, or a copy of the object? 05:30:21 you can check two objects are the same by comparing them, but if they're very complicated that might take a while. Comparing the two pointers can save time. 05:30:23 Peaker: but then the algortihms might explode in size or something 05:30:25 I understand performance reasons but those sound easy to implement in the compiler-level 05:30:27 --- quit: mustard (Read error: 110 (Connection timed out)) 05:30:35 if they're the same the objects are the same, and if they're not, you compare the actual objects 05:30:40 dennisb: Okay, the compiler can simply never copy objects but only copy references 05:30:47 some graphalgorthims is a typical example where you really need pointers (references) 05:30:49 true 05:30:57 ok, got it 05:31:04 isConsonant a = elem a (filter (not . isVowel) ['A'..'Z'] ++ ['a'..'z']) 05:31:11 shapr: yep :-) 05:31:16 Heffalump: Okay, that is obvious, but I see that as a mere implementation detail 05:31:20 I'm so cool 05:31:25 * shapr does the nifty code dance 05:31:25 I don't see how "pointers" have to do with Haskell as a language 05:31:31 w00 05:31:39 they don't, much 05:31:56 --- join: mustard (~felix@159.180.250.254) joined #haskell 05:31:56 weren't you the one arguing earlier that having compilers do your implementation work is like solving the halting problem, btw? :-) 05:32:39 wheee 05:32:41 def isConsonant(l): import string ; return l in filter(lambda x: x.lower() not in "aeiou", string.letters) :) 05:32:54 Heffalump: converting copying-algorithms to inplace-changes is 05:33:01 you can use pointers, but you typically use them in a very small part of the program, like in a function for calculating something, and from the outside the function looks like any pure function 05:33:02 Heffalump: copying pointers rather than objects is trivial 05:33:39 dennisb: Again, why isn't it a hidden implementation detail of the compilation process, and appearant at the language level? 05:34:13 peaker: true 05:34:14 with monads, it is possible to emulate the sematics of other languages in haskell. with a state monad there is state, that is where pointers or references are useful 05:34:31 beacause no one have solved that problem. Best so far is letting the programmer handle this 05:35:08 10-15 years ago everyone tought you would never need to use pointers in a pure functional program, but state of the art changes. 05:35:12 dennisb: do you have a specific example of an algorithm that requires pointers as you describe? 05:35:16 smkl: and how are monads implemented? 05:35:28 Now I believe that most people think they really are needed 05:35:38 dennisb: Wouldn't such optimization only require the compiler to implement object copying as pointer copying? 05:35:39 Peaker: you should probably read stuff on www.haskell.org, and read some papers, etc. 05:35:39 peaker: often by the implementation of the language, so not in Haskell itself 05:35:44 but it depends on the monad 05:35:46 Heffalump: yes, you could use it to implement hashtables 05:36:06 yeah, point :-) 05:36:07 Heffalump: So Haskell is not a pure functional language and already more attractive :) 05:36:17 Peaker: it is purely functional 05:36:22 Peaker: how do you create a graph in memory? 05:36:22 clausen: not with monads.. 05:36:26 Peaker: monads are implemented in a purely functional way 05:36:34 peaker: any implementer of an external module has to guarantee that the *interface* to his module will be purely functional 05:36:52 you can't do IO without having an external library, for example 05:36:59 dennisb: An object containing copies of other objects within it will actually contain pointers to those objects in runtime, so its a graph.. 05:37:25 clausen: how is that possible? and in that case, why: peaker: often by the implementation of the language, so not in Haskell itself 05:37:28 boy am I glad this is being logged 05:37:50 Heffalump: yeah, I meant non-pure beyond I/O requirements 05:38:01 Peaker: go search google 05:38:03 the point is that the haskell main program returns a computation. this computation is contructed in a purely functional way. anyways, referential transparency remains 05:38:12 peaker: but as you yourself said, you can sometimes get better algorithmic performance with a non-pure implementation 05:38:13 well, then it needs to identify objects that should be the same, so it can change one of them to a pointer to the other 05:38:13 Peaker: I'm sure the original papers do a better job of explaining than me 05:38:19 but as I said, the *interface* must be pure. 05:39:27 to create the graph you really need references to distinct nodes so you can get hold of a special one and really point to that one 05:40:29 getChar and getChar are the same computation, but they might return different values depending on the context 05:40:29 smkl: that's why they are in the IO monad :-) 05:42:22 dennisb: if you guarantee objects are never copied but references are, you essentially have a graph 05:43:28 well, it can be hard to move pointers after you create it. 05:44:04 for creating I agree with you 05:44:18 there are for example algoritms where you reverse pointers in a graph 05:45:39 you really want to do that in place, and have a guarantee that it is fast, because the algorithm depends on that the pointer updating is O(1) 05:46:13 * Heffalump --> lunch and a meeting and stuff, bye 05:46:25 * shapr waves to Heffalump 05:47:48 --- quit: jewel (Read error: 110 (Connection timed out)) 05:54:34 Pointers are not dangerous, even functional programmers can use them. We just don't need them that often because we have polymorphi and higher order functions 05:59:59 And for the examples where you have a list with different kind of elements. Well, that doesn't happen to often, and if it does we would just have to put them in a tagged list. Even in a untyped language you need to know the type of the element anyway if you ever want to use it. But in an untyped language typically every value have a tag saying what type it is so it can generate runtime errors when something is wrong. 06:00:40 actually, in Python you don't necessarily have to know the type of what you're working on... 06:00:54 it has a very nifty thing that I'm not sure there's a name for.. 06:01:07 where you say "this function expects a X-like object" 06:01:14 like the classes in haskell, i guess 06:01:16 for example, a file-like object 06:01:19 yah, that kind of thing 06:01:48 in Haskell you'd write func :: File a => a -> b 06:01:58 and that's how almost everything in Python works 06:03:27 so func might be doing something like "func fileobjs = map read fileobjs" 06:04:05 yes 06:04:12 and those fileobjs could be actual file objects, strings acting as fileobjs (StringIO), arrays of whatever that just happen to have a read method, etc etc 06:04:58 so you can get NameErrors at runtime if one of those guys doesn't have a read method 06:05:05 in Python it doesn't care that the type IS something, only that it has some attribute 06:05:05 that is the essence of classes and objects. in haskell or any language 06:05:14 truly 06:05:38 Peaker: that's how Haskell type classes work too 06:05:44 Peaker: yes, that is what we use classes for in haskell 06:05:47 * Heffalump is eating lunch and not really here, honestguv 06:07:31 --- join: jewel (~jleuner@57.66.12.99) joined #haskell 06:07:39 re jewel 06:07:47 hi 06:07:54 what's up? 06:07:54 building contractors cut the power! 06:07:59 whoa, suckage 06:08:08 * shapr hands the discipline stick to jewel 06:08:10 but the idiots did it while we were away at lunch 06:08:10 go get 'em! 06:08:16 instead of allowing us some downtime 06:08:22 idjits 06:49:24 --- quit: mustard (Read error: 110 (Connection timed out)) 06:50:10 --- join: mustard (~felix@159.180.250.254) joined #haskell 06:50:23 hrm 07:39:52 --- join: dmiles (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 07:45:05 --- quit: clausen (Read error: 113 (No route to host)) 07:52:35 --- join: jsw (scott@12-234-202-177.client.attbi.com) joined #haskell 07:53:03 --- quit: jsw (Client Quit) 07:53:31 wheee 07:58:04 --- quit: mustard (Read error: 60 (Operation timed out)) 08:07:17 --- join: mustard (~felix@159.180.250.254) joined #haskell 08:07:21 re 08:43:49 xbill? 08:43:58 you rang? 08:44:05 i am taking the plunge into Mercury today 08:44:21 i have 8 hrs to try to see how long it will be to port my App 08:44:38 how much Mercury have you used? 08:45:11 i just made a sample toy program 08:45:31 but i need to understand the type and 'mode' decls 08:45:53 dmiles: shoot 08:46:01 what is happing is its finding every atom in my system.. 08:46:16 what kind of toy program? 08:46:30 and saying.. one sec. 08:46:31 estit.m:943: error: undefined symbol `OrganOrTissueProcess/0'. 08:46:31 testit.m:943: In clause for predicate `testit:holds/2': 08:46:31 testit.m:943: in argument 2 of clause head: 08:46:31 testit.m:943: in argument 2 of functor `./2': 08:46:31 testit.m:943: in argument 2 of functor `./2': 08:46:42 its an medical expert system 08:47:01 :- import_module list. 08:47:11 ah.. first :) 08:47:46 ok restaritng to give you next error 08:48:46 sure =) 08:48:54 shouldy i :- pred holds(term,list). 08:49:12 fyi: :- import_module term. 08:49:33 holds(instance, [zzsk(zzsk309267Fn, [_G1903]), 'ColorProperty']):-holds(attribute, [_G1903, 'Polychromatic']). 08:49:42 thats wwhat a data stament looks like 08:49:53 oops well that on is a rule 08:52:10 xbill: i have 4571 warnings :) i dont know if there are errors in bwetween 08:52:35 so... will cat to file 08:53:13 testit.m:407: In definition of predicate `testit:holds'/2: 08:53:13 testit.m:407: error: undefined type `list'/ 08:53:32 testit.m:001: warning: modules `list' and `term' 08:53:32 testit.m:001: are imported in the interface, but are not 08:53:32 testit.m:001: used in the interface. 08:54:03 wow 1000's of less errors now 08:54:41 list_struct or something i need 08:56:40 list(T) 08:56:53 list is a type constructor it needs an argument 08:59:34 ok .. i see 09:03:14 wheeee 09:07:05 wli: thank you .. no errors now 09:07:40 * shapr bounces frivolously 09:07:47 oops i lie 09:07:49 testit.m:2470: type error: type of argument does not match its expected type; 09:07:49 testit.m:2470: argument has overloaded actual/expected types { 09:07:49 testit.m:2470: pred(T, (list:list(T)), (list:list(T)))/(term:term((term:generic))), pred(T, (list:list(T)))/(term:term((term:generic))) 09:07:49 testit.m:2470: }. 09:08:40 oopps and testit.m:2475: error: undefined symbol `zzsk309260Fn/0'. 09:09:04 what are the compile options? 09:09:43 dmiles what's on line 2470 or thereabouts? 09:10:00 http://216.39.172.56/_/engine/testit.m 09:10:38 holds(instance, [zzsk(zzsk309161Fn, [_G1903]), 'BodyPart']):-holds(instance, [_G1903, 'BodyMotion']). 09:11:06 i used zzsk?????Fn for Skolems 09:11:55 http://216.39.172.56/_/engine/testit.err 09:12:37 i know i am abusing mercury.. this is just a little demo to myslef to see that it can handle insane amnount of data 09:12:58 and leanr what is basic to getting things to compile :) 09:14:45 Skolems? 09:14:48 nifty word 09:15:00 suggest skeletal golem to me 09:15:40 hehe.. skolems a gensyms used to represent things 09:16:09 skeletal smoglum 09:16:36 skeletal golem :) cute 09:16:53 dmiles: best to send it to the Mercuy list 09:17:00 smoglum 09:17:04 another nifty word 09:17:10 smoky gollum 09:17:12 xbill: you mean i did veverything rigt? 09:17:40 xbill: it seems like such a newbie thing 09:17:48 dmiles: I don't know what you did wrong 09:18:02 so it 'looks' right then? 09:18:06 but I don't know what's in your source 09:18:19 oh testit.m is there 09:18:23 you saw the soruce rigth?> 09:18:51 i have wered urls.. i know 09:18:56 I'm looking now 09:20:32 dmiles: you *definitely* want to get on the Mercury list... those guys would love to make your stuff work with their compiler (or so I'd think) and they'll probably know what goes wrong 09:21:06 okay it's a repeated thing 09:21:16 but it looks like i at least covered my types right? 09:21:36 yeah there's a mode problem for the more than once in the scope though 09:21:48 or osmething 09:21:55 what is undetermined mode in or out? 09:22:23 the manulaul only ussing themn randomly never describes them 09:22:43 dmiles: yeah, the problem is you're using uo 09:22:50 uo means it can only appear once 09:22:51 i would like to see examlpes of pred declarartrions.. i had to snoop thru modules to see them 09:23:12 http://holomorphy.com/~wli/dcg/dcg.m 09:23:20 how can i say foo(?,?) ?] 09:23:42 what? 09:24:09 means in or out 09:24:24 you have to declare multiple modes separately 09:24:31 means (+,-),(-,-),(+,+),(-,+) 09:24:54 so four decls that ar in/out 09:24:56 yeah 09:25:07 Mercury doesn't want you to do that =( 09:25:34 does dcg.m help at all? 09:25:35 i know it dont.. but i want to see if it can hadle the abuses :) 09:25:46 yes dcg.m does .. i can see exampoles 09:25:56 does it still compile and run? 09:26:09 one sec.. reload that page 09:26:55 so far seo good.. no eorrros yet 09:27:25 ok millions of errros now 09:27:37 millions of errors on dcg.m? 09:27:41 testit.m:091: error: undefined symbol `SubjectiveAssessmentProperty/0'. 09:27:46 or testit.m? 09:27:53 nope in dgc.m .. i'll download and try 09:27:57 testit.m 09:28:10 it wants every dataatom declared? 09:28:23 yeah 09:28:34 there is 60,000 terms in our KB 09:28:36 I'm assuming this is automaticlaly generated =) 09:28:56 yeah i can decalre each what does the decl look like? 09:29:06 (i gan genrate whatever it needs) 09:29:44 actually --infer-types might help... 09:30:09 can i sert up a compiler switch in a source file like that? 09:30:10 this channel rocks 09:30:26 only place where 50% of the conversation is over my head 09:30:27 I love it. 09:30:33 shapr, becasue we are working? 09:30:45 ah .. cool *wink* 09:30:46 that too :) 09:30:49 you guys *do* stuff 09:30:56 --- quit: mustard ("Client Exiting") 09:32:04 /msg #haskell did --infer-types help? 09:32:45 hrm I'm not 100% convinced that's the syntax for weird variable names like that 09:33:04 yes yay it did so far 09:33:07 :) 09:33:19 you can reload trhe .err file at any time 09:33:34 mmc --infer-types testit > testit.err 2>&1 09:33:54 oh poo 09:33:59 i need the .m ? 09:34:15 simnce there is another w/o .m :) 09:34:31 the other without the .m, is it executable? =) 09:34:48 nope its the dump i create the .m with 09:34:53 :( 09:35:02 soon tho 09:35:19 oh 09:35:29 be careful it will overwrite that thing 09:35:47 oh n/p 09:35:53 http://216.39.172.56/_/engine/testit.err <-looking better? 09:36:37 I don't know change the mode kill the warning you're getting megabytes of warnings 09:37:03 i can fix the wraing be sucking out th e_'s 09:37:06 one sec 09:37:37 okay 09:38:08 err well i though it would 09:38:15 i use single variables 09:38:19 reload 09:38:44 how do i rtemove singleton warnings ? 09:38:48 still too many warnings 09:38:52 ok one sec 09:39:02 you're reusing something defined by uo twice in the same scope 09:39:05 oi am going to search for switch 09:39:26 uo.. i thought thats fixed 09:39:33 i chaing tio in,out 09:40:44 okay 09:41:07 okay wantings fixed 09:41:13 err warnings 09:41:15 reload :) 09:41:30 Hrm I'm not sure you need the backticks 09:41:47 are those atoms or real logical variables? 09:42:01 lofgical variable (the G66666) 09:42:09 they are universals 09:42:28 meaning any value could fall ther for unification 09:42:38 example is.. 09:42:57 heart(X):-humasn_heart(Name,X) 09:43:04 Name gould be any humasn 09:43:24 Name could be any human 09:43:37 I think you have to do universals differently ... very differently. 09:43:40 sdo if i had 10 people with hearts heqart(X) should return 10 tuimes 09:44:10 yeah.. you see i am creating a blind crash cousre here 09:44:26 i read a bit.. for a couple hours 09:44:45 type universal ---> subjectiveAssessmentProperty ; NormativeProperty ; ... 09:45:00 oh those.. those are Atoms 09:45:09 the G666 are the only unversials 09:45:32 you have to declare an atom as a discriminated union basically 09:45:35 but your saying i shgould declare the atoms as well 09:45:43 ok.. cool 09:45:53 i actually have types and subtyope 09:46:13 but i dind tknow if i could tell merc that 09:46:25 the universals I don't believe you're having trouble with 09:47:00 Smooth and TextureProperty and so on are having trouble 09:47:06 its my billions of undeclared atoms? 09:47:22 it looks like it 09:47:35 ifer type i was hoping :) 09:47:38 instance subclass and contraryProperty also need to be declared. 09:47:39 err infer 09:47:53 well they are random user words 09:48:05 but i see what your saying.. 09:48:17 dolds/2 is like a genric prolog interopretor 09:48:21 err holds/2 09:48:41 and the data inside is what i am trying to process 09:48:56 so maybe i need losser types in my :-pred ? 09:49:03 err looser 09:49:16 what if all these where strings? 09:49:30 i would loose speed .. :) 09:49:35 hrm, it might be easier if they were strings... it's faster if they're atoms though 09:49:50 string processing is slow no matter what 09:49:54 yeah.. so ok i'll can make a list of atoms.. 09:50:07 and dio a :-type for each 09:50:17 and just call thenm atom ? 09:50:43 with the sk6666Fn whhat could i call them? 09:50:48 you don't want a :- type for each 09:51:04 just one ype with a list? 09:51:10 you want one big :- type and each thing a case in the :- type 09:51:23 ok that will take me about 5 minutes to generate 09:51:30 like :- type ---> foo ; bar ; snoo ... 09:51:37 ok one sec P:) 09:52:08 * dmiles uses mad SWI-Prolog skills to generate the list 09:52:25 * xbill =) 09:52:50 should put them on one line ort 09:52:55 :-type atom --> 09:52:57 foo 09:53:00 eerr 09:53:03 foo, 09:53:05 bar, 09:53:09 blah. 09:53:18 no the separator is ; 09:53:28 ah good thing you said that 09:53:36 heh 09:54:30 :- type expr ---> in dcg.m should help 10:00:25 dmiles: whatever the results of your experiment for optimizing things is I'm sure the Mercury guys would love to hear of the results 10:02:26 dmiles: also you may hit bottlenecks further down the toolchain like the compiler and/or executable format 10:03:43 er C compiler 10:04:00 yeah.. is there a way to tay in mercury like interpr4etor? 10:04:26 since i know i hvsae to hit C code 10:13:23 nope 10:19:30 rrm i tghought :- type atom --> zzsk964310Fn ; subsumedExternalConcept ; 10:19:39 well witl perios at end 10:19:50 that's wha it should be 10:19:57 is that not working? 10:21:57 --- quit: dmiles (Read error: 54 (Connection reset by peer)) 10:23:36 --- join: dmiles (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 10:24:20 is it not working? 10:24:58 gettimg beeter :) 10:25:08 i need --- 's :) 10:25:23 sex? 10:25:40 * shapr tries to think of other three letter words 10:25:43 luv ? 10:25:48 fud? 10:25:59 hehe 10:26:18 must be able top be prulaized as well 10:26:25 oh right 10:26:37 wli: hrrm some of the keeywrks mean things to it 10:27:04 bud ? 10:27:10 buds 10:27:13 that would work 10:27:26 ok, I have no idea 10:29:13 wow wli,, new types of errs 10:29:35 shapr:) 10:29:38 what errors? 10:29:39 buds fine 10:29:47 testit.m:091: In clause for predicate `testit:holds/2': 10:29:47 testit.m:091: in argument 1 of clause head: 10:29:47 testit.m:091: type error in unification of variable `HeadVar__1' 10:29:57 no more undefine constants tho :) 10:30:03 heh 10:30:15 14 list of constants 10:30:18 err 14k 10:30:45 http://216.39.172.56/_/engine/testit.[m|err] 10:31:11 is instance/subclass reserved? 10:31:20 or at at least insrtance? 10:32:01 no 10:32:04 i had to remove and,or,=>,<=>,instance from my type list 10:32:27 hrrm i mgiht add 'instance' back 10:32:40 some of the names are used by the libraries 10:32:55 testit.m:019: Syntax error at token 'instance': unexpected token at start of (sub)term. 10:33:25 opk fixed 10:33:29 (instance) 10:33:39 i parend it 10:34:06 2.2MB of errors 10:34:36 thats alot better huh? 10:34:44 hehe 10:34:55 wait tho 10:34:57 i think.. 10:35:05 some of them are reserved by the term module 10:35:23 no 10:35:40 you say that holds() takes an arg of type term and pass it an atom 10:36:02 but isnt atom subclass of term? 10:36:11 no 10:36:15 i can make sure its always an atom of variable thio 10:36:25 iok .. i'll fix that type 10:37:17 ok fixed 10:37:22 regend the err file 10:37:51 down to 422KB 10:38:29 heh 10:38:40 what's the type signature for error? 10:38:43 :- pred holds(atom,list(T)). 10:38:45 for holds() 10:38:57 try holds(atom, list(atom)). 10:40:11 holds(domain, [deathTime, 2, 'TimePosition']). 10:40:18 testit.m:126: In clause for predicate `testit:holds/2': 10:40:18 testit.m:126: in argument 2 of clause head: 10:40:18 testit.m:126: in argument 2 of functor `./2': 10:40:18 testit.m:126: in argument 1 of functor `./2': 10:40:18 testit.m:126: type error in unification of argument 10:40:20 testit.m:126: and constant `2'. 10:40:21 --- part: Heffalump left #haskell 10:40:22 testit.m:126: argument has type `(testit:atom)', 10:40:24 testit.m:126: constant `2' has type `int'. 10:40:47 define a case in the atom type like intatom(int) 10:40:59 and wrap the integer constants with intatom() 10:41:16 hrrm good idea 10:41:28 well it's required =) 10:43:14 --- join: nefph (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 10:43:48 ok lets go over types real quick 10:43:54 85KB =) 10:44:13 looks like you're still putting naked integers in there 10:44:38 you need to put the constructor intatom() around the integer constants in the rule heads 10:45:23 grrm coonection 10:45:30 lets go over my tpyes real quick 10:45:36 --- quit: dmiles (Read error: 104 (Connection reset by peer)) 10:45:37 i was dead 10:45:59 i have Numbers,Atoms,sk666Fn,doDaoFn 10:46:17 okay 10:46:20 so i'll make a list of my tpes in the top of the file 10:46:34 then point to iot for you 10:46:41 you need to wrap the integers 10:53:55 --- join: dmiles (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 10:54:45 heel 10:54:49 hello 10:55:08 ok 20 second lag 10:55:17 re 10:55:25 hey, did you wrap the integers? 10:55:44 i see that i need more typing 10:55:51 let me show you 10:55:56 you need to wrap the integers 10:56:02 Anything = wff ; AtomOrVar ; atomint ; reifyConst 10:56:02 wff = holds(AtomOrVar,ListOfAnything) 10:56:02 reifyConst = zzsk(Atom,ListOfAnything) ; fn(AtomOrVar,ListOfAnything) 10:56:02 AtomOrVar = Atom ; Var 10:56:02 ListOfAnything = list of Anything 10:56:06 i may as well do it now 10:56:14 i hvaer a very set type and syntax 10:56:28 i am ussing your dcg.m to make one.. one sec 10:56:40 otherwsie we are shooting in the dark 10:56:58 atomint(int) 10:56:59 since i have very strict types i know aboput but maybe need to tell merc L:) 10:57:06 yes that is parrt of it 10:57:07 heh 10:57:12 --- quit: nefph (Read error: 113 (No route to host)) 10:57:36 :- type nonreifiable ---> atomint(int) 10:58:14 :- type reifiable ---> atom ; term_entiy. 10:58:24 hrm 10:59:32 :- type alltypes --> nonreifiable ; reifiable . 11:00:10 ok here we are 11:00:11 :- type alltypes --> nonreifiable ; reifiable . 11:00:12 :- type nonreifiable ---> atomint(int). 11:00:12 :- type reifiable ---> atom ; term_entity. 11:00:12 :- term_entity ---> fn(atom,list(alltypes)) ; sk(atom,list(alltypes)). 11:00:31 okay 11:03:32 what would a ','(foo,foo) bwe? 11:03:40 is that a 'term' ? 11:04:21 i i should defuine a stricter type 11:04:28 (since i can) 11:04:49 one sec 11:05:56 like a pair? 11:06:11 pair syntax is {T1,T2} 11:08:50 yeah i am defencing the type logicalsentence 11:09:00 :- type alltypes --> nonreifiable ; reifiable ; logicalsentence . 11:09:00 :- type nonlogical --> nonreifiable ; reifiable. 11:09:00 :- type allsimple --> atom ; atomint(int) . 11:09:00 :- type nonreifiable ---> atomint(int). 11:09:00 :- type reifiable ---> atom ; term_entity. 11:09:01 :- type term_entity ---> zzfn(atom,list(nonlogical)) ; zzsk(atom,list(nonlogical)). 11:09:03 :- type logicalsentence---> logicaltuple. 11:09:05 :- type logicaltuple ---> holds(atom, list(nonlogical)) ; not_holds(atom, list(nonlogical)) ; equal(nonlogical,nonlogical) ; not_equal(nonlogical,nonlogical). 11:09:49 --- join: nefph (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 11:09:53 --- quit: dmiles (Read error: 54 (Connection reset by peer)) 11:10:39 see topline of http://216.39.172.56/_/engine/testit.m 11:10:43 see hold/2 is very generic 11:10:45 so i have 3 basic typs.. 11:10:53 logicalsentence, reifiable, nonreifiable 11:11:55 ok reload 11:12:09 see the parts right below main 11:13:02 :- pred holds(atom, list(alltypes)). 11:13:03 :- pred not_holds(atom, list(alltypes)). 11:13:03 :- pred equal(nonlogical,nonlogical). 11:13:03 :- pred not_equal(nonlogical,nonlogical). 11:13:03 :- pred entails(logicalsentence,logicalsentence). 11:13:03 :- pred not_entails(logicalsentence,logicalsentence). 11:14:18 i am goig to chuck out the file a bit :) 11:14:22 make it smaller 11:14:29 just having the structres i need 11:14:41 like one of easch kind 11:17:35 --- quit: nefph (Read error: 104 (Connection reset by peer)) 11:18:23 --- join: dmiles (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 11:19:31 ok wli , i rediuced the prblem size 11:19:35 like the file size 11:19:42 so its easier :) 11:19:52 like at the .m and .err file now 11:19:57 did some typingh 11:20:09 they are both tiny now 11:20:21 my connection sucks 11:20:47 i keep dropingh 11:20:47 lesss then 400 lines 11:20:47 for the .m 11:25:37 --- quit: dmiles (Read error: 104 (Connection reset by peer)) 11:25:46 --- join: nefph (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 11:27:31 oh its all wrapping 11:27:37 i see now 11:27:45 i cant just subtpye 11:28:01 coorect? 11:28:05 like at the .m and .err file now are less then 400 11:28:21 i get bumped off every few minute 11:28:31 i havent seen a response if you gave one :) 11:28:43 like now i a may no be here 11:33:42 --- quit: nefph (Read error: 104 (Connection reset by peer)) 11:54:49 --- join: dmiles (~alife@sense-sea-MegaSub-2-56.oz.net) joined #haskell 11:55:43 man my connection sucks 11:55:45 can anyone here me? 11:55:47 err hear 12:05:10 xbill 12:05:17 i have the problems vbery simplified now 12:05:33 http://216.39.172.56/_/engine/testit.err nicer and small 12:05:40 http://216.39.172.56/_/engine/testit.m nioce and small 12:06:20 only eleven errors 13:03:18 xbill 13:03:38 you here.. think i got the problems down to sanity 13:03:48 before i was asking allot L( 13:03:50 :) 13:04:39 holds(time, [_G298, _G301]):-holds(holdsDuring, [_G301, holds(_G316, [_G319, _G298])]), holds(instance, [_G319, 'Physical']), holds(instance, [_G298, 'Physical']). 13:04:50 thats gives error: 13:05:01 testit.m:441: In clause for predicate `testit:holds/2': 13:05:01 testit.m:441: in argument 2 of call to predicate `holds/2': 13:05:01 testit.m:441: in argument 2 of functor `./2': 13:05:01 testit.m:441: in argument 1 of functor `./2': 13:05:01 testit.m:441: type error in unification of argument 13:05:02 testit.m:441: and functor `holds/2'. 13:05:04 testit.m:441: argument has type `(testit:alltypes)', 13:05:06 testit.m:441: functor `holds/2' has type 13:05:08 testit.m:441: `holds((testit:alltypes), (list:list((testit:alltypes)))) :: (pred)'. 13:07:14 [_G298, _G301] i guess does not match list:list((testit:alltypes)) 13:21:11 --- quit: smkl (carter.openprojects.net irc.openprojects.net) 13:21:27 --- join: smkl (~sami@glubimox.yok.utu.fi) joined #haskell 13:59:35 --- join: skullface (~asd@210.214.37.218) joined #haskell 14:00:34 whats functional programming and how is it diff. from C/Java programming langauges?? 14:03:13 --- part: skullface left #haskell 14:13:15 --- join: nodie (~nodie@212-170-181-119.uc.nombres.ttd.es) joined #haskell 14:13:18 hi 14:15:15 what is the advantages of monads? 14:16:58 --- quit: nodie (Client Quit) 14:33:00 that was odd 14:33:05 and I even missed it 14:34:10 --- join: tmoertel (~chatzilla@pa-mtlebanon2a-414.pit.adelphia.net) joined #haskell 14:34:18 hi again :) 14:34:27 howdy, again! 14:35:41 anyone here use Functional MetaPost? 14:42:31 --- join: nodie (~nodie@193-152-195-205.uc.nombres.ttd.es) joined #haskell 14:42:40 hi again 15:00:03 hi 15:00:12 tmoertel: don't you post to the haskell list? 15:00:40 every once and a while 15:00:59 hm, your name sounds familiar 15:01:04 * shapr looks at his archives 15:02:28 nodie: functional programming is different from procedural programming in that the entire evaluation model is more like a mathematical equation rather than like a set of steps happening in order 15:03:01 monads are a safe way of representing a computation in a language which does not allow side effects in code 15:03:31 * shapr tries to remember what he was working on 15:04:01 like Object Oriented programming? 15:04:23 no, that's an entirely different story. 15:04:39 yes 15:04:42 i use haskell 15:04:50 one might say that it's an orthogonal story (see, e.g., Dylan) 15:05:55 i want to say that monad hide code like objects make... 15:06:24 hrm, I don't think I'd say that. 15:07:00 the 'spirit' behind the original idea of objects was to package a collection of data and the code that works on that data, behind a set interface 15:07:20 so objects are more about abstraction from implementation 15:07:31 ya know, maybe that does work :) 15:10:51 dmiles: still there? 15:13:15 yes hi 15:13:27 you see the error page? 15:13:36 i almost have it down 15:13:51 when you say my nick it fashies for me 15:13:57 flashes? 15:13:59 err flashes 15:14:04 that yes 15:14:08 heh :) 15:14:28 dmiles: what's your native language? 15:14:38 newspeak 15:14:38 you told me this before, but I forgot :( 15:14:42 HA! 15:14:47 * shapr falls over laughing 15:14:49 i never had oine 15:15:16 even see blue lagoon? 15:15:24 er, no, I don't think so 15:15:44 my parents were hippies that lived on a remote desert inland until i was 5 15:15:55 and my father was deaf 15:16:01 wow, cool! 15:16:26 but in person my grammer is not as bad.. i just got a new keyboard last week 15:16:33 oh, what kind of keyboard? 15:16:36 kinesis or maltron? 15:16:53 i whent from a large MS naturla keyboard to this timy tiny one 15:16:59 oh 15:17:14 it had too much coffee and cigarets.. stopped working 15:17:22 do you compile hugs? 15:17:36 dmiles: hah :) 15:17:44 nodie: no, I used DebianLinux 15:17:48 er, "use" 15:18:52 i don't know how to say to compile I have readline... it's horrible to use hugs without readline 15:19:15 use it from within emacs? ;) 15:19:23 are you compiling on *nix? 15:20:04 yes 15:20:12 from emacs? 15:20:14 hummm 15:20:15 try doing ./configure --with-readline 15:20:17 i use emacs.. 15:20:25 M-x haskell-mode ;) 15:20:39 M-x turn-on-haskell-hugs 15:20:45 i write --with-readline but configure don't detected it 15:20:59 i'd to download haskell mode... 15:21:13 you may have to do --with-readline=/usr/lib/$MYREADLINELOCATION 15:21:23 * shapr loves metasyntactic variables 15:22:42 that's not 15:22:48 i'll prove it 15:23:07 ? 15:23:14 really? 15:23:15 go for it! 15:36:29 dmiles: how did the -> Mercury thing go? 15:38:05 dowen to 11 errors 15:39:09 holds(time, [_G298, _G301]):-holds(holdsDuring, [_G301, holds(_G316, [_G319, _G298])]), holds(instance, [_G319, 'Physical']), holds(instance, [_G298, 'Physical']). 15:39:17 [13:07] testit.m:441: In clause for predicate `testit:holds/2': 15:39:18 [13:07] testit.m:441: in argument 2 of call to predicate `holds/2': 15:39:18 [13:07] testit.m:441: in argument 2 of functor `./2': 15:39:18 [13:07] testit.m:441: in argument 1 of functor `./2': 15:39:18 [13:07] testit.m:441: type error in unification of argument 15:39:18 [13:07] testit.m:441: and functor `holds/2'. 15:39:20 [13:07] testit.m:441: argument has type `(testit:alltypes)', 15:39:22 [13:07] testit.m:441: functor `holds/2' has type 15:39:24 [13:07] testit.m:441: `holds((testit:alltypes), (list:list((testit:alltypes)))) :: (pred)'. 15:39:26 [13:09] [_G298, _G301] i guess does not match list:list((testit:alltypes)) 15:40:15 (is this prolog?) 15:41:31 --- quit: nodie ("i must sleep") 15:42:17 --- quit: shapr (Read error: 104 (Connection reset by peer)) 15:47:25 Mercury 15:49:29 dmiles: how far are you now? 15:49:51 i sort of started basck in SWI-mode until i could ask you what was up 15:49:58 i simplified the program and the problems 15:50:11 http://216.39.172.56/_/engine/testit.m http://216.39.172.56/_/engine/testit.err 15:50:17 much smaller fuiles now 15:50:52 [_G298, _G301] doess not match list:list((testit:alltypes)) ? 15:51:45 oic 15:57:53 hrm well I'm still sort of working .. hang on 16:04:26 n/p i am now addfing color to my types in the rule output code 16:04:40 so each type is wrapped 16:05:05 preds(instance),numerical(55) 16:06:13 and variable possitions that require a certin type is holds(preds(X),...) 16:06:33 also removing the list types 16:06:55 and making the list a verttor like [A,V] -> argv(A,V) 16:07:20 [a,b,c] -> argv(a,b,c) 16:08:02 that way its creates a virtual hash based on the arity of the relatyion 16:08:26 argv/2 arv/3.. etc 16:22:12 heh 16:44:14 crap I didn't see anything 16:56:40 --- quit: tmoertel (Read error: 110 (Connection timed out)) 18:05:17 it ok my work with mercury has really inspired me to explore better typing in the specialization of rules 18:06:03 myt rule output format is getting more contstrained ev3ery hour 18:07:02 dmiles: heh, does it compile yet? 18:07:24 i left it at the 11 rules.. and working on typing the output form 18:07:31 err 11 errors 18:07:47 so i am not ussing lists and each varible will have type wrappers 18:08:25 what i am doing is only moving both the SWI-Prolog and Mercury version forwasrd 18:09:17 nice 18:09:23 may sound wierd, but i might just have SwI output the .m file then switch over to mercury ofr Querytime 18:09:43 what are you hoping to see from Mercury in all this? 18:10:00 faster specialized version of the database 18:10:12 with Tabling (loop checking) 18:10:16 hrm cool 18:10:34 if it wasnt for some of the rules looping to infinitum swi would have worked 18:10:43 oh? 18:10:48 i hate ussing time/space/backchain constaints 18:10:56 its wrong for a user to have to decide that 18:11:23 in SWI i can set timeout for query.. backchain depth etc.. 18:11:52 but thats just casue i am looping 18:12:05 Mercury has termination analysis 18:12:17 Rgith, thats the most important feature 18:12:29 i thought it had a good contraint librayry.. but it doesnt 18:12:38 but its ok.. 18:12:53 you can add in contraint by wrapping types 18:13:08 hrm 18:13:11 human(X) dog(X) .. etc 18:13:32 human(X) wont unify with dog(X) 18:13:48 thats what ui mean by sontraint 18:13:53 err contraint 18:14:11 its all about overloading the vbasic operation of = 18:14:32 if i said that dog was a subclass of animal.. 18:14:33 aha 18:14:58 and so was humun... then a predicate with the typer breaths*(animal(X),air) 18:15:25 then that would alow dog(fido) human(jeff) to inify 18:15:43 but i wound not want just X... 18:16:00 i would want th ewhole term dog(fido) human(jeff) 18:16:21 vs fido,jeff 18:16:49 so one wouild voerload =- to.. 18:17:18 animal(dog(X)) = dog(X). 18:17:31 animal(human(X)) = human(X). 18:18:04 mercury and other prologs dont have that 18:18:22 since =.. is such a basic operation 18:18:26 err = 18:19:38 huh? 18:19:45 but i know that i am going to end up writing my own version of myeqequals.. ;( and every chain (forward/backward) is going to have to call it 18:20:07 well in basic prolog.. 18:20:14 you have =/2 18:20:28 which all of prolog is buiult i8on top of 18:21:00 it defines how your reader envisions your :- rules 18:21:01 right... 18:21:19 a([X|Y],X,Y). 18:21:58 means.. a([X|Y],XX,YY):-X=XX,Y=YY. 18:22:30 so it i wanted to do this.. 18:22:54 a([human(X)],X,Y) 18:23:31 a([human(X)],animal(human(joe)),Y) 18:24:01 and have Joe pop out of X 18:24:07 CLP? 18:24:14 i would be redifining =/2 18:24:19 correct 18:24:23 oic 18:24:27 attriburted atoms and variables 18:25:01 there is no clean way to show attrribrtes 18:25:13 except maybe a set of arribs 18:25:27 [human,mammal,joe] 18:25:50 then you are constanly seeing if things intersect 18:26:04 ijnstead of uiunification 18:26:19 very slow 18:26:32 eclipse.. suposidly does this 18:26:42 and was meant to do it fast 18:27:07 CLP is overly brandished by prdeclaritive interpetoirs 18:27:25 they often mean types :) 18:27:30 what's eclipse? 18:27:46 its a really bassass CLP system.. hard to get.. 18:28:25 http://www-icparc.doc.ic.ac.uk/eclipse/ 18:28:30 explains why I've not heard of it yet 18:29:27 i got my copy with extensive FTP searching in people home dirs :) 18:30:13 November 26, 2001 18:30:23 they are very up to date 18:30:33 it is the best allk around i hear 18:30:56 http://www-icparc.doc.ic.ac.uk/eclipse/features.html 18:32:06 ECLiPSe programs can execute in or-parallel on shared-memory multiprocessor hardware (this functionality is currently not actively maintained because of other priorities). 18:32:38 The system is designed to impose no unnecessary limits on programs and data. E.g. there is no limit, other than the available memory, on the number or length of atoms and strings, the arity of functors, the code size, number of procedures, complexity of clauses or stack sizes. 18:33:14 and what *I* need... 18:33:15 The attributed variable data type is the key to many extensions to the basic Logic Programming language. The system calls user-definable event handlers when it encounters attributed variables in certain contexts, e.g. unification. 18:33:58 howver i dont see claim for termination 18:36:11 what claim for termination? 18:36:54 for the ablity to see if rules can come to a termination 18:37:15 termination analysis 18:37:47 otherwsie i would be on it in a second 18:41:21 oic 18:41:39 nice system eh? 18:43:52 yes 18:44:31 my worjk wasnt cionvinced it would be ok for some reason 18:44:39 ywet they are letting me try mercury 18:45:02 who knows? 18:45:23 but hey, if you get to throw the Mercury guys a bone by using it in a real application... all the better =) 18:45:53 yeah :) 18:46:32 that and Mercury's reputedly a speed demon =) 18:46:57 i am going to work all weekend at getting mercury to work for me 18:47:19 this evening is dedicated to the output file format being as infomative as possible 18:48:33 --- join: Vutral (~ss@212.169.154.100) joined #haskell 18:48:38 cool 18:49:10 Therre was a test that was run between B-prolog and mercury that B-Prolog beat it.. 18:49:20 so i tried 'B' for a while 18:49:33 the implemntor even added two predicatyes for me.. 18:49:39 but man its very unstable 18:49:52 I've never heard of B-prolog 18:50:12 dont worry about it.. :) its cool becasue thwe autyhor is accesssavble 18:50:18 he even called me a couple times 18:50:37 but certain normal things you expect dont work 18:51:01 like ther is no I/O .. uits based on calling into Java JNI 18:51:10 thats what got me on the Java/Prolog kick 18:51:46 but once i added a java interface to swi.. i couldnt gain anyrthing from 'B' 18:52:21 http://www.probp.com/ <- to see it if your interested 18:52:38 but its about as good as gnu-prolog 18:52:48 which to me is too tiny 18:53:08 does neat stuff that any prolog system should do as a baseline 18:53:28 but no real incentives 18:55:32 er gnuprolog ...?? 18:55:47 (last I recall gprolog wasn't that hot) 18:58:16 yeah :( 19:00:56 mercury's machine model is pretty cool though 19:01:39 shame they're tied down to a shitty code generator (gcc). 19:03:33 yeah i am wondering how much time between the user assertion into the DB and before its ready to answer rthe query will be 19:07:10 Shoot I don't know how to guess 19:08:29 well the amount of time i inkvoe mmc etc until its loaded and linkjed 19:08:42 i am not too worried right this miunute 19:35:01 --- quit: Vutral (Read error: 54 (Connection reset by peer)) 19:35:11 --- join: Vutral (~ss@212.169.154.100) joined #haskell 19:35:18 --- quit: Vutral (Read error: 104 (Connection reset by peer)) 19:35:28 --- join: Vutral (~ss@212.169.154.100) joined #haskell 19:35:45 --- quit: Vutral (Read error: 54 (Connection reset by peer)) 19:36:37 --- join: Vutral (~ss@212.169.154.100) joined #haskell 19:36:49 --- quit: Vutral (Read error: 54 (Connection reset by peer)) 19:43:25 --- join: Vutra_ (~ss@212.169.154.100) joined #haskell 20:05:16 * xbill hacks the kernel. 20:06:03 wow wow wow 20:06:06 xbill :> 20:06:13 you old hacker ;) 20:08:55 * xbill shrugs 20:14:25 hehe 20:14:43 hrm 20:14:48 if this is opposite of vb 20:14:58 do you turn around brackets ? 20:15:21 ;sub bla bla") (" 20:15:22 :> 20:37:58 uh 20:38:08 Haskell is nothing like vb 20:38:18 what's a good haskell program? 20:38:30 http://holomorphy.com/~wli/grid/GInterp.hs 20:40:23 looks similar to python but only at the beginning 20:40:26 :> 20:40:46 can you compile and run it and see what it does? 20:40:57 sure 20:41:03 its python 20:41:26 well 20:41:30 i will lay down now 20:41:32 bbl 20:41:46 er, wtf? where is python in any of this? 20:42:04 import 20:42:05 :> 20:42:10 well java has that too 20:42:14 ;) 20:42:19 bbl 20:53:18 blah 23:59:59 --- log: ended haskell/02.01.11