Skip to content

Instantly share code, notes, and snippets.

View CheatEx's full-sized avatar

Alexey Zlobin CheatEx

View GitHub Profile
package main
import (
"fmt"
"log"
"net/http"
"os"
"sync"
"time"
)
@CheatEx
CheatEx / gist:dc7ee7e8bd0750f350c5a270095c792e
Created February 18, 2024 10:25
6.2.4 An Event-Based Variation
module examples/hotelEvents
open util/ordering[Time] as TO
open util/ordering[Key] as KO
sig Key, Time {}
sig Room {
keys: set Key,
currentKey: keys one -> Time
}
class LoginDemo {
type LoginResult = Either[UserInfo, String]
def Success[T, E] = Left[T, E] _
def Failure[T, E] = Right[T, E] _
//@rest.Method(httpMethod = Array(POST))
def login(request: rest.Request,
//@rest.Param(name = "login")
loginParam: String,
Uncaught Error: function cljs$core$map(var_args){
var G__11166 = arguments.length;
switch (G__11166) {
case 1:
return cljs.core.map.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
break;
case 2:
return cljs.core.map.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
Configuring elm-compiler-0.16...
Building elm-compiler-0.16...
Failed to install elm-compiler-0.16
Build log ( /home/zan/installed/Elm-Platform/0.16/.cabal-sandbox/logs/elm-compiler-0.16.log ):
Configuring elm-compiler-0.16...
Building elm-compiler-0.16...
Preprocessing library elm-compiler-0.16...
[ 1 of 85] Compiling Generate.JavaScript.Helpers ( src/Generate/JavaScript/Helpers.hs, dist/dist-sandbox-a9625549/build/Generate/JavaScript/Helpers.o ) [flags changed]
[ 2 of 85] Compiling Paths_elm_compiler ( dist/dist-sandbox-a9625549/build/autogen/Paths_elm_compiler.hs, dist/dist-sandbox-a9625549/build/Paths_elm_compiler.o ) [flags changed]
[ 3 of 85] Compiling AST.Literal ( src/AST/Literal.hs, dist/dist-sandbox-a9625549/build/AST/Literal.o ) [flags changed]
@CheatEx
CheatEx / gist:1125489
Created August 4, 2011 15:50
Draft for hs-style function-in-applicative usage
import scalaz._
import Scalaz._
trait AMA[M[_], A] extends PimpedType[M[A]] {
//just <*> with a swapped arguments
def <@>[X, Y](x: M[X])(implicit ev: A <:< (X=>Y), app: Apply[M], f: Functor[M]): M[Y] = app.apply(value map ev, x)
}
object Fs {