Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

haskell & prolog

Name: Anonymous 2009-03-24 18:49

so guys at my uni we have to pick a seminar (writing about 20 pages + talking about it). one of the possible topics was "functional programming using haskell"

of course with prog circlejerking haskell every day i was quite interested in that topic, even though i have to admit that all i knew about haskell was the wikipedia article.

anyway turns out i wasnt the only one interested in haskell and shit is decided by flipping a coin, which i lose of course, so now i'm stuck with "logical programming using the example of prolog".

so, im asking you /prog/, what's your stance on prolog and what can i expect?

Name: Anonymous 2009-03-24 18:50

It's not scheme.

Name: Anonymous 2009-03-24 18:50

>>2

i know that much

Name: Anonymous 2009-03-24 19:08

it's better than scheme.
product([], 1).
product([H|T], X) :- product(T, Y), X is H * Y.

factorial(N, R) :- numlist(2, N, Ns), product(Ns, R).


:- use_module(library(chr)).
:- chr_constraint prime/1.

prime(X) \ prime(Y) <=> 0 is Y mod X | true.

primes(1). primes(N) :- prime(N), succ(M,N), primes(M).

Name: Anonymous 2009-03-24 19:13

prolog sucks

Name: Anonymous 2009-03-24 19:20

Prolog is pretty awesome, but don't try to do imperative programming with it.  Any time you need complex fact storage, queries, data conversions, and deductions from input, it fucking kicks the shit out of any lame-ass imperative/iterative approach.  Even stuff like compilers are awesome in prolog.

Name: Anonymous 2009-03-24 19:38

>>5
We told him that much

Name: Anonymous 2009-03-24 21:27

any books you recommend?

Name: Anonymous 2009-03-24 21:43

Name: Anonymous 2009-03-24 22:02

Brolog

Name: Anonymous 2009-03-25 1:15

Name: Anonymous 2009-03-25 2:38

Prolog.
You can have Prolog in Haskell: http://lambda-the-ultimate.org/node/112

Name: Anonymous 2009-03-25 6:43

>>12

but i want haskell in prolog

Name: Anonymous 2009-03-25 7:07

of course with prog circlejerking haskell every day i was quite interested in that topic,

Oh we have failed

Name: Anonymous 2009-03-25 7:13

NEWSFLASH:

Haskell programmers invade EVERY FUCKING WHERE even /prog/ and use there powers to make people want to program in their fucking idiotic language that is "PERFECT FOR INSANE TROLLS"

GODFUCKINGDAMMIT

Name: Anonymous 2009-03-25 7:26

>>15
Isn't it tempting to compress programming logic into a one-liner of functions?

Name: Anonymous 2009-03-25 7:52

>>16
A one-liner that is tedious to write, impossible to maintain, and slow as fuck even compared to clearly-written haskell.

Name: Anonymous 2009-03-25 8:17

>>17
The main benefit in learning Haskell is for the neurological benefits. Kind of like how learning Latin is meant to strengthen the synapses between neurons, ultimately improving memory and mental endurance.

Name: Anonymous 2009-03-25 8:49

>>18
That's why I do acid

Name: Anonymous 2009-03-25 11:38

Haskell turns you into an insane troll. just look at #haskell

Name: Anonymous 2009-03-25 11:51

>>20
Have you tried asking "How are monads different than side effects?" question there?

Name: Anonymous 2009-03-25 12:02

>>21
What is the point of lambdas in lisp?

Name: Anonymous 2009-03-25 12:59

>>22
They're functions, bro. You don't get far without functions.

Name: Anonymous 2009-03-25 13:02

>>23
But you could just use (define (f x y) body).

Name: Anonymous 2009-03-25 13:08

>>24
Not without lambda, see R5RS section 5.2

Name: Anonymous 2009-03-25 13:12

>>25
But you can create lambda in terms of define just as easily as you could create define in terms of lambda.

Name: Anonymous 2009-03-25 13:30

>>26
Yea, well, your a fag

Name: Anonymous 2009-03-25 13:31

>>27
what about his a fag?

Name: Anonymous 2009-03-25 13:31

>>27,28
Cut it out. This is getting old.

Name: Anonymous 2009-03-25 13:33

>>29
Your getting old.

Name: Anonymous 2009-03-25 13:45

>>30
what about my getting old?

Name: Anonymous 2009-03-25 14:13

>>30
Touché :-(

Name: Anonymous 2009-03-25 14:15

>>32
I don't think you understand touché.

Name: Anonymous 2009-03-25 14:16

>>15
"PERFECT FOR INSANE TROLLS"
I have never been as proud of myself as I am right now.

Name: Anonymous 2011-02-03 5:55

Don't change these.
Name: Email:
Entire Thread Thread List