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

invade this shitty huskel-nigger site

Name: Anonymous 2015-02-21 0:44

http://lambda-the-ultimate.org

no actual programmers or ``hackers'' here, just dumb huskel-niggers who haven't written more than a thousand lines in their entire pseudo-intellectual low-iq nigger academia lives. Those niggers actually posted a link to us and that's where the newfag huskel-niggers are coming from. We'll show them, /b/ style aka c and lisp master race one million lines in a day working for the military and science. Not industry(code word for web apping) or academia(code word for huskel).

how to spot the the-ultimate-nigger niggers on here: they call the-ultimate-nigger ``ltu'' when it should be tun like in tuna and not capitalized(show of respect, no respect for niggers).

Name: Anonymous 2015-02-21 0:51

Why the fuck is every second thread about Haskell or Lisp?

Name: Anonymous 2015-02-21 0:51

How about you just kill yourself. Just wrap your lips around the cold steel of that shotgun of yours. Make sure that the barrel is pointed at your brain so that you don't fuck it up.

Name: Anonymous 2015-02-21 1:01

>>3
Be nice.

Name: Anonymous 2015-02-21 8:21

spending times with retards who think haskell is good

yeah... I thinnk ill stay here, thanks.. kid

Name: Anonymous 2015-02-21 11:00

>>5
Whom are you quoting?

Name: Anonymous 2015-02-24 7:18

>>1
Where does a /prog/ link appear on that site?

Name: Anonymous 2015-02-24 17:41

>>2
Because other languages are too hopeless to talk about.

Name: Anonymous 2015-02-24 18:18

Why does everyone on this board hate Haskell so much?

Name: Anonymous 2015-02-24 18:21

>>9
Because they just want to be cunts on the Internet.
You'll find if you mention anything else, you'll get the same people saying how shitty it is compared to Haskell.

Name: Anonymous 2015-02-24 18:29

>>9
Because they can't master Haskell and can't master any category theory.

Name: Anonymous 2015-02-24 19:00

A-a-nyway, back to Haskell: Conor McBride rocks. Don't miss his excellent explanation of "indexed monads":

http://stackoverflow.com/questions/28690448/what-is-indexed-monad

As ever, the terminology people use is not entirely consistent. There's a variety of inspired-by-monads-but-strictly-speaking-isn't-quite notions. The term "indexed monad" is one of a number (including "monadish" and "parameterised monad" (Atkey's name for them)) of terms used to characterize one such notion. (Another such notion, if you're interested, is Katsumata's "parametric effect monad", indexed by a monoid, where return is indexed neutrally and bind accumulates in its index.)

First of all, let's check kinds.

IxMonad (m :: state -> state -> * -> *)

That is, the type of a "computation" (or "action", if you prefer, but I'll stick with "computation"), looks like

m before after value

where before, after :: state and value :: *. The idea is to capture the means to interact safely with an external system that has some predictable notion of state. A computation's type tells you what the state must be before it runs, what the state will be after it runs and (like with regular monads over *) what type of values the computation produces.

The usual bits and pieces are *-wise like a monad and state-wise like playing dominoes.

ireturn :: a -> m i i a -- returning a pure value preserves state
ibind :: m i j a -> -- we can go from i to j and get an a, thence
(a -> m j k b) -- we can go from j to k and get a b, therefore
-> m i k b -- we can indeed go from i to k and get a b


The notion of "Kleisli arrow" (function which yields computation) thus generated is

a -> m i j b -- values a in, b out; state transition i to j

and we get a composition

icomp :: IxMonad m => (b -> m j k c) -> (a -> m i j b) -> a -> m i k c
icomp f g = \ a -> ibind (g a) f


and, as ever, the laws exactly ensure that ireturn and icomp give us a category

ireturn `icomp` g = g
f `icomp` ireturn = f
(f `icomp` g) `icomp` h = f `icomp` (g `icomp` h)


or, in comedy fake C/Java/whatever,

g(); skip = g()
skip; f() = f()
{h(); g()}; f() = h(); {g(); f()}


Why bother? To model "rules" of interaction. For example, you can't eject a dvd if there isn't one in the drive, and you can't put a dvd into the drive if there's one already in it. So

data DVDDrive :: Bool -> Bool -> * -> * where -- Bool is "drive full?"
DReturn :: a -> DVDDrive i i a
DInsert :: DVD -> -- you have a DVD
DVDDrive True k a -> -- you know how to continue full
DVDDrive False k a -- so you can insert from empty
DEject :: (DVD -> -- once you receive a DVD
DVDDrive False k a) -> -- you know how to continue empty
DVDDrive True k a -- so you can eject when full


instance IxMonad DVDDrive where -- put these methods where they need to go
ireturn = DReturn -- so this goes somewhere else
ibind (DReturn a) k = k a
ibind (DInsert dvd j) k = DInsert dvd (ibind j k)
ibind (DEject j) k = DEject j $ \ dvd -> ibind (j dvd) k


With this in place, we can define the "primitive" commands

dInsert :: DVD -> DVDDrive False True ()
dInsert dvd = DInsert dvd $ DReturn ()

dEject :: DVDrive True False DVD
dEject = DEject $ \ dvd -> DReturn dvd


from which others are assembled with ireturn and ibind. Now, I can write (borrowing do-notation)

discSwap :: DVD -> DVDDrive True True DVD
discSwap dvd = do dvd' <- dEject; dInsert dvd ; ireturn dvd'


but not the physically impossible

discSwap :: DVD -> DVDDrive True True DVD
discSwap dvd = do dInsert dvd; dEject -- ouch!


Alternatively, one can define one's primitive commands directly

data DVDCommand :: Bool -> Bool -> * -> * where
InsertC :: DVD -> DVDCommand False True ()
EjectC :: DVDCommand True False DVD


and then instantiate the generic template

data CommandIxMonad :: (state -> state -> * -> *) ->
state -> state -> * -> * where
CReturn :: a -> CommandIxMonad c i i a
(:?) :: c i j a -> (a -> CommandIxMonad c j k b) ->
CommandIxMonad c i k b

instance IxMonad (CommandIxMonad c) where
ireturn = CReturn
ibind (CReturn a) k = k a
ibind (c :? j) k = c :? \ a -> ibind (j a) k


In effect, we've said what the primitive Kleisli arrows are (what one "domino" is), then built a suitable notion of "computation sequence" over them.

Note that for every indexed monad m, the "no change diagonal" m i i is a monad, but in general, m i j is not. Moreover, values are not indexed but computations are indexed, so an indexed monad is not just the usual idea of monad instantiated for some other category.

Now, look again at the type of a Kleisli arrow

a -> m i j b

We know we must be in state i to start, and we predict that any continuation will start from state j. We know a lot about this system! This isn't a risky operation! When we put the dvd in the drive, it goes in! The dvd drive doesn't get any say in what the state is after each command.

But that's not true in general, when interacting with the world. Sometimes you might need to give away some control and let the world do what it likes. For example, if you are a server, you might offer your client a choice, and your session state will depend on what they choose. The server's "offer choice" operation does not determine the resulting state, but the server should be able to carry on anyway. It's not a "primitive command" in the above sense, so indexed monads are not such a good tool to model the unpredictable scenario.

What's a better tool?

type f :-> g = forall state. f state -> g state

class MonadIx (m :: (state -> *) -> (state -> *)) where
returnIx :: x :-> m x
flipBindIx :: (a :-> m b) -> (m a :-> m b) -- tidier than bindIx


Scary biscuits? Not really, for two reasons. One, it looks rather more like what a monad is, because it is a monad, but over (state -> *) rather than *. Two, if you look at the type of a Kleisli arrow,

a :-> m b = forall state. a state -> m b state

you get the type of computations with a precondition a and postcondition b, just like in Good Old Hoare Logic. Assertions in program logics have taken under half a century to cross the Curry-Howard correspondence and become Haskell types. The type of returnIx says "you can achieve any postcondition which holds, just by doing nothing", which is the Hoare Logic rule for "skip". The corresponding composition is the Hoare Logic rule for ";".

Let's finish by looking at the type of bindIx, putting all the quantifiers in.

bindIx :: forall i. m a i -> (forall j. a j -> m b j) -> m b i

These foralls have opposite polarity. We choose initial state i, and a computation which can start at i, with postcondition a. The world chooses any intermediate state j it likes, but it must give us the evidence that postcondition b holds, and from any such state, we can carry on to make b hold. So, in sequence, we can achieve condition b from state i. By releasing our grip on the "after" states, we can model unpredictable computations.

Both IxMonad and MonadIx are useful. Both model validity of interactive computations with respect to changing state, predictable and unpredictable, respectively. Predictability is valuable when you can get it, but unpredictability is sometimes a fact of life. Hopefully, then, this answer gives some indication of what indexed monads are, predicting both when they start to be useful and when they stop.

Name: Anonymous 2015-02-25 5:34

>>9
I'm indifferent to Haskell but I happen to hate most of the haskellers I encounter on the internet because they generally exhibit a mild combination of arrogance and ignorance, which would be tolerable if it wasn't for their evangelicalism.

Name: Anonymous 2015-02-25 6:29

>>1
I'm still waiting for an answer to my question, judge.
Where does a /prog/ link appear on that site?

Name: Anonymous 2015-02-25 12:15

>>12
Damn that's a whole lot of bullshit and not too much code.

Name: Anonymous 2015-02-25 14:12

http://bbs.progrider.org/prog/read/1424483056

no actual programmers or ``hackers'' here, just dumb huskel-niggers who haven't written more than a thousand lines in their entire pseudo-intellectual low-iq nigger academia lives. Those niggers actually posted a link to us and that's where the newfag huskel-niggers are coming from. We'll show them, /b/ style aka c and lisp master race one million lines in a day working for the military and science. Not industry(code word for web apping) or academia(code word for huskel).

how to spot the the-ultimate-nigger niggers on here: they call the-ultimate-nigger ``ltu'' when it should be tun like in tuna and not capitalized(show of respect, no respect for niggers).

Name: Anonymous 2015-02-25 18:57

>>15
Damn you really are a low-brainer. Struggle with them words? Got an attention deficit disorder? Would prefer to just smoke weed all day?

Name: Anonymous 2015-02-26 9:07

>>17
Hey man can you even name a piece of software you use that's written in Haskell?

Name: Anonymous 2015-02-26 13:09

>>18
easy, GHC.

Name: Anonymous 2015-02-26 13:22

Name: Anonymous 2015-02-26 13:28

//TRIGGER WARNING:very high-level Haskell code below
#include "../includes/ghcconfig.h"

/* ******************************** PowerPC ******************************** */

#if defined(powerpc_HOST_ARCH) || defined(powerpc64_HOST_ARCH)
#if !(defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS))
/* The following code applies, with some differences,
to all powerpc platforms except for powerpc32-linux,
whose calling convention is annoyingly complex.
*/

/* The code is "almost" the same for
32-bit and for 64-bit
*/
#if defined(powerpc64_HOST_ARCH)
#define WS 8
#define LOAD ld
#define STORE std
#else
#define WS 4
#define LOAD lwz
#define STORE stw
#endif

/* Some info about stack frame layout */
#define LINK_SLOT (2*WS)
#define LINKAGE_AREA_SIZE (6*WS)

/* The following defines mirror struct AdjustorStub
from Adjustor.c. Make sure to keep these in sync.
*/
#if defined(powerpc_HOST_ARCH) && defined(darwin_HOST_OS)
#define HEADER_WORDS 6
#elif defined(powerpc64_HOST_ARCH) && defined(darwin_HOST_OS)
#else
#define HEADER_WORDS 3
#endif

#define HPTR_OFF ((HEADER_WORDS )*WS)
#define WPTR_OFF ((HEADER_WORDS + 1)*WS)
#define FRAMESIZE_OFF ((HEADER_WORDS + 2)*WS)
#define EXTRA_WORDS_OFF ((HEADER_WORDS + 3)*WS)

/* Darwin insists on register names, everyone else prefers
to use numbers. */
#if !defined(darwin_HOST_OS)
#define r0 0
#define r1 1
#define r2 2
#define r3 3
#define r4 4
#define r5 5
#define r6 6
#define r7 7
#define r8 8
#define r9 9
#define r10 10
#define r11 11
#define r12 12

#define r30 30
#define r31 31
#endif

.text
#if LEADING_UNDERSCORE
.globl _adjustorCode
_adjustorCode:
#else
.globl adjustorCode
/* Note that we don't build a function descriptor
for AIX-derived ABIs here. This will happen at runtime
in createAdjustor().
*/
adjustorCode:
#endif
/* On entry, r2 will point to the AdjustorStub data structure. */

/* save the link */
mflr r0
STORE r0, LINK_SLOT(r1)

/* set up stack frame */
LOAD r12, FRAMESIZE_OFF(r2)
#ifdef powerpc64_HOST_ARCH
stdux r1, r1, r12
#else
stwux r1, r1, r12
#endif

/* Save some regs so that we can use them.
Note that we use the "Red Zone" below the stack pointer.
*/
STORE r31, -WS(r1)
STORE r30, -2*WS(r1)

mr r31, r1
subf r30, r12, r31

LOAD r12, EXTRA_WORDS_OFF(r2)
mtctr r12
b 2f
1:
LOAD r0, LINKAGE_AREA_SIZE + 8*WS(r30)
STORE r0, LINKAGE_AREA_SIZE + 10*WS(r31)
addi r30, r30, WS
addi r31, r31, WS
2:
bdnz 1b

/* Restore r30 and r31 now.
*/
LOAD r31, -WS(r1)
LOAD r30, -2*WS(r1)

STORE r10, LINKAGE_AREA_SIZE + 9*WS(r1)
STORE r9, LINKAGE_AREA_SIZE + 8*WS(r1)
mr r10, r8
mr r9, r7
mr r8, r6
mr r7, r5
mr r6, r4
mr r5, r3

LOAD r3, HPTR_OFF(r2)

LOAD r12, WPTR_OFF(r2)
#if defined(darwin_HOST_OS)
mtctr r12
#else
LOAD r0, 0(r12)
/* The function we're calling will never be a nested function,
so we don't load r11.
*/
mtctr r0
LOAD r2, WS(r12)
#endif
bctrl

LOAD r1, 0(r1)
LOAD r0, LINK_SLOT(r1)
mtlr r0
blr
#endif

/* ********************************* i386 ********************************** */

#elif defined(i386_HOST_ARCH)

#define WS 4
#define RETVAL_OFF 5
#define HEADER_BYTES 8

#define HPTR_OFF HEADER_BYTES
#define WPTR_OFF (HEADER_BYTES + 1*WS)
#define FRAMESIZE_OFF (HEADER_BYTES + 2*WS)
#define ARGWORDS_OFF (HEADER_BYTES + 3*WS)

#ifdef LEADING_UNDERSCORE
.globl _adjustorCode
_adjustorCode:
#else
.globl adjustorCode
adjustorCode:
#endif
popl %eax
subl $RETVAL_OFF, %eax

pushl %ebp
movl %esp, %ebp

subl FRAMESIZE_OFF(%eax), %esp

pushl %esi
pushl %edi

leal 8(%ebp), %esi
leal 12(%esp), %edi
movl ARGWORDS_OFF(%eax), %ecx
rep
movsl

popl %edi
popl %esi

pushl HPTR_OFF(%eax)
call *WPTR_OFF(%eax)

leave
ret
#endif

/* mark stack as nonexecutable */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",@progbits
#endif

Name: Anonymous 2015-02-26 21:18

>>18
Pugs

Name: Anonymous 2015-02-26 23:20

>>20
So parts of GHC is written in C. C is a systems programming language and the Haskell language compiler is a reasonable application where C's strengths are useful.

Name: Anonymous 2015-02-27 0:33

>>20
you're so bent on arguing you missed the joke again

Name: Anonymous 2015-02-27 6:14

Name: Anonymous 2015-02-27 6:15

Name: Anonymous 2015-02-27 6:51

>>23
C is a systems programming language and the Haskell language compiler is a reasonable application where C's strengths are useful.
import Foreign.Autism
Non-sequitur GHC/Pugs are not operating systems.
Their job is to produce assembler/text/scripts from haskell text.
Compiler infrastructures are just tools for text transformation phases.
Having any C/asm dependency/includes means they're not as high-level/safe/pure as they claim and lack native flexibility to perform the transforms. i.e. their PURE FUNCTION AUTISM is a scam and Haskell is merely a huge abstraction layer over the low level arch-specific unsafe "byte shuffling".

Name: Anonymous 2015-02-27 7:11

It appears Haskell(the dog) requires Vitamin C to function
http://en.wikipedia.org/wiki/Eating_your_own_dog_food

Name: Anonymous 2015-02-27 7:40

>>26
is that some audrey tang wizardry?

Name: Anonymous 2015-02-27 8:39

>>26
Pure.

Name: Anonymous 2015-02-27 9:46

https://github.com/ghc/ghc/blob/master/rts/Interpreter.c
So safe, pure and functional.
/* Sp points to the lowest live word on the stack. */

#define BCO_NEXT instrs[bciPtr++]
#define BCO_NEXT_32 (bciPtr += 2)
#define BCO_READ_NEXT_32 (BCO_NEXT_32, (((StgWord) instrs[bciPtr-2]) << 16) \
+ ( (StgWord) instrs[bciPtr-1]))
#define BCO_NEXT_64 (bciPtr += 4)
#define BCO_READ_NEXT_64 (BCO_NEXT_64, (((StgWord) instrs[bciPtr-4]) << 48) \
+ (((StgWord) instrs[bciPtr-3]) << 32) \
+ (((StgWord) instrs[bciPtr-2]) << 16) \
+ ( (StgWord) instrs[bciPtr-1]))

#define LOAD_STACK_POINTERS \
Sp = cap->r.rCurrentTSO->stackobj->sp; \
/* We don't change this ... */ \
SpLim = tso_SpLim(cap->r.rCurrentTSO);

#define SAVE_STACK_POINTERS \
cap->r.rCurrentTSO->stackobj->sp = Sp
#define RETURN_TO_SCHEDULER(todo,retcode) \
SAVE_STACK_POINTERS; \
cap->r.rCurrentTSO->what_next = (todo); \
threadPaused(cap,cap->r.rCurrentTSO); \
cap->r.rRet = (retcode); \
return cap;

#define RETURN_TO_SCHEDULER_NO_PAUSE(todo,retcode) \
SAVE_STACK_POINTERS; \
cap->r.rCurrentTSO->what_next = (todo); \
cap->r.rRet = (retcode); \
return cap;

STATIC_INLINE StgPtr
allocate_NONUPD (Capability *cap, int n_words)
{
return allocate(cap, stg_max(sizeofW(StgHeader)+MIN_PAYLOAD_SIZE, n_words));
}

static StgWord app_ptrs_itbl[] = {
(W_)&stg_ap_p_info,
(W_)&stg_ap_pp_info,
(W_)&stg_ap_ppp_info,
(W_)&stg_ap_pppp_info,
(W_)&stg_ap_ppppp_info,
(W_)&stg_ap_pppppp_info,
};
cap->r.rHpLim = (P_)1; // HpLim is the context-switch flag; when it
// goes to zero we must return to the scheduler.
if (Sp[0] == (W_)&stg_enter_info) {
Sp++;
goto eval;
}
// Case 2:
//
// We have a BCO application to perform. Stack looks like:
//
// | .... |
// +---------------+
// | arg1 |
// +---------------+
// | BCO |
// +---------------+
// Sp | RET_BCO |
// +---------------+
//
else if (Sp[0] == (W_)&stg_apply_interp_info) {
obj = UNTAG_CLOSURE((StgClosure *)Sp[1]);
Sp += 2;
goto run_BCO_fun;
}
else {
goto do_return_unboxed;
}
// Evaluate the object on top of the stack.
eval:
tagged_obj = (StgClosure*)Sp[0]; Sp++;

eval_obj:
obj = UNTAG_CLOSURE(tagged_obj);
INTERP_TICK(it_total_evals);

IF_DEBUG(interpreter,
debugBelch(
"\n---------------------------------------------------------------\n");
debugBelch("Evaluating: "); printObj(obj);
debugBelch("Sp = %p\n", Sp);
debugBelch("\n" );

printStackChunk(Sp,cap->r.rCurrentTSO->stackobj->stack+cap->r.rCurrentTSO->stackobj->stack_size);
debugBelch("\n\n");
);

// IF_DEBUG(sanity,checkStackChunk(Sp, cap->r.rCurrentTSO->stack+cap->r.rCurrentTSO->stack_size));
IF_DEBUG(sanity,checkStackFrame(Sp));

switch ( get_itbl(obj)->type ) {

case IND:
case IND_PERM:
case IND_STATIC:
{
tagged_obj = ((StgInd*)obj)->indirectee;
goto eval_obj;
}

case CONSTR:
case CONSTR_1_0:
case CONSTR_0_1:
case CONSTR_2_0:
case CONSTR_1_1:
case CONSTR_0_2:
case CONSTR_STATIC:
case CONSTR_NOCAF_STATIC:
case FUN:
case FUN_1_0:
case FUN_0_1:
case FUN_2_0:
case FUN_1_1:
case FUN_0_2:
case FUN_STATIC:
case PAP:
// already in WHNF
break;

case BCO:
{
ASSERT(((StgBCO *)obj)->arity > 0);
break;
}

case AP: /* Copied from stg_AP_entry. */
{
nat i, words;
StgAP *ap;

ap = (StgAP*)obj;
words = ap->n_args;

// Stack check
if (Sp - (words+sizeofW(StgUpdateFrame)) < SpLim) {
Sp -= 2;
Sp[1] = (W_)tagged_obj;
Sp[0] = (W_)&stg_enter_info;
RETURN_TO_SCHEDULER(ThreadInterpret, StackOverflow);
}

/* Ok; we're safe. Party on. Push an update frame. */
Sp -= sizeofW(StgUpdateFrame);
{
StgUpdateFrame *__frame;
__frame = (StgUpdateFrame *)Sp;
SET_INFO((StgClosure *)__frame, (StgInfoTable *)&stg_upd_frame_info);
__frame->updatee = (StgClosure *)(ap);
}

/* Reload the stack */
Sp -= words;
for (i=0; i < words; i++) {
Sp[i] = (W_)ap->payload[i];
}

obj = UNTAG_CLOSURE((StgClosure*)ap->fun);
ASSERT(get_itbl(obj)->type == BCO);
goto run_BCO_fun;
}

default:
#ifdef INTERP_STATS
{
int j;

j = get_itbl(obj)->type;
ASSERT(j >= 0 && j < N_CLOSURE_TYPES);
it_unknown_entries[j]++;
it_total_unknown_entries++;
}
#endif
{
// Can't handle this object; yield to scheduler
IF_DEBUG(interpreter,
debugBelch("evaluating unknown closure -- yielding to sched\n");
printObj(obj);
);
Sp -= 2;
Sp[1] = (W_)tagged_obj;
Sp[0] = (W_)&stg_enter_info;
RETURN_TO_SCHEDULER_NO_PAUSE(ThreadRunGHC, ThreadYielding);
}
}

Name: Anonymous 2015-02-27 16:39

>>31
You cocksocker should use [code].

Name: Anonymous 2015-02-27 20:33

chech'em dubs

Name: Anonymous 2015-02-27 20:49

>>32
Don't tell my cocksocker what to do.

Name: Anonymous 2015-02-28 10:06

hask > [1, 3..6] :: [Integer]
[1,3,5]
hask > [1, 3..6] :: [Float]
[1.0,3.0,5.0,7.0]

Name: Anonymous 2015-02-28 13:18

>>34
Your joke isn't even a joke. Just a retardism.

Name: Anonymous 2015-03-01 9:19

>>36
Retardism isn't even a word according to merriam-webster, dictionary.reference.com and Cambridge dictionary.

Name: Anonymous 2015-03-01 9:33

>>37
You can consider it a proper noun.

Name: Anonymous 2015-03-01 16:57

>>36
It's hard to bring myself down to your level but I try.

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