Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created December 13, 2011 10:40
Show Gist options
  • Select an option

  • Save frenchy64/1471620 to your computer and use it in GitHub Desktop.

Select an option

Save frenchy64/1471620 to your computer and use it in GitHub Desktop.
seq type annotation
;; Type annotation for seq, inspired by haskell
;; (+T <var> :- <interface/protocol>* => <classes>)
(+T clojure.core/seq :- (ISeq a) (ISeq b) => a -> b)
(+T clojure.core/seq :- (Seqable a) (ISeq b) => a -> b)
(+T clojure.core/seq :- nil -> nil)
(+T clojure.core/seq :- (Iterable a) (ISeq b) => a -> b)
(+T clojure.core/seq :- (PrimArray a) (ISeq b) => a -> b)
(+T clojure.core/seq :- (CharSequence a) (ISeq b) => a -> b)
(+T clojure.core/seq :- (Map a) (ISeq b) => a -> b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment