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

Problem w/ FP

Name: Anonymous 2012-02-09 22:49

Functional programing makes simple things nearly imposible to do . for example I found this exercise on reddit

"create a program that will ask the users name, age, and reddit username. have it tell them the information back, in the format:
your name is (blank), you are (blank) years old, and your username is (blank)
for extra credit, have the program log this information in a file to be accessed later."

At first I dismissed it as stupidly trivial but then thought, is there even a way to do this in scheme? And I couldnt think of one. This just shows that scheme sucks for programs used by users. There is no sequential steps to actually accomplish anything

Name: Anonymous 2012-02-10 14:42

CAWBOL

Name: Anonymous 2012-02-10 14:44

import Control.Applicative ((<$>), (<*>))

prompt :: String -> IO String
prompt str = putStr (str ++ ": ") >> getLine

main :: IO ()
main =
  putStrLn =<<
    (\name age username -> "your name is " ++ name ++ ", you are " ++ age ++ " years old, and your username is " ++ username)
      <$> prompt "Name"
      <*> prompt "Age"
      <*> prompt "Username"

Name: Anonymous 2012-02-10 15:06

Look at all these shitty ugly solutions, Haskell is shit and so are its users.

Name: Anonymous 2012-02-10 15:10

>>43
You're mommas a Monoid of lard.

Name: Anonymous 2012-02-10 15:15

>>44
nice dubs bro

Name: Anonymous 2012-02-10 15:35

IO
The interface between logic and raging monkeys that is always shitting up the purity of our programs.

Name: Anonymous 2012-02-10 15:43

>>46
Programs that have no observable effects can be optimized to a no-op.

Name: Anonymous 2012-02-10 16:04

>>47
Nah, it's just a lazy computation that never gets evaluated.

Name: Anonymous 2012-02-10 18:37

>>47
Most of /gorp/ code could be optimized to main() { return *((int*)0); }.

Name: Anonymous 2012-02-10 21:02

I couldnt think of one
This just shows that scheme sucks

No, it shows that you're a fucking mental midget. Fuck off back to reddit you talentless piece of shit.

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