Re: [Haskell-cafe] Knowledge

2008-01-02 Thread jlw501
Good point. By fold/unfold transformation you get the following: contains = flip elem [Eureka] = contains xs e = flip elem xs e [Expose data structures] = contains [] e = False contains (x:xs) e = flip elem (x:xs) e [Instantiate] = contains [] e = False contains (x:xs) e = elem e x:[] || flip

Re: [Haskell-cafe] Knowledge

2007-12-20 Thread Tillmann Rendel
jlw501 wrote: I'm new to functional programming and Haskell and I love its expressive ability! I've been trying to formalize the following function for time. Given people and a piece of information, can all people know the same thing? Anyway, this is just a bit of fun... but can anyone help me

Re: [Haskell-cafe] Knowledge

2007-12-19 Thread Luke Palmer
On Dec 19, 2007 7:26 PM, jlw501 [EMAIL PROTECTED] wrote: I'm new to functional programming and Haskell and I love its expressive ability! I've been trying to formalize the following function for time. Given people and a piece of information, can all people know the same thing? Anyway, this is

Re: [Haskell-cafe] Knowledge

2007-12-19 Thread Neil Mitchell
Hi contains :: Eq a = [a]-a-Bool contains [] e = False contains (x:xs) e = if x==e then True else contains xs e contains = flip elem And even if not using the elem function, the expression: if x==e then True else contains xs e can be written as: x==e || contains xs e Thanks Neil

Re: [Haskell-cafe] Knowledge

2007-12-19 Thread jlw501
Just to clarify, this is a little gag almost. It just demonstrates the problem of understanding knowledge as discussed by philosophers. perfectcomm is undefined as it is unknown if you can perfectly pass on your intention to another person. Likewise, it is unknown if you can express your

Re: [Haskell-cafe] Knowledge

2007-12-19 Thread jlw501
The main observation I've made it when playing with the values of knowing the self and perfect communication, nothing else becomes undefined if just perfect communication is true, it is still depended on knowing the self if you can have knowledge. Makes sense. jlw501 wrote: Just to clarify,