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

Pages: 1-4041-8081-

Immutable data

Name: Anonymous 2013-07-25 18:01

What kind of idiot needs to have his data kept constant to keep himself from breaking something? If you can't keep your shit in order without stupid artificial constraints, then you don't know shit about programming.

Name: Anonymous 2013-07-25 18:07

Hah, that's the one thing I don't like about Perl 6, immutable Match objects.

Name: Anonymous 2013-07-25 18:14

What kind of idiot needs to obey a certain restriction meant to reduce programming errors? If you can't keep your shit in order without stupid artificial constraints, then you don't know shit about programming.

Name: Anonymous 2013-07-25 18:16

>>1
Well what happens if the program enters a function *before* the args are bound to the values? How would you control something like that. And if you say use Lisp, I will bitchslap you with your moms dick.

Name: Anonymous 2013-07-25 18:17

What kind of idiot needs to have his data kept mutable to keep himself from building something correctly? If you can't keep your shit in order without stupid artificial mutable data, then you don't know shit about Haskell.

Name: Anonymous 2013-07-25 20:45

>>5
Haskell is not for programming with, it is for circlejerking over. I doesn't even really need any sort of data. In fact, there have been numerous studies done that proved that there has not once in the entire history of Haskell, where it was used for anything practical.

Name: Anonymous 2013-07-25 21:21

I doesn't
This about concludes my argument.

I have written a full-scale deployed botnet using Tor in Haskell.

What was that about,
numerous studies ?

Name: Anonymous 2013-07-25 21:56

Name: Anonymous 2013-07-25 22:53

>>7,8
None of that is useful, nor was it practical to write in Haskell instead of some other language. My thesis is unfalsifiable, you cannot object.

Name: NOT NOT == TRUE 2013-07-26 0:17

>>9
[thesis required]

(defun useful
do not read my email address, please!

Name: Anonymous 2013-07-26 0:29

>>9
You, sir, are a ("8" ++ (repeat '=') ++ "D").

Name: Anonymous 2013-07-26 14:02

Monads are stupid.

Name: Anonymous 2013-07-26 14:32

>>12
Doesn't understand monads.
Calls them stupid.

Name: Anonymous 2013-07-26 14:37

>>13
Fine sir. May I ask you who the fuck are you quoting?

Name: youtu.be/aP0m-PJozWo 2013-07-26 14:46

>>11
Thank you 3
That is an honour.

>>13
I know right
It should have been typed as:
The usage of Monads for programming is an efficient way to group procedures with the desired outcome.

Name: can't handle these sums 2013-07-26 15:04

Name: Anonymous 2013-07-26 15:15

>>16
The word "monads" doesn't even appear in that text. Please don't quote something that has not been said.

Name: Anonymous 2013-07-26 15:50

>>12

They are over-hyped imho. The structure of a monad is very simple. They are endofunctors with some extra structure. The only thing they work quite well, is that they can represent the idea of sequential computations. 

For example the free monad is a tree like structure, where the nodes are commands and the leaves are values. It is free, in the sense it is the most minimal definition, which follows the monad laws and thus is free of interpretation.

What is this structure? It is an abstract syntax tree. Thus an evaluator for a monad is an interpreter.  With monads we can model most imperative constructs. State? Coroutines? Logging? Exceptions? It is a monad. We can define it by adding structure to the free monad. 


A monad is easy to spot. If you find a functor, which has some operation: prob (prob a) -> prob a, you found yourself prob(ably) a monad.

Why does this all work. Two things. The join operation, allows the compiler to join two contexts together. This is effectively what bind does. It first maps the functor with some action: a -> m a. Thus we get m (m a). In m we can add a lot of extra structure (eg. state). This structure is then collapsed with join: m (m a) -> m a. This way we can hide a lot of effects in the structure of m.

Another reason is that they make code sequential, recall the third law:


(f a >>= g) >>= h = f a >>= (\b -> g b >>= h)


We can read the right side as, before calculating the next step we have to calculate the previous step. 

Monads are simple. This simplicity makes them stupid. It are not very interesting objects from my point of view. 

What is interesting is if their are other categories, which can model computations. Arrows are such a category, but these were a miss.

A lot of arrows are monads too. For example the state arrow:

newtype State a b = State ((s, a) -> (s, b))

is simple the kleisli arrow of the state monad.

Look at the state monad:

(s -> (s, a))

Now throw the kleisli transformer over it, which is an operation (a -> m b) -> (Kleisli m a b)

If we strip the last term we get:

(a -> s -> (s, b))

Which gives the arrow we already had:

(a,s) -> (s,b)

A lot of interesting arrows cannot be implemented, because they can't give arr.

Name: Anonymous 2013-07-26 16:08

>>14,17
You seem to have gotten lost. I believe that this is the imagereddit that you are looking for: http://boards.4chan.org/jp/ .

Name: Anonymous 2013-07-26 16:14

>>18
The Haskell Nomad has returned!

Name: Anonymous 2013-07-26 16:19

>>19
/anus/ ⊆ /jp/

Name: Anonymous 2013-07-26 16:20

>>18
The structure of a monad is very simple. They are endofunctors with some extra structure.
I'm part of the unwashed swines and I found your post funny, because I don't even know what the fuck is an endofunctor and that doesn't look very simple to me.

Name: Anonymous 2013-07-26 16:38

>>22

But it is. An endofunctor is nothing more than saying:

We have an operation fmap : (a -> b) -> f a -> f b

Which should behave as follow:


fmap f . fmap g = fmap (f . g) -- I can fuse computations
fmap id = id -- And I don't change the container


It is endo, because it doesn't send it's objects to another category. It is a functor, because it preserves structure.

A well known functor is an array:


map : (a -> b) -> [a] -> [b]


Which in perl is:


sub map {
 my $f = shift;
 my $xs = shift;
 my $ys = [];
 for my $x(@$xs){
    $ys[] = $f->(x);
 }
 return $ys;
}


Everything which follow these laws is a functor. For the monad we have a couple of extra laws. But again, everything which follow those laws is a monad. It is like a design pattern, but than more defined and thus easier to find and apply.

It is not hard, you only need to forget about all those stupid monad tutorials and grab a book about category theory: www.maths.ed.ac.uk/~aar/papers/maclanecat.pdf‎

Name: Anonymous 2013-07-26 16:42

Actually better take this one, I think many here have a CS background: www.math.mcgill.ca/triples/Barr-Wells-ctcs.pdf‎

And you need to see how to translate the abstraction to a computer program, before you  are able to work with them properly.

Name: Anonymous 2013-07-26 16:44

Name: Anonymous 2013-07-26 17:28

>>25
Yup, Haskell is once again laying the smack down on the mental midgets.

Name: Anonymous 2013-07-26 17:30

>>26
Hip hip, Hurray!

Name: Anonymous 2013-07-26 17:41

>>23
Thank you. I don't have any knowledge about Haskell and would have appreciated it more if it were written in standard notation, but I'll try to find more about that. I haven't taken any course on category theory, which is why I don't understand all this monad sorcery.

>>25
It doesn't really help to know the definition of a functor (a function, says the dictionary, but then how is it any different from f: R -> R; x |-> f(x)?) or the meaning of the prefix endo-, for the aforementioned reasons.

Thank you anyway.

Name: Anonymous 2013-07-26 22:16

29 get

Name: Anonymous 2013-07-28 13:59

30 get

and checked them >>33

Name: Anonymous 2013-07-28 14:03

thank

Name: Anonymous 2013-07-28 14:03

you

Name: Anonymous 2013-07-28 14:03

>>30-san

Name: Anonymous 2013-07-28 14:19

Thread reported.

Name: Anonymous 2013-07-28 14:33

This thread has some interesting information in it >>34-chan.

Name: Anonymous 2013-07-28 14:34

>>35
You realize he probably isn't reporting anything, right?

Name: Anonymous 2013-07-28 14:39

I tink ``Thread reported.'' is a meme.

Name: Anonymous 2013-07-28 14:47

>>35
The I HAVE A GIGANTIC PENIS thread should be reported. It fucks the layout up. This thread has some moderate interesting information.

Name: Anonymous 2013-07-28 15:09

>>38
Where is the GIGANTIC PENIS thread? I want to read it.

Name: Anonymous 2013-07-28 15:21

By reporting everything, it decreases the effectiveness of moderation and forces the mods to examine each thread before clicking delete. Eventually they will stop caring and ignore reports on /prog/. This is a good way to fight the /le bacqseat mod/-faggot.

Name: Anonymous 2013-07-28 15:31

>>40
I think it's more likely they'll just start deleting everything in the queue.

Name: Anonymous 2013-07-28 15:36

>>41
Maybe, but moot doesn't like it when they do that. He'll tell them to lay off if we complain enough (and being annoying is something we quite excel at).

Name: Anonymous 2013-07-28 15:38

>>42
The only problem is the moderation advocate is one of us, and is just as good at persistently complaining as we are.

Name: Anonymous 2013-07-28 15:44

>>43
the moderation advocate
There's more than one of us. We're everywhere. We bag your groceries. We scrub your toilets. We clean up your spill on aisle five. We pleasure you in the front seat of your pickup truck behind the Taco Bell. Don't. Fuck. With. Us.

Name: Anonymous 2013-07-28 15:47

>>44
There is one particularly devoted one that will actually respond to us when we talk about it, moderation advocate. The others are more passive.

Name: Anonymous 2013-07-28 16:01

>>40
I will start reporting every single post on /prog/ then.

I suppose this can be done with bots and subject.txt.

Name: Anonymous 2013-07-28 16:15

>>44

I program sometimes you elevator. I never scrubbed toilets. And I never pleasured someone at behind the Taco Bell. I never even went to a Taco Bell.

Name: Anonymous 2013-07-28 16:35

>>47
Oh, it must have been behind McDonald's then, I forget these things sometimes.

Name: Anonymous 2013-07-28 16:42

>>48

I am more a Burger King person myself. I have trained myself to be able to put the biggest burger in my mouth, thinking about the salty taste of bacon, while I feel my orbicularis oris muscle (the sphincter of your mouth) is completely stretched out. I also put it deep in my throat, such that I am unable to gag. Somehow I find this mildly exciting, but I don't know why.

What is the missing link? What do I want?

Name: Anonymous 2013-07-28 16:58

>>49

faggot reported

Name: Anonymous 2013-07-28 17:41

>>46

>get up
>check reported threads list
>over 29,000 threads have been reported
>go back to sleep


The proper way to do would be to hax shiichan, get the ip address of the reporter, hax the reporter, and get the reporter to report every thread on /prog/. And then automate it so that it happens every time the reporter announces his report.

Name: Anonymous 2013-07-28 17:53

>>51
>le e/g/in quotes
>le memes
>le mfw
>le 2013
>le implyting
LLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLL E/G/IN WIN /G/RO XDDDDDDDDDDDDDDDDDDDDDD

Name: Anonymous 2013-07-28 17:55

My immutable data goes in ROM, because I have 32K of that but only 8K of RAM.

Name: Anonymous 2013-07-28 18:15

Flashable ROM is just a really slow RAM.

Name: Anonymous 2013-07-28 19:37

>>5
Well, my favourite window manager is written in haskell.  I love it very much and I am yet to try a window manager at least half as good.  Also, the nicest (and slowest, sadly) revision control system was also written in haskell.

Name: Anonymous 2013-07-28 20:19

>>55
Does it still have that thing where it pegs the CPU at 100% for no goddamn reason at all with no other processes running?

Name: Anonymous 2013-07-28 21:09

>>55
And i3 beats the shit out of xmonad. Heck, even againts StumpWM and CLFSWM, xmonad can't compare at all.

darcs? That piece of shit? It never delivered, and crashed all the time. At the time, Monotone was a better option than that shit. Now Fossil is (after Mercurial) the best option.

Name: Anonymous 2013-07-29 0:12

i7 > i3

Name: Anonymous 2013-07-29 0:18

reported

Name: Anonymous 2013-07-29 0:54

>>58
Strictly speaking, you want |i7| > |i3|, unless you're using a version of > that is defined in something other than R.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-07-29 1:17

>>60
That > is defined by Intel.

Name: Anonymous 2013-07-29 2:16

>>1
Suppose integers are mutable, then 5=2+2 is possible. But that is nonsense! Therefore some data shouldn't be mutable.

Name: Anonymous 2013-07-29 2:25

>>62
All functions should be pure.
Especially if you want pure programs.

Name: Anonymous 2013-07-29 3:43

>>62
You are confusing `data' and `variables'. Data is trivially immutable, yet the restriction 2+2≠5 imposes no restrictions on variables which might, during the lifetime of the program, happen to hold 2 or 5.

Name: Anonymous 2013-07-29 3:47

>>64
Data is trivially immutable
what about set-car! and set-cdr!?

Name: ‮✌ me kcehc ☜☜‭ 2013-07-29 3:59

Name: Anonymous 2013-07-29 4:01

>>65
Again, that's changing the variables.  When I say `Data is trivially immutable' I really mean that.  If a register holds 0111010110110101, the contents of the register may change, but 0111010110110101 will never change.  It just may not be held by a variable at any particular time.  Yes, it's a fucking copout, but it's also true.

Name: Anonymous 2013-07-29 4:08

>>67
0111010110110101 cannot exist separate from register. It just gets permanently lost, until constructed again.

Name: Anonymous 2013-07-29 4:18

>>68
Sure. What I'm really saying is that the 2+2=4 constraint doesn't have anything to do with integers (the object/variable type) being mutable. It has to do with an abstraction of mathematics that the code doesn't necessarily follow.  The complaint of >>62 is based on an [intentional] mis-application of this abstraction to computer programs, and is easily shown to be absurd.

For example: Suppose no `data' is mutable.  Then create an array that addresses every bit in memory. Then this array is immutable, so nothing in memory can be changed. Thus the program cannot complete, no instructions can be loaded, no output can be performed, and the program counter (in a STACK BOY world, since I've already broken the third-and-a-half wall) cannot be saved. Thus a computer is almost completely useless.  So `data' should be mutable.

Name: Anonymous 2013-07-29 4:29

>>69
every bit in memory
Upon further thought, I guess that should be `byte'. I call poetic license anyway.

Name: Anonymous 2013-07-29 4:29

Reported.

Name: Anonymous 2013-07-29 4:40

>>71
are you dense?

Name: Anonymous 2013-07-29 4:43

>>72
i am sparse.

Name: Anonymous 2013-07-29 4:44

fkdfjdkksdlfjsdlfjsafjakf aksfjksad fa
df
asdf
asd
fasdf
a
sdf
asfd




































































asdfsd

Name: Anonymous 2013-07-29 4:46

>>73
Your brain is sparse.

Name: Anonymous 2013-07-29 5:20

>>56
Not, it doesn't do that anymore. It is quite a sophisticated system now, if you can program it yourself.

Name: 2013-07-29 19:30

Name: Anonymous 2013-07-29 21:15

>>77
You are so fucking reported. I can't believe you bring this shit in here again and again and again. "OH MY GOD I POSTED A PICTURE OF SOME FAGGOT POINTING AT A POST NUMBER AND MY NUMBER ENDED IN THREE REPEATED NUMBERS ZOMGROFLMFAO!!!11!!" You listen here you underaged shitdicked little cumguzzler: THIS. ISN'T. FUNNY. It's not cute or charming or something that gives people a smile, it's a waste of time, a waste of space, and an eyesore. You make me worry, really really really worry about the state of my generation. Where the hell is our world gonna go if it's run by shit-stained cuntminds like you that have NO originality and NO creative drive AT ALL. You contribute nothing at all to this board, nothing at all to your fellow peers. You are worse than a dumbass my asinine little friend, you are a black hole of faggotry and stupidity. You suck in the people around you and corrupt them with your cancerous posts. Your very existence is robbing this world of all things good. Leave this place, sell your computer, give the money to someone with brains who can wisely use it, and then kill yourself you waste of life. Die.

Name: Anonymous 2013-07-29 21:18

>>77
Nice dubs, bro.

Name: Anonymous 2013-07-29 21:44

>>72,73,75
HOLY SHIIIIIIIIIIIIIIIIIIIIIIIIIIIIT

Name: Anonymous 2013-07-29 21:49

>>78
U MAD?

Name: Anonymous 2013-07-29 21:59

My anus is sparse. Please populate it with some seed values, mix it around, and take it out and examine it.

Name: Anonymous 2013-07-30 1:22

MUTATE MY >>82 beat me to it.

Name: Anonymous 2013-07-30 1:26

My anus is a pseudo random shit generator.

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