THIS DRAFT HAS MOVED TO https://github.com/owickstrom/kashmir.
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
defmodule BinaryConcat do | |
def run do | |
data = | |
<<65, 32, 119, 97>> <> | |
<<114, 110, 105, 110>> # <- binary concatenation operator missing here | |
<<103, 32, 112, 101>> <> | |
<<114, 104, 97, 112, 115, 63>> | |
IO.puts <<data :: binary>> | |
end |
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
(require '[clojure.core.typed :as t]) | |
; This seem to work nicely | |
(t/cf (identity 1)) ;=> [(t/Val 123) {:then tt, :else ff}] | |
; And this | |
(t/cf pmap) ;=> (All [c a b ...] (t/IFn [[a b ... b -> c] (t/NonEmptySeqable a) (t/NonEmptySeqable b) ... b -> (t/NonEmptyASeq c)] [[a b ... b -> c] (t/U nil (Seqable a)) (t/U nil (Seqable b)) ... b -> (t/ASeq c)])) | |
; But when I combine the two... | |
(t/cf (pmap identity [1 2 3]) ;=> Type Error (/tmp/form-init5174330476817989076.clj:1:7) Polymorphic function pmap could not be applied to arguments: |
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 Debug.Trace | |
data T = A | B Number | |
instance eqT :: Eq T where | |
A == A = true | |
(B v1) == (B v2) = v1 == v2 | |
_ == _ = false |
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 Control.Applicative | |
-- value with type a is only for demo purposes, it would be supplied | |
-- asyncronously in Rackla (or with messages, I don't know how it works | |
-- exactly). | |
data PID a = PID a deriving (Show) | |
instance Functor PID where |
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 Test.Spec where | |
import Debug.Trace | |
import Control.Monad | |
import Control.Monad.Error.Class | |
import Control.Monad.Trans | |
import Control.Monad.Eff | |
import Control.Monad.Eff.Exception | |
import Control.Monad.Eff.Class | |
import Control.Monad.Aff |
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
{ | |
"graph": { | |
"label": "Some Title", | |
"metadata": { | |
"id": "uc1" | |
}, | |
"nodes": [ | |
{ | |
"id": "user", | |
"label": "User", |
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
(ns scratch.core | |
(:require [clojure.core.typed :as t])) | |
(t/defalias DropboxEntry | |
(t/Rec [x] | |
(t/U '{:type (Value :file) | |
:path String | |
:mime-type String} | |
'{:type (Value :directory) | |
:path String |
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 class Thing | |
{ | |
public long ThingId { get; set; } | |
public string Name { get; set; } | |
public string Description { get; set; } | |
} |
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
#lang racket | |
(require "minikanren/mk.rkt") | |
(struct e/var (name) #:transparent) | |
(struct e/app (fn param) #:transparent) | |
(struct e/lam (arg body) #:transparent) | |
(define (t/fn domain range) | |
(list ':fn domain range)) |
OlderNewer