This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Data.Array.ST as STArray | |
import Control.Monad.Eff.Console (log) as Console | |
import Control.Monad.Eff (runPure, Eff) | |
import Control.Monad.Rec.Class (tailRecM) | |
import Control.Monad.ST (newSTRef, runST, readSTRef, writeSTRef, ST, STRef) | |
import Data.Array.ST (pushSTArray, emptySTArray, STArray) | |
import Data.Either (either, Either(Left, Right)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Draw { | |
void drawLine(double x1, double y1, double x2, double y2); | |
} | |
public class DrawUtil { | |
public static void drawBox(Draw draw, double x1, double y1, double width, double height) { | |
draw.drawLine(x1, y1, x1 + width, y1); | |
draw.drawLine(x1 + width, y1, x1 + width, y1 + height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="lib/jszip.min.js"></script> | |
</head> | |
<body> | |
<input type="file" id="file" name="file" /> | |
<output id="list"></output> | |
<script> | |
function handleFileSelect(evt) { | |
var f = evt.target.files[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Weak Ref) | |
+-------------+ +-----------------+ | |
| | | | (Returned) | |
V | | V | |
loop_s :: forall a b. (Stream a -> (Stream a, b)) -> (Stream a, b) | |
| ^ | |
| | (Returned) | |
+------------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Node { | |
id: u32, | |
rank: u32, | |
update: Box<FnMut()>, | |
children: Vec<Weak<Node>> | |
} | |
struct Context { | |
next_id: u32, | |
transaction_depth: u32, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import fj.F; | |
import fj.F2; | |
import fj.data.Option; | |
import java.lang.ref.WeakReference; | |
import java.util.Comparator; | |
import java.util.Optional; | |
import java.util.Vector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface DependsOnAnyOf { | |
fn dependsOnAnyOf(v: Vertex[]): boolean; | |
fn toFixedDependsOnAnyOf(): FixedDependsOnAnyOf? { | |
return null; | |
} | |
fn toDeferredDependsOnAnyOf(): DeferredDepensOnAnyOf? { | |
return null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data AwaitF a | |
= SelectRoof (RoofBlock -> a) | |
| AskDistIn (Double -> a) | |
| AskOverhang (Double -> a) | |
data YeildF a | |
= InsertRoof roofBlock a | |
data Mode = FreeT AwaitF YieldF () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Mode f m = Mode (f (m, Mode f m)) | |
-- f is a f-algebra representing the input the mode is wait on, it has a functor instance | |
-- m is a monoid representing the effects that get pushed out once the input gets recieved | |
-- f is like await | |
-- m is like yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.highj.typeclass1.alternative; | |
import org.derive4j.hkt.__; | |
import org.highj.data.List; | |
import org.highj.data.tuple.T1; | |
import org.highj.data.tuple.T2; | |
import org.highj.function.F1; | |
import org.highj.typeclass1.LazifyH; | |
import org.highj.typeclass1.monad.Applicative; |