How to infer u
as '{:a Num}
in
(inc (:a u))
Step 1:
Import u
as type Unchecked(u)
Step 2:
#lang racket | |
(define (emit s) s) | |
(define (process-file in out) | |
(with-input-from-file in | |
(lambda () | |
(with-output-to-file out | |
#:exists 'replace | |
(lambda () |
(ns clojure.core.typed.test.mini-occ | |
{:lang :core.typed | |
:core.typed {:features #{:runtime-infer}} | |
} | |
(:require [clojure.test :refer [deftest is]] | |
[clojure.core.typed :as t] | |
[clojure.pprint :refer [pprint]])) | |
;; Start: Generated by clojure.core.typed - DO NOT EDIT |
Types in Clojure | |
================ | |
What is Typed Clojure? | |
- optional type system Clojure | |
- based on Typed Racket "Gradual typing" | |
- dynamic checking | |
- static checking <--- | |
Why is it built that way? |
(add-core-async-handler! :print-stuff [Any -> nil]) | |
(register-core-typed-emission async/handler (fn [[v kw & args]] `(~v ~kw ~@(map #(add-handler cast % kw) args))) | |
(register-core-typed-emission async/emit! (fn [[v kw & args]] `(~v ~kw ~@(map #(add-handler cast % kw) args))) | |
(handle :print-stuff prn) | |
;=> (handle :print-stuff (cast [Any -> nil] prn)) | |
(emit! :print-stuff "a") | |
;=> (emit! :printf-stuff (cast String "a")) |
References: http://www.azlyrics.com/lyrics/coldplay/whatif.html | |
https://tabs.ultimate-guitar.com/c/coldplay/what_if_crd.htm | |
F#m 24422x | |
A x0222x | |
Bm7 x2423x | |
E7 02213x | |
Bm7(3) x2023x | |
D xx0232 | |
Bm7(5) x24232 |
How to infer u
as '{:a Num}
in
(inc (:a u))
Step 1:
Import u
as type Unchecked(u)
Step 2:
user=> (-> (ana/analyze '['a]) :val) | |
[(quote a)] |
There's a few clues in the recording that suggest this is the original tuning. One, it simply sounds better | |
since it's easier to fret the main chords. Two, the E2 chord seems to mute the G string, I'd bet that idea | |
from the G string actually being an A string. | |
However, standard tuning still works. The final chord sounds better in standard tuning, plus it's easier | |
to play E major chords. If you can somehow play B minor 9 the way John does live (I can't) then try it! | |
Enjoy! | |
Tuning: EADABE <tune G string up to A from standard tuning> |
(is-tc-e (fn [k] | |
(let [i (keyword k)] | |
i)) | |
(IFn ['a -> ':a] | |
['a/b -> ':a/b] | |
['"a" -> ':a] | |
['"a/b" -> ':a/b] | |
[':a -> ':a] | |
[':a/b -> ':a/b] | |
[Sym -> Kw] |
Type Error (rdp_214/bar.clj:37:9) Polymorphic function (new clojure.lang.LazySeq (fn* ([] (do :clojure.core.typed.special-form/special-form :clojure.core.typed/loop {:ann (quote {:params [{:type (clojure.core.typed/Option #)}]})} (loop* [s__29299 s__29299] (let* [temp__4423__auto__ (clojure.core/seq s__29299)] (if temp__4423__auto__ (do (let* [s__29299 temp__4423__auto__] (if # # #)))))))))) could not be applied to arguments: | |
Polymorphic Variables: | |
x | |
Domains: | |
[-> (t/Option (Seqable x))] | |
Arguments: | |
[-> (t/U (t/I (java.util.Collection (t/U (t/I (java.util.Collection (t/HVec [Long Long])) (ISeq (t/HVec [Long Long])) (java.util.List (t/HVec [Long Long])) (Iterable (t/HVec [Long Long])) IObj Sequential) (t/HVec [Long Long]))) (ISeq (t/U (t/I (java.util.Collection (t/HVec [Long Long])) (ISeq (t/HVec [Long Long])) (java.util.List (t/HVec [Long Long])) (Iterable (t/HVec [Long Long])) IObj Sequential) (t/HVec [Long Long]))) (java.util.List (t/U (t/I (java.util.Collection (t/HVec [Long Long])) (ISeq (t/HVec [Long |