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

Show me functional IO

Name: Anonymous 2007-08-17 0:27 ID:qrTUeVE5

IO is not referentially transparent. Show me functional I/O. Then show me the same thing imperatively. Which is simpler.

Name: Anonymous 2007-08-17 1:11 ID:yt3VJBYn

I/O isn't really done in functional languages, because those languages only exist for theoretical purposes.

Name: Anonymous 2007-08-17 8:25 ID:Heaven

Show me an oxymoron.

Name: Anonymous 2007-08-17 10:12 ID:u+rS1G9h

C io: printf("%d", 3);
Haskell io: print 3

lol

Name: Anonymous 2007-08-17 10:19 ID:lQfsGlCa

The idea (in Haskell):

doSomething :: World -> World

print :: a -> World -> World

It's very simple really.

Name: Anonymous 2007-08-17 10:25 ID:/4AmOB2A

>>1
Judging from >>4 , I'd say Haskell is clearly simpler. Are you trying to make some sort of statement? Speak your mind.

Name: Anonymous 2007-08-17 10:32 ID:dducprHi

Only novice programmers care about their programs' output.  Satori programmers don't even write their programs down, they don't even have to think about the programs -- they already know the answer.

Name: Anonymous 2007-08-17 13:55 ID:2n0j+IS/

No program can be truly functional, because time passes destructively and irreversibly as it runs.

Disclaimer:  I am a functional programmer.

Name: Anonymous 2007-08-17 14:01 ID:p1ALdnL5

Does LISP has STDIN?

Name: Anonymous 2007-08-17 14:04 ID:Heaven

>>9
*facepalm*

Name: Anonymous 2007-08-17 14:16 ID:u+rS1G9h

>>9
Is STDIN a list?

Name: Anonymous 2007-08-17 14:18 ID:u+rS1G9h

>>9
Does it bug anyone else how Lisp is the first thing that pops into everyone's mind when the words "functional programming" appear?

Name: Anonymous 2007-08-17 14:25 ID:qXou5ahM

>>12
Kind of yes. It does both functional programming and Lisp a great disservice.

Name: Anonymous 2007-08-17 14:26 ID:u+rS1G9h

>>13
Yes. It's a LIST PROCESSING language, people. That happens to be flexible enough to allow something resembling FP, but that's not what it is.

Name: Anonymous 2007-08-17 15:01 ID:8sTPQtT/

IM READING YOUR FUNCTIONAL PROGRAMMING THINKING ABOUT LISP

Name: Anonymous 2007-08-17 15:10 ID:Heaven

>>15
Show me other functional languages that don't suck..

Name: Anonymous 2007-08-17 15:28 ID:Heaven

>>7
God damn that joke is old.

Do you tell the same joke over and over to your friends?

Do they stay friends with you?

Name: Anonymous 2007-08-17 15:37 ID:Heaven

>>16
ECMAScript
Factor
C#

unless you want purely functional languages, but lisp isn't purely functional.

Name: Anonymous 2007-08-17 15:42 ID:Heaven

>>16
PHP

Name: Anonymous 2007-08-17 16:03 ID:Heaven

>>17
My other car is a cdr.

I have no friends, that why I'm here at /prog/.

Name: Anonymous 2007-08-17 16:11 ID:qrTUeVE5

>>6
print 3 is not a valid answer. Only 5 bothered trying to give a real answer.

Well the printing is a side effect. The return of print is an arbitrary value, the IO occurred externally. Which is silly because if you rely on laziness you need to know when the side effects of IO are required or not.

Try reading a list in.

Name: Anonymous 2007-08-17 16:47 ID:Heaven

>>19
Enjoy your flawed security.

Name: Anonymous 2007-08-17 21:51 ID:kcSOtizV

(input)
 )out(

Name: Anonymous 2007-08-17 22:11 ID:1Zd6TYY6

>>8
Win

>>14
Lisp is like most languages that borrow from it (Python, Ruby, JavaScript, Lua): a bit of everything, so you can use the right tool for the right job at the right time.

Name: Anonymous 2007-08-17 23:29 ID:djIfg4hV

>>13
>>14
it's one of the oldest, if not the oldest, language that supports functional programming. not pure, but still. it supports it.

Name: Anonymous 2007-08-17 23:39 ID:Heaven

The best program in the whole eternity (written in lisp) -- behold:
x

Name: Anonymous 2007-08-17 23:57 ID:u+rS1G9h

>>26
That variable doesn't even seem to be bound.

Name: Anonymous 2007-08-19 23:51 ID:h072jnb6

Programs that do I/O aren't purely functional. But programs that don't do I/O are boring and pointless. Therefore it's better to specify I/O in a manner that preserves referential transparency and obeys most of the conventions of the functional language underneath. Hence the IO monad in Haskell.

That good enough? No? Then go suck on some "uniqueness types" in Clean. Hint: they don't do parser monads in Clean.

Name: Anonymous 2007-08-20 5:32 ID:mLERogCq

Omae monad

Name: Anonymous 2007-08-20 5:52 ID:XE/iz0zI

>>29
I see what you did there.

Name: Anonymous 2007-08-20 5:53 ID:XE/iz0zI

>>30
also,  my ID is awesome

Name: Anonymous 2007-08-20 11:53 ID:UYyo6+r0

NP Type System

Name: Anonymous 2007-08-20 11:54 ID:UYyo6+r0

>>28
Right but monadic style is not simple. You can't do functional I/O in a simple manner without taking massive hits.

Name: Anonymous 2007-08-20 11:58 ID:jizBIDBZ

>>33
So? If your brain is underdeveloped, maybe you should quit programming.

Name: Anonymous 2007-08-20 16:17 ID:q9T/u4Uk

>>34

Yet the computer is not a functional device and you're adding unnecessary semantics for the sake of a methodology which doesn't even help you finish programs!

Name: herc 2007-08-20 16:32 ID:ZE+6eXHy

there are chips optimized for functional programming ( haskell, if i remember right) . those chips might be fast enough

Name: Anonymous 2007-08-20 17:23 ID:1vtoBzcw

>>35

Yet the problems we want to solve with computers are many times not imperative.  Fuck if the CPU isn't functional; it's a better layer to work with.

Name: Anonymous 2007-08-20 19:33 ID:i+RACIuI

>Fuck if the CPU isn't functional; it's a better layer to work with.

Well, then your solution will be so slow that you might as well not use a computer to solve it.  </thread></forum></internet></known-universe></entirety-of-all-existences></essence-of-matter-space-energy>

Name: Anonymous 2007-08-20 20:18 ID:ledHqLSz

>>38 lol how do i look clueless on internet?

Name: Anonymous 2007-08-20 20:56 ID:zApKazP0

>>38
ONE WORD, THE LAMBDA PAPERS, THREAD OVER

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