Hacker News new | ask | show | jobs
by kovrik 3641 days ago
I find Shen lang interesting, but never actually tried it. Can anyone explain few things?

1. Why explicitly call `prolog?` function? Why not make it implicit, so user could use, for example, `member` function (defined via `defprolog` notation) as a normal function?

2. Automatic partial application. I see that example was simplified, but then how it looks in reality? Because I find (* 2) returning `lambda`, instead of 2 confusing.

1 comments

In math ( * ) is a binary operation. ( * 2) returning 2 is confusing to everyone that hasn't gotten used to a non-standard way of thinking about * .
> In math ( * ) is a binary operation.

https://en.wikipedia.org/wiki/Empty_product

I am talking about Empty Product.

In all Lisps I know ( * ) returns 1, (* n) returns n. Which makes sense.

Shen's example is confusing for me.

* :: a -> a -> a

Π :: {a} -> a

This would make nonsense out of exponents less than 2. Fortunately, they actually make perfect sense.