Re: [Haskell-cafe] Interesting feature

2008-07-07 Thread fero

Thanks a lot Neil,
I will definitely read it. I searched google and found the same article here
for free
http://www.cs.chalmers.se/~emax/wired/documents/LP_HFL07.pdf

I didn't know that Haskell commuity is so alive. Much more answers in much
less time than when I wrote something to jav:)

Fero


Neil Mitchell wrote:
> 
> Hi
> 
>>  Hi I have read in one tutorial (I can't find it again, but it was
>> probably
>>  either one on ibm, gentle introduction or yaht), that it is possible to
>>  define relationships between free variables and the same program can be
>> used
>>  to calculate either first variable when second is set or second when
>> first
>>  is set.
> 
> Here is how to do it in Haskell:
> 
> http://portal.acm.org/citation.cfm?id=1291201.1291207
> 
> Thanks
> 
> Neil
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Interesting-feature-tp18311432p18314566.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Interesting feature

2008-07-07 Thread Neil Mitchell
Hi

>  Hi I have read in one tutorial (I can't find it again, but it was probably
>  either one on ibm, gentle introduction or yaht), that it is possible to
>  define relationships between free variables and the same program can be used
>  to calculate either first variable when second is set or second when first
>  is set.

Here is how to do it in Haskell:

http://portal.acm.org/citation.cfm?id=1291201.1291207

Thanks

Neil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Interesting feature

2008-07-07 Thread Jules Bean

fero wrote:

Hi I have read in one tutorial (I can't find it again, but it was probably
either one on ibm, gentle introduction or yaht), that it is possible to
define relationships between free variables and the same program can be used
to calculate either first variable when second is set or second when first
is set. I have understood this as if I set first free variable, run program
and write name of second variable and I get result, and vice versa. I don't
know if I understood it well. It looks really interesting but I can't figure
out how to do it. Is this really possible? (I doubt.) If yes show example
please. 


See also metafont, which defines equational relationships between 
variables and solves.


Jules

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Interesting feature

2008-07-07 Thread Janis Voigtlaender

Robin Green wrote:

On Mon, 07 Jul 2008 12:30:34 +0200 (CEST)
Henning Thielemann <[EMAIL PROTECTED]> wrote:



 Actually the type system of Haskell is also logic programming. I
have implemented a simple kind of logic programming using lazy peano
numbers: http://darcs.haskell.org/unique-logic/



There is also Curry which is basically Haskell extended with features
from logic programming. There you get to use ordinary values instead of
having to use types. However, it seems that Curry's solution finding
mechanism is built-in to the language and cannot be modified (e.g. for
performance reasons) without modifying the language implementation. (I


Actually, I think it can:

http://dblp.uni-trier.de/rec/bibtex/conf/iclp/HanusS98

Also more recently, I heard of a way to abstract a nondeterministic
Curry value into its explicit search tree, which one can then traverse
to one's own liking. Obviously, people on the Curry list will know more
about the details...

Ciao, Janis.

--
Dr. Janis Voigtlaender
http://wwwtcs.inf.tu-dresden.de/~voigt/
mailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Interesting feature

2008-07-07 Thread Robin Green
On Mon, 07 Jul 2008 12:30:34 +0200 (CEST)
Henning Thielemann <[EMAIL PROTECTED]> wrote:

>   Actually the type system of Haskell is also logic programming. I
> have implemented a simple kind of logic programming using lazy peano
> numbers: http://darcs.haskell.org/unique-logic/

There is also Curry which is basically Haskell extended with features
from logic programming. There you get to use ordinary values instead of
having to use types. However, it seems that Curry's solution finding
mechanism is built-in to the language and cannot be modified (e.g. for
performance reasons) without modifying the language implementation. (I
think the same would be true for logic programming with Haskell types.)
-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Interesting feature

2008-07-07 Thread Henning Thielemann


On Mon, 7 Jul 2008, fero wrote:


Hi I have read in one tutorial (I can't find it again, but it was probably
either one on ibm, gentle introduction or yaht), that it is possible to
define relationships between free variables and the same program can be used
to calculate either first variable when second is set or second when first
is set. I have understood this as if I set first free variable, run program
and write name of second variable and I get result, and vice versa. I don't
know if I understood it well. It looks really interesting but I can't figure
out how to do it. Is this really possible? (I doubt.) If yes show example
please.


Are you talking about logic programming and PROLOG?
$ pl  # swi-prolog

?- plus(X,2,3).

X = 1 ;

No
?- plus(1,X,3).

X = 2 ;

No
?- plus(1,2,X).

X = 3 ;

No


 Actually the type system of Haskell is also logic programming. I have 
implemented a simple kind of logic programming using lazy peano numbers:

  http://darcs.haskell.org/unique-logic/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Interesting feature

2008-07-07 Thread fero

Hi I have read in one tutorial (I can't find it again, but it was probably
either one on ibm, gentle introduction or yaht), that it is possible to
define relationships between free variables and the same program can be used
to calculate either first variable when second is set or second when first
is set. I have understood this as if I set first free variable, run program
and write name of second variable and I get result, and vice versa. I don't
know if I understood it well. It looks really interesting but I can't figure
out how to do it. Is this really possible? (I doubt.) If yes show example
please. 

Thanks
Fero
-- 
View this message in context: 
http://www.nabble.com/Interesting-feature-tp18311432p18311432.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe