Live data from Hacker News

A difference between Haskell and Common Lisp

chrisdone.com

201–203 of 203 posts

Re: A difference between Haskell and Common Lisp

#201

Earlier quoted context omitted.

I'm not exactly sure what semantics you intend, it seems like you might be able to spell this { foo; baz; } | grep bar | sort -rn | tail or, in bash only: cat This is assuming you didn't intend interleaving, for which the second syntax would work but you'd need something other than cat.

the EDIT: Unless you're just piping both of them to STDIN. piping two files to STDIN is useful, just not as useful as the thing that I wanted. This seems to be what you're doing.

It sets up a fifo, and passes in one end of it by name:

    $ echo 
So yeah, should be what you want for that use case :)

As I mentioned though, it's a bashism.

Re: A difference between Haskell and Common Lisp

#202
post #200
post #198

Earlier quoted context omitted.

> We don't trip over ourselves when writing imperative code Speak for yourself. Though I guess I'm more concerned with refactoring than with writing. In particular in imperative code it's very hard to tell the difference between semantically important ordering and accidental ordering. > when we do, it mostly has to do with IO or other OS state, and monads won't help you there. Yes they will? It's very normal to encap…

> it's very hard to tell the difference between semantically important ordering and accidental ordering. Not when effects are clearly marked. There is zero difference in that respect between continuations (i.e. imperative) and monads. It's only syntax and whatever your type system is. > It's very normal to encapsulate something of that nature with a monad. Sure, but a monad won't help you ensure their proper ordering…

> Not when effects are clearly marked. There is zero difference in that respect between continuations (i.e. imperative) and monads. It's only syntax and whatever your type system is.

Well, my experience is that refactoring code with an explicit =/I find it hard to understand what the change (compared to monads) you're advocating is. If you want to make the evaluation of a function not a value, then what semantics does it have? (and surely however elegant they are, having different semantics for the return value and the effects of a given call is always going to be more confusing than finding a way to express both in the same model).

> Sure, but a monad won't help you ensure their proper ordering.

It does. You can offer only safe operations - e.g. because I can use a monad to compose a sequence of database operations and store that as a value, I don't have to expose "begin transaction" and "end transaction" operations, only a "do this operation (potentially a composition of several operations and/or pure computations) in a transaction" operation.

Re: A difference between Haskell and Common Lisp

#203

Earlier quoted context omitted.

the EDIT: Unless you're just piping both of them to STDIN. piping two files to STDIN is useful, just not as useful as the thing that I wanted. This seems to be what you're doing.

It sets up a fifo, and passes in one end of it by name: $ echo So yeah, should be what you want for that use case :) As I mentioned though, it's a bashism.

Now I'm going to have to build a portable version of that. It shouldn't be too hard.
Post reply on HN