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

Rich Hickey is mad!

Name: Anonymous 2013-06-20 20:39

Name: Anonymous 2013-06-22 3:05

>>40
Try to strain your lishp brain and think about what the computer should do if you try to call cdr on an integer.

Name: Anonymous 2013-06-22 3:08

>>41
You don't need to give up type safety in order to support recursive types.

Name: Anonymous 2013-06-22 3:16

>>40
Type a unifies with type (a,b)
I'm more of a Lisp person, and this is completely retarded.

Name: Anonymous 2013-06-22 3:18

cdr n => n + 1

Name: Anonymous 2013-06-22 5:00

>>43
It's not that hard. Even java programmers can do it.


class a {
  a car;
  b cdr;
}

Name: Anonymous 2013-06-22 5:05

>>45
but (a,b) is Tuple a b, not a a b.

Name: Anonymous 2013-06-22 5:15

>>46
a is a Tuple a b

Name: Anonymous 2013-06-22 5:32

>>36
You want a function with type a ∨ (a,b) → a or (a → a) ∨ ((a,b) → a) but Haskell doesn't let you do that, so you have to wrap it in a data constructor.
data Union a b = Value a | Pair a b

Name: Anonymous 2013-06-22 5:38

>>42
But Haskell already supports recursive types. In fact, the whole Lishp type system can fit into one Haskell recursive type.

Name: Anonymous 2013-06-22 5:41

>>48
It needs to be Pair a b all the way down along the first element of the pair, to be the same.

Name: Anonymous 2013-06-22 5:45

>>49
It doesn't seem to handle recursive types in type inference. Is there a way to do it explicitly?

Name: Anonymous 2013-06-22 5:49

>>51
>>50
`I don't know where you get your ideas, TJ`
Haskell can have any kinds of fucking trees, including but not limited to the lisp lists. For instance like this:
data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show)
The type system handles them like any other fucking type. Type inference works. You can even save time if you want to walk down a path in a tree without evaluating it whole, thanks to laziness.
Get your heads out of your SICP archaism and read about fucking Haskell which can do everything Lisp can, and more.
http://learnyouahaskell.com/zippers

Name: Anonymous 2013-06-22 6:02

>>52
Type inference does not work, because it cannot unify a with (a,b).

Name: Anonymous 2013-06-22 6:04

also, (lambda (x) (x x))

Name: Anonymous 2013-06-22 6:07

>>53
Because (a, b) is fucking not the same as a. Just fucking not the same. Can you wrap your head around that? Are you capable of thought or is carring, cdring and consing the only thing a lishp-idiot can understand?
>>54
What the fuck is that? Why do you need it? You've never written actual programs, have you. It's all just infinite fucking Turing machines and syntax trees for you imbeciles.

Name: Anonymous 2013-06-22 6:09

>>53
Unification of recursive type should be, like, unifying [a,b] with [b]. Where do you get the idea that it's about unifying a and (a,b)? (a,b) has the type 2-element-tuple type-of-a type-of-b. It's not even recursive in nature.

Name: Anonymous 2013-06-22 6:14

>>55
He's right about self application though. If you're bragging about your favorite funtional language you should at least know the basic gist of LAMBDA CALCULUS

Name: Anonymous 2013-06-22 6:18

>>53
a and (a,b) can be constrained to be the same.

>>54
fix. Haskell has it built in because you can't express it using its puny non-recursive type system.

>>56
a = (a,b) = ((a,b),b) = (((a,b),b),b) = ...
It's natural enough for me. Maybe it's just too much for you, being a goy and all.

Name: Anonymous 2013-06-22 6:31

>>57
Why is lambda calculus important? What are its advantages? By the way, lithp itself is only very remotely related to lambda calculus.

Name: Anonymous 2013-06-22 6:32

>>58
Because that's just simply not how tuples are defined in Haskell. How couldn't you get over that?
You can do the following if you're so anally about that though:
data Tuple a b = Tuple (Tuple a b) b| NIL
Now if x has the type Tuple a b, it can be unified with a tuple with the type Tuple x y (y has the type b of course).

Name: Anonymous 2013-06-22 6:34

>>59
I just mean that self application is just some basic shit that you shouldn't react all like ``WTF IS THAT SHIT'' about if you called yo, that's all.

Name: Anonymous 2013-06-22 6:34

>>60
a tuple with the type Tuple x y (y has the type b of course)
What you're saying is y is a type that has the type b. You've spent too much time here with these lishp-retoids.

Name: Anonymous 2013-06-22 6:35

>>61
*called yourself a functional programmer.

Name: Anonymous 2013-06-22 6:35

>>61
What is it useful for? Why do we need it? What is the type of f if f can be applied to itself?

Name: Anonymous 2013-06-22 6:37

>>62
Yeah, I was going to say ``a tuple with the value ``Tuple x y''''.

Name: Anonymous 2013-06-22 6:38

>>58
...and then you end up spewing (declare) everywhere because you cannot into static typing.

Name: Anonymous 2013-06-22 6:41

>>64
f is a function that take a function that take a function that....
Well, you can define it and do useful shit with it in untyped lambda calculus, but Haskell doesn't really need it.

Name: Anonymous 2013-06-22 6:41

>>67
useful shit
untyped lambda calculus
DIVISION BY ZERO ERROR

Name: Anonymous 2013-06-22 6:44

>>68
Useful for barebone untyped lambda calculus, of course.
Gosh, you're just as much anally frustrated as the other doubly linked anus Lithper.

Name: Anonymous 2013-06-22 6:46

If lisp is mental masturbation, what is haskell?

Name: Anonymous 2013-06-22 6:47

If lisp is mental masturbation, what is haskell?
Statically typed mental masturbation.

Name: Anonymous 2013-06-22 6:47

>>59
By learning the untyped lambda calculus, you'll realize why haskell sucks. It's safe, but it's weak.

>>60
I don't doubt that you can define your own data type for that example. Although, to match the recursive type exactly, it would be data Tuple a b = Tuple (Tuple a b) b. The type can't include NIL, as there no case to handle that in the original code. But the issue I have is that this isn't done in type inference. It's a hole in the feature. With this example, you have no choice but to define your own datatype. Some people would say that is more self-documenting, but then at that point you may as well throw out type inference all together and force type declarations everywhere.

And then with self application you aren't so lucky. Although maybe there is a work around for that as well.

Name: Anonymous 2013-06-22 6:47

Lazily haxed anus masturbation.

Name: Anonymous 2013-06-22 6:49

The only type I need is the word.

Name: Anonymous 2013-06-22 6:50

>>72
By learning simply-typed lambda calculus, you'll realize why lisp sucks. It's unsafe, and it's weak.

Name: Anonymous 2013-06-22 6:57

>>75
But Lisp is safe. You can't do retoid computation like (/ 1 x) where x = 0.

Name: Anonymous 2013-06-22 6:58

>>76
^ the lishp-imbecile idea of safety.

Name: Anonymous 2013-06-22 6:58

>>75
\x -> x x

Name: Anonymous 2013-06-22 6:59

^ the haskall-anal idea of ``safety''.

Name: Anonymous 2013-06-22 6:59

>>77
Static typing does not prevent division by zero.

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