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

The joke that is Haskell stdlib

Name: TRUE TRUTH EXPERT 2010-05-17 5:19

oBSERVE MY GOOD OL' FELLAS, THE JOKE THAT IS 'HASKELL STDLIB'. i DO NOT DOUBT THE EXCELLENCE IN HASKELL THEORY, BUT ALLOW ME TO MAKE FUN OF THE FRIVOLOUS LIBRARY THEY HAVE FOR STANDARD. LA-FUCKING-OWL.


-- | 'zip' takes two lists and returns a list of corresponding pairs.
-- If one input list is short, excess elements of the longer list are
-- discarded.
zip :: [a] -> [b] -> [(a,b)]
zip (a:as) (b:bs) = (a,b) : zip as bs
zip _      _      = []

;; I shall compare it with Communist Lisp
;; notice the solution is more general
;; and the documentation is built-in
(defun zip (&rest lists)
  "zip takes lists and returns corresponding pairs"
  (apply #'mapcar #'list lists))


o GUESS WAT! BAAA!!! hASKELL PROVIDES zip3 HOHOHOH. wAT ABOUT ZIP4 YOU ASSHOLES??

wAIT, WAIT. nOW IT GETS BETTER.


-- | 'unzip' transforms a list of pairs into a list of first components
-- and a list of second components.
unzip    :: [(a,b)] -> ([a],[b])
{-# INLINE unzip #-}
unzip    =  foldr (\(a,b) ~(as,bs) -> (a:as,b:bs)) ([],[])


;; La Communa lispa
(defun unzip (&rest lists)
  "list of pairs -> list of components"
  (apply #'zip lists))

oH SHIT!!!! fULL GENERAL SOLUTION WITH THE POWAH OF LISPA, HA SS KELL STDLIB IS A JOKE. dID YOU FUCKING LOL READING THIS POST?

Name: Anonymous 2010-05-18 5:34

Terminology
Define S to be the set of all touring complete languages. For a given language L in S with name N, let f(L) and g(L) be the number of Google results for the search queries "N" and "N fibs" respectively.

Definition 1
The fibs ratio of a language L, fibs(L) is defined as f(L)/g(L), g(L) ≠ 0.

Axiom 1 The well ordering property.
Let K be the set of all possible fibs ratios. Every nonempty subset of K has a least element.

Theorem 1
"Haskell" ∈ S.
Proof: Haskell is a touring complete language.1

Theorem 2
∀x ∈ S, fibs("Haskell") ≤ fibs(x).
Proof: Left as an exercise to the reader.

Corollary 1
Haskell is for basement dwelling nerds.
Proof: Directly follows from Theorem 2.

__________________________________
[sub]1. http://www.haskell.org/pipermail/haskell/2006-August/018355.html retrieved 18 May, 2009.[/sup]

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