Comment

Comment by nemo1618

Nice, but I was hoping for something like:

  slice :: Int{1..} -> [a] -> [[a]]
  slice n l =
    splitAt n l & \(a, b) -> a : slice n b
I don't think this is possible in Haskell. Is there a language that supports this sort of syntax?

(Also, what's up with that &? It doesn't seem to be a Prelude operator.)

parent nemo1618 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton