Talk:Haskell

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

Factorial example[edit]

Regarding Revert Anon; let us charitably assume he doesn't realize this is a humor site on 12:54, June 8, 2012 by user:SPIKE

I don't get why this is not funny:

main = putStrLn "Input number" >> fmap (iterate ((<*>) ((<*>) (pure (<*>)) pure)) (pure unsafeCoerce) !!) readLn >>= (<*>) (pure (print :: Int -> IO ())) ((<*> (pure ((<*>) ((<*>) unsafeCoerce (pure (succ :: Int -> Int))) (pure 0))) ((<*>) ((<*>) ((<*>) (pure (<*>)) pure) (pure ((<*>) unsafeCoerce unsafeCoerce))) ((<*>) ((<*>) (pure (<*>)) pure) (pure ((<*>) unsafeCoerce unsafeCoerce))) ((<*>) (pure ((<*>) ((<*>) ((<*>) ((<*>) unsafeCoerce (pure ((pure :: a -> b -> a) ((pure :: a -> b -> a) unsafeCoerce)))) (pure (pure :: a -> b -> a))) (pure unsafeCoerce)))) ((<*>) (pure ((<*>) ((<*>) (pure ((<*>) :: (a -> b -> c) -> (a -> b) -> a -> c)) pure))) ((<*>) ((<*>) (pure (<*>)) pure) (pure ((<*>) ((<*>) (pure (<*>)) ((<*>) (pure ((<*>) (pure (<*>)))) ((<*> ((<*>) (pure (<*>)) ((<*>) (pure ((<*>) (pure (<*>)))) ((<*>) (pure ((<*>) (pure pure))) ((<*>) ((<*>) (pure (<*>)) pure) (pure ((<*>) (pure ((<*>) (pure ((<*>) unsafeCoerce)))) ((<*>) (pure ((<*>) (pure pure))) ((<*>) (pure ((<*>) unsafeCoerce)) pure)))))))) (pure (pure (pure :: a -> b -> a)))))) (pure (pure (pure unsafeCoerce)))))))))) >> main

When I first saw this example I found it more amazing and more funny than most examples at for example The International Obfuscated C code contest. It's amazing because it actually works and it is funny because it probably only works because of the type system hacks (due to the type annotations) and all unsafeCoerces. Using unsafeCoerce goes against all conventions which are usually employed when programming in Haskell. This example also seems to go well with the theme on the haskell page that interactive programs (i.e. programs that read from stdin) are hard to express using haskell (see for example System.IO.Unsafe.Really.IMeanIt.reallyReallyAbsurdlyUnsafePerformIOShameOnYou and ...had to be augmented by the best parts of Perl to actually do anything useful).

// David


Heh, the Zygohistomorphic Prepromorphism section is outdated and wrong. The real code is

 zygoHistoPrepro 
 :: (Unfoldable t, Foldable t) 
 => (Base t b -> b) 
 -> (forall c. Base t c -> Base t c) 
 -> (Base t (EnvT b (Stream (Base t)) a) -> a) 
 -> t
 -> a
 zygoHistoPrepro f g t = gprepro (distZygoT f distHisto) g t

taken from http://www.haskell.org/haskellwiki/Zygohistomorphic_prepromorphisms

// Boris

Douglas Adams joke[edit]

Yo, the phrase is "almost, but not quite, entirely unlike". To say instead "almost, but not entirely, unlike" is good comedy only if your comic purpose is to troll me. Fine, you got me, now fix the joke. The preceding unsigned comment was added by 173.59.124.238 (talk • contribs)

The quotation is almost, but not entirely, unlike what you say the phrase is. This could be editorial sloppiness, or it might be comedy aimed at persons entirely other than Your Majesty. I suggest you overcome the delusions of self-reference and pick a user name. Spıke Ѧ 03:47 22-Jun-14