Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
Glad to help!

Ambrose

On Wed, Aug 31, 2016 at 10:33 AM, Eelke van Foeken 
wrote:

> That was it!
>
> Thank you.
>
> Op woensdag 31 augustus 2016 16:22:57 UTC+2 schreef Ambrose
> Bonnaire-Sergeant:
>>
>> Try using cidre-nrepl "0.13.0". It might be in your ~/.lein/profiles.clj
>> file.
>>
>> Thanks,
>> Ambrose
>>
>> On Wed, Aug 31, 2016 at 10:16 AM, Eelke van Foeken 
>> wrote:
>>
>>> Hey,
>>>
>>> Apologies if I am wasting your time, I am just a beginner in Clojure, so
>>> I might be overlooking some basic things.
>>>
>>> Hereby
>>>
>>> $lein version
>>> Leiningen 2.6.1 on Java 1.8.0_102 Java HotSpot(TM) 64-Bit Server VM
>>> $ lein deps :tree
>>> Possibly confusing dependencies found:
>>> [cider/cider-nrepl "0.8.1"] -> [org.clojure/java.classpath "0.2.0"
>>> :exclusions [org.clojure/clojure]]
>>>  overrides
>>> [org.clojure/core.typed "0.3.25"] -> [org.clojure/tools.namespace
>>> "0.3.0-alpha3"] -> [org.clojure/java.classpath "0.2.3"]
>>>
>>> Consider using these exclusions:
>>> [org.clojure/core.typed "0.3.25" :exclusions
>>> [org.clojure/java.classpath]]
>>>
>>> [cider/cider-nrepl "0.8.1"] -> [org.clojure/tools.namespace "0.2.5"
>>> :exclusions [org.clojure/clojure]]
>>>  overrides
>>> [org.clojure/core.typed "0.3.25"] -> [org.clojure/tools.namespace
>>> "0.3.0-alpha3"]
>>>
>>> Consider using these exclusions:
>>> [org.clojure/core.typed "0.3.25" :exclusions
>>> [org.clojure/tools.namespace]]
>>>
>>>  [cider/cider-nrepl "0.8.1"]
>>>[cljs-tooling "0.1.3" :exclusions [[org.clojure/clojure]]]
>>>[compliment "0.2.0" :exclusions [[org.clojure/clojure]]]
>>>[org.clojure/java.classpath "0.2.0" :exclusions
>>> [[org.clojure/clojure]]]
>>>[org.clojure/tools.namespace "0.2.5" :exclusions
>>> [[org.clojure/clojure]]]
>>>[org.clojure/tools.trace "0.7.8" :exclusions [[org.clojure/clojure]]]
>>>[org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]
>>>  [clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
>>>  [org.clojure/clojure "1.9.0-alpha11"]
>>>  [org.clojure/core.typed "0.3.25"]
>>>[org.clojure/core.cache "0.6.4"]
>>>  [org.clojure/data.priority-map "0.0.4"]
>>>[org.clojure/core.contracts "0.0.6" :exclusions
>>> [[org.clojure/clojure]]]
>>>  [org.clojure/core.unify "0.5.7"]
>>>[org.clojure/core.typed.rt "0.3.25"]
>>>[org.clojure/math.combinatorics "0.1.3" :exclusions
>>> [[org.clojure/clojure]]]
>>>[org.clojure/tools.analyzer.jvm "0.6.8"]
>>>  [org.clojure/core.memoize "0.5.7"]
>>>  [org.clojure/tools.analyzer "0.6.7"]
>>>  [org.ow2.asm/asm-all "4.2"]
>>>[org.clojure/tools.reader "1.0.0-beta3"]
>>>  [org.clojure/test.check "0.9.0"]
>>>  [org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]
>>>
>>>
>>> Op wo 31 aug. 2016 om 16:09 schreef Ambrose Bonnaire-Sergeant <
>>> abonnair...@gmail.com>:
>>>
>>>> I'm out of ideas.
>>>>
>>>> Can you send your `lein version` and `lein deps :tree`
>>>> from the repo directory?
>>>>
>>>> Thanks,
>>>> Ambrose
>>>>
>>>> On Wed, Aug 31, 2016 at 9:13 AM, Eelke van Foeken 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Yes I did exactly that. clone the repo. lein repl and then int the
>>>>> repl:
>>>>>
>>>>> $ lein repl
>>>>> Initializing core.typed ...
>>>>> WARNING: boolean? already refers to: #'clojure.core/boolean? in
>>>>> namespace: clojure.tools.analyzer.utils, being replaced by:
>>>>> #'clojure.tools.analyzer.utils/boolean?
>>>>> WARNING: boolean? already refers to: #'clojure.core/boolean? in
>>>>> namespace: clojure.tools.analyzer, being replaced by:
>>>>> #'clojure.tools.analyzer.utils/boolean?
>>>>> Build

Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
Try using cidre-nrepl "0.13.0". It might be in your ~/.lein/profiles.clj
file.

Thanks,
Ambrose

On Wed, Aug 31, 2016 at 10:16 AM, Eelke van Foeken 
wrote:

> Hey,
>
> Apologies if I am wasting your time, I am just a beginner in Clojure, so I
> might be overlooking some basic things.
>
> Hereby
>
> $lein version
> Leiningen 2.6.1 on Java 1.8.0_102 Java HotSpot(TM) 64-Bit Server VM
> $ lein deps :tree
> Possibly confusing dependencies found:
> [cider/cider-nrepl "0.8.1"] -> [org.clojure/java.classpath "0.2.0"
> :exclusions [org.clojure/clojure]]
>  overrides
> [org.clojure/core.typed "0.3.25"] -> [org.clojure/tools.namespace
> "0.3.0-alpha3"] -> [org.clojure/java.classpath "0.2.3"]
>
> Consider using these exclusions:
> [org.clojure/core.typed "0.3.25" :exclusions [org.clojure/java.classpath]]
>
> [cider/cider-nrepl "0.8.1"] -> [org.clojure/tools.namespace "0.2.5"
> :exclusions [org.clojure/clojure]]
>  overrides
> [org.clojure/core.typed "0.3.25"] -> [org.clojure/tools.namespace
> "0.3.0-alpha3"]
>
> Consider using these exclusions:
> [org.clojure/core.typed "0.3.25" :exclusions [org.clojure/tools.namespace]]
>
>  [cider/cider-nrepl "0.8.1"]
>[cljs-tooling "0.1.3" :exclusions [[org.clojure/clojure]]]
>[compliment "0.2.0" :exclusions [[org.clojure/clojure]]]
>[org.clojure/java.classpath "0.2.0" :exclusions [[org.clojure/clojure]]]
>[org.clojure/tools.namespace "0.2.5" :exclusions
> [[org.clojure/clojure]]]
>[org.clojure/tools.trace "0.7.8" :exclusions [[org.clojure/clojure]]]
>[org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]
>  [clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
>  [org.clojure/clojure "1.9.0-alpha11"]
>  [org.clojure/core.typed "0.3.25"]
>[org.clojure/core.cache "0.6.4"]
>  [org.clojure/data.priority-map "0.0.4"]
>[org.clojure/core.contracts "0.0.6" :exclusions [[org.clojure/clojure]]]
>  [org.clojure/core.unify "0.5.7"]
>[org.clojure/core.typed.rt "0.3.25"]
>[org.clojure/math.combinatorics "0.1.3" :exclusions
> [[org.clojure/clojure]]]
>[org.clojure/tools.analyzer.jvm "0.6.8"]
>  [org.clojure/core.memoize "0.5.7"]
>  [org.clojure/tools.analyzer "0.6.7"]
>  [org.ow2.asm/asm-all "4.2"]
>[org.clojure/tools.reader "1.0.0-beta3"]
>  [org.clojure/test.check "0.9.0"]
>  [org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]
>
>
> Op wo 31 aug. 2016 om 16:09 schreef Ambrose Bonnaire-Sergeant <
> abonnaireserge...@gmail.com>:
>
>> I'm out of ideas.
>>
>> Can you send your `lein version` and `lein deps :tree`
>> from the repo directory?
>>
>> Thanks,
>> Ambrose
>>
>> On Wed, Aug 31, 2016 at 9:13 AM, Eelke van Foeken 
>> wrote:
>>
>>> Hi,
>>>
>>> Yes I did exactly that. clone the repo. lein repl and then int the repl:
>>>
>>> $ lein repl
>>> Initializing core.typed ...
>>> WARNING: boolean? already refers to: #'clojure.core/boolean? in
>>> namespace: clojure.tools.analyzer.utils, being replaced by:
>>> #'clojure.tools.analyzer.utils/boolean?
>>> WARNING: boolean? already refers to: #'clojure.core/boolean? in
>>> namespace: clojure.tools.analyzer, being replaced by:
>>> #'clojure.tools.analyzer.utils/boolean?
>>> Building core.typed base environments ...
>>> Finished building base environments
>>> "Elapsed time: 14919.589655 msecs"
>>> core.typed initialized.
>>> nREPL server started on port 57873 on host 127.0.0.1 - nrepl://
>>> 127.0.0.1:57873
>>> REPL-y 0.3.7, nREPL 0.2.12
>>> Clojure 1.9.0-alpha11
>>> Java HotSpot(TM) 64-Bit Server VM 1.8.0_102-b14
>>> Docs: (doc function-name-here)
>>>   (find-doc "part-of-name-here")
>>>   Source: (source function-name-here)
>>>  Javadoc: (javadoc java-object-or-class-here)
>>> Exit: Control+D or (exit) or (quit)
>>>  Results: Stored in vars *1, *2, *3, an exception in *e
>>>
>>>
>>> user=> (require 'runtime-infer-demo.core-test)
>>> nil
>>> user=> (in-ns 'runtime-infer-demo.core-test)
>>> #object[clojure.lang.Namespace 0x139b884e "runtime-infer-demo.core-test"

Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
I'm out of ideas.

Can you send your `lein version` and `lein deps :tree`
from the repo directory?

Thanks,
Ambrose

On Wed, Aug 31, 2016 at 9:13 AM, Eelke van Foeken 
wrote:

> Hi,
>
> Yes I did exactly that. clone the repo. lein repl and then int the repl:
>
> $ lein repl
> Initializing core.typed ...
> WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace:
> clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.
> utils/boolean?
> WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace:
> clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.
> utils/boolean?
> Building core.typed base environments ...
> Finished building base environments
> "Elapsed time: 14919.589655 msecs"
> core.typed initialized.
> nREPL server started on port 57873 on host 127.0.0.1 - nrepl://
> 127.0.0.1:57873
> REPL-y 0.3.7, nREPL 0.2.12
> Clojure 1.9.0-alpha11
> Java HotSpot(TM) 64-Bit Server VM 1.8.0_102-b14
> Docs: (doc function-name-here)
>   (find-doc "part-of-name-here")
>   Source: (source function-name-here)
>  Javadoc: (javadoc java-object-or-class-here)
> Exit: Control+D or (exit) or (quit)
>  Results: Stored in vars *1, *2, *3, an exception in *e
>
>
> user=> (require 'runtime-infer-demo.core-test)
> nil
> user=> (in-ns 'runtime-infer-demo.core-test)
> #object[clojure.lang.Namespace 0x139b884e "runtime-infer-demo.core-test"]
> runtime-infer-demo.core-test=> (run-tests)
>
>
> Testing runtime-infer-demo.core-test
>
>
> Ran 1 tests containing 2 assertions.
> 0 failures, 0 errors.
> {:test 1, :pass 2, :fail 0, :error 0, :type :summary}
> runtime-infer-demo.core-test=>  (in-ns 'runtime-infer-demo.core)
> #object[clojure.lang.Namespace 0x5aee3dae "runtime-infer-demo.core"]
> runtime-infer-demo.core=> (t/runtime-infer)
>
> AssertionError Assert failed: No namespace form found
> ns-form  clojure.core.typed.runtime-infer/ns-end-line
> (runtime_infer.clj:2566)
> runtime-infer-demo.core=>
>
> Thanks for helping out,
> Eelke
>
> Op woensdag 31 augustus 2016 14:57:17 UTC+2 schreef Ambrose
> Bonnaire-Sergeant:
>>
>> Hi Eelke,
>>
>> I can't reproduce, did you just clone the project and run the steps?
>>
>> Can you post your REPL session?
>>
>> Thanks,
>> Ambrose
>>
>> On Wed, Aug 31, 2016 at 8:33 AM, Eelke van Foeken 
>> wrote:
>>
>>> Hi,
>>>
>>> Great feature! I am trying the demo project. I am following the steps
>>> from the first example, but when I get to (t/runtime-infer) I get the
>>> following error:
>>> AssertionError Assert failed: No namespace form found
>>> ns-form  clojure.core.typed.runtime-infer/ns-end-line
>>> (runtime_infer.clj:2566)
>>>
>>> Am I overlooking something?
>>>
>>> Best regards,
>>> Eelke van Foeken
>>>
>>>
>>> Op woensdag 31 augustus 2016 11:17:09 UTC+2 schreef Ambrose
>>> Bonnaire-Sergeant:
>>>
>>>> Hi,
>>>>
>>>> The latest core.typed release has support for generating
>>>> clojure.spec specs from unit tests.
>>>>
>>>> [org.clojure/core.typed "0.3.25"]
>>>>
>>>> ...; for very recent releases
>>>> :repositories {"sonatype-oss-public" 
>>>> "https://oss.sonatype.org/content/groups/public/"}
>>>>
>>>>
>>>> Here's an example
>>>> <https://gist.github.com/frenchy64/85c1c812daf81d07a55dd3ff82e3b0fe>
>>>> of the kind of specs it can generate
>>>> from even minimal tests.
>>>>
>>>> There is a demo <https://github.com/typedclojure/auto-annotation> 
>>>> repository
>>>> if you want to test this feature out.
>>>>
>>>> We now use a modified version of Compiler.java as an
>>>> analyzer, so there are nice noticeable speedups for
>>>> compilation.
>>>>
>>>> Feedback welcome!
>>>>
>>>> README <https://github.com/clojure/core.typed>
>>>> CHANGELOG
>>>> <https://github.com/clojure/core.typed/blob/master/CHANGELOG.md#0325---31-august-2016>
>>>>
>>>> Thanks,
>>>> Ambrose
>>>>
>>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
Hi Eelke,

I can't reproduce, did you just clone the project and run the steps?

Can you post your REPL session?

Thanks,
Ambrose

On Wed, Aug 31, 2016 at 8:33 AM, Eelke van Foeken 
wrote:

> Hi,
>
> Great feature! I am trying the demo project. I am following the steps from
> the first example, but when I get to (t/runtime-infer) I get the following
> error:
> AssertionError Assert failed: No namespace form found
> ns-form  clojure.core.typed.runtime-infer/ns-end-line
> (runtime_infer.clj:2566)
>
> Am I overlooking something?
>
> Best regards,
> Eelke van Foeken
>
>
> Op woensdag 31 augustus 2016 11:17:09 UTC+2 schreef Ambrose
> Bonnaire-Sergeant:
>
>> Hi,
>>
>> The latest core.typed release has support for generating
>> clojure.spec specs from unit tests.
>>
>> [org.clojure/core.typed "0.3.25"]
>>
>> ...; for very recent releases
>> :repositories {"sonatype-oss-public" 
>> "https://oss.sonatype.org/content/groups/public/"}
>>
>>
>> Here's an example
>> <https://gist.github.com/frenchy64/85c1c812daf81d07a55dd3ff82e3b0fe> of
>> the kind of specs it can generate
>> from even minimal tests.
>>
>> There is a demo <https://github.com/typedclojure/auto-annotation> repository
>> if you want to test this feature out.
>>
>> We now use a modified version of Compiler.java as an
>> analyzer, so there are nice noticeable speedups for
>> compilation.
>>
>> Feedback welcome!
>>
>> README <https://github.com/clojure/core.typed>
>> CHANGELOG
>> <https://github.com/clojure/core.typed/blob/master/CHANGELOG.md#0325---31-august-2016>
>>
>> Thanks,
>> Ambrose
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
Hi,

The latest core.typed release has support for generating
clojure.spec specs from unit tests.

[org.clojure/core.typed "0.3.25"]

...; for very recent releases
:repositories {"sonatype-oss-public"
"https://oss.sonatype.org/content/groups/public/"}


Here's an example
<https://gist.github.com/frenchy64/85c1c812daf81d07a55dd3ff82e3b0fe> of the
kind of specs it can generate
from even minimal tests.

There is a demo <https://github.com/typedclojure/auto-annotation> repository
if you want to test this feature out.

We now use a modified version of Compiler.java as an
analyzer, so there are nice noticeable speedups for
compilation.

Feedback welcome!

README <https://github.com/clojure/core.typed>
CHANGELOG
<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md#0325---31-august-2016>

Thanks,
Ambrose

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed - Can't resolve alias name

2015-10-29 Thread Ambrose Bonnaire-Sergeant
If you're at the repl, you should use `cf` to evaluate `defalias` also.

Sorry for the late response.

Thanks,
Ambrose

On Thu, Oct 29, 2015 at 9:23 PM, JvJ  wrote:

> Reposting from the core.typed google group.  Didn't get a response.
>
> I'm just starting with core.typed, and I can't seem to get it to work
> properly in the REPL.
>
> I start by defining an alias (Fhtagn), but when I later try to type-check
> it, the name "Fhtagn" is unresolved.
>
> Am I using it wrong, or is this just a consequence of using the REPL?
>
>
> guymover.game-server> (t/defalias Fhtagn (t/HMap :mandatory {:a t/Int :b t
> /Str}))
> nil
> guymover.game-server> (t/cf {:a 1 :b ""} Fhtagn)
> Type Error (C:\Users\Kaylen\AppData\Local\Temp\form-
> init7559705448676355576.clj) Internal Error (:) Cannot resolve
> name guymover.game-server/Fhtagn
> Error
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


core.typed - Can't resolve alias name

2015-10-29 Thread JvJ
Reposting from the core.typed google group.  Didn't get a response.

I'm just starting with core.typed, and I can't seem to get it to work 
properly in the REPL.

I start by defining an alias (Fhtagn), but when I later try to type-check 
it, the name "Fhtagn" is unresolved.

Am I using it wrong, or is this just a consequence of using the REPL?


guymover.game-server> (t/defalias Fhtagn (t/HMap :mandatory {:a t/Int :b t/
Str}))
nil
guymover.game-server> (t/cf {:a 1 :b ""} Fhtagn)
Type Error (C:\Users\Kaylen\AppData\Local\Temp\form-init7559705448676355576.
clj) Internal Error (:) Cannot resolve name guymover.game-server/
Fhtagn
Error

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed and cider

2015-09-26 Thread Andrea Richiardi
I got a working version in my fork of emacs-live (if you happen to use it).
See here 
https://github.com/arichiardi/emacs-live/blob/ar-stable/packs/dev/clojure-pack/config/flycheck-clojure-conf.el

On Thursday, September 24, 2015 at 1:36:07 PM UTC-7, JvJ wrote:
>
> Hi,
>
> Maybe this topic has already been addressed, but if it has been, I 
> couldn't find it.
>
> When using cider, I tend to user C-c C-l a lot to reload my namespaces as 
> I'm writing them.
>
> Is there an easy way to incorporate type-checking into this process?  A 
> load-file-and-typecheck command?
>
> I've already tried just putting (t/check-ns) at the end of the file, but 
> this seems to cause stack overflows in some cases.
>
> Thanks 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed and cider

2015-09-26 Thread Lars Andersen
It relies on kibit, eastwood and core.typed to provide warnings and errors. 
This means support for other dialects will be available when those projects 
add support.

On Saturday, September 26, 2015 at 12:19:03 AM UTC+2, JvJ wrote:
>
> Lars, thanks for telling me about squiggly-clojure.  It seems great.
>
> Do you know if there's a way to get it to work with cljc and/or cljs 
> files?  Currently, it only seems to work with clj files.
>
> On Thursday, 24 September 2015 13:36:07 UTC-7, JvJ wrote:
>>
>> Hi,
>>
>> Maybe this topic has already been addressed, but if it has been, I 
>> couldn't find it.
>>
>> When using cider, I tend to user C-c C-l a lot to reload my namespaces as 
>> I'm writing them.
>>
>> Is there an easy way to incorporate type-checking into this process?  A 
>> load-file-and-typecheck command?
>>
>> I've already tried just putting (t/check-ns) at the end of the file, but 
>> this seems to cause stack overflows in some cases.
>>
>> Thanks 
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed and cider

2015-09-25 Thread JvJ
Lars, thanks for telling me about squiggly-clojure.  It seems great.

Do you know if there's a way to get it to work with cljc and/or cljs files? 
 Currently, it only seems to work with clj files.

On Thursday, 24 September 2015 13:36:07 UTC-7, JvJ wrote:
>
> Hi,
>
> Maybe this topic has already been addressed, but if it has been, I 
> couldn't find it.
>
> When using cider, I tend to user C-c C-l a lot to reload my namespaces as 
> I'm writing them.
>
> Is there an easy way to incorporate type-checking into this process?  A 
> load-file-and-typecheck command?
>
> I've already tried just putting (t/check-ns) at the end of the file, but 
> this seems to cause stack overflows in some cases.
>
> Thanks 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed and cider

2015-09-25 Thread john walker
Hello, 

Have you given typed-clojure-mode a shot? If there are any issues, post on 
the github page and I'll address them. There are similar modes for vim and 
light table.

https://github.com/typedclojure/typed-clojure-mode

John

On Thursday, September 24, 2015 at 1:36:07 PM UTC-7, JvJ wrote:
>
> Hi,
>
> Maybe this topic has already been addressed, but if it has been, I 
> couldn't find it.
>
> When using cider, I tend to user C-c C-l a lot to reload my namespaces as 
> I'm writing them.
>
> Is there an easy way to incorporate type-checking into this process?  A 
> load-file-and-typecheck command?
>
> I've already tried just putting (t/check-ns) at the end of the file, but 
> this seems to cause stack overflows in some cases.
>
> Thanks 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed and cider

2015-09-25 Thread Artur Malabarba
Cider has a cider-run command as an easy way to run specific functions. You
can cook up some simple elisp to load the buffer and then call that
function.
On 25 Sep 2015 10:22 am, "Lars Andersen"  wrote:

> Something like this doesn't exist in CIDER, so you have to write some
> elisp yourself, if you want it.
>
> While not exactly what you've envisioned, I think the best solution is
> this: https://github.com/clojure-emacs/squiggly-clojure
>
> On Thursday, September 24, 2015 at 10:36:07 PM UTC+2, JvJ wrote:
>>
>> Hi,
>>
>> Maybe this topic has already been addressed, but if it has been, I
>> couldn't find it.
>>
>> When using cider, I tend to user C-c C-l a lot to reload my namespaces as
>> I'm writing them.
>>
>> Is there an easy way to incorporate type-checking into this process?  A
>> load-file-and-typecheck command?
>>
>> I've already tried just putting (t/check-ns) at the end of the file, but
>> this seems to cause stack overflows in some cases.
>>
>> Thanks
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed and cider

2015-09-25 Thread Lars Andersen
Something like this doesn't exist in CIDER, so you have to write some elisp 
yourself, if you want it.

While not exactly what you've envisioned, I think the best solution is 
this: https://github.com/clojure-emacs/squiggly-clojure 

On Thursday, September 24, 2015 at 10:36:07 PM UTC+2, JvJ wrote:
>
> Hi,
>
> Maybe this topic has already been addressed, but if it has been, I 
> couldn't find it.
>
> When using cider, I tend to user C-c C-l a lot to reload my namespaces as 
> I'm writing them.
>
> Is there an easy way to incorporate type-checking into this process?  A 
> load-file-and-typecheck command?
>
> I've already tried just putting (t/check-ns) at the end of the file, but 
> this seems to cause stack overflows in some cases.
>
> Thanks 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


core.typed and cider

2015-09-24 Thread JvJ
Hi,

Maybe this topic has already been addressed, but if it has been, I couldn't 
find it.

When using cider, I tend to user C-c C-l a lot to reload my namespaces as 
I'm writing them.

Is there an easy way to incorporate type-checking into this process?  A 
load-file-and-typecheck command?

I've already tried just putting (t/check-ns) at the end of the file, but 
this seems to cause stack overflows in some cases.

Thanks 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed question (maybe a bug?)

2015-04-17 Thread Sven Richter
Hm, 

Is it possible that core.typed may be influenced by the repl state? New day 
and a new try I got these both working:

(t/ann dt->hiccup [(t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) 
t/Any t/Any *]) -> html-form-group])
(defmulti dt->hiccup (t/fn [col :- (t/HVec [Keyword (t/U Keyword (t/HVec 
[Keyword Number])) t/Any t/Any *])]
   (if (vector? (second col))
 (first (second col))
 (second col

and

(t/ann dt->hiccup [(t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) 
t/Any t/Any *]) -> html-form-group])
(defmulti dt->hiccup (t/fn [col :- (t/HVec [Keyword (t/U Keyword (t/HVec 
[Keyword Number])) t/Any t/Any *])]
   (let [[_ s] col]
 (if (vector? s) (first s) s

Which are the same basically regarding type declarations. Sorry for making such 
a noise, 
maybe a simple repl restart would have fixed this.

Thanks,
Sven



Am Donnerstag, 16. April 2015 22:43:41 UTC+2 schrieb Sven Richter:
>
> Hi,
>
> I tried both destructuring and the nth form instead of second and first. 
> None of which worked.
>
> However, if I change the Union to Intersection in 
>
> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>
> it works for the definition of the multimethod. Does that make sense? I 
> thought Union was either one type or the other.
>
> Thanks,
> Sven
>
>
> Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose 
> Bonnaire-Sergeant:
>>
>> I don't think second's type is is smart enough.
>>
>> Try using nth or destructuring instead:
>>
>> (let [[f s] v]
>>   (if (vector? s) (first s) s))
>>
>> or
>>
>> (if (vector? (nth v 1)) (first (nth v 1)) s)
>>
>> Thanks,
>> Ambrose
>>
>> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter  
>> wrote:
>>
>>> Hi,
>>>
>>> I have this code:
>>>
>>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String}) 
>>> String]))
>>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) t/Any 
>>> *]))
>>> (defalias html-form-group (t/HVec [html-label html-form]))
>>>  
>>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) t/Any 
>>> t/Any *]) -> 
>>>html-form-group])
>>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>>(if (vector? (second col))
>>>  (first (second col))
>>>  (second col
>>>
>>> And here comes the error message when checking this function:
>>>
>>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function first 
>>> could not be applied to arguments:
>>> Polymorphic Variables:
>>> x
>>>  
>>> Domains:
>>> (t/HSequential [x t/Any *])
>>> (t/Option (t/EmptySeqable x))
>>> (t/NonEmptySeqable x)
>>> (t/Option (clojure.lang.Seqable x))
>>>  
>>> Arguments:
>>> (t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
>>>  
>>> Ranges:
>>> x :object {:path [(Nth 0)], :id 0}
>>> nil
>>> x
>>> (t/Option x)
>>>  
>>> in: (first (second col))
>>> in: (first (second col))
>>>  
>>>  
>>> ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.
>>> clj:4403)
>>>
>>> My assumption is that the check (if (vector? (second col will return 
>>> only true if it is this type: (HVec [Keyword Number]). However, I have 
>>> the impression that core.typed does not resolve the if expression properly.
>>> Or maybe I am missing something completely.
>>>
>>> Any hints or recommendations?
>>>
>>> Thanks,
>>> Sven
>>>
>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with 
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> G

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Sven Richter
I added your explanation the the wiki of core.typed: 
https://github.com/clojure/core.typed/wiki/Intersection-vs.-Union I hope 
that is fine for you.



Am Donnerstag, 16. April 2015 23:25:42 UTC+2 schrieb Ambrose 
Bonnaire-Sergeant:
>
> It might help thinking in terms of Java interfaces, Foo and Bar.
>
> (definterface Foo
>   (foo []))
> (definterface Bar
>   (bar []))
>
> (I Foo Bar) is a value that extends both Foo and Bar.
>
> (deftype IImp []
>   Foo
>   (foo [this])
>   Bar
>   (bar [this]))
>
> (->IImp) is of type Foo, Bar, (I Foo Bar) and (U Foo Bar).
>
> Assuming we assign (->IImp) the type (I Foo Bar), we can call these safely:
>
> (let [i :- (I Foo Bar), (->IImp)]
>  (.foo i)
>  (.bar i))
>
> A type that just implements Foo is not a Bar, so we can't claim it's a Foo 
> *and* a Bar.
>
> (deftype UImp []
>   Foo
>   (foo [this]))
>
> (->UImp) is of type Foo, and (U Foo Bar).
>
> Assuming we assign (->UImp) the type (U Foo Bar), the same operations now 
> must cast at runtime.
>
> (let [i :- (U Foo Bar), (->UImp)]
>  (if (instance? Foo)
>   (.foo i)
>   (.bar i))
>
>
> Thanks,
> Ambrose
>
> On Thu, Apr 16, 2015 at 5:15 PM, Sven Richter  > wrote:
>
>> I meant when I change:
>>
>> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])  
>> to  (t/HVec [Keyword (t/I Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>> 
>> ^^   
>>   
>> to  ^^
>> Still I think that making an intersection of it is wrong conceptually.
>>
>>
>> Thanks,
>> Sven
>>
>> Am Donnerstag, 16. April 2015 23:08:30 UTC+2 schrieb Ambrose 
>> Bonnaire-Sergeant:
>>>
>>> I don't see an intersection, what do you mean?
>>>
>>> Thanks,
>>> Ambrose
>>>
>>> On Thu, Apr 16, 2015 at 4:43 PM, Sven Richter  
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I tried both destructuring and the nth form instead of second and 
>>>> first. None of which worked.
>>>>
>>>> However, if I change the Union to Intersection in 
>>>>
>>>> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>>>>
>>>> it works for the definition of the multimethod. Does that make sense? I 
>>>> thought Union was either one type or the other.
>>>>
>>>> Thanks,
>>>> Sven
>>>>
>>>>
>>>> Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose 
>>>> Bonnaire-Sergeant:
>>>>>
>>>>> I don't think second's type is is smart enough.
>>>>>
>>>>> Try using nth or destructuring instead:
>>>>>
>>>>> (let [[f s] v]
>>>>>   (if (vector? s) (first s) s))
>>>>>
>>>>> or
>>>>>
>>>>> (if (vector? (nth v 1)) (first (nth v 1)) s)
>>>>>
>>>>> Thanks,
>>>>> Ambrose
>>>>>
>>>>> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter  
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have this code:
>>>>>>
>>>>>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String
>>>>>> }) String]))
>>>>>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) 
>>>>>> t/Any *]))
>>>>>> (defalias html-form-group (t/HVec [html-label html-form]))
>>>>>>  
>>>>>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) 
>>>>>> t/Any t/Any *]) -> 
>>>>>>html-form-group])
>>>>>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>>>>>(if (vector? (second col))
>>>>>>  (first (second col))
>>>>>>  (second col
>>>>>>
>>>>>> And here comes the error message when checking this function:
>>>>>>
>>>>>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function 
>>>>>> first could not be applied to arguments:
>>>>>> Polymorphic Variables:
>>>>&

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Sven Richter
Now thats a really nice explanation of union versus intersection in termes 
of types. 

Thank you very much for that,
Sven

Am Donnerstag, 16. April 2015 23:25:42 UTC+2 schrieb Ambrose 
Bonnaire-Sergeant:
>
> It might help thinking in terms of Java interfaces, Foo and Bar.
>
> (definterface Foo
>   (foo []))
> (definterface Bar
>   (bar []))
>
> (I Foo Bar) is a value that extends both Foo and Bar.
>
> (deftype IImp []
>   Foo
>   (foo [this])
>   Bar
>   (bar [this]))
>
> (->IImp) is of type Foo, Bar, (I Foo Bar) and (U Foo Bar).
>
> Assuming we assign (->IImp) the type (I Foo Bar), we can call these safely:
>
> (let [i :- (I Foo Bar), (->IImp)]
>  (.foo i)
>  (.bar i))
>
> A type that just implements Foo is not a Bar, so we can't claim it's a Foo 
> *and* a Bar.
>
> (deftype UImp []
>   Foo
>   (foo [this]))
>
> (->UImp) is of type Foo, and (U Foo Bar).
>
> Assuming we assign (->UImp) the type (U Foo Bar), the same operations now 
> must cast at runtime.
>
> (let [i :- (U Foo Bar), (->UImp)]
>  (if (instance? Foo)
>   (.foo i)
>   (.bar i))
>
>
> Thanks,
> Ambrose
>
> On Thu, Apr 16, 2015 at 5:15 PM, Sven Richter  > wrote:
>
>> I meant when I change:
>>
>> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])  
>> to  (t/HVec [Keyword (t/I Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>> 
>> ^^   
>>   
>> to  ^^
>> Still I think that making an intersection of it is wrong conceptually.
>>
>>
>> Thanks,
>> Sven
>>
>> Am Donnerstag, 16. April 2015 23:08:30 UTC+2 schrieb Ambrose 
>> Bonnaire-Sergeant:
>>>
>>> I don't see an intersection, what do you mean?
>>>
>>> Thanks,
>>> Ambrose
>>>
>>> On Thu, Apr 16, 2015 at 4:43 PM, Sven Richter  
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I tried both destructuring and the nth form instead of second and 
>>>> first. None of which worked.
>>>>
>>>> However, if I change the Union to Intersection in 
>>>>
>>>> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>>>>
>>>> it works for the definition of the multimethod. Does that make sense? I 
>>>> thought Union was either one type or the other.
>>>>
>>>> Thanks,
>>>> Sven
>>>>
>>>>
>>>> Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose 
>>>> Bonnaire-Sergeant:
>>>>>
>>>>> I don't think second's type is is smart enough.
>>>>>
>>>>> Try using nth or destructuring instead:
>>>>>
>>>>> (let [[f s] v]
>>>>>   (if (vector? s) (first s) s))
>>>>>
>>>>> or
>>>>>
>>>>> (if (vector? (nth v 1)) (first (nth v 1)) s)
>>>>>
>>>>> Thanks,
>>>>> Ambrose
>>>>>
>>>>> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter  
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have this code:
>>>>>>
>>>>>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String
>>>>>> }) String]))
>>>>>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) 
>>>>>> t/Any *]))
>>>>>> (defalias html-form-group (t/HVec [html-label html-form]))
>>>>>>  
>>>>>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) 
>>>>>> t/Any t/Any *]) -> 
>>>>>>html-form-group])
>>>>>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>>>>>(if (vector? (second col))
>>>>>>  (first (second col))
>>>>>>  (second col
>>>>>>
>>>>>> And here comes the error message when checking this function:
>>>>>>
>>>>>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function 
>>>>>> first could not be applied to arguments:
>>>>>> Polymorphic Variables:
>>>>>> x
>>>>

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
It might help thinking in terms of Java interfaces, Foo and Bar.

(definterface Foo
  (foo []))
(definterface Bar
  (bar []))

(I Foo Bar) is a value that extends both Foo and Bar.

(deftype IImp []
  Foo
  (foo [this])
  Bar
  (bar [this]))

(->IImp) is of type Foo, Bar, (I Foo Bar) and (U Foo Bar).

Assuming we assign (->IImp) the type (I Foo Bar), we can call these safely:

(let [i :- (I Foo Bar), (->IImp)]
 (.foo i)
 (.bar i))

A type that just implements Foo is not a Bar, so we can't claim it's a Foo
*and* a Bar.

(deftype UImp []
  Foo
  (foo [this]))

(->UImp) is of type Foo, and (U Foo Bar).

Assuming we assign (->UImp) the type (U Foo Bar), the same operations now
must cast at runtime.

(let [i :- (U Foo Bar), (->UImp)]
 (if (instance? Foo)
  (.foo i)
  (.bar i))


Thanks,
Ambrose

On Thu, Apr 16, 2015 at 5:15 PM, Sven Richter 
wrote:

> I meant when I change:
>
> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
> to  (t/HVec [Keyword (t/I Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>
> ^^
> to  ^^
> Still I think that making an intersection of it is wrong conceptually.
>
>
> Thanks,
> Sven
>
> Am Donnerstag, 16. April 2015 23:08:30 UTC+2 schrieb Ambrose
> Bonnaire-Sergeant:
>>
>> I don't see an intersection, what do you mean?
>>
>> Thanks,
>> Ambrose
>>
>> On Thu, Apr 16, 2015 at 4:43 PM, Sven Richter 
>> wrote:
>>
>>> Hi,
>>>
>>> I tried both destructuring and the nth form instead of second and first.
>>> None of which worked.
>>>
>>> However, if I change the Union to Intersection in
>>>
>>> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>>>
>>> it works for the definition of the multimethod. Does that make sense? I 
>>> thought Union was either one type or the other.
>>>
>>> Thanks,
>>> Sven
>>>
>>>
>>> Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose
>>> Bonnaire-Sergeant:
>>>>
>>>> I don't think second's type is is smart enough.
>>>>
>>>> Try using nth or destructuring instead:
>>>>
>>>> (let [[f s] v]
>>>>   (if (vector? s) (first s) s))
>>>>
>>>> or
>>>>
>>>> (if (vector? (nth v 1)) (first (nth v 1)) s)
>>>>
>>>> Thanks,
>>>> Ambrose
>>>>
>>>> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have this code:
>>>>>
>>>>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String}
>>>>> ) String]))
>>>>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String})
>>>>> t/Any *]))
>>>>> (defalias html-form-group (t/HVec [html-label html-form]))
>>>>>
>>>>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number]))
>>>>> t/Any t/Any *]) ->
>>>>>html-form-group])
>>>>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>>>>(if (vector? (second col))
>>>>>  (first (second col))
>>>>>  (second col
>>>>>
>>>>> And here comes the error message when checking this function:
>>>>>
>>>>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function
>>>>> first could not be applied to arguments:
>>>>> Polymorphic Variables:
>>>>> x
>>>>>
>>>>> Domains:
>>>>> (t/HSequential [x t/Any *])
>>>>> (t/Option (t/EmptySeqable x))
>>>>> (t/NonEmptySeqable x)
>>>>> (t/Option (clojure.lang.Seqable x))
>>>>>
>>>>> Arguments:
>>>>> (t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
>>>>>
>>>>> Ranges:
>>>>> x :object {:path [(Nth 0)], :id 0}
>>>>> nil
>>>>> x
>>>>> (t/Option x)
>>>>>
>>>>> in: (first (second col))
>>>>> in: (first (second col))
>>>>>
>>>>>
>>>>> ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.
>>>>> clj:44

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Sven Richter
I meant when I change:

(t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])  
to  (t/HVec [Keyword (t/I Keyword (t/HVec [Keyword Number])) t/Any t/Any *])

^^  
   
to  ^^
Still I think that making an intersection of it is wrong conceptually.


Thanks,
Sven

Am Donnerstag, 16. April 2015 23:08:30 UTC+2 schrieb Ambrose 
Bonnaire-Sergeant:
>
> I don't see an intersection, what do you mean?
>
> Thanks,
> Ambrose
>
> On Thu, Apr 16, 2015 at 4:43 PM, Sven Richter  > wrote:
>
>> Hi,
>>
>> I tried both destructuring and the nth form instead of second and first. 
>> None of which worked.
>>
>> However, if I change the Union to Intersection in 
>>
>> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>>
>> it works for the definition of the multimethod. Does that make sense? I 
>> thought Union was either one type or the other.
>>
>> Thanks,
>> Sven
>>
>>
>> Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose 
>> Bonnaire-Sergeant:
>>>
>>> I don't think second's type is is smart enough.
>>>
>>> Try using nth or destructuring instead:
>>>
>>> (let [[f s] v]
>>>   (if (vector? s) (first s) s))
>>>
>>> or
>>>
>>> (if (vector? (nth v 1)) (first (nth v 1)) s)
>>>
>>> Thanks,
>>> Ambrose
>>>
>>> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter  
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have this code:
>>>>
>>>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String}) 
>>>> String]))
>>>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) t
>>>> /Any *]))
>>>> (defalias html-form-group (t/HVec [html-label html-form]))
>>>>  
>>>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) t
>>>> /Any t/Any *]) -> 
>>>>html-form-group])
>>>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>>>(if (vector? (second col))
>>>>  (first (second col))
>>>>  (second col
>>>>
>>>> And here comes the error message when checking this function:
>>>>
>>>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function 
>>>> first could not be applied to arguments:
>>>> Polymorphic Variables:
>>>> x
>>>>  
>>>> Domains:
>>>> (t/HSequential [x t/Any *])
>>>> (t/Option (t/EmptySeqable x))
>>>> (t/NonEmptySeqable x)
>>>> (t/Option (clojure.lang.Seqable x))
>>>>  
>>>> Arguments:
>>>> (t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
>>>>  
>>>> Ranges:
>>>> x :object {:path [(Nth 0)], :id 0}
>>>> nil
>>>> x
>>>> (t/Option x)
>>>>  
>>>> in: (first (second col))
>>>> in: (first (second col))
>>>>  
>>>>  
>>>> ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.
>>>> clj:4403)
>>>>
>>>> My assumption is that the check (if (vector? (second col will return 
>>>> only true if it is this type: (HVec [Keyword Number]). However, I have 
>>>> the impression that core.typed does not resolve the if expression properly.
>>>> Or maybe I am missing something completely.
>>>>
>>>> Any hints or recommendations?
>>>>
>>>> Thanks,
>>>> Sven
>>>>
>>>>
>>>>  -- 
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To post to this group, send email to clo...@googlegroups.com
>>>> Note that posts from new members are moderated - please be patient with 
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>> clojure+u...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> --- 
>>>> You received this message because you are su

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
Oh, you changed it to (t/HVec [Keyword (t/I Keyword (t/HVec [Keyword
Number])) t/Any t/Any *])?

Unions are like `or`, intersections like `and`. This might work for
checking the definition, as function bodies are
checked with a set of assumptions about parameter types.

However it should be impossible to call this function as you cannot
construct a type of (I Keyword (HVec ...)).

Thanks,
Ambrose

On Thu, Apr 16, 2015 at 5:07 PM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> I don't see an intersection, what do you mean?
>
> Thanks,
> Ambrose
>
> On Thu, Apr 16, 2015 at 4:43 PM, Sven Richter 
> wrote:
>
>> Hi,
>>
>> I tried both destructuring and the nth form instead of second and first.
>> None of which worked.
>>
>> However, if I change the Union to Intersection in
>>
>> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>>
>> it works for the definition of the multimethod. Does that make sense? I 
>> thought Union was either one type or the other.
>>
>> Thanks,
>> Sven
>>
>>
>> Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose
>> Bonnaire-Sergeant:
>>>
>>> I don't think second's type is is smart enough.
>>>
>>> Try using nth or destructuring instead:
>>>
>>> (let [[f s] v]
>>>   (if (vector? s) (first s) s))
>>>
>>> or
>>>
>>> (if (vector? (nth v 1)) (first (nth v 1)) s)
>>>
>>> Thanks,
>>> Ambrose
>>>
>>> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter 
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have this code:
>>>>
>>>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String})
>>>> String]))
>>>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) t
>>>> /Any *]))
>>>> (defalias html-form-group (t/HVec [html-label html-form]))
>>>>
>>>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) t
>>>> /Any t/Any *]) ->
>>>>html-form-group])
>>>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>>>(if (vector? (second col))
>>>>  (first (second col))
>>>>  (second col
>>>>
>>>> And here comes the error message when checking this function:
>>>>
>>>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function
>>>> first could not be applied to arguments:
>>>> Polymorphic Variables:
>>>> x
>>>>
>>>> Domains:
>>>> (t/HSequential [x t/Any *])
>>>> (t/Option (t/EmptySeqable x))
>>>> (t/NonEmptySeqable x)
>>>> (t/Option (clojure.lang.Seqable x))
>>>>
>>>> Arguments:
>>>> (t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
>>>>
>>>> Ranges:
>>>> x :object {:path [(Nth 0)], :id 0}
>>>> nil
>>>> x
>>>> (t/Option x)
>>>>
>>>> in: (first (second col))
>>>> in: (first (second col))
>>>>
>>>>
>>>> ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.
>>>> clj:4403)
>>>>
>>>> My assumption is that the check (if (vector? (second col will return
>>>> only true if it is this type: (HVec [Keyword Number]). However, I have
>>>> the impression that core.typed does not resolve the if expression properly.
>>>> Or maybe I am missing something completely.
>>>>
>>>> Any hints or recommendations?
>>>>
>>>> Thanks,
>>>> Sven
>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To post to this group, send email to clo...@googlegroups.com
>>>> Note that posts from new members are moderated - please be patient with
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>> clojure+u...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>&g

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
I don't see an intersection, what do you mean?

Thanks,
Ambrose

On Thu, Apr 16, 2015 at 4:43 PM, Sven Richter 
wrote:

> Hi,
>
> I tried both destructuring and the nth form instead of second and first.
> None of which worked.
>
> However, if I change the Union to Intersection in
>
> (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])
>
> it works for the definition of the multimethod. Does that make sense? I 
> thought Union was either one type or the other.
>
> Thanks,
> Sven
>
>
> Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose
> Bonnaire-Sergeant:
>>
>> I don't think second's type is is smart enough.
>>
>> Try using nth or destructuring instead:
>>
>> (let [[f s] v]
>>   (if (vector? s) (first s) s))
>>
>> or
>>
>> (if (vector? (nth v 1)) (first (nth v 1)) s)
>>
>> Thanks,
>> Ambrose
>>
>> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter 
>> wrote:
>>
>>> Hi,
>>>
>>> I have this code:
>>>
>>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String})
>>> String]))
>>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) t/Any
>>> *]))
>>> (defalias html-form-group (t/HVec [html-label html-form]))
>>>
>>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) t/Any
>>> t/Any *]) ->
>>>html-form-group])
>>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>>(if (vector? (second col))
>>>  (first (second col))
>>>  (second col
>>>
>>> And here comes the error message when checking this function:
>>>
>>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function first
>>> could not be applied to arguments:
>>> Polymorphic Variables:
>>> x
>>>
>>> Domains:
>>> (t/HSequential [x t/Any *])
>>> (t/Option (t/EmptySeqable x))
>>> (t/NonEmptySeqable x)
>>> (t/Option (clojure.lang.Seqable x))
>>>
>>> Arguments:
>>> (t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
>>>
>>> Ranges:
>>> x :object {:path [(Nth 0)], :id 0}
>>> nil
>>> x
>>> (t/Option x)
>>>
>>> in: (first (second col))
>>> in: (first (second col))
>>>
>>>
>>> ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.
>>> clj:4403)
>>>
>>> My assumption is that the check (if (vector? (second col will return
>>> only true if it is this type: (HVec [Keyword Number]). However, I have
>>> the impression that core.typed does not resolve the if expression properly.
>>> Or maybe I am missing something completely.
>>>
>>> Any hints or recommendations?
>>>
>>> Thanks,
>>> Sven
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed question (maybe a bug?)

2015-04-16 Thread Sven Richter
Hi,

I tried both destructuring and the nth form instead of second and first. 
None of which worked.

However, if I change the Union to Intersection in 

(t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *])

it works for the definition of the multimethod. Does that make sense? I thought 
Union was either one type or the other.

Thanks,
Sven


Am Donnerstag, 16. April 2015 21:44:25 UTC+2 schrieb Ambrose 
Bonnaire-Sergeant:
>
> I don't think second's type is is smart enough.
>
> Try using nth or destructuring instead:
>
> (let [[f s] v]
>   (if (vector? s) (first s) s))
>
> or
>
> (if (vector? (nth v 1)) (first (nth v 1)) s)
>
> Thanks,
> Ambrose
>
> On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter  > wrote:
>
>> Hi,
>>
>> I have this code:
>>
>> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String}) 
>> String]))
>> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) t/Any 
>> *]))
>> (defalias html-form-group (t/HVec [html-label html-form]))
>>  
>> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) t/Any 
>> t/Any *]) -> 
>>html-form-group])
>> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>>(if (vector? (second col))
>>  (first (second col))
>>  (second col
>>
>> And here comes the error message when checking this function:
>>
>> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function first 
>> could not be applied to arguments:
>> Polymorphic Variables:
>> x
>>  
>> Domains:
>> (t/HSequential [x t/Any *])
>> (t/Option (t/EmptySeqable x))
>> (t/NonEmptySeqable x)
>> (t/Option (clojure.lang.Seqable x))
>>  
>> Arguments:
>> (t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
>>  
>> Ranges:
>> x :object {:path [(Nth 0)], :id 0}
>> nil
>> x
>> (t/Option x)
>>  
>> in: (first (second col))
>> in: (first (second col))
>>  
>>  
>> ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.
>> clj:4403)
>>
>> My assumption is that the check (if (vector? (second col will return only 
>> true if it is this type: (HVec [Keyword Number]). However, I have the 
>> impression that core.typed does not resolve the if expression properly.
>> Or maybe I am missing something completely.
>>
>> Any hints or recommendations?
>>
>> Thanks,
>> Sven
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
I don't think second's type is is smart enough.

Try using nth or destructuring instead:

(let [[f s] v]
  (if (vector? s) (first s) s))

or

(if (vector? (nth v 1)) (first (nth v 1)) s)

Thanks,
Ambrose

On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter 
wrote:

> Hi,
>
> I have this code:
>
> (defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String})
> String]))
> (defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) t/Any
> *]))
> (defalias html-form-group (t/HVec [html-label html-form]))
>
> (t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) t/Any
> t/Any *]) ->
>html-form-group])
> (defmulti dt->hiccup (t/fn [col :- pt/et-column]
>(if (vector? (second col))
>  (first (second col))
>  (second col
>
> And here comes the error message when checking this function:
>
> Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function first
> could not be applied to arguments:
> Polymorphic Variables:
> x
>
> Domains:
> (t/HSequential [x t/Any *])
> (t/Option (t/EmptySeqable x))
> (t/NonEmptySeqable x)
> (t/Option (clojure.lang.Seqable x))
>
> Arguments:
> (t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
>
> Ranges:
> x :object {:path [(Nth 0)], :id 0}
> nil
> x
> (t/Option x)
>
> in: (first (second col))
> in: (first (second col))
>
>
> ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.clj:
> 4403)
>
> My assumption is that the check (if (vector? (second col will return only
> true if it is this type: (HVec [Keyword Number]). However, I have the
> impression that core.typed does not resolve the if expression properly.
> Or maybe I am missing something completely.
>
> Any hints or recommendations?
>
> Thanks,
> Sven
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


core.typed question (maybe a bug?)

2015-04-16 Thread Sven Richter
Hi,

I have this code:

(defalias html-label (t/HVec [Keyword (t/HMap :mandatory {:for String}) 
String]))
(defalias html-form (t/HVec [Keyword (t/HMap :mandatory {:id String}) t/Any 
*]))
(defalias html-form-group (t/HVec [html-label html-form]))
 
(t/ann dt->hiccup [(HVec [Keyword (U Keyword (HVec [Keyword Number])) t/Any 
t/Any *]) -> 
   html-form-group])
(defmulti dt->hiccup (t/fn [col :- pt/et-column]
   (if (vector? (second col))
 (first (second col))
 (second col

And here comes the error message when checking this function:

Type Error (leiningen/td_to_hiccup.clj:25:34) Polymorphic function first 
could not be applied to arguments:
Polymorphic Variables:
x
 
Domains:
(t/HSequential [x t/Any *])
(t/Option (t/EmptySeqable x))
(t/NonEmptySeqable x)
(t/Option (clojure.lang.Seqable x))
 
Arguments:
(t/U Keyword (t/HVec [clojure.lang.Keyword java.lang.Number]))
 
Ranges:
x :object {:path [(Nth 0)], :id 0}
nil
x
(t/Option x)
 
in: (first (second col))
in: (first (second col))
 
 
ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.clj:
4403)

My assumption is that the check (if (vector? (second col will return only 
true if it is this type: (HVec [Keyword Number]). However, I have the 
impression that core.typed does not resolve the if expression properly.
Or maybe I am missing something completely.

Any hints or recommendations?

Thanks,
Sven


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [GSoC] core.typed Annotations and Macros Proposal

2015-03-18 Thread ZhanLin Shang
Thanks for the information :)

On Wed, Mar 18, 2015 at 2:35 AM Di Xu  wrote:

> Read code base, submit some patches to get familiar with the process, etc.
>
> Also you can reach Ambrose to discuss your idea & proposal.
>
> Di Xu
>
> 2015-03-18 13:29 GMT+08:00 ZhanLin Shang :
>
>> Hi,
>> Thanks for replying, I've signed the CA and forwarded this post to the
>> core.typed mailing list.
>> Can you tell me what should I do for now?
>> Thanks,
>> Z.Shang
>>
>> On Tuesday, March 17, 2015 at 5:49:34 PM UTC-7, Di Xu wrote:
>>>
>>> Welcome,
>>>
>>> I participated core.typed GSoC last year, and happy to see another
>>> Chinese student interested in core.typed project, you may forward your
>>> email to core.typed mail list[0], also you should first sign CA[1] (if you
>>> haven't) before any of your patches get accepted by core.typed or any core
>>> clojure library. You may submit some patches to JIRA[2] to make your
>>> application stronger. Also read base_env.clj[3] to get yourself familiar
>>> with core.typed annotation.
>>>
>>> Any question is welcomed.
>>>
>>> [0] https://groups.google.com/forum/#!forum/clojure-core-typed
>>> [1] http://clojure.org/contributing
>>> [2] http://dev.clojure.org/jira/browse/CTYP
>>> [3] https://github.com/clojure/core.typed/blob/
>>> master/module-check/src/main/clojure/clojure/core/typed/base_env.clj
>>>
>>> ​Best wishes for your GSoC​
>>>
>>> Thanks,
>>> Di Xu
>>>
>>> 2015-03-18 4:44 GMT+08:00 ZhanLin Shang :
>>>
>>>> Hello all,
>>>>
>>>> My name is Zhanlin Shang and I'd like to work with the core.typed
>>>> Annotations and Macros mentored by Ambrose Bonnaire-Sergeant this summer.
>>>> This is the first time for me to take part in this kind of event and I
>>>> hope this mailing list is the right place.
>>>>
>>>> I'm a second year undergraduate student of Arizona State University and
>>>> I've been programming with Common Lisp for two years and I've played around
>>>> with Racket and Clojure.
>>>> I'm interested in type theory and typed lambda calculus, and I've
>>>> created a Lisp dialect with a type system which shares some concept with
>>>> Core.Typed.
>>>>
>>>> I'd like to join this project to make Core.Typed better using all my
>>>> knowledge and learn from the process. And I'd like to discuss with you all
>>>> about the best / most beneficial design of Core.Typed.
>>>>
>>>> Best Wishes,
>>>> Z.Shang
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To post to this group, send email to clo...@googlegroups.com
>>>> Note that posts from new members are moderated - please be patient with
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>> clojure+u...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/clojure?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to clojure+u...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>>
> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To p

Re: [GSoC] core.typed Annotations and Macros Proposal

2015-03-18 Thread Di Xu
Read code base, submit some patches to get familiar with the process, etc.

Also you can reach Ambrose to discuss your idea & proposal.

Di Xu

2015-03-18 13:29 GMT+08:00 ZhanLin Shang :

> Hi,
> Thanks for replying, I've signed the CA and forwarded this post to the
> core.typed mailing list.
> Can you tell me what should I do for now?
> Thanks,
> Z.Shang
>
> On Tuesday, March 17, 2015 at 5:49:34 PM UTC-7, Di Xu wrote:
>>
>> Welcome,
>>
>> I participated core.typed GSoC last year, and happy to see another
>> Chinese student interested in core.typed project, you may forward your
>> email to core.typed mail list[0], also you should first sign CA[1] (if you
>> haven't) before any of your patches get accepted by core.typed or any core
>> clojure library. You may submit some patches to JIRA[2] to make your
>> application stronger. Also read base_env.clj[3] to get yourself familiar
>> with core.typed annotation.
>>
>> Any question is welcomed.
>>
>> [0] https://groups.google.com/forum/#!forum/clojure-core-typed
>> [1] http://clojure.org/contributing
>> [2] http://dev.clojure.org/jira/browse/CTYP
>> [3] https://github.com/clojure/core.typed/blob/
>> master/module-check/src/main/clojure/clojure/core/typed/base_env.clj
>>
>> ​Best wishes for your GSoC​
>>
>> Thanks,
>> Di Xu
>>
>> 2015-03-18 4:44 GMT+08:00 ZhanLin Shang :
>>
>>> Hello all,
>>>
>>> My name is Zhanlin Shang and I'd like to work with the core.typed
>>> Annotations and Macros mentored by Ambrose Bonnaire-Sergeant this summer.
>>> This is the first time for me to take part in this kind of event and I
>>> hope this mailing list is the right place.
>>>
>>> I'm a second year undergraduate student of Arizona State University and
>>> I've been programming with Common Lisp for two years and I've played around
>>> with Racket and Clojure.
>>> I'm interested in type theory and typed lambda calculus, and I've
>>> created a Lisp dialect with a type system which shares some concept with
>>> Core.Typed.
>>>
>>> I'd like to join this project to make Core.Typed better using all my
>>> knowledge and learn from the process. And I'd like to discuss with you all
>>> about the best / most beneficial design of Core.Typed.
>>>
>>> Best Wishes,
>>> Z.Shang
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [GSoC] core.typed Annotations and Macros Proposal

2015-03-17 Thread ZhanLin Shang
Hi,
Thanks for replying, I've signed the CA and forwarded this post to the 
core.typed mailing list.
Can you tell me what should I do for now?
Thanks,
Z.Shang

On Tuesday, March 17, 2015 at 5:49:34 PM UTC-7, Di Xu wrote:
>
> Welcome,
>
> I participated core.typed GSoC last year, and happy to see another Chinese 
> student interested in core.typed project, you may forward your email to 
> core.typed mail list[0], also you should first sign CA[1] (if you haven't) 
> before any of your patches get accepted by core.typed or any core clojure 
> library. You may submit some patches to JIRA[2] to make your application 
> stronger. Also read base_env.clj[3] to get yourself familiar with 
> core.typed annotation.
>
> Any question is welcomed.
>
> [0] https://groups.google.com/forum/#!forum/clojure-core-typed
> [1] http://clojure.org/contributing
> [2] http://dev.clojure.org/jira/browse/CTYP
> [3] 
> https://github.com/clojure/core.typed/blob/master/module-check/src/main/clojure/clojure/core/typed/base_env.clj
>
> ​Best wishes for your GSoC​
>
> Thanks,
> Di Xu
>
> 2015-03-18 4:44 GMT+08:00 ZhanLin Shang 
> >:
>
>> Hello all,
>>
>> My name is Zhanlin Shang and I'd like to work with the core.typed 
>> Annotations and Macros mentored by Ambrose Bonnaire-Sergeant this summer.
>> This is the first time for me to take part in this kind of event and I 
>> hope this mailing list is the right place.
>>
>> I'm a second year undergraduate student of Arizona State University and 
>> I've been programming with Common Lisp for two years and I've played around 
>> with Racket and Clojure. 
>> I'm interested in type theory and typed lambda calculus, and I've created 
>> a Lisp dialect with a type system which shares some concept with Core.Typed.
>>
>> I'd like to join this project to make Core.Typed better using all my 
>> knowledge and learn from the process. And I'd like to discuss with you all 
>> about the best / most beneficial design of Core.Typed.
>>
>> Best Wishes,
>> Z.Shang
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [GSoC] core.typed Annotations and Macros Proposal

2015-03-17 Thread Di Xu
Welcome,

I participated core.typed GSoC last year, and happy to see another Chinese
student interested in core.typed project, you may forward your email to
core.typed mail list[0], also you should first sign CA[1] (if you haven't)
before any of your patches get accepted by core.typed or any core clojure
library. You may submit some patches to JIRA[2] to make your application
stronger. Also read base_env.clj[3] to get yourself familiar with
core.typed annotation.

Any question is welcomed.

[0] https://groups.google.com/forum/#!forum/clojure-core-typed
[1] http://clojure.org/contributing
[2] http://dev.clojure.org/jira/browse/CTYP
[3]
https://github.com/clojure/core.typed/blob/master/module-check/src/main/clojure/clojure/core/typed/base_env.clj

​Best wishes for your GSoC​

Thanks,
Di Xu

2015-03-18 4:44 GMT+08:00 ZhanLin Shang :

> Hello all,
>
> My name is Zhanlin Shang and I'd like to work with the core.typed
> Annotations and Macros mentored by Ambrose Bonnaire-Sergeant this summer.
> This is the first time for me to take part in this kind of event and I
> hope this mailing list is the right place.
>
> I'm a second year undergraduate student of Arizona State University and
> I've been programming with Common Lisp for two years and I've played around
> with Racket and Clojure.
> I'm interested in type theory and typed lambda calculus, and I've created
> a Lisp dialect with a type system which shares some concept with Core.Typed.
>
> I'd like to join this project to make Core.Typed better using all my
> knowledge and learn from the process. And I'd like to discuss with you all
> about the best / most beneficial design of Core.Typed.
>
> Best Wishes,
> Z.Shang
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[GSoC] core.typed Annotations and Macros Proposal

2015-03-17 Thread ZhanLin Shang
Hello all,

My name is Zhanlin Shang and I'd like to work with the core.typed 
Annotations and Macros mentored by Ambrose Bonnaire-Sergeant this summer.
This is the first time for me to take part in this kind of event and I hope 
this mailing list is the right place.

I'm a second year undergraduate student of Arizona State University and 
I've been programming with Common Lisp for two years and I've played around 
with Racket and Clojure. 
I'm interested in type theory and typed lambda calculus, and I've created a 
Lisp dialect with a type system which shares some concept with Core.Typed.

I'd like to join this project to make Core.Typed better using all my 
knowledge and learn from the process. And I'd like to discuss with you all 
about the best / most beneficial design of Core.Typed.

Best Wishes,
Z.Shang

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed questions

2014-12-12 Thread Jesse
Thanks Di Xu. Good to know. I have joined the core.typed group and will 
post my questions there from now on. 

J

On Friday, December 12, 2014 11:41:43 PM UTC-6, Jesse wrote:
>
> Hi guys, Does anyone know how to properly deal with refs in core.typed? I 
> am running into trouble. When I try to do stuff like this:
>
> (ann  my-ref (Ref1 (U Kw nil)))
>> (def my-ref (ref #{}))
>
>
> I get this error:
>
>> IllegalArgumentException No value supplied for key: true  
>> clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)
>
>
> the only thing I can do to make it work is ^:no-check it, but is this the 
> solution? 
>
> Furthermore, when check this code here: 
>
> (defn update-refs [ref-name :- (Ref1 (Set (Option Kw))),  update-map :- 
>> (Map Kw String)] :- (Set (Option Kw))
>>   (dosync
>> (alter some-other-ref merge update-map)
>> (alter ref-name s/union #{(first (keys update-map))})))
>
>
> I get errors about how alter is unable to be applied to its arguments and 
> how first is a polymorphic function. Here they are in all their glory. I 
> can't follow the the thread of what exactly is wrong here from what it says.
>
> Type Error (tic_tac_toe/check.clj:80:3) Polymorphic function alter could 
> not be applied to arguments:
> Polymorphic Variables:
> w
> r
> b
>
> Domains:
> (Ref2 w r) [r b ... b -> w] b ... b 
>
> Arguments:
> (Ref1 (HMap :mandatory {:a2 (Option Str), :b2 (Option Str), :c3 (Option 
> Str), :a3 (Option Str), :a1 (Option Str), :b1 (Option Str), :c2 (Option 
> Str), :c1 (Option Str), :b3 (Option Str)})) (All [k v] (IFn [nil * -> nil] 
> [(clojure.lang.IPersistentMap k v) (clojure.lang.IPersistentMap k v) * -> 
> (clojure.lang.IPersistentMap k v)] [(Option (clojure.lang.IPersistentMap k 
> v)) * -> (Option (clojure.lang.IPersistentMap k v))])) (Map Kw 
> java.lang.String) 
>
> Ranges:
> w 
>
> in: (alter some-other-ref merge update-map)
> in: (alter some-other-ref merge update-map)
>
> Type Error (tic_tac_toe/check.clj:81:4) Polymorphic function alter could 
> not be applied to arguments:
> Polymorphic Variables:
> w
> r
> b 
>
> Domains:
> (Ref2 w r) [r b ... b -> w] b ... b 
>
> Arguments:
> (Ref1 (Set (Option Kw))) (All [x] [(Set x) * -> (Set x)]) 
> (PersistentHashSet (U Keyword nil)) 
>
> Ranges:
> w 
>
> with expected type:
> Any
> in: (alter my-ref s/union #{(first (keys update-map))})
> in: (alter my-ref s/union #{(first (keys update-map))})
>
> Type Error (tic_tac_toe/check.clj:79:3) Polymorphic static method 
> clojure.lang.LockingTransaction/runInTransaction could not be applied to 
> arguments:
> Polymorphic Variables:
> x 
>
> Domains:
> [-> x] 
>
> Arguments:
> [-> Any] 
>
> Ranges:
> x 
>
> with expected type:
> (Set (Option Kw)) 
>
> in: (clojure.lang.LockingTransaction/runInTransaction (fn* ([] (do (alter 
> some-other-ref merge update-map) (alter my-ref s/union #{(first (keys 
> update-map))})
> in: (clojure.lang.LockingTransaction/runInTransaction (fn* ([] (do # #
>
>  
> Lastly, the example from the wiki with the atom:
>
> (cf (atom {}) (Atom1 (Map Sym Num)))
>
> =>  (Atom2 (IPersistentMap Sym Num) (IPersistentMap Sym Num))
>
>
> does not translate to the ref: 
>
> (cf (ref #{}) (Ref1 (Seq (U nil Kw
>
> =>  IllegalArgumentException No value supplied for key: true  
>> clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)
>
> (same error as above) 
>
> I have seen this error before on a jira issue posted here:  
> http://dev.clojure.org/jira/browse/CLJ-1149
>
> What is going on? I am using clojure 1.7.0-alpha4 and core.typed 0.2.72
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed questions

2014-12-12 Thread Di Xu
2014-12-13 13:41 GMT+08:00 Jesse :

> Hi guys, Does anyone know how to properly deal with refs in core.typed? I
> am running into trouble. When I try to do stuff like this:
>
> (ann  my-ref (Ref1 (U Kw nil)))
>> (def my-ref (ref #{}))
>
>
> I get this error:
>
>> IllegalArgumentException No value supplied for key: true
>> clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)
>
>
> the only thing I can do to make it work is ^:no-check it, but is this the
> solution?
>

​Hi, it's pst likes:

IllegalArgumentException No value supplied for key: true
clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)
clojure.core.typed.type-rep/-hset (type_rep.clj:598)

clojure.core.typed.promote-demote/eval27552/fn--27553/f--27366--auto27554
(promote_demote.clj:221)
clojure.core.typed.promote-demote/eval27552/fn--27553
(promote_demote.clj:218)
clojure.lang.MultiFn.invoke (MultiFn.java:231)
clojure.core.typed.promote-demote/promote-var
(promote_demote.clj:49)
clojure.core.typed.cs-gen/promote-F (cs_gen.clj:1090)
clojure.core.typed.cs-gen/cs-gen-right-F (cs_gen.clj:1116)
clojure.core.typed.cs-gen/cs-gen/fn--29151 (cs_gen.clj:328)
clojure.core.typed.cs-gen/cs-gen (cs_gen.clj:316)
clojure.core.typed.cs-gen/cs-gen-list/iter--31724--31728/fn--31729
(cs_gen.clj:1594)
clojure.lang.LazySeq.sval (LazySeq.java:40)
​


​it seems a bug in core.typed here
<https://github.com/clojure/core.typed/blob/master/module-check/src/main/clojure/clojure/core/typed/promote_demote.clj#L221>.
I think it supposed to be ​`(r/-hset fixed :complete? (:complete? T))`.

BTW, there're core.typed mail list
<https://groups.google.com/forum/#!forum/clojure-core-typed>, you can ask
question about core.typed there instead of general clojure list here.

Thanks,
Di Xu

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


core.typed questions

2014-12-12 Thread Jesse
Hi guys, Does anyone know how to properly deal with refs in core.typed? I 
am running into trouble. When I try to do stuff like this:

(ann  my-ref (Ref1 (U Kw nil)))
> (def my-ref (ref #{}))


I get this error:

> IllegalArgumentException No value supplied for key: true  
> clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)


the only thing I can do to make it work is ^:no-check it, but is this the 
solution? 

Furthermore, when check this code here: 

(defn update-refs [ref-name :- (Ref1 (Set (Option Kw))),  update-map :- 
> (Map Kw String)] :- (Set (Option Kw))
>   (dosync
> (alter some-other-ref merge update-map)
> (alter ref-name s/union #{(first (keys update-map))})))


I get errors about how alter is unable to be applied to its arguments and 
how first is a polymorphic function. Here they are in all their glory. I 
can't follow the the thread of what exactly is wrong here from what it says.

Type Error (tic_tac_toe/check.clj:80:3) Polymorphic function alter could 
not be applied to arguments:
Polymorphic Variables:
w
r
b

Domains:
(Ref2 w r) [r b ... b -> w] b ... b 

Arguments:
(Ref1 (HMap :mandatory {:a2 (Option Str), :b2 (Option Str), :c3 (Option 
Str), :a3 (Option Str), :a1 (Option Str), :b1 (Option Str), :c2 (Option 
Str), :c1 (Option Str), :b3 (Option Str)})) (All [k v] (IFn [nil * -> nil] 
[(clojure.lang.IPersistentMap k v) (clojure.lang.IPersistentMap k v) * -> 
(clojure.lang.IPersistentMap k v)] [(Option (clojure.lang.IPersistentMap k 
v)) * -> (Option (clojure.lang.IPersistentMap k v))])) (Map Kw 
java.lang.String) 

Ranges:
w 

in: (alter some-other-ref merge update-map)
in: (alter some-other-ref merge update-map)

Type Error (tic_tac_toe/check.clj:81:4) Polymorphic function alter could 
not be applied to arguments:
Polymorphic Variables:
w
r
b 

Domains:
(Ref2 w r) [r b ... b -> w] b ... b 

Arguments:
(Ref1 (Set (Option Kw))) (All [x] [(Set x) * -> (Set x)]) 
(PersistentHashSet (U Keyword nil)) 

Ranges:
w 

with expected type:
Any
in: (alter my-ref s/union #{(first (keys update-map))})
in: (alter my-ref s/union #{(first (keys update-map))})

Type Error (tic_tac_toe/check.clj:79:3) Polymorphic static method 
clojure.lang.LockingTransaction/runInTransaction could not be applied to 
arguments:
Polymorphic Variables:
x 

Domains:
[-> x] 

Arguments:
[-> Any] 

Ranges:
x 

with expected type:
(Set (Option Kw)) 

in: (clojure.lang.LockingTransaction/runInTransaction (fn* ([] (do (alter 
some-other-ref merge update-map) (alter my-ref s/union #{(first (keys 
update-map))})
in: (clojure.lang.LockingTransaction/runInTransaction (fn* ([] (do # #

 
Lastly, the example from the wiki with the atom:

(cf (atom {}) (Atom1 (Map Sym Num)))

=>  (Atom2 (IPersistentMap Sym Num) (IPersistentMap Sym Num))


does not translate to the ref: 

(cf (ref #{}) (Ref1 (Seq (U nil Kw

=>  IllegalArgumentException No value supplied for key: true  
> clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)

(same error as above) 

I have seen this error before on a jira issue posted 
here:  http://dev.clojure.org/jira/browse/CLJ-1149

What is going on? I am using clojure 1.7.0-alpha4 and core.typed 0.2.72

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: annotating functions that use destructuring in core.typed

2014-10-15 Thread kurofune
That's much clearer now. Thanks a lot. 



On Wednesday, October 15, 2014 5:46:37 PM UTC-5, Ambrose Bonnaire-Sergeant 
wrote:
>
> The :- is just a bit of syntax to signify an annotation. As a rule, it 
> goes *after*
> the form you might expect to attach metadata to.
>
> eg. (t/fn [a :- Int] :- Num ) is [Int -> Num]
>   (t/let [a :- Int, 1] ...) checks 1 as being under Int.
>   (t/let [[a b] :- '[Num Num], [1 2]] ...) checks [1 2] as under 
> '[Num Num], then assigns whatever expression is to the left the type '[Num 
> Num]
>   (t/for [[a b] :- '[Num Num], foo] :- Ret e) assigns the left hand 
> side of the binder type '[Num Num], where the right hand side is (U nil 
> (Seqable '[Num Num])). This is because every iteration [a b] is an element 
> of foo.
>   The return type Ret is similarly for one iteration, and the inferred 
> type will be (Seq Ret).
>
> Thanks,
> Ambrose
>
>
> On Wed, Oct 15, 2014 at 6:34 PM, kurofune  > wrote:
>
>> Thanks Ambrose, 
>>
>> It makes way better sense after looking at your gist. I still don't 
>> *quite* understand the :- syntax, though. Is it just introducing a type 
>> declaration to the data structure that comes after it?
>>
>> This is a super cool project, by the way.
>>
>> K
>>
>>
>> On Wednesday, October 15, 2014 3:14:58 PM UTC-5, Ambrose 
>> Bonnaire-Sergeant wrote:
>>>
>>> Hi,
>>>
>>> The issue is that you can't use clojure.core/for in typed code.
>>>
>>> You must use clojure.core.typed/for 
>>> <http://www.google.com/url?q=http%3A%2F%2Fclojure.github.io%2Fcore.typed%2F%23clojure.core.typed%2Ffor&sa=D&sntz=1&usg=AFQjCNHQ7AqglYarx-OVAqx1sUXcO4c9vw>,
>>>  
>>> and annotate the parameters and expected type.
>>>
>>> (ann map-span (All [x y y1] [(Map x y) [y -> y1]  -> (Map x y1)]))
>>> (defn map-span [m f] 
>>>(into {} (t/for [[k v] :- '[x y] m] :- '[x y1]
>>>   [k (f v)])))
>>>
>>> Here's a real gist 
>>> <https://gist.github.com/frenchy64/176fa8aadfd5b0cbfc09>.
>>>
>>> Thanks,
>>> Ambrose
>>>
>>> On Wed, Oct 15, 2014 at 2:28 PM, kurofune  wrote:
>>>
>>>> Hi everyone, 
>>>>
>>>> I am learning core.typed and ran into a stumbling block. When I use 
>>>> annotations on normal functions and run 'check-ns', things work out ok, 
>>>>
>>>> ;; works as expected
>>>>> (ann plus1 [Number -> Number])
>>>>> (defn plus1 [n] (+ n 1))
>>>>>
>>>>> ;; Works as expected
>>>>> (ann mult-arity [Number String -> (HMap :mandatory {:a Number :b 
>>>>> String})])
>>>>> (defn mult-arity [n s] {:a n :b s})
>>>>
>>>>
>>>>
>>>> but with functions that use destructuring in their body, I run into 
>>>> problems. 
>>>>
>>>>
>>>> ;; Does not work. 
>>>>> (ann map-span [Map Fn  -> Map])
>>>>> (defn map-span [m f] (into {} (for [[k v] m] [k (f v)])))
>>>>>
>>>>  
>>>>
>>>> clojure.lang.ExceptionInfo: Type Checker: Found 8 errors :: 
>>>> {:type-error :top-level-error, :errors (#>>> clojure.lang.ExceptionInfo: Polymorphic static method clojure.lang.RT/nth 
>>>> could not be applied to arguments: Polymorphic Variables: x y Domains: (I 
>>>> (CountRange 1) (U (I (clojure.lang.Seqable x) clojure.lang.Sequential) 
>>>> (Indexed x))) (Val 0) Any (U nil (I (clojure.lang.Seqable x) 
>>>> clojure.lang.Sequential) (Indexed x)) Int y Arguments: Any (Val 0) nil 
>>>> Ranges: x 
>>>> (U x y) ...
>>>>
>>>>
>>>> ;; This also throws errors at the repl.
>>>>> (cf (fn [m f] (into {} (for [[k v] m] [k (f v)]))) [Map Fn  -> Map])
>>>>
>>>>
>>>>
>>>>
>>>> I have been on the core.typed wiki and googled around but to no avail. 
>>>> I have also used lighter amounts of destructuring in the function 
>>>> parameters and run into similar errors. I am having trouble even 
>>>> understanding the error messages (even after reading the pertinent wiki 
>>>> page) so if someone could give me some insights on how to do this 
>>>> properly, 
>>>> I would really appreciate it. 
>>>>
>>>> K
>&

Re: annotating functions that use destructuring in core.typed

2014-10-15 Thread Ambrose Bonnaire-Sergeant
The :- is just a bit of syntax to signify an annotation. As a rule, it goes
*after*
the form you might expect to attach metadata to.

eg. (t/fn [a :- Int] :- Num ) is [Int -> Num]
  (t/let [a :- Int, 1] ...) checks 1 as being under Int.
  (t/let [[a b] :- '[Num Num], [1 2]] ...) checks [1 2] as under '[Num
Num], then assigns whatever expression is to the left the type '[Num Num]
  (t/for [[a b] :- '[Num Num], foo] :- Ret e) assigns the left hand
side of the binder type '[Num Num], where the right hand side is (U nil
(Seqable '[Num Num])). This is because every iteration [a b] is an element
of foo.
  The return type Ret is similarly for one iteration, and the inferred
type will be (Seq Ret).

Thanks,
Ambrose


On Wed, Oct 15, 2014 at 6:34 PM, kurofune  wrote:

> Thanks Ambrose,
>
> It makes way better sense after looking at your gist. I still don't
> *quite* understand the :- syntax, though. Is it just introducing a type
> declaration to the data structure that comes after it?
>
> This is a super cool project, by the way.
>
> K
>
>
> On Wednesday, October 15, 2014 3:14:58 PM UTC-5, Ambrose Bonnaire-Sergeant
> wrote:
>>
>> Hi,
>>
>> The issue is that you can't use clojure.core/for in typed code.
>>
>> You must use clojure.core.typed/for
>> <http://www.google.com/url?q=http%3A%2F%2Fclojure.github.io%2Fcore.typed%2F%23clojure.core.typed%2Ffor&sa=D&sntz=1&usg=AFQjCNHQ7AqglYarx-OVAqx1sUXcO4c9vw>,
>> and annotate the parameters and expected type.
>>
>> (ann map-span (All [x y y1] [(Map x y) [y -> y1]  -> (Map x y1)]))
>> (defn map-span [m f]
>>(into {} (t/for [[k v] :- '[x y] m] :- '[x y1]
>>   [k (f v)])))
>>
>> Here's a real gist
>> <https://gist.github.com/frenchy64/176fa8aadfd5b0cbfc09>.
>>
>> Thanks,
>> Ambrose
>>
>> On Wed, Oct 15, 2014 at 2:28 PM, kurofune  wrote:
>>
>>> Hi everyone,
>>>
>>> I am learning core.typed and ran into a stumbling block. When I use
>>> annotations on normal functions and run 'check-ns', things work out ok,
>>>
>>> ;; works as expected
>>>> (ann plus1 [Number -> Number])
>>>> (defn plus1 [n] (+ n 1))
>>>>
>>>> ;; Works as expected
>>>> (ann mult-arity [Number String -> (HMap :mandatory {:a Number :b
>>>> String})])
>>>> (defn mult-arity [n s] {:a n :b s})
>>>
>>>
>>>
>>> but with functions that use destructuring in their body, I run into
>>> problems.
>>>
>>>
>>> ;; Does not work.
>>>> (ann map-span [Map Fn  -> Map])
>>>> (defn map-span [m f] (into {} (for [[k v] m] [k (f v)])))
>>>>
>>>
>>>
>>> clojure.lang.ExceptionInfo: Type Checker: Found 8 errors :: {:type-error
>>> :top-level-error, :errors (#>> Polymorphic static method clojure.lang.RT/nth could not be applied to
>>> arguments: Polymorphic Variables: x y Domains: (I (CountRange 1) (U (I
>>> (clojure.lang.Seqable x) clojure.lang.Sequential) (Indexed x))) (Val 0) Any
>>> (U nil (I (clojure.lang.Seqable x) clojure.lang.Sequential) (Indexed x))
>>> Int y Arguments: Any (Val 0) nil Ranges: x
>>> (U x y) ...
>>>
>>>
>>> ;; This also throws errors at the repl.
>>>> (cf (fn [m f] (into {} (for [[k v] m] [k (f v)]))) [Map Fn  -> Map])
>>>
>>>
>>>
>>>
>>> I have been on the core.typed wiki and googled around but to no avail. I
>>> have also used lighter amounts of destructuring in the function parameters
>>> and run into similar errors. I am having trouble even understanding the
>>> error messages (even after reading the pertinent wiki page) so if someone
>>> could give me some insights on how to do this properly, I would really
>>> appreciate it.
>>>
>>> K
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>&

Re: annotating functions that use destructuring in core.typed

2014-10-15 Thread kurofune
Thanks Ambrose, 

It makes way better sense after looking at your gist. I still don't *quite* 
understand the :- syntax, though. Is it just introducing a type declaration 
to the data structure that comes after it?

This is a super cool project, by the way.

K


On Wednesday, October 15, 2014 3:14:58 PM UTC-5, Ambrose Bonnaire-Sergeant 
wrote:
>
> Hi,
>
> The issue is that you can't use clojure.core/for in typed code.
>
> You must use clojure.core.typed/for 
> <http://www.google.com/url?q=http%3A%2F%2Fclojure.github.io%2Fcore.typed%2F%23clojure.core.typed%2Ffor&sa=D&sntz=1&usg=AFQjCNHQ7AqglYarx-OVAqx1sUXcO4c9vw>,
>  
> and annotate the parameters and expected type.
>
> (ann map-span (All [x y y1] [(Map x y) [y -> y1]  -> (Map x y1)]))
> (defn map-span [m f] 
>(into {} (t/for [[k v] :- '[x y] m] :- '[x y1]
>   [k (f v)])))
>
> Here's a real gist 
> <https://gist.github.com/frenchy64/176fa8aadfd5b0cbfc09>.
>
> Thanks,
> Ambrose
>
> On Wed, Oct 15, 2014 at 2:28 PM, kurofune  > wrote:
>
>> Hi everyone, 
>>
>> I am learning core.typed and ran into a stumbling block. When I use 
>> annotations on normal functions and run 'check-ns', things work out ok, 
>>
>> ;; works as expected
>>> (ann plus1 [Number -> Number])
>>> (defn plus1 [n] (+ n 1))
>>>
>>> ;; Works as expected
>>> (ann mult-arity [Number String -> (HMap :mandatory {:a Number :b 
>>> String})])
>>> (defn mult-arity [n s] {:a n :b s})
>>
>>
>>
>> but with functions that use destructuring in their body, I run into 
>> problems. 
>>
>>
>> ;; Does not work. 
>>> (ann map-span [Map Fn  -> Map])
>>> (defn map-span [m f] (into {} (for [[k v] m] [k (f v)])))
>>>
>>  
>>
>> clojure.lang.ExceptionInfo: Type Checker: Found 8 errors :: {:type-error 
>> :top-level-error, :errors (#> Polymorphic static method clojure.lang.RT/nth could not be applied to 
>> arguments: Polymorphic Variables: x y Domains: (I (CountRange 1) (U (I 
>> (clojure.lang.Seqable x) clojure.lang.Sequential) (Indexed x))) (Val 0) Any 
>> (U nil (I (clojure.lang.Seqable x) clojure.lang.Sequential) (Indexed x)) 
>> Int y Arguments: Any (Val 0) nil Ranges: x 
>> (U x y) ...
>>
>>
>> ;; This also throws errors at the repl.
>>> (cf (fn [m f] (into {} (for [[k v] m] [k (f v)]))) [Map Fn  -> Map])
>>
>>
>>
>>
>> I have been on the core.typed wiki and googled around but to no avail. I 
>> have also used lighter amounts of destructuring in the function parameters 
>> and run into similar errors. I am having trouble even understanding the 
>> error messages (even after reading the pertinent wiki page) so if someone 
>> could give me some insights on how to do this properly, I would really 
>> appreciate it. 
>>
>> K
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: annotating functions that use destructuring in core.typed

2014-10-15 Thread Ambrose Bonnaire-Sergeant
Hi,

The issue is that you can't use clojure.core/for in typed code.

You must use clojure.core.typed/for
<http://clojure.github.io/core.typed/#clojure.core.typed/for>, and annotate
the parameters and expected type.

(ann map-span (All [x y y1] [(Map x y) [y -> y1]  -> (Map x y1)]))
(defn map-span [m f]
   (into {} (t/for [[k v] :- '[x y] m] :- '[x y1]
  [k (f v)])))

Here's a real gist <https://gist.github.com/frenchy64/176fa8aadfd5b0cbfc09>.

Thanks,
Ambrose

On Wed, Oct 15, 2014 at 2:28 PM, kurofune  wrote:

> Hi everyone,
>
> I am learning core.typed and ran into a stumbling block. When I use
> annotations on normal functions and run 'check-ns', things work out ok,
>
> ;; works as expected
>> (ann plus1 [Number -> Number])
>> (defn plus1 [n] (+ n 1))
>>
>> ;; Works as expected
>> (ann mult-arity [Number String -> (HMap :mandatory {:a Number :b
>> String})])
>> (defn mult-arity [n s] {:a n :b s})
>
>
>
> but with functions that use destructuring in their body, I run into
> problems.
>
>
> ;; Does not work.
>> (ann map-span [Map Fn  -> Map])
>> (defn map-span [m f] (into {} (for [[k v] m] [k (f v)])))
>>
>
>
> clojure.lang.ExceptionInfo: Type Checker: Found 8 errors :: {:type-error
> :top-level-error, :errors (# Polymorphic static method clojure.lang.RT/nth could not be applied to
> arguments: Polymorphic Variables: x y Domains: (I (CountRange 1) (U (I
> (clojure.lang.Seqable x) clojure.lang.Sequential) (Indexed x))) (Val 0) Any
> (U nil (I (clojure.lang.Seqable x) clojure.lang.Sequential) (Indexed x))
> Int y Arguments: Any (Val 0) nil Ranges: x
> (U x y) ...
>
>
> ;; This also throws errors at the repl.
>> (cf (fn [m f] (into {} (for [[k v] m] [k (f v)]))) [Map Fn  -> Map])
>
>
>
>
> I have been on the core.typed wiki and googled around but to no avail. I
> have also used lighter amounts of destructuring in the function parameters
> and run into similar errors. I am having trouble even understanding the
> error messages (even after reading the pertinent wiki page) so if someone
> could give me some insights on how to do this properly, I would really
> appreciate it.
>
> K
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


annotating functions that use destructuring in core.typed

2014-10-15 Thread kurofune
Hi everyone, 

I am learning core.typed and ran into a stumbling block. When I use 
annotations on normal functions and run 'check-ns', things work out ok, 

;; works as expected
> (ann plus1 [Number -> Number])
> (defn plus1 [n] (+ n 1))
>
> ;; Works as expected
> (ann mult-arity [Number String -> (HMap :mandatory {:a Number :b String})])
> (defn mult-arity [n s] {:a n :b s})



but with functions that use destructuring in their body, I run into 
problems. 


;; Does not work. 
> (ann map-span [Map Fn  -> Map])
> (defn map-span [m f] (into {} (for [[k v] m] [k (f v)])))
>
 

clojure.lang.ExceptionInfo: Type Checker: Found 8 errors :: {:type-error 
:top-level-error, :errors (# (cf (fn [m f] (into {} (for [[k v] m] [k (f v)]))) [Map Fn  -> Map])




I have been on the core.typed wiki and googled around but to no avail. I 
have also used lighter amounts of destructuring in the function parameters 
and run into similar errors. I am having trouble even understanding the 
error messages (even after reading the pertinent wiki page) so if someone 
could give me some insights on how to do this properly, I would really 
appreciate it. 

K

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using core.typed to guide runtime behavior?

2014-04-24 Thread James MacAulay
Thanks for the pointers, Ambrose, and thanks for core.typed!

James

On Thursday, 24 April 2014 17:24:21 UTC-4, Ambrose Bonnaire-Sergeant wrote:
>
> I haven't tried anything like this.
>
> The most obvious pitfall is core.typed currently loads lazily and collects
> type annotations only after check-ns.
>
> There's a bunch of tools for manipulating types in the checker.
>
> Thanks,
> Ambrose
>
>
> On Thu, Apr 24, 2014 at 11:18 PM, James MacAulay 
> 
> > wrote:
>
>> I'm interested in exploring the use of the types provided by core.typed 
>> to guide function behavior at runtime. Specifically, I'd like to wrap 
>> existing functions such that the resulting functions behave in different 
>> ways depending on the type signatures of each original function.
>>
>> I'm imagining a setup where I have macros that get type information from 
>> core.typed at the time of macro-expansion, and either:
>>
>> * decide entirely at macro-expansion time how a function should be 
>> wrapped based on its type, or
>> * somehow make the type information available at runtime, leaving the 
>> analysis of the types to runtime functions.
>>
>> As an example of the kind of decision I'd like to make based on types, I 
>> might look at `clojure.core/map` and say "I'll wrap `map` such that its 
>> first argument will be transformed in some particular way because the 
>> argument is a function, and the rest of the arguments will be transformed 
>> in some other way because they are collections." The reason I want to have 
>> type information for this is that I want the transformations to be 
>> dependent on the actual semantics of the original function, which is hinted 
>> at by the types. For example I can take the fact that an argument's type is 
>> some sort of collection and infer that the function is probably processing 
>> its contents; in that case I would want to transform the argument in a 
>> different way than if its type were `Any`, in which case I could conclude 
>> that even if the argument ends up being a collection at runtime, the 
>> original function must not be relying on that fact.
>>
>> Does anyone see any obvious pitfalls with this kind of thing? Any tips 
>> from the crowd? I'm not sure exactly the best way of actually "analyzing" 
>> the type signatures, but I'm hoping that I might find some tools for that 
>> in core.typed.
>>
>> Thanks for any help you can give!
>>
>> Cheers,
>> James
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using core.typed to guide runtime behavior?

2014-04-24 Thread Ambrose Bonnaire-Sergeant
I haven't tried anything like this.

The most obvious pitfall is core.typed currently loads lazily and collects
type annotations only after check-ns.

There's a bunch of tools for manipulating types in the checker.

Thanks,
Ambrose


On Thu, Apr 24, 2014 at 11:18 PM, James MacAulay wrote:

> I'm interested in exploring the use of the types provided by core.typed to
> guide function behavior at runtime. Specifically, I'd like to wrap existing
> functions such that the resulting functions behave in different ways
> depending on the type signatures of each original function.
>
> I'm imagining a setup where I have macros that get type information from
> core.typed at the time of macro-expansion, and either:
>
> * decide entirely at macro-expansion time how a function should be wrapped
> based on its type, or
> * somehow make the type information available at runtime, leaving the
> analysis of the types to runtime functions.
>
> As an example of the kind of decision I'd like to make based on types, I
> might look at `clojure.core/map` and say "I'll wrap `map` such that its
> first argument will be transformed in some particular way because the
> argument is a function, and the rest of the arguments will be transformed
> in some other way because they are collections." The reason I want to have
> type information for this is that I want the transformations to be
> dependent on the actual semantics of the original function, which is hinted
> at by the types. For example I can take the fact that an argument's type is
> some sort of collection and infer that the function is probably processing
> its contents; in that case I would want to transform the argument in a
> different way than if its type were `Any`, in which case I could conclude
> that even if the argument ends up being a collection at runtime, the
> original function must not be relying on that fact.
>
> Does anyone see any obvious pitfalls with this kind of thing? Any tips
> from the crowd? I'm not sure exactly the best way of actually "analyzing"
> the type signatures, but I'm hoping that I might find some tools for that
> in core.typed.
>
> Thanks for any help you can give!
>
> Cheers,
> James
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using core.typed to guide runtime behavior?

2014-04-24 Thread James MacAulay
I'm interested in exploring the use of the types provided by core.typed to 
guide function behavior at runtime. Specifically, I'd like to wrap existing 
functions such that the resulting functions behave in different ways 
depending on the type signatures of each original function.

I'm imagining a setup where I have macros that get type information from 
core.typed at the time of macro-expansion, and either:

* decide entirely at macro-expansion time how a function should be wrapped 
based on its type, or
* somehow make the type information available at runtime, leaving the 
analysis of the types to runtime functions.

As an example of the kind of decision I'd like to make based on types, I 
might look at `clojure.core/map` and say "I'll wrap `map` such that its 
first argument will be transformed in some particular way because the 
argument is a function, and the rest of the arguments will be transformed 
in some other way because they are collections." The reason I want to have 
type information for this is that I want the transformations to be 
dependent on the actual semantics of the original function, which is hinted 
at by the types. For example I can take the fact that an argument's type is 
some sort of collection and infer that the function is probably processing 
its contents; in that case I would want to transform the argument in a 
different way than if its type were `Any`, in which case I could conclude 
that even if the argument ends up being a collection at runtime, the 
original function must not be relying on that fact.

Does anyone see any obvious pitfalls with this kind of thing? Any tips from 
the crowd? I'm not sure exactly the best way of actually "analyzing" the 
type signatures, but I'm hoping that I might find some tools for that in 
core.typed.

Thanks for any help you can give!

Cheers,
James

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: core.typed

2014-01-28 Thread Ambrose Bonnaire-Sergeant
Great, thanks!


On Wed, Jan 29, 2014 at 1:54 AM, Sean Corfield  wrote:

> I can confirm that I can evaluate namespaces that use core.typed 0.2.26
> inside LightTable - and run check-ns, which failed inside LightTable with
> 0.2.25!
>
> Sean
>
> On Jan 28, 2014, at 5:34 AM, Ambrose Bonnaire-Sergeant <
> abonnaireserge...@gmail.com> wrote:
>
> 0.2.26 contains a workaround by disabling the WIP Clojurescript support.
> You might need the 
> Sonatype<https://github.com/clojure/core.typed#releases-and-dependency-information>
>  repo.
>
> I've got a GRE exam on Monday so I can't work on this properly yet.
>
> Please let me know if it worked.
>
> Also Sean (CCed), please try 0.2.26 against your Light Table failure case.
> I believe this is the same issue.
>
> Thanks,
> Ambrose
>
> On Tue, Jan 28, 2014 at 9:03 PM, t x  wrote:
>
>> Hi Ambrose,
>>
>> Yes, I have a manual dependency on:
>>  [org.clojure/clojurescript "0.0-2138"]
>>
>> I looked at the project.clj of core.typed, and got:
>>
>> https://github.com/clojure/core.typed/blob/master/project.clj#L13
>>
>> Is the dependency on "[org.clojure/clojurescript "0.0-1859"]" correct?
>> (it seems rather outdated).
>>
>> Thanks!
>>
>> On Tue, Jan 28, 2014 at 4:59 AM, Ambrose Bonnaire-Sergeant
>>  wrote:
>> > Hi,
>> >
>> > There is some conflict with ClojureScript, some others have also
>> observed
>> > this.
>> >
>> > Is there some library that is upgrading the Clojurescript version to one
>> > different to
>> > what core.typed depends on?
>> >
>> > Thanks,
>> > Ambrose
>> >
>> >
>> > On Tue, Jan 28, 2014 at 5:38 PM, t x  wrote:
>> >>
>> >> ## Background
>> >>
>> >>   I'm using [org.clojure/core.typed "0.2.25"]
>> >>
>> >> ## Question:
>> >>
>> >>   Which is the following is true:
>> >>
>> >>   (1) my code is correct / should work, and therefore there is
>> something
>> >> with my setup
>> >>
>> >>   (2) my code is wrong (and please point out how I can fix it)
>> >>
>> >>
>> >> ## Code
>> >>
>> >> (ns test
>> >>   #+clj (:require [clojure.core.typed])
>> >>   #+clj (:use [clojure.core.typed]))
>> >>
>> >> (ann add [Number Number -> Number])
>> >> (defn add [a b]
>> >>   (+ a b))
>> >>
>> >> (check-ns)
>> >>
>> >>
>> >> ## Error
>> >>
>> >> When I execute the above, I get the following error.
>> >>
>> >> It's not clear to me what I'm doing wrong.
>> >>
>> >> java.lang.NullPointerException: null
>> >>  at clojure.core$deref_future.invoke (core.clj:2108)
>> >> clojure.core$deref.invoke (core.clj:2129)
>> >> cljs.analyzer$resolve_var.invoke (analyzer.clj:347)
>> >> cljs.analyzer$resolve_var.invoke (analyzer.clj:308)
>> >> clojure.core.typed.util_cljs$resolve_var.invoke (util_cljs.clj:40)
>> >> clojure.core.typed.parse_unparse$resolve_type_cljs.invoke
>> >> (parse_unparse.clj:585)
>> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:709)
>> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
>> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:723)
>> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
>> >> clojure.core.typed.parse_unparse$parse_function.invoke
>> >> (parse_unparse.clj:879)
>> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:900)
>> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
>> >>
>> >>
>>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: core.typed

2014-01-28 Thread Sean Corfield
I can confirm that I can evaluate namespaces that use core.typed 0.2.26 inside 
LightTable - and run check-ns, which failed inside LightTable with 0.2.25!

Sean

On Jan 28, 2014, at 5:34 AM, Ambrose Bonnaire-Sergeant 
 wrote:

> 0.2.26 contains a workaround by disabling the WIP Clojurescript support.
> You might need the Sonatype repo.
> 
> I've got a GRE exam on Monday so I can't work on this properly yet.
> 
> Please let me know if it worked.
> 
> Also Sean (CCed), please try 0.2.26 against your Light Table failure case. I 
> believe this is the same issue.
> 
> Thanks,
> Ambrose
> 
> On Tue, Jan 28, 2014 at 9:03 PM, t x  wrote:
> Hi Ambrose,
> 
> Yes, I have a manual dependency on:
>  [org.clojure/clojurescript "0.0-2138"]
> 
> I looked at the project.clj of core.typed, and got:
> 
> https://github.com/clojure/core.typed/blob/master/project.clj#L13
> 
> Is the dependency on "[org.clojure/clojurescript "0.0-1859"]" correct?
> (it seems rather outdated).
> 
> Thanks!
> 
> On Tue, Jan 28, 2014 at 4:59 AM, Ambrose Bonnaire-Sergeant
>  wrote:
> > Hi,
> >
> > There is some conflict with ClojureScript, some others have also observed
> > this.
> >
> > Is there some library that is upgrading the Clojurescript version to one
> > different to
> > what core.typed depends on?
> >
> > Thanks,
> > Ambrose
> >
> >
> > On Tue, Jan 28, 2014 at 5:38 PM, t x  wrote:
> >>
> >> ## Background
> >>
> >>   I'm using [org.clojure/core.typed "0.2.25"]
> >>
> >> ## Question:
> >>
> >>   Which is the following is true:
> >>
> >>   (1) my code is correct / should work, and therefore there is something
> >> with my setup
> >>
> >>   (2) my code is wrong (and please point out how I can fix it)
> >>
> >>
> >> ## Code
> >>
> >> (ns test
> >>   #+clj (:require [clojure.core.typed])
> >>   #+clj (:use [clojure.core.typed]))
> >>
> >> (ann add [Number Number -> Number])
> >> (defn add [a b]
> >>   (+ a b))
> >>
> >> (check-ns)
> >>
> >>
> >> ## Error
> >>
> >> When I execute the above, I get the following error.
> >>
> >> It's not clear to me what I'm doing wrong.
> >>
> >> java.lang.NullPointerException: null
> >>  at clojure.core$deref_future.invoke (core.clj:2108)
> >> clojure.core$deref.invoke (core.clj:2129)
> >> cljs.analyzer$resolve_var.invoke (analyzer.clj:347)
> >> cljs.analyzer$resolve_var.invoke (analyzer.clj:308)
> >> clojure.core.typed.util_cljs$resolve_var.invoke (util_cljs.clj:40)
> >> clojure.core.typed.parse_unparse$resolve_type_cljs.invoke
> >> (parse_unparse.clj:585)
> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:709)
> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:723)
> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> >> clojure.core.typed.parse_unparse$parse_function.invoke
> >> (parse_unparse.clj:879)
> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:900)
> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> >>
> >> 



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: core.typed

2014-01-28 Thread Ambrose Bonnaire-Sergeant
0.2.26 contains a workaround by disabling the WIP Clojurescript support.
You might need the
Sonatype<https://github.com/clojure/core.typed#releases-and-dependency-information>
 repo.

I've got a GRE exam on Monday so I can't work on this properly yet.

Please let me know if it worked.

Also Sean (CCed), please try 0.2.26 against your Light Table failure case.
I believe this is the same issue.

Thanks,
Ambrose

On Tue, Jan 28, 2014 at 9:03 PM, t x  wrote:

> Hi Ambrose,
>
> Yes, I have a manual dependency on:
>  [org.clojure/clojurescript "0.0-2138"]
>
> I looked at the project.clj of core.typed, and got:
>
> https://github.com/clojure/core.typed/blob/master/project.clj#L13
>
> Is the dependency on "[org.clojure/clojurescript "0.0-1859"]" correct?
> (it seems rather outdated).
>
> Thanks!
>
> On Tue, Jan 28, 2014 at 4:59 AM, Ambrose Bonnaire-Sergeant
>  wrote:
> > Hi,
> >
> > There is some conflict with ClojureScript, some others have also observed
> > this.
> >
> > Is there some library that is upgrading the Clojurescript version to one
> > different to
> > what core.typed depends on?
> >
> > Thanks,
> > Ambrose
> >
> >
> > On Tue, Jan 28, 2014 at 5:38 PM, t x  wrote:
> >>
> >> ## Background
> >>
> >>   I'm using [org.clojure/core.typed "0.2.25"]
> >>
> >> ## Question:
> >>
> >>   Which is the following is true:
> >>
> >>   (1) my code is correct / should work, and therefore there is something
> >> with my setup
> >>
> >>   (2) my code is wrong (and please point out how I can fix it)
> >>
> >>
> >> ## Code
> >>
> >> (ns test
> >>   #+clj (:require [clojure.core.typed])
> >>   #+clj (:use [clojure.core.typed]))
> >>
> >> (ann add [Number Number -> Number])
> >> (defn add [a b]
> >>   (+ a b))
> >>
> >> (check-ns)
> >>
> >>
> >> ## Error
> >>
> >> When I execute the above, I get the following error.
> >>
> >> It's not clear to me what I'm doing wrong.
> >>
> >> java.lang.NullPointerException: null
> >>  at clojure.core$deref_future.invoke (core.clj:2108)
> >> clojure.core$deref.invoke (core.clj:2129)
> >> cljs.analyzer$resolve_var.invoke (analyzer.clj:347)
> >> cljs.analyzer$resolve_var.invoke (analyzer.clj:308)
> >> clojure.core.typed.util_cljs$resolve_var.invoke (util_cljs.clj:40)
> >> clojure.core.typed.parse_unparse$resolve_type_cljs.invoke
> >> (parse_unparse.clj:585)
> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:709)
> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:723)
> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> >> clojure.core.typed.parse_unparse$parse_function.invoke
> >> (parse_unparse.clj:879)
> >> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:900)
> >> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> >>
> >>
> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320$iter__17321__17325$fn__17326.invoke
> >> (base_env_cljs.clj:31)
> >> clojure.lang.LazySeq.sval (LazySeq.java:42)
> >> clojure.lang.LazySeq.seq (LazySeq.java:60)
> >> clojure.lang.RT.seq (RT.java:484)
> >> clojure.core$seq.invoke (core.clj:133)
> >> clojure.core.protocols$seq_reduce.invoke (protocols.clj:30)
> >> clojure.core.protocols/fn (protocols.clj:54)
> >> clojure.core.protocols$fn__5979$G__5974__5992.invoke
> >> (protocols.clj:13)
> >> clojure.core$reduce.invoke (core.clj:6177)
> >> clojure.core$into.invoke (core.clj:6229)
> >> clojure.lang.AFn.applyToHelper (AFn.java:163)
> >> clojure.lang.AFn.applyTo (AFn.java:151)
> >> clojure.core$apply.invoke (core.clj:619)
> >> clojure.core.contracts.constraints$apply_contract$fn__845.doInvoke
> >> (constraints.clj:175)
> >> clojure.lang.RestFn.applyTo (RestFn.java:137)
> >> clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
> >> clojure.lang.RestFn.invoke (RestFn.java:421)
> >>
> >>
> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320.invoke
> >> (base_env_cljs.clj:31)
> >>
> >>
> clojure.core.ty

Re: core.typed

2014-01-28 Thread t x
Hi Ambrose,

Yes, I have a manual dependency on:
 [org.clojure/clojurescript "0.0-2138"]

I looked at the project.clj of core.typed, and got:

https://github.com/clojure/core.typed/blob/master/project.clj#L13

Is the dependency on "[org.clojure/clojurescript "0.0-1859"]" correct?
(it seems rather outdated).

Thanks!

On Tue, Jan 28, 2014 at 4:59 AM, Ambrose Bonnaire-Sergeant
 wrote:
> Hi,
>
> There is some conflict with ClojureScript, some others have also observed
> this.
>
> Is there some library that is upgrading the Clojurescript version to one
> different to
> what core.typed depends on?
>
> Thanks,
> Ambrose
>
>
> On Tue, Jan 28, 2014 at 5:38 PM, t x  wrote:
>>
>> ## Background
>>
>>   I'm using [org.clojure/core.typed "0.2.25"]
>>
>> ## Question:
>>
>>   Which is the following is true:
>>
>>   (1) my code is correct / should work, and therefore there is something
>> with my setup
>>
>>   (2) my code is wrong (and please point out how I can fix it)
>>
>>
>> ## Code
>>
>> (ns test
>>   #+clj (:require [clojure.core.typed])
>>   #+clj (:use [clojure.core.typed]))
>>
>> (ann add [Number Number -> Number])
>> (defn add [a b]
>>   (+ a b))
>>
>> (check-ns)
>>
>>
>> ## Error
>>
>> When I execute the above, I get the following error.
>>
>> It's not clear to me what I'm doing wrong.
>>
>> java.lang.NullPointerException: null
>>  at clojure.core$deref_future.invoke (core.clj:2108)
>> clojure.core$deref.invoke (core.clj:2129)
>> cljs.analyzer$resolve_var.invoke (analyzer.clj:347)
>> cljs.analyzer$resolve_var.invoke (analyzer.clj:308)
>> clojure.core.typed.util_cljs$resolve_var.invoke (util_cljs.clj:40)
>> clojure.core.typed.parse_unparse$resolve_type_cljs.invoke
>> (parse_unparse.clj:585)
>> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:709)
>> clojure.lang.MultiFn.invoke (MultiFn.java:227)
>> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:723)
>> clojure.lang.MultiFn.invoke (MultiFn.java:227)
>> clojure.core.typed.parse_unparse$parse_function.invoke
>> (parse_unparse.clj:879)
>> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:900)
>> clojure.lang.MultiFn.invoke (MultiFn.java:227)
>>
>> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320$iter__17321__17325$fn__17326.invoke
>> (base_env_cljs.clj:31)
>> clojure.lang.LazySeq.sval (LazySeq.java:42)
>> clojure.lang.LazySeq.seq (LazySeq.java:60)
>> clojure.lang.RT.seq (RT.java:484)
>> clojure.core$seq.invoke (core.clj:133)
>> clojure.core.protocols$seq_reduce.invoke (protocols.clj:30)
>> clojure.core.protocols/fn (protocols.clj:54)
>> clojure.core.protocols$fn__5979$G__5974__5992.invoke
>> (protocols.clj:13)
>> clojure.core$reduce.invoke (core.clj:6177)
>> clojure.core$into.invoke (core.clj:6229)
>> clojure.lang.AFn.applyToHelper (AFn.java:163)
>> clojure.lang.AFn.applyTo (AFn.java:151)
>> clojure.core$apply.invoke (core.clj:619)
>> clojure.core.contracts.constraints$apply_contract$fn__845.doInvoke
>> (constraints.clj:175)
>> clojure.lang.RestFn.applyTo (RestFn.java:137)
>> clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
>> clojure.lang.RestFn.invoke (RestFn.java:421)
>>
>> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320.invoke
>> (base_env_cljs.clj:31)
>>
>> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063.invoke
>> (base_env_cljs.clj:31)
>> clojure.lang.LazySeq.sval (LazySeq.java:42)
>> clojure.lang.LazySeq.seq (LazySeq.java:60)
>> clojure.lang.RT.seq (RT.java:484)
>> clojure.core$seq.invoke (core.clj:133)
>> clojure.core$dorun.invoke (core.clj:2780)
>> clojure.core$doall.invoke (core.clj:2796)
>> clojure.core.typed.base_env_cljs$generator_init_jsnominals.invoke
>> (base_env_cljs.clj:31)
>> clojure.core.typed.base_env_cljs$init_jsnominals.invoke
>> (base_env_cljs.clj:29)
>> clojure.core.typed.base_env_cljs$reset_jsnominal_env_BANG_.invoke
>> (base_env_cljs.clj:67)
>> clojure.core.typed.base_env_cljs$generator_init_alias_env.invoke
>> (base_env_cljs.clj:138)
>> clojure.core.typed.base_env_cljs$init_alias_env.invoke
>> (base_env_cljs.clj:136)
>> clojure.core.typed.base_env_cljs$r

Re: core.typed

2014-01-28 Thread Ambrose Bonnaire-Sergeant
Hi,

There is some conflict with ClojureScript, some others have also observed
this.

Is there some library that is upgrading the Clojurescript version to one
different to
what core.typed depends on?

Thanks,
Ambrose


On Tue, Jan 28, 2014 at 5:38 PM, t x  wrote:

> ## Background
>
>   I'm using [org.clojure/core.typed "0.2.25"]
>
> ## Question:
>
>   Which is the following is true:
>
>   (1) my code is correct / should work, and therefore there is something
> with my setup
>
>   (2) my code is wrong (and please point out how I can fix it)
>
>
> ## Code
>
> (ns test
>   #+clj (:require [clojure.core.typed])
>   #+clj (:use [clojure.core.typed]))
>
> (ann add [Number Number -> Number])
> (defn add [a b]
>   (+ a b))
>
> (check-ns)
>
>
> ## Error
>
> When I execute the above, I get the following error.
>
> It's not clear to me what I'm doing wrong.
>
> java.lang.NullPointerException: null
>  at clojure.core$deref_future.invoke (core.clj:2108)
> clojure.core$deref.invoke (core.clj:2129)
> cljs.analyzer$resolve_var.invoke (analyzer.clj:347)
> cljs.analyzer$resolve_var.invoke (analyzer.clj:308)
> clojure.core.typed.util_cljs$resolve_var.invoke (util_cljs.clj:40)
> clojure.core.typed.parse_unparse$resolve_type_cljs.invoke
> (parse_unparse.clj:585)
> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:709)
> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:723)
> clojure.lang.MultiFn.invoke (MultiFn.java:227)
> clojure.core.typed.parse_unparse$parse_function.invoke
> (parse_unparse.clj:879)
> clojure.core.typed.parse_unparse/fn (parse_unparse.clj:900)
> clojure.lang.MultiFn.invoke (MultiFn.java:227)
>
> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320$iter__17321__17325$fn__17326.invoke
> (base_env_cljs.clj:31)
> clojure.lang.LazySeq.sval (LazySeq.java:42)
> clojure.lang.LazySeq.seq (LazySeq.java:60)
> clojure.lang.RT.seq (RT.java:484)
> clojure.core$seq.invoke (core.clj:133)
> clojure.core.protocols$seq_reduce.invoke (protocols.clj:30)
> clojure.core.protocols/fn (protocols.clj:54)
> clojure.core.protocols$fn__5979$G__5974__5992.invoke (protocols.clj:13)
> clojure.core$reduce.invoke (core.clj:6177)
> clojure.core$into.invoke (core.clj:6229)
> clojure.lang.AFn.applyToHelper (AFn.java:163)
> clojure.lang.AFn.applyTo (AFn.java:151)
> clojure.core$apply.invoke (core.clj:619)
> clojure.core.contracts.constraints$apply_contract$fn__845.doInvoke
> (constraints.clj:175)
> clojure.lang.RestFn.applyTo (RestFn.java:137)
> clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
> clojure.lang.RestFn.invoke (RestFn.java:421)
>
> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320.invoke
> (base_env_cljs.clj:31)
>
> clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063.invoke
> (base_env_cljs.clj:31)
> clojure.lang.LazySeq.sval (LazySeq.java:42)
> clojure.lang.LazySeq.seq (LazySeq.java:60)
> clojure.lang.RT.seq (RT.java:484)
> clojure.core$seq.invoke (core.clj:133)
> clojure.core$dorun.invoke (core.clj:2780)
> clojure.core$doall.invoke (core.clj:2796)
> clojure.core.typed.base_env_cljs$generator_init_jsnominals.invoke
> (base_env_cljs.clj:31)
> clojure.core.typed.base_env_cljs$init_jsnominals.invoke
> (base_env_cljs.clj:29)
> clojure.core.typed.base_env_cljs$reset_jsnominal_env_BANG_.invoke
> (base_env_cljs.clj:67)
> clojure.core.typed.base_env_cljs$generator_init_alias_env.invoke
> (base_env_cljs.clj:138)
> clojure.core.typed.base_env_cljs$init_alias_env.invoke
> (base_env_cljs.clj:136)
> clojure.core.typed.base_env_cljs$reset_alias_env_BANG_.invoke
> (base_env_cljs.clj:159)
>
> clojure.core.typed.base_env_cljs$reset_cljs_envs_BANG_$fn__17803.invoke
> (base_env_cljs.clj:188)
> clojure.core.typed.base_env_cljs$reset_cljs_envs_BANG_.invoke
> (base_env_cljs.clj:187)
> clojure.core.typed.reset_env$reset_envs_BANG_.invoke (reset_env.clj:24)
> clojure.core.typed$check_ns_info.doInvoke (typed.clj:1490)
> clojure.lang.RestFn.invoke (RestFn.java:410)
> clojure.lang.AFn.applyToHelper (AFn.java:161)
> clojure.lang.RestFn.applyTo (RestFn.java:132)
> clojure.core$apply.invoke (core.clj:619)
> clojure.core.typed$check_ns.doInvoke (typed.clj:1559)
> clojure.lang.RestFn.invoke (RestFn.java:410)
> clojure.core.typed$check_ns.invoke (typed.clj:1557)
> test$eval21761.invoke (NO_SOURCE_FILE:1)
> clojure.lang

core.typed

2014-01-28 Thread t x
## Background

  I'm using [org.clojure/core.typed "0.2.25"]

## Question:

  Which is the following is true:

  (1) my code is correct / should work, and therefore there is something
with my setup

  (2) my code is wrong (and please point out how I can fix it)


## Code

(ns test
  #+clj (:require [clojure.core.typed])
  #+clj (:use [clojure.core.typed]))

(ann add [Number Number -> Number])
(defn add [a b]
  (+ a b))

(check-ns)


## Error

When I execute the above, I get the following error.

It's not clear to me what I'm doing wrong.

java.lang.NullPointerException: null
 at clojure.core$deref_future.invoke (core.clj:2108)
clojure.core$deref.invoke (core.clj:2129)
cljs.analyzer$resolve_var.invoke (analyzer.clj:347)
cljs.analyzer$resolve_var.invoke (analyzer.clj:308)
clojure.core.typed.util_cljs$resolve_var.invoke (util_cljs.clj:40)
clojure.core.typed.parse_unparse$resolve_type_cljs.invoke
(parse_unparse.clj:585)
clojure.core.typed.parse_unparse/fn (parse_unparse.clj:709)
clojure.lang.MultiFn.invoke (MultiFn.java:227)
clojure.core.typed.parse_unparse/fn (parse_unparse.clj:723)
clojure.lang.MultiFn.invoke (MultiFn.java:227)
clojure.core.typed.parse_unparse$parse_function.invoke
(parse_unparse.clj:879)
clojure.core.typed.parse_unparse/fn (parse_unparse.clj:900)
clojure.lang.MultiFn.invoke (MultiFn.java:227)

clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320$iter__17321__17325$fn__17326.invoke
(base_env_cljs.clj:31)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:60)
clojure.lang.RT.seq (RT.java:484)
clojure.core$seq.invoke (core.clj:133)
clojure.core.protocols$seq_reduce.invoke (protocols.clj:30)
clojure.core.protocols/fn (protocols.clj:54)
clojure.core.protocols$fn__5979$G__5974__5992.invoke (protocols.clj:13)
clojure.core$reduce.invoke (core.clj:6177)
clojure.core$into.invoke (core.clj:6229)
clojure.lang.AFn.applyToHelper (AFn.java:163)
clojure.lang.AFn.applyTo (AFn.java:151)
clojure.core$apply.invoke (core.clj:619)
clojure.core.contracts.constraints$apply_contract$fn__845.doInvoke
(constraints.clj:175)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
clojure.lang.RestFn.invoke (RestFn.java:421)

clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063$fn__17320.invoke
(base_env_cljs.clj:31)

clojure.core.typed.base_env_cljs$generator_init_jsnominals$iter__17058__17062$fn__17063.invoke
(base_env_cljs.clj:31)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:60)
clojure.lang.RT.seq (RT.java:484)
clojure.core$seq.invoke (core.clj:133)
clojure.core$dorun.invoke (core.clj:2780)
clojure.core$doall.invoke (core.clj:2796)
clojure.core.typed.base_env_cljs$generator_init_jsnominals.invoke
(base_env_cljs.clj:31)
clojure.core.typed.base_env_cljs$init_jsnominals.invoke
(base_env_cljs.clj:29)
clojure.core.typed.base_env_cljs$reset_jsnominal_env_BANG_.invoke
(base_env_cljs.clj:67)
clojure.core.typed.base_env_cljs$generator_init_alias_env.invoke
(base_env_cljs.clj:138)
clojure.core.typed.base_env_cljs$init_alias_env.invoke
(base_env_cljs.clj:136)
clojure.core.typed.base_env_cljs$reset_alias_env_BANG_.invoke
(base_env_cljs.clj:159)
clojure.core.typed.base_env_cljs$reset_cljs_envs_BANG_$fn__17803.invoke
(base_env_cljs.clj:188)
clojure.core.typed.base_env_cljs$reset_cljs_envs_BANG_.invoke
(base_env_cljs.clj:187)
clojure.core.typed.reset_env$reset_envs_BANG_.invoke (reset_env.clj:24)
clojure.core.typed$check_ns_info.doInvoke (typed.clj:1490)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.lang.AFn.applyToHelper (AFn.java:161)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.core$apply.invoke (core.clj:619)
clojure.core.typed$check_ns.doInvoke (typed.clj:1559)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.core.typed$check_ns.invoke (typed.clj:1557)
test$eval21761.invoke (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6619)
clojure.lang.Compiler.eval (Compiler.java:6582)
clojure.core$eval.invoke (core.clj:2852)
clojure.main$repl$read_eval_print__6588$fn__6591.invoke (main.clj:259)
clojure.main$repl$read_eval_print__6588.invoke (main.clj:259)
clojure.main$repl$fn__6597.invoke (main.clj:277)
clojure.main$repl.doInvoke (main.clj:277)
clojure.lang.RestFn.invoke (RestFn.java:1096)

clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__5040.invoke
(interruptible_eval.clj:56)
clojure.lang.AFn.applyToHelper (AFn.java:159)
clojure.lang.AFn.applyTo (AFn.java:151)
clojure.core$apply.invoke (core.clj:617)
clojure.core$with_bindings_STAR_.doInvoke (core.clj:1788)
clojure.lang.Re

Re: Crowdfunding for full-time core.typed development

2013-11-06 Thread Rich Morin
On Sep 27, 2013, at 09:51, Ambrose Bonnaire-Sergeant wrote:
> I have started a crowdfunding campaign to support full-time work
> on Typed Clojure.
> 
> Please share!
> 
> http://www.indiegogo.com/projects/typed-clojure

With only five (5) days left, the Typed Clojure campaign still needs
$47,400 to meet the "stretch goal" of supporting Ambrose for a full
year of development.  I think Ambrose is offering Typed Clojure fans
a real bargain here and we _definitely_ should take him up on it.

If you've been waiting for the right time to contribute, this is it!

-r

 -- 
http://www.cfcl.com/rdm   Rich Morin   r...@cfcl.com
http://www.cfcl.com/rdm/resumeSan Bruno, CA, USA   +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] core.typed 0.2.14

2013-10-21 Thread Ambrose Bonnaire-Sergeant
Hi,

Pleased to announce core.typed 0.2.14.

There are breaking changes in this release.

See the 
Changelog<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>for
the full list of changes.
See the Readme <https://github.com/clojure/core.typed/blob/master/README.md>for
dependency info.

Highlights:
* Heterogeneous vectors accept rest arguments
(ann my-first (All [x] ['[x Any *] -> x]))
; (cf (my-first [1 2 3 4 5]) Number)

* Type level Assoc
(ann (All [[x :< (Map Any Any)]]
   [x -> (Assoc x ':a Number)]))
(defn f [m] (assoc m :a 1))

; (cf (f {:b 2}) '{:a Number :b Number})

Please report/discuss issues to the core.typed mailing
list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>,
Jira <http://dev.clojure.org/jira/browse/CTYP> or
#typed-clojure<http://logs.lazybot.org/irc.freenode.net/%23typed-clojure>on
Freenode.

Enjoy!
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: type checking clojure.set with core.typed

2013-10-05 Thread Ambrose Bonnaire-Sergeant
Hi Stu,

Please try lein-typed "0.3.1". It should fix the build issue.

Thanks,
Ambrose


On Tue, Oct 1, 2013 at 8:42 AM, Ben Mabey  wrote:

>  Heh, based on that my guess is that no one has used lein-typed in CI
> builds. :)  I've submitted a PR to Ambrose to exit with a non-zero code
> when type checking fails:
> https://github.com/frenchy64/lein-typed/pull/1
>
> Since lein-typed is brand new I imagine people have been writing there own
> tasks to do something similar for CI. Any CircleCI guys are on the list
> want to give us a real experience report?
>
>
> On 9/30/13 5:26 PM, Stuart Halloway wrote:
>
> Any experience reports?  My experience so far:
>
>  Type Checker: Found 1 error
> $ echo $?
> 0
>
>
>
>
> On Mon, Sep 30, 2013 at 7:20 PM, Ben Mabey  wrote:
>
>>  On 9/30/13 5:16 PM, Stuart Halloway wrote:
>>
>>> I tried the following experiment with type checking clojure.set:
>>>
>>> (ns exploring.core-typed
>>>   (:use clojure.core.typed clojure.repl)
>>>   (:require [clojure.set :as set]))
>>>
>>> (ann ^:no-check clojure.set/difference [(Set Any) (Set Any) -> (Set
>>> Any)])
>>>
>>> (set/difference #{1 2} [1 2])
>>>
>>> (comment
>>>   (check-ns)
>>>   )
>>>
>>> Is there an extant example that shows how this kind of safety check
>>> might be used in e.g. a CI build?
>>>
>>> Stu
>>>
>>>   Seems like an invocation of `lein typed check`[1] would do the trick
>> in a CI build...
>>
>> -Ben
>>
>> 1. https://github.com/frenchy64/lein-typed
>>
>> --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: type checking clojure.set with core.typed

2013-09-30 Thread Ben Mabey
Heh, based on that my guess is that no one has used lein-typed in CI 
builds. :)  I've submitted a PR to Ambrose to exit with a non-zero code 
when type checking fails:

https://github.com/frenchy64/lein-typed/pull/1

Since lein-typed is brand new I imagine people have been writing there 
own tasks to do something similar for CI. Any CircleCI guys are on the 
list want to give us a real experience report?


On 9/30/13 5:26 PM, Stuart Halloway wrote:

Any experience reports?  My experience so far:

Type Checker: Found 1 error
$ echo $?
0




On Mon, Sep 30, 2013 at 7:20 PM, Ben Mabey > wrote:


On 9/30/13 5:16 PM, Stuart Halloway wrote:

I tried the following experiment with type checking clojure.set:

(ns exploring.core-typed
  (:use clojure.core.typed clojure.repl)
  (:require [clojure.set :as set]))

(ann ^:no-check clojure.set/difference [(Set Any) (Set Any) ->
(Set Any)])

(set/difference #{1 2} [1 2])

(comment
  (check-ns)
  )

Is there an extant example that shows how this kind of safety
check might be used in e.g. a CI build?

Stu

Seems like an invocation of `lein typed check`[1] would do the
trick in a CI build...

-Ben

1. https://github.com/frenchy64/lein-typed

-- 
-- 
You received this message because you are subscribed to the Google

Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com

Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- You received this message because you are subscribed to the
Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to clojure+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.


--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient 
with your first post.

To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google 
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to clojure+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: type checking clojure.set with core.typed

2013-09-30 Thread Stuart Halloway
Any experience reports?  My experience so far:

Type Checker: Found 1 error
$ echo $?
0




On Mon, Sep 30, 2013 at 7:20 PM, Ben Mabey  wrote:

> On 9/30/13 5:16 PM, Stuart Halloway wrote:
>
>> I tried the following experiment with type checking clojure.set:
>>
>> (ns exploring.core-typed
>>   (:use clojure.core.typed clojure.repl)
>>   (:require [clojure.set :as set]))
>>
>> (ann ^:no-check clojure.set/difference [(Set Any) (Set Any) -> (Set Any)])
>>
>> (set/difference #{1 2} [1 2])
>>
>> (comment
>>   (check-ns)
>>   )
>>
>> Is there an extant example that shows how this kind of safety check might
>> be used in e.g. a CI build?
>>
>> Stu
>>
>>  Seems like an invocation of `lein typed check`[1] would do the trick in
> a CI build...
>
> -Ben
>
> 1. 
> https://github.com/frenchy64/**lein-typed
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscribe@**googlegroups.com
> For more options, visit this group at
> http://groups.google.com/**group/clojure?hl=en
> --- You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> clojure+unsubscribe@**googlegroups.com
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: type checking clojure.set with core.typed

2013-09-30 Thread Ben Mabey

On 9/30/13 5:16 PM, Stuart Halloway wrote:

I tried the following experiment with type checking clojure.set:

(ns exploring.core-typed
  (:use clojure.core.typed clojure.repl)
  (:require [clojure.set :as set]))

(ann ^:no-check clojure.set/difference [(Set Any) (Set Any) -> (Set Any)])

(set/difference #{1 2} [1 2])

(comment
  (check-ns)
  )

Is there an extant example that shows how this kind of safety check 
might be used in e.g. a CI build?


Stu

Seems like an invocation of `lein typed check`[1] would do the trick in 
a CI build...


-Ben

1. https://github.com/frenchy64/lein-typed

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


type checking clojure.set with core.typed

2013-09-30 Thread Stuart Halloway
I tried the following experiment with type checking clojure.set:

(ns exploring.core-typed
  (:use clojure.core.typed clojure.repl)
  (:require [clojure.set :as set]))

(ann ^:no-check clojure.set/difference [(Set Any) (Set Any) -> (Set Any)])

(set/difference #{1 2} [1 2])

(comment
  (check-ns)
  )

Is there an extant example that shows how this kind of safety check might
be used in e.g. a CI build?

Stu

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Crowdfunding for full-time core.typed development

2013-09-30 Thread Rich Morin
Adam Bard has written an interesting blog post, comparing
core.typed to Haskell:

  http://adambard.com/blog/core-typed-vs-haskell/

Both the post and the comments are worthwhile...

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Crowdfunding for full-time core.typed development

2013-09-28 Thread Rich Morin
The CircleCI folks have posted a nice write-up of Typed Clojure
(and the campaign) here:

  tl;dr Typed Clojure is an important step for not just Clojure,
  but all dynamic languages. CircleCI is supporting it, and you
  should too.

  Typed Clojure is one of the biggest advancements to dynamic
  programming languages in the last few decades.  It shows that
  you can have the amazing flexibility of a dynamic language,
  while providing lightweight, optional typing.  Most importantly,
  this can make your team more productive, and it’s ready to use
  in production.

  ...

  -- Why we’re supporting Typed Clojure, and you should too!
 http://blog.circleci.com/supporting-typed-clojure/

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Crowdfunding for full-time core.typed development

2013-09-27 Thread Rich Morin
On Sep 27, 2013, at 09:51, Ambrose Bonnaire-Sergeant wrote:
> I have started a crowdfunding campaign to support full-time
> work on Typed Clojure.
> 
> Please share!
> 
> http://www.indiegogo.com/projects/typed-clojure

Still in its first day, the campaign is already an eighth
of the way to its goal!  I encourage other Typed Clojure
fans to make a contribution.

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Crowdfunding for full-time core.typed development

2013-09-27 Thread Ambrose Bonnaire-Sergeant
Hi,

I have started a crowdfunding campaign to support full-time work on Typed
Clojure.

Please share!

http://www.indiegogo.com/projects/typed-clojure

Thanks,
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [GSoC] core.typed

2013-09-25 Thread Ambrose Bonnaire-Sergeant
Oh, and a big thanks to David Nolen for mentoring me, now twice in a row! I
will certainly be mentoring next year.

Ambrose


On Wed, Sep 25, 2013 at 6:32 PM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Hi,
>
> Google Summer of Code has ended and it has been a particularly productive
> one for core.typed.
>
> In that time I:
>
> 1. released core.typed 
> 0.2<https://groups.google.com/d/msg/clojure-core-typed/U_aA_Ce3qWg/gJWpdflBe4AJ>
>  which
> I consider useful for production systems.
> 2. resolved 30 Jira 
> tickets<http://dev.clojure.org/jira/secure/ConfigureReport.jspa?projectOrFilterId=project-10271&periodName=daily&daysprevious=120&cumulative=true&versionLabels=major&selectedProjectId=10271&reportKey=com.atlassian.jira.plugin.system.reports%3Acreatedvsresolved-report&Next=Next>
> 3. wrote a preliminary version of Typed 
> Clojurescript<https://github.com/clojure/core.typed/blob/master/src/test/cljs/cljs/core/typed/test/dnolen/utils/dom.cljs>
> 4. added 
> many<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>enhancements
>  and bug fixes, some written by other contributors
> 5. generated complete API 
> documentation<http://clojure.github.io/core.typed/>(also thanks Tom Faulhaber)
> 6. opened a mailing 
> list<https://groups.google.com/forum/#!forum/clojure-core-typed>and IRC 
> channel #typed-clojure
> 7. started a blog <http://frenchy64.github.io/> about Typed Clojure
> 8. wrote a leiningen plugin for core.typed: 
> lein-typed<https://github.com/frenchy64/lein-typed>
> 9. wrote 3 core.typed 
> recipes<https://github.com/clojure-cookbook/clojure-cookbook/pull/212>for 
> Clojure Cookbook
>
> One task I did *not* do was write significantly more user documentation.
>
> If you haven't been following core.typed recently, we're up to version
> 0.2.13. There have been no breaking changes since 0.2.0.
>
> Changelog <https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>
> Dependency info <https://github.com/clojure/core.typed>
>
> Some notable changes:
> - big 
> improvements<https://groups.google.com/d/msg/clojure-core-typed/eyEnKhsZ1bQ/Dm35KdZdnBYJ>to
>  assoc/merge by cspencer
> - new 
> aliases<https://groups.google.com/forum/#!topic/clojure-core-typed/Pl1RpRjbPPM>
>  for
> common types
>
> I intend to continue work on core.typed, you will hear of my future plans
> in the next week.
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[GSoC] core.typed

2013-09-25 Thread Ambrose Bonnaire-Sergeant
Hi,

Google Summer of Code has ended and it has been a particularly productive
one for core.typed.

In that time I:

1. released core.typed
0.2<https://groups.google.com/d/msg/clojure-core-typed/U_aA_Ce3qWg/gJWpdflBe4AJ>
which
I consider useful for production systems.
2. resolved 30 Jira
tickets<http://dev.clojure.org/jira/secure/ConfigureReport.jspa?projectOrFilterId=project-10271&periodName=daily&daysprevious=120&cumulative=true&versionLabels=major&selectedProjectId=10271&reportKey=com.atlassian.jira.plugin.system.reports%3Acreatedvsresolved-report&Next=Next>
3. wrote a preliminary version of Typed
Clojurescript<https://github.com/clojure/core.typed/blob/master/src/test/cljs/cljs/core/typed/test/dnolen/utils/dom.cljs>
4. added 
many<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>enhancements
and bug fixes, some written by other contributors
5. generated complete API
documentation<http://clojure.github.io/core.typed/>(also thanks Tom
Faulhaber)
6. opened a mailing
list<https://groups.google.com/forum/#!forum/clojure-core-typed>and
IRC channel #typed-clojure
7. started a blog <http://frenchy64.github.io/> about Typed Clojure
8. wrote a leiningen plugin for core.typed:
lein-typed<https://github.com/frenchy64/lein-typed>
9. wrote 3 core.typed
recipes<https://github.com/clojure-cookbook/clojure-cookbook/pull/212>for
Clojure Cookbook

One task I did *not* do was write significantly more user documentation.

If you haven't been following core.typed recently, we're up to version
0.2.13. There have been no breaking changes since 0.2.0.

Changelog <https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>
Dependency info <https://github.com/clojure/core.typed>

Some notable changes:
- big 
improvements<https://groups.google.com/d/msg/clojure-core-typed/eyEnKhsZ1bQ/Dm35KdZdnBYJ>to
assoc/merge by cspencer
- new 
aliases<https://groups.google.com/forum/#!topic/clojure-core-typed/Pl1RpRjbPPM>
for
common types

I intend to continue work on core.typed, you will hear of my future plans
in the next week.

Thanks,
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.5, News

2013-09-10 Thread Leonardo Borges
Thanks for all your work ambrose! Core.typed is quite a feat.

And I can confirm ambrose is amazingly responsive on freenode. Every time I
bug him, it works :)
On 10/09/2013 9:57 PM, "Ambrose Bonnaire-Sergeant" <
abonnaireserge...@gmail.com> wrote:

> Hi,
>
> Pushing another release of core.typed<https://github.com/clojure/core.typed>,
> mostly bug/documentation fixes.
>
> We now push a "slim" jar which does not include AOT file. See the README
> for dependency information.
>
> See the CHANGELOG for specific changes.
>
> I'm also starting to provide functions that will help integrate core.typed
> with IDE's. eg. 
> check-form-info<http://clojure.github.io/core.typed/#clojure.core.typed/check-form-info>
>  returns
> a map of data summarising the results of type checking, including type
> errors. This is towards Counterclockwise 
> support<http://dev.clojure.org/display/design/Typed+CLJS>
> .
>
> I'm planning to fix a bunch of things that have proven problematic with
> the type syntax. I'll be adding to this design 
> wiki<http://dev.clojure.org/display/design/Cleaning+up+Type+Syntax>if you 
> want to follow along, or contribute. These may end up being breaking
> changes.
>
> Also, recursive deftype and protocols have proven to be tricky. 
> Here<http://dev.clojure.org/display/design/Recursive+Definitions>are my 
> thoughts.
>
> Finally, I wrote a blog 
> post<http://frenchy64.github.io/2013/09/08/simple-reasoning-assertions-core-typed.html>explaining
>  how core.typed understands assertions.
>
> Enjoy!
> Ambrose
>
> PS. If you have questions, try #typed-clojure on Freenode!
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] core.typed 0.2.5, News

2013-09-10 Thread Ambrose Bonnaire-Sergeant
Hi,

Pushing another release of core.typed<https://github.com/clojure/core.typed>,
mostly bug/documentation fixes.

We now push a "slim" jar which does not include AOT file. See the README
for dependency information.

See the CHANGELOG for specific changes.

I'm also starting to provide functions that will help integrate core.typed
with IDE's. eg.
check-form-info<http://clojure.github.io/core.typed/#clojure.core.typed/check-form-info>
returns
a map of data summarising the results of type checking, including type
errors. This is towards Counterclockwise
support<http://dev.clojure.org/display/design/Typed+CLJS>
.

I'm planning to fix a bunch of things that have proven problematic with the
type syntax. I'll be adding to this design
wiki<http://dev.clojure.org/display/design/Cleaning+up+Type+Syntax>if
you want to follow along, or contribute. These may end up being
breaking
changes.

Also, recursive deftype and protocols have proven to be tricky.
Here<http://dev.clojure.org/display/design/Recursive+Definitions>are
my thoughts.

Finally, I wrote a blog
post<http://frenchy64.github.io/2013/09/08/simple-reasoning-assertions-core-typed.html>explaining
how core.typed understands assertions.

Enjoy!
Ambrose

PS. If you have questions, try #typed-clojure on Freenode!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] lein typed - Check Clojure code with core.typed

2013-09-05 Thread Ambrose Bonnaire-Sergeant
Hi,

core.typed is designed to be used at the REPL.

Using core.typed at the
REPL<http://frenchy64.github.io/typed/clojure,/core.typed,/clojure/2013/09/03/core-typed-repl.html>

There is currently no automatic type checking when loading a namespace.
Consider a commented out
(check-ns), a unit test (is (check-ns ...)) or manually typing it into a
REPL when needed.

Thanks,
Ambrose


On Fri, Sep 6, 2013 at 3:45 AM, JvJ  wrote:

> What's the compatibility with the REPL like?  Is there anything like a
> type-checked REPL initialization, or automatic type checking when loading a
> namespace?
>
> On Tuesday, 3 September 2013 11:18:04 UTC-7, Ambrose Bonnaire-Sergeant
> wrote:
>
>> Hi,
>>
>> Announcing lein typed, a tool to use core.typed at the command line.
>>
>> https://github.com/frenchy64/**lein-typed<https://github.com/frenchy64/lein-typed>
>>
>> Thanks,
>> Ambrose
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] lein typed - Check Clojure code with core.typed

2013-09-05 Thread JvJ
What's the compatibility with the REPL like?  Is there anything like a 
type-checked REPL initialization, or automatic type checking when loading a 
namespace?

On Tuesday, 3 September 2013 11:18:04 UTC-7, Ambrose Bonnaire-Sergeant 
wrote:

> Hi,
>
> Announcing lein typed, a tool to use core.typed at the command line.
>
> https://github.com/frenchy64/lein-typed
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] "Type Coverage" - core.typed 0.2.3, lein-typed 0.3.0

2013-09-04 Thread Brandon Bloom
> lein-typed <https://github.com/frenchy64/lein-typed> 0.3.0 is also 
released, and supports a new 
coverage<https://github.com/frenchy64/lein-typed#type-coverage>
 command.

Awesome!
 
> This is all part of Brandon Bloom's ideal vision of how types should be 
used in Clojure. Thanks for the great idea!

Heh, you're welcome! Thanks for doing this & the shout out.

Just wanted to elaborate a little bit on the views I shared with Ambrose 
and why I pushed him to do this lein plugin, and then to add the coverage 
command. In short, I view types as just one more tool in the verification 
and correctness toolbox. They have lots of other uses, such as for aiding 
optimization in compilers, but they can (and should!) be part of a varied 
suite of tests for robust applications.

However, just as approaching 100% unit test coverage has diminishing 
returns, so does approaching 100% "type coverage". Type annotations can fit 
in right next to your unit and integration tests, outside of your src 
directory. Alternatively, you can include your type annotations inline, 
just like :pre and :post conditions, or validators. For modules that fit at 
the intersection of easily and precisely typed, core.typed can save you a 
lot of manual verification work!

As for the lein plugin, I think that low barriers to use will encourage 
more people to try core.typed as a verification tool. My dream is to be 
able to run a single command that infers all the types in my program, with 
separate annotations on the public interface from the private ones. Then I 
can then validate and check-in the public annotations and discard the 
private annotations. Whenever I change the public interface or experience 
cascading type inference failures in private code, I'd get a test error 
with lein. In this world, I can get 80% of the benefits of types with only 
20% of the cost.

Cheers,
Brandon

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] "Type Coverage" - core.typed 0.2.3, lein-typed 0.3.0

2013-09-04 Thread Ambrose Bonnaire-Sergeant
Hi,

core.typed <https://github.com/clojure/core.typed> 0.2.3 is up, and comes
with two new functions:
- statistics<http://clojure.github.io/core.typed/#clojure.core.typed/statistics>
- 
var-coverage<http://clojure.github.io/core.typed/#clojure.core.typed/var-coverage>

*statistics* returns a map of data on the results of type checking some
namespaces. *var-coverage* is an example of how to leverage this data to
write quick and easy aggregating functions.

This works well at the REPL, for example var-coverage accepts zero
arguments for the current namespace.

clojure.core.typed.utils=> (t/var-coverage)
Start collecting clojure.core.typed.utils
Finished collecting clojure.core.typed.utils
Collected 1 namespaces in 347.052768 msecs
Checked 0 namespaces (approx. 0 lines) in 347.38633 msecs
Found 12 annotated vars out of 51 vars
23% var annotation coverage
nil


lein-typed <https://github.com/frenchy64/lein-typed> 0.3.0 is also
released, and supports a new
coverage<https://github.com/frenchy64/lein-typed#type-coverage>command.
It requires core.typed 0.2.3 or later to use.

$ lein typed coverage
Initializing core.typed ...
"Elapsed time: 4505.279024 msecs"
core.typed initialized.
Start collecting typed-demo.core
Finished collecting typed-demo.core
Collected 1 namespaces in 4619.570363 msecs
Checked 0 namespaces (approx. 0 lines) in 4621.945525 msecs
Start collecting typed-demo.nil
Finished collecting typed-demo.nil
Collected 1 namespaces in 20.48361 msecs
Checked 0 namespaces (approx. 0 lines) in 20.645363 msecs
Found 2 annotated vars out of 2 vars
100% var annotation coverage

This is all part of Brandon Bloom's ideal vision of how types should be
used in Clojure. Thanks for the great idea!

Enjoy!
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] lein typed - Check Clojure code with core.typed

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Released 0.2.0 which consolidates all commands to `lein typed check ...` on
advice of technomancy.

Thanks,
Ambrose


On Wed, Sep 4, 2013 at 2:18 AM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Hi,
>
> Announcing lein typed, a tool to use core.typed at the command line.
>
> https://github.com/frenchy64/lein-typed
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] core.typed 0.2.2 - Loading performance

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi,

Just pushed core.typed 0.2.2. It should be significantly less
excruciating waiting for core.typed to initialise.

There are also minor documentation/error fixes.

[org.clojure/core.typed "0.2.2"]
...; for very recent releases:repositories {"sonatype-oss-public"
"https://oss.sonatype.org/content/groups/public/"}


Readme <https://github.com/clojure/core.typed>
Changelog <https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>

Thanks,
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] lein typed - Check Clojure code with core.typed

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi,

Announcing lein typed, a tool to use core.typed at the command line.

https://github.com/frenchy64/lein-typed

Thanks,
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


core.typed Blog posts

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi,

Some new posts on core.typed:

- Polymorphic 
HOFs<http://frenchy64.github.io/typed/clojure,/core.typed,/clojure/2013/09/02/polymorphic-hof.html>
- Using core.typed at the
REPL<http://frenchy64.github.io/typed/clojure,/core.typed,/clojure/2013/09/03/core-typed-repl.html>

Also, join #typed-clojure on Freenode for discussions on core.typed.

Thanks,
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-30 Thread Ambrose Bonnaire-Sergeant
Hi Shantanu,

CLJS support is planned but not current plans to work on CLR myself.

No leiningen plugins yet, FWIW I tend to add type checks to my unit tests
like:

(is (check-ns 'my.ns))

Thanks,
Ambrose


On Sat, Aug 31, 2013 at 4:13 AM, Shantanu Kumar wrote:

> Sorry for a late reply to the thread. This release is pretty cool. I
> haven't been following the development too closely, so I have two questions:
>
> 1. Is ClojureScript/ClojureCLR supported by core.typed? Or, is it planned?
>
> 2. Is there a Leiningen plugin that can help run the type checks from the
> command line?
>
> Shantanu
>
>
> On Thursday, 29 August 2013 22:10:18 UTC+5:30, Ambrose Bonnaire-Sergeant
> wrote:
>
>> Just pushed 0.2.1 based on feedback from the video on HN.
>>
>> https://github.com/clojure/**core.typed/blob/master/**CHANGELOG.md<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>
>>
>> Thanks,
>> Ambrose
>>
>>
>> On Thu, Aug 29, 2013 at 6:28 AM, Ambrose Bonnaire-Sergeant <
>> abonnair...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> After 10 months and 26 0.1.x releases of transitioning core.typed from
>>> an ambitious student project, I am finally comfortable recommending
>>> core.typed for production use.
>>>
>>> Production Ready
>>>
>>> My interpretation of "production ready" in this context is:
>>> - core.typed can *find bugs* in real code
>>> - core.typed will *not slow down* your existing code by loading
>>>   a large library at production. (core.typed does introduce an extra
>>> "identity-like"
>>>   function call at type annotations, I assume this is a candidate for
>>> optimisation via
>>>   HotSpot)
>>> - A basic *tutorial*, API docs and example project exist
>>> - core.typed is *currently used in production* with success (at
>>> CircleCI for several months)
>>> - The core type checking API is mostly *stable*, with only very
>>>   minor removals/breaking changes in the last few months.
>>>
>>> There are several outstanding issues, but I am satisfied that core.typed
>>> can bring real utility to real programs *today* and with *no
>>> production-time drawbacks*, thus this release.
>>>
>>> How to get started
>>>
>>> Leiningen dep:
>>>
>>> [org.clojure/core.typed "0.2.0"]
>>> ...; for very recent releases:repositories {"sonatype-oss-public" 
>>> "https://oss.sonatype.org/**content/groups/public/ 
>>> <https://oss.sonatype.org/content/groups/public/>"}
>>>
>>> If you like following tutorials try the user/types guide. If you just
>>> want to get your hands on some typed code, see the Example project.
>>>
>>> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
>>> core.typed Types Guide<https://github.com/clojure/core.typed/wiki/Types>
>>> Example project <https://github.com/frenchy64/core.typed-example>
>>> API Reference <http://clojure.github.io/core.typed/>
>>>
>>> core.typed Github Home <https://github.com/clojure/core.typed>
>>> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>>>
>>> Please report bugs, ask questions or discuss things on the mailing 
>>> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
>>> .
>>>
>>> (FWIW I'm ambrosebs on #clojure.)
>>>
>>> Thanks,
>>> Ambrose
>>>
>>
>>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-30 Thread Shantanu Kumar
Sorry for a late reply to the thread. This release is pretty cool. I 
haven't been following the development too closely, so I have two questions:

1. Is ClojureScript/ClojureCLR supported by core.typed? Or, is it planned?

2. Is there a Leiningen plugin that can help run the type checks from the 
command line?

Shantanu

On Thursday, 29 August 2013 22:10:18 UTC+5:30, Ambrose Bonnaire-Sergeant 
wrote:
>
> Just pushed 0.2.1 based on feedback from the video on HN.
>
> https://github.com/clojure/core.typed/blob/master/CHANGELOG.md
>
> Thanks,
> Ambrose
>
>
> On Thu, Aug 29, 2013 at 6:28 AM, Ambrose Bonnaire-Sergeant <
> abonnair...@gmail.com > wrote:
>
>> Hi,
>>
>> After 10 months and 26 0.1.x releases of transitioning core.typed from an 
>> ambitious student project, I am finally comfortable recommending core.typed 
>> for production use.
>>
>> Production Ready
>>
>> My interpretation of "production ready" in this context is:
>> - core.typed can *find bugs* in real code
>> - core.typed will *not slow down* your existing code by loading
>>   a large library at production. (core.typed does introduce an extra 
>> "identity-like"
>>   function call at type annotations, I assume this is a candidate for 
>> optimisation via
>>   HotSpot)
>> - A basic *tutorial*, API docs and example project exist
>> - core.typed is *currently used in production* with success (at CircleCI 
>> for several months)
>> - The core type checking API is mostly *stable*, with only very
>>   minor removals/breaking changes in the last few months.
>>
>> There are several outstanding issues, but I am satisfied that core.typed 
>> can bring real utility to real programs *today* and with *no 
>> production-time drawbacks*, thus this release.
>>
>> How to get started
>>
>> Leiningen dep:
>>
>> [org.clojure/core.typed "0.2.0"]
>> ...; for very recent releases:repositories {"sonatype-oss-public" 
>> "https://oss.sonatype.org/content/groups/public/"}
>>
>> If you like following tutorials try the user/types guide. If you just 
>> want to get your hands on some typed code, see the Example project.
>>
>> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
>> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
>> Example project <https://github.com/frenchy64/core.typed-example>
>> API Reference <http://clojure.github.io/core.typed/>
>>
>> core.typed Github Home <https://github.com/clojure/core.typed>
>> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>>
>> Please report bugs, ask questions or discuss things on the mailing 
>> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
>> .
>>
>> (FWIW I'm ambrosebs on #clojure.)
>>
>> Thanks,
>> Ambrose
>>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Just pushed 0.2.1 based on feedback from the video on HN.

https://github.com/clojure/core.typed/blob/master/CHANGELOG.md

Thanks,
Ambrose


On Thu, Aug 29, 2013 at 6:28 AM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Hi,
>
> After 10 months and 26 0.1.x releases of transitioning core.typed from an
> ambitious student project, I am finally comfortable recommending core.typed
> for production use.
>
> Production Ready
>
> My interpretation of "production ready" in this context is:
> - core.typed can *find bugs* in real code
> - core.typed will *not slow down* your existing code by loading
>   a large library at production. (core.typed does introduce an extra
> "identity-like"
>   function call at type annotations, I assume this is a candidate for
> optimisation via
>   HotSpot)
> - A basic *tutorial*, API docs and example project exist
> - core.typed is *currently used in production* with success (at CircleCI
> for several months)
> - The core type checking API is mostly *stable*, with only very
>   minor removals/breaking changes in the last few months.
>
> There are several outstanding issues, but I am satisfied that core.typed
> can bring real utility to real programs *today* and with *no
> production-time drawbacks*, thus this release.
>
> How to get started
>
> Leiningen dep:
>
> [org.clojure/core.typed "0.2.0"]
> ...; for very recent releases:repositories {"sonatype-oss-public" 
> "https://oss.sonatype.org/content/groups/public/"}
>
> If you like following tutorials try the user/types guide. If you just want
> to get your hands on some typed code, see the Example project.
>
> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
> Example project <https://github.com/frenchy64/core.typed-example>
> API Reference <http://clojure.github.io/core.typed/>
>
> core.typed Github Home <https://github.com/clojure/core.typed>
> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>
> Please report bugs, ask questions or discuss things on the mailing 
> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
> .
>
> (FWIW I'm ambrosebs on #clojure.)
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
Yeah, it's pretty much impossible unless you limit yourself to a manageable 
subset of Clojure.  The "easy" part I was referring to was the Leiningen 
plugin, not the whole kit n' caboodle.

On Thursday, August 29, 2013 11:02:17 AM UTC-5, Alex Baranosky wrote:
>
> Imo, there's nothing "easy" about writing something like Slamhound. Even 
> after many iterations it can't handle macros, because ultimately they're 
> impossible, without some kind of hints specifically added for Slamhound (or 
> for Typed Clojure) :)
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Alex Baranosky
Imo, there's nothing "easy" about writing something like Slamhound. Even
after many iterations it can't handle macros, because ultimately they're
impossible, without some kind of hints specifically added for Slamhound (or
for Typed Clojure) :)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Maik Schünemann
On Thu, Aug 29, 2013 at 5:01 PM, Ambrose Bonnaire-Sergeant
 wrote:
> Well I'm sure people wouldn't be happy if their call to (+ a b c) was
> suddenly turned into (clojure.lang.Numbers/add (clojure.lang.Numbers/add a
> b) c)
>
> :)

the expresso [1] optimizer can be used for those optimizations ;)


[1] https://github.com/clojure-numerics/expresso

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Well I'm sure people wouldn't be happy if their call to (+ a b c) was
suddenly turned into (clojure.lang.Numbers/add (clojure.lang.Numbers/add a
b) c)

:)


On Thu, Aug 29, 2013 at 10:57 PM, Daniel  wrote:

> Those forms won't be in the namespace you're evaluating?
>
> Yeah, it's probably a lot of work, but it sounds neat.  :-)
>
>
>
> On Thursday, August 29, 2013 9:07:26 AM UTC-5, Ambrose Bonnaire-Sergeant
> wrote:
>
>> I don't think it would be possible to reconstruct the original forms in
>> general, you would need to reverse macroexpansion to provide a form that
>> has at least a passing familiarity with the original form. Otherwise you
>> would get fully macroexpanded forms.
>>
>> That's a lot of work!
>>
>>
>> On Thu, Aug 29, 2013 at 9:56 PM, Daniel  wrote:
>>
>>> If you can do that, why not return the literal representation of the
>>> type hinted function?
>>>
>>> For the repl you could provide a function that interns the type-hinted
>>> function into the namespace by evaluating the literal representation first.
>>>
>>> From there it's easy to provide something like slamhound.  Once you're
>>> certain types have been provided to your namespace correctly at the repl,
>>> run 'lein type ' to type hint everything in the namespace by
>>> literally restructuring the file.
>>>
>>> Things type hinted with expressions would be tricky, but this could work
>>> (or you could just leave it alone):
>>>
>>> myfn (original)
>>> myfn-int
>>> myfn-long
>>> myfn-float
>>> etc
>>>
>>>
>>>
>>> On Thursday, August 29, 2013 6:40:16 AM UTC-5, Ambrose Bonnaire-Sergeant
>>> wrote:
>>>
>>>> With Clojure the lines blur between compile time and runtime.
>>>>
>>>> The clearest way to put it is that type checking is explicitly called
>>>> at the REPL or in a unit test. Usually this is done during development
>>>> iterations or testing time.
>>>>
>>>> Re: performance improvements: Michael is correct. Interestingly Typed
>>>> Racket offers numeric optimisations, but leans heavily on Racket's
>>>> metaprogramming facilities to insert them automatically. There's potential
>>>> in Typed Clojure for *identification* of speed improvements, but not
>>>> actually inserting them. Typed Racket's "optimisation coach" comes to mind
>>>> in ways we can present this information ("put a type hint at line 10, col
>>>> 20 to get full speed...").
>>>>
>>>> Thanks,
>>>> Ambrose
>>>>
>>>>
>>>> On Thu, Aug 29, 2013 at 6:03 PM, Christian Sperandio <
>>>> christian...@gmail.com**> wrote:
>>>>
>>>>> Ok...
>>>>>
>>>>> Another question, the checking is done only once (while compiling) ?
>>>>> Or, it's done while the runtime?
>>>>>
>>>>>
>>>>>
>>>>> 2013/8/29 Michael Klishin 
>>>>>
>>>>>> 2013/8/29 Christian Sperandio 
>>>>>>
>>>>>> Is there any perf improvement to use static typing in Clojure?
>>>>>>
>>>>>>
>>>>>>  core.typed is not a compiler, it's a type annotation/checker
>>>>>> implemented
>>>>>> as a library.
>>>>>>
>>>>>> If you are familiar with Erlang, it is to Clojure what Dialyzer is to
>>>>>> Erlang.
>>>>>> --
>>>>>> MK
>>>>>>
>>>>>> http://github.com/**michaelklish**in<http://github.com/michaelklishin>
>>>>>> http://twitter.com/**michaelklis**hin<http://twitter.com/michaelklishin>
>>>>>>
>>>>>> --
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Clojure" group.
>>>>>> To post to this group, send email to clo...@googlegroups.com
>>>>>>
>>>>>> Note that posts from new members are moderated - please be patient
>>>>>> with your first post.
>>>>>> To unsubscribe from this group, send email to
>>>>>> clojure+u...@**googlegroups.com
>>>>>>
>>>>>> For more options, 

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
Those forms won't be in the namespace you're evaluating?

Yeah, it's probably a lot of work, but it sounds neat.  :-)


On Thursday, August 29, 2013 9:07:26 AM UTC-5, Ambrose Bonnaire-Sergeant 
wrote:
>
> I don't think it would be possible to reconstruct the original forms in 
> general, you would need to reverse macroexpansion to provide a form that 
> has at least a passing familiarity with the original form. Otherwise you 
> would get fully macroexpanded forms.
>
> That's a lot of work!
>
>
> On Thu, Aug 29, 2013 at 9:56 PM, Daniel 
> > wrote:
>
>> If you can do that, why not return the literal representation of the type 
>> hinted function?
>>
>> For the repl you could provide a function that interns the type-hinted 
>> function into the namespace by evaluating the literal representation first.
>>
>> From there it's easy to provide something like slamhound.  Once you're 
>> certain types have been provided to your namespace correctly at the repl, 
>> run 'lein type ' to type hint everything in the namespace by 
>> literally restructuring the file.
>>
>> Things type hinted with expressions would be tricky, but this could work 
>> (or you could just leave it alone):
>>
>> myfn (original)
>> myfn-int
>> myfn-long
>> myfn-float
>> etc
>>
>>
>>
>> On Thursday, August 29, 2013 6:40:16 AM UTC-5, Ambrose Bonnaire-Sergeant 
>> wrote:
>>
>>> With Clojure the lines blur between compile time and runtime.
>>>
>>> The clearest way to put it is that type checking is explicitly called at 
>>> the REPL or in a unit test. Usually this is done during development 
>>> iterations or testing time.
>>>
>>> Re: performance improvements: Michael is correct. Interestingly Typed 
>>> Racket offers numeric optimisations, but leans heavily on Racket's 
>>> metaprogramming facilities to insert them automatically. There's potential 
>>> in Typed Clojure for *identification* of speed improvements, but not 
>>> actually inserting them. Typed Racket's "optimisation coach" comes to mind 
>>> in ways we can present this information ("put a type hint at line 10, col 
>>> 20 to get full speed...").
>>>
>>> Thanks,
>>> Ambrose
>>>
>>>
>>> On Thu, Aug 29, 2013 at 6:03 PM, Christian Sperandio <
>>> christian...@gmail.com**> wrote:
>>>
>>>> Ok...
>>>>
>>>> Another question, the checking is done only once (while compiling) ? 
>>>> Or, it's done while the runtime?
>>>>
>>>>
>>>>
>>>> 2013/8/29 Michael Klishin 
>>>>
>>>>> 2013/8/29 Christian Sperandio 
>>>>>
>>>>> Is there any perf improvement to use static typing in Clojure?
>>>>>
>>>>>
>>>>>  core.typed is not a compiler, it's a type annotation/checker 
>>>>> implemented
>>>>> as a library.
>>>>>
>>>>> If you are familiar with Erlang, it is to Clojure what Dialyzer is to 
>>>>> Erlang.
>>>>> -- 
>>>>> MK
>>>>>
>>>>> http://github.com/**michaelklishin <http://github.com/michaelklishin>
>>>>> http://twitter.com/**michaelklishin<http://twitter.com/michaelklishin>
>>>>>  
>>>>> -- 
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Clojure" group.
>>>>> To post to this group, send email to clo...@googlegroups.com
>>>>>
>>>>> Note that posts from new members are moderated - please be patient 
>>>>> with your first post.
>>>>> To unsubscribe from this group, send email to
>>>>> clojure+u...@**googlegroups.com
>>>>>
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/**group/clojure?hl=en<http://groups.google.com/group/clojure?hl=en>
>>>>> --- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "Clojure" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to clojure+u...@**googlegroups.com.
>>>>>
>>>>> For more options, visit 
>>>>> https://groups.google.com/**groups/opt_out<

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
I don't think it would be possible to reconstruct the original forms in
general, you would need to reverse macroexpansion to provide a form that
has at least a passing familiarity with the original form. Otherwise you
would get fully macroexpanded forms.

That's a lot of work!


On Thu, Aug 29, 2013 at 9:56 PM, Daniel  wrote:

> If you can do that, why not return the literal representation of the type
> hinted function?
>
> For the repl you could provide a function that interns the type-hinted
> function into the namespace by evaluating the literal representation first.
>
> From there it's easy to provide something like slamhound.  Once you're
> certain types have been provided to your namespace correctly at the repl,
> run 'lein type ' to type hint everything in the namespace by
> literally restructuring the file.
>
> Things type hinted with expressions would be tricky, but this could work
> (or you could just leave it alone):
>
> myfn (original)
> myfn-int
> myfn-long
> myfn-float
> etc
>
>
>
> On Thursday, August 29, 2013 6:40:16 AM UTC-5, Ambrose Bonnaire-Sergeant
> wrote:
>
>> With Clojure the lines blur between compile time and runtime.
>>
>> The clearest way to put it is that type checking is explicitly called at
>> the REPL or in a unit test. Usually this is done during development
>> iterations or testing time.
>>
>> Re: performance improvements: Michael is correct. Interestingly Typed
>> Racket offers numeric optimisations, but leans heavily on Racket's
>> metaprogramming facilities to insert them automatically. There's potential
>> in Typed Clojure for *identification* of speed improvements, but not
>> actually inserting them. Typed Racket's "optimisation coach" comes to mind
>> in ways we can present this information ("put a type hint at line 10, col
>> 20 to get full speed...").
>>
>> Thanks,
>> Ambrose
>>
>>
>> On Thu, Aug 29, 2013 at 6:03 PM, Christian Sperandio <
>> christian...@gmail.com**> wrote:
>>
>>> Ok...
>>>
>>> Another question, the checking is done only once (while compiling) ? Or,
>>> it's done while the runtime?
>>>
>>>
>>>
>>> 2013/8/29 Michael Klishin 
>>>
>>>> 2013/8/29 Christian Sperandio 
>>>>
>>>> Is there any perf improvement to use static typing in Clojure?
>>>>
>>>>
>>>>  core.typed is not a compiler, it's a type annotation/checker
>>>> implemented
>>>> as a library.
>>>>
>>>> If you are familiar with Erlang, it is to Clojure what Dialyzer is to
>>>> Erlang.
>>>> --
>>>> MK
>>>>
>>>> http://github.com/**michaelklishin <http://github.com/michaelklishin>
>>>> http://twitter.com/**michaelklishin <http://twitter.com/michaelklishin>
>>>>
>>>> --
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To post to this group, send email to clo...@googlegroups.com
>>>>
>>>> Note that posts from new members are moderated - please be patient with
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>> clojure+u...@**googlegroups.com
>>>>
>>>> For more options, visit this group at
>>>> http://groups.google.com/**group/clojure?hl=en<http://groups.google.com/group/clojure?hl=en>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to clojure+u...@**googlegroups.com.
>>>>
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>
>>>  --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>>
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@**googlegroups.com
>>>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/clojure?

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
If you can do that, why not return the literal representation of the type 
hinted function?

For the repl you could provide a function that interns the type-hinted 
function into the namespace by evaluating the literal representation first.

>From there it's easy to provide something like slamhound.  Once you're 
certain types have been provided to your namespace correctly at the repl, 
run 'lein type ' to type hint everything in the namespace by 
literally restructuring the file.

Things type hinted with expressions would be tricky, but this could work 
(or you could just leave it alone):

myfn (original)
myfn-int
myfn-long
myfn-float
etc



On Thursday, August 29, 2013 6:40:16 AM UTC-5, Ambrose Bonnaire-Sergeant 
wrote:
>
> With Clojure the lines blur between compile time and runtime.
>
> The clearest way to put it is that type checking is explicitly called at 
> the REPL or in a unit test. Usually this is done during development 
> iterations or testing time.
>
> Re: performance improvements: Michael is correct. Interestingly Typed 
> Racket offers numeric optimisations, but leans heavily on Racket's 
> metaprogramming facilities to insert them automatically. There's potential 
> in Typed Clojure for *identification* of speed improvements, but not 
> actually inserting them. Typed Racket's "optimisation coach" comes to mind 
> in ways we can present this information ("put a type hint at line 10, col 
> 20 to get full speed...").
>
> Thanks,
> Ambrose
>
>
> On Thu, Aug 29, 2013 at 6:03 PM, Christian Sperandio <
> christian...@gmail.com > wrote:
>
>> Ok...
>>
>> Another question, the checking is done only once (while compiling) ? Or, 
>> it's done while the runtime?
>>
>>
>>
>> 2013/8/29 Michael Klishin >
>>
>>> 2013/8/29 Christian Sperandio >
>>>
>>>> Is there any perf improvement to use static typing in Clojure?
>>>
>>>
>>> core.typed is not a compiler, it's a type annotation/checker implemented
>>> as a library.
>>>
>>> If you are familiar with Erlang, it is to Clojure what Dialyzer is to 
>>> Erlang.
>>> -- 
>>> MK
>>>
>>> http://github.com/michaelklishin
>>> http://twitter.com/michaelklishin
>>>  
>>> -- 
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with 
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@googlegroups.com 
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to clojure+u...@googlegroups.com .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
With Clojure the lines blur between compile time and runtime.

The clearest way to put it is that type checking is explicitly called at
the REPL or in a unit test. Usually this is done during development
iterations or testing time.

Re: performance improvements: Michael is correct. Interestingly Typed
Racket offers numeric optimisations, but leans heavily on Racket's
metaprogramming facilities to insert them automatically. There's potential
in Typed Clojure for *identification* of speed improvements, but not
actually inserting them. Typed Racket's "optimisation coach" comes to mind
in ways we can present this information ("put a type hint at line 10, col
20 to get full speed...").

Thanks,
Ambrose


On Thu, Aug 29, 2013 at 6:03 PM, Christian Sperandio <
christian.speran...@gmail.com> wrote:

> Ok...
>
> Another question, the checking is done only once (while compiling) ? Or,
> it's done while the runtime?
>
>
>
> 2013/8/29 Michael Klishin 
>
>> 2013/8/29 Christian Sperandio 
>>
>>> Is there any perf improvement to use static typing in Clojure?
>>
>>
>> core.typed is not a compiler, it's a type annotation/checker implemented
>> as a library.
>>
>> If you are familiar with Erlang, it is to Clojure what Dialyzer is to
>> Erlang.
>> --
>> MK
>>
>> http://github.com/michaelklishin
>> http://twitter.com/michaelklishin
>>
>> --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Christian Sperandio
Ok...

Another question, the checking is done only once (while compiling) ? Or,
it's done while the runtime?



2013/8/29 Michael Klishin 

> 2013/8/29 Christian Sperandio 
>
>> Is there any perf improvement to use static typing in Clojure?
>
>
> core.typed is not a compiler, it's a type annotation/checker implemented
> as a library.
>
> If you are familiar with Erlang, it is to Clojure what Dialyzer is to
> Erlang.
> --
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Michael Klishin
2013/8/29 Christian Sperandio 

> Is there any perf improvement to use static typing in Clojure?


core.typed is not a compiler, it's a type annotation/checker implemented
as a library.

If you are familiar with Erlang, it is to Clojure what Dialyzer is to
Erlang.
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Christian Sperandio
Is there any perf improvement to use static typing in Clojure?
Like we can see with Groovy 2.x and its static mode.



2013/8/29 Nils Grunwald 

> Congratulations and thanks for your work!
>
>
> On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant
> wrote:
>
>> Hi,
>>
>> After 10 months and 26 0.1.x releases of transitioning core.typed from an
>> ambitious student project, I am finally comfortable recommending core.typed
>> for production use.
>>
>> Production Ready
>>
>> My interpretation of "production ready" in this context is:
>> - core.typed can *find bugs* in real code
>> - core.typed will *not slow down* your existing code by loading
>>   a large library at production. (core.typed does introduce an extra
>> "identity-like"
>>   function call at type annotations, I assume this is a candidate for
>> optimisation via
>>   HotSpot)
>> - A basic *tutorial*, API docs and example project exist
>> - core.typed is *currently used in production* with success (at CircleCI
>> for several months)
>> - The core type checking API is mostly *stable*, with only very
>>   minor removals/breaking changes in the last few months.
>>
>> There are several outstanding issues, but I am satisfied that core.typed
>> can bring real utility to real programs *today* and with *no
>> production-time drawbacks*, thus this release.
>>
>> How to get started
>>
>> Leiningen dep:
>>
>> [org.clojure/core.typed "0.2.0"]
>> ...; for very recent releases:repositories {"sonatype-oss-public" 
>> "https://oss.sonatype.org/**content/groups/public/ 
>> <https://oss.sonatype.org/content/groups/public/>"}
>>
>> If you like following tutorials try the user/types guide. If you just
>> want to get your hands on some typed code, see the Example project.
>>
>> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
>> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
>> Example project <https://github.com/frenchy64/core.typed-example>
>> API Reference <http://clojure.github.io/core.typed/>
>>
>> core.typed Github Home <https://github.com/clojure/core.typed>
>> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>>
>> Please report bugs, ask questions or discuss things on the mailing 
>> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
>> .
>>
>> (FWIW I'm ambrosebs on #clojure.)
>>
>> Thanks,
>> Ambrose
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Nils Grunwald
Congratulations and thanks for your work!

On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant 
wrote:
>
> Hi,
>
> After 10 months and 26 0.1.x releases of transitioning core.typed from an 
> ambitious student project, I am finally comfortable recommending core.typed 
> for production use.
>
> Production Ready
>
> My interpretation of "production ready" in this context is:
> - core.typed can *find bugs* in real code
> - core.typed will *not slow down* your existing code by loading
>   a large library at production. (core.typed does introduce an extra 
> "identity-like"
>   function call at type annotations, I assume this is a candidate for 
> optimisation via
>   HotSpot)
> - A basic *tutorial*, API docs and example project exist
> - core.typed is *currently used in production* with success (at CircleCI 
> for several months)
> - The core type checking API is mostly *stable*, with only very
>   minor removals/breaking changes in the last few months.
>
> There are several outstanding issues, but I am satisfied that core.typed 
> can bring real utility to real programs *today* and with *no 
> production-time drawbacks*, thus this release.
>
> How to get started
>
> Leiningen dep:
>
> [org.clojure/core.typed "0.2.0"]
> ...; for very recent releases:repositories {"sonatype-oss-public" 
> "https://oss.sonatype.org/content/groups/public/"}
>
> If you like following tutorials try the user/types guide. If you just want 
> to get your hands on some typed code, see the Example project.
>
> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
> Example project <https://github.com/frenchy64/core.typed-example>
> API Reference <http://clojure.github.io/core.typed/>
>
> core.typed Github Home <https://github.com/clojure/core.typed>
> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>
> Please report bugs, ask questions or discuss things on the mailing 
> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
> .
>
> (FWIW I'm ambrosebs on #clojure.)
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Also you can add missing annotations via ann.

(ann ^:no-check clojure.core/+ )

Core vars observe the same rules as all vars: they must be annotated.

Thanks,
Ambrose


On Thu, Aug 29, 2013 at 3:44 PM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Hi,
>
> Roughly 1/3 of clojure.core is annotated and comes included with
> core.typed. They are unchecked annotations.
>
>
> https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/base_env.clj#L658
>
> You can lookup types via cf at the REPL.
>
> (clojure.core.typed/cf +)
> ;=> (Fn [clojure.core.typed/AnyInteger * -> clojure.core.typed/AnyInteger]
> [Number * -> Number])
>
> Thanks,
> Ambrose
>
>
> On Thu, Aug 29, 2013 at 3:40 PM, Jozef Wagner wrote:
>
>> How about annotating clojure.core API. Is it needed, provided, optional?
>>
>>
>> On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant
>> wrote:
>>>
>>> Hi,
>>>
>>> After 10 months and 26 0.1.x releases of transitioning core.typed from
>>> an ambitious student project, I am finally comfortable recommending
>>> core.typed for production use.
>>>
>>> Production Ready
>>>
>>> My interpretation of "production ready" in this context is:
>>> - core.typed can *find bugs* in real code
>>> - core.typed will *not slow down* your existing code by loading
>>>   a large library at production. (core.typed does introduce an extra
>>> "identity-like"
>>>   function call at type annotations, I assume this is a candidate for
>>> optimisation via
>>>   HotSpot)
>>> - A basic *tutorial*, API docs and example project exist
>>> - core.typed is *currently used in production* with success (at
>>> CircleCI for several months)
>>> - The core type checking API is mostly *stable*, with only very
>>>   minor removals/breaking changes in the last few months.
>>>
>>> There are several outstanding issues, but I am satisfied that core.typed
>>> can bring real utility to real programs *today* and with *no
>>> production-time drawbacks*, thus this release.
>>>
>>> How to get started
>>>
>>> Leiningen dep:
>>>
>>> [org.clojure/core.typed "0.2.0"]
>>> ...; for very recent releases:repositories {"sonatype-oss-public" 
>>> "https://oss.sonatype.org/**content/groups/public/ 
>>> <https://oss.sonatype.org/content/groups/public/>"}
>>>
>>> If you like following tutorials try the user/types guide. If you just
>>> want to get your hands on some typed code, see the Example project.
>>>
>>> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
>>> core.typed Types Guide<https://github.com/clojure/core.typed/wiki/Types>
>>> Example project <https://github.com/frenchy64/core.typed-example>
>>> API Reference <http://clojure.github.io/core.typed/>
>>>
>>> core.typed Github Home <https://github.com/clojure/core.typed>
>>> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>>>
>>> Please report bugs, ask questions or discuss things on the mailing 
>>> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
>>> .
>>>
>>> (FWIW I'm ambrosebs on #clojure.)
>>>
>>> Thanks,
>>> Ambrose
>>>
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Hi,

Roughly 1/3 of clojure.core is annotated and comes included with
core.typed. They are unchecked annotations.

https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/base_env.clj#L658

You can lookup types via cf at the REPL.

(clojure.core.typed/cf +)
;=> (Fn [clojure.core.typed/AnyInteger * -> clojure.core.typed/AnyInteger]
[Number * -> Number])

Thanks,
Ambrose


On Thu, Aug 29, 2013 at 3:40 PM, Jozef Wagner wrote:

> How about annotating clojure.core API. Is it needed, provided, optional?
>
>
> On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant
> wrote:
>>
>> Hi,
>>
>> After 10 months and 26 0.1.x releases of transitioning core.typed from an
>> ambitious student project, I am finally comfortable recommending core.typed
>> for production use.
>>
>> Production Ready
>>
>> My interpretation of "production ready" in this context is:
>> - core.typed can *find bugs* in real code
>> - core.typed will *not slow down* your existing code by loading
>>   a large library at production. (core.typed does introduce an extra
>> "identity-like"
>>   function call at type annotations, I assume this is a candidate for
>> optimisation via
>>   HotSpot)
>> - A basic *tutorial*, API docs and example project exist
>> - core.typed is *currently used in production* with success (at CircleCI
>> for several months)
>> - The core type checking API is mostly *stable*, with only very
>>   minor removals/breaking changes in the last few months.
>>
>> There are several outstanding issues, but I am satisfied that core.typed
>> can bring real utility to real programs *today* and with *no
>> production-time drawbacks*, thus this release.
>>
>> How to get started
>>
>> Leiningen dep:
>>
>> [org.clojure/core.typed "0.2.0"]
>> ...; for very recent releases:repositories {"sonatype-oss-public" 
>> "https://oss.sonatype.org/**content/groups/public/ 
>> <https://oss.sonatype.org/content/groups/public/>"}
>>
>> If you like following tutorials try the user/types guide. If you just
>> want to get your hands on some typed code, see the Example project.
>>
>> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
>> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
>> Example project <https://github.com/frenchy64/core.typed-example>
>> API Reference <http://clojure.github.io/core.typed/>
>>
>> core.typed Github Home <https://github.com/clojure/core.typed>
>> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>>
>> Please report bugs, ask questions or discuss things on the mailing 
>> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
>> .
>>
>> (FWIW I'm ambrosebs on #clojure.)
>>
>> Thanks,
>> Ambrose
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
I see optional typing as the opposite of mandatory typing. You don't need
to pass a type checker to get a program semantics.

Typed Clojure offers a particular flavour of optional typing: gradual
typing. My interpretation of gradual typing is some of your code is
rigorously statically typed, some is untyped, and there is some mediator
that handles the interface between the two. (Typed Clojure lacks the
mediator atm). You need to be explicit about the boundaries between
typed/untyped to make the most of the type system.

If you're providing a library, the implementation could be completely
untyped, but you might have annotations for your API.

Admittedly I've been exclusively researching Typed Racket style type
systems for awhile now, but I'm sceptical that the kind of type system you
describe would be effective in finding bugs in your programs. It might find
them, but error messages will probably be unpredictable and unreadable, and
the type system would not have simple rules to get a namespace type
checking like Typed Clojure/Racket does. (eg. assign types to top-levels
and fn parameters.)

I'm fairly confident that if you use core.typed, you'll see it's not for
everything, but that it can rigorously type check some isolated code, which
is often a use case. There are tradeoffs here: the more flexible the type
system is, the more complicated the rules are for what type checks, and
there will probably be tradeoffs in the accuracy of the static type system.

Also knowing that you've applied a picky, accurate type checker such as
core.typed on a large code base is a (valid) good feeling. It will take
investment though. In my experience, writing static types for functions is
similar to a code review, and probably makes you think about what your code
is doing a little more.

Thanks,
Ambrose


On Thu, Aug 29, 2013 at 3:13 PM, Daniel  wrote:

> Couldn't occurrence typing catch the error in that example, since
> evil-atom-reset! can only return an atom wrapping a keyword?
>
> I guess the problem I had is that the "optional typing" moniker seems
> misleading since it forces you to annotate vars.  I had visions of
> gradually assigning types to vars as it became evident that typing was
> needed as a pre-runtime guardrail based on how other developers were using
> my functions.  If I'm publishing a library then that's backward thinking,
> but in a team using core.typed it sounds useful... Only type what you need
> when you need to.
>
> Don't mind me... Clearly I need to actually use the library before
> developing an opinion.
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Jozef Wagner
How about annotating clojure.core API. Is it needed, provided, optional?

On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant 
wrote:
>
> Hi,
>
> After 10 months and 26 0.1.x releases of transitioning core.typed from an 
> ambitious student project, I am finally comfortable recommending core.typed 
> for production use.
>
> Production Ready
>
> My interpretation of "production ready" in this context is:
> - core.typed can *find bugs* in real code
> - core.typed will *not slow down* your existing code by loading
>   a large library at production. (core.typed does introduce an extra 
> "identity-like"
>   function call at type annotations, I assume this is a candidate for 
> optimisation via
>   HotSpot)
> - A basic *tutorial*, API docs and example project exist
> - core.typed is *currently used in production* with success (at CircleCI 
> for several months)
> - The core type checking API is mostly *stable*, with only very
>   minor removals/breaking changes in the last few months.
>
> There are several outstanding issues, but I am satisfied that core.typed 
> can bring real utility to real programs *today* and with *no 
> production-time drawbacks*, thus this release.
>
> How to get started
>
> Leiningen dep:
>
> [org.clojure/core.typed "0.2.0"]
> ...; for very recent releases:repositories {"sonatype-oss-public" 
> "https://oss.sonatype.org/content/groups/public/"}
>
> If you like following tutorials try the user/types guide. If you just want 
> to get your hands on some typed code, see the Example project.
>
> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
> Example project <https://github.com/frenchy64/core.typed-example>
> API Reference <http://clojure.github.io/core.typed/>
>
> core.typed Github Home <https://github.com/clojure/core.typed>
> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>
> Please report bugs, ask questions or discuss things on the mailing 
> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
> .
>
> (FWIW I'm ambrosebs on #clojure.)
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Daniel
Couldn't occurrence typing catch the error in that example, since 
evil-atom-reset! can only return an atom wrapping a keyword?

I guess the problem I had is that the "optional typing" moniker seems 
misleading since it forces you to annotate vars.  I had visions of gradually 
assigning types to vars as it became evident that typing was needed as a 
pre-runtime guardrail based on how other developers were using my functions.  
If I'm publishing a library then that's backward thinking, but in a team using 
core.typed it sounds useful... Only type what you need when you need to.

Don't mind me... Clearly I need to actually use the library before developing 
an opinion.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Ambrose Bonnaire-Sergeant
Hi Daniel,

It is unsound to assume we can pass anything to an unannotated, unchecked
var.

core.typed makes the user explicitly mark unchecked vars, which is also a
source of unsoundness, but an explicit one. Hopefully :no-check is not
ambiguous in this regard.

Take this example.

;; untyped namespace
(defn evil-atom-reset! [a]
  (reset! a :foo))
...
;; typed namespace
(defn nice-typed-fn []
  (let [a (ann-form (atom 1) (Atom1 Number))
_ (evil-atom-reset! a)]
(+ @a 2)))

If we simply assume evil-atom-reset! is of type [Any -> Any], our atom gets
changed underneath us, and any type guarantees do not hold anymore.

The answer to this is generating contracts to wrap about our calls to
untyped vars. These should probably be driven by user annotations though.
Typed Racket automatically does this via macros, which is very cool, but
probably impossible in Clojure.

So in general, implicitly trusting untyped code can be problematic.
core.typed at least makes the user be explicit about unchecked vars so
there is some chance the annotation is correct.

Thanks,
Ambrose

On Thu, Aug 29, 2013 at 12:06 PM, Daniel  wrote:

> Excellent work. I noticed that function parameter types default to Any
> when not Annotated.  What was the reasoning behind not mirroring this
> behavior for vars, and instead requiring an annotation?
>
>
> On Wednesday, August 28, 2013 5:28:35 PM UTC-5, Ambrose Bonnaire-Sergeant
> wrote:
>>
>> Hi,
>>
>> After 10 months and 26 0.1.x releases of transitioning core.typed from an
>> ambitious student project, I am finally comfortable recommending core.typed
>> for production use.
>>
>> Production Ready
>>
>> My interpretation of "production ready" in this context is:
>> - core.typed can *find bugs* in real code
>> - core.typed will *not slow down* your existing code by loading
>>   a large library at production. (core.typed does introduce an extra
>> "identity-like"
>>   function call at type annotations, I assume this is a candidate for
>> optimisation via
>>   HotSpot)
>> - A basic *tutorial*, API docs and example project exist
>> - core.typed is *currently used in production* with success (at CircleCI
>> for several months)
>> - The core type checking API is mostly *stable*, with only very
>>   minor removals/breaking changes in the last few months.
>>
>> There are several outstanding issues, but I am satisfied that core.typed
>> can bring real utility to real programs *today* and with *no
>> production-time drawbacks*, thus this release.
>>
>> How to get started
>>
>> Leiningen dep:
>>
>> [org.clojure/core.typed "0.2.0"]
>> ...; for very recent releases:repositories {"sonatype-oss-public" 
>> "https://oss.sonatype.org/**content/groups/public/ 
>> <https://oss.sonatype.org/content/groups/public/>"}
>>
>> If you like following tutorials try the user/types guide. If you just
>> want to get your hands on some typed code, see the Example project.
>>
>> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
>> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
>> Example project <https://github.com/frenchy64/core.typed-example>
>> API Reference <http://clojure.github.io/core.typed/>
>>
>> core.typed Github Home <https://github.com/clojure/core.typed>
>> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>>
>> Please report bugs, ask questions or discuss things on the mailing 
>> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
>> .
>>
>> (FWIW I'm ambrosebs on #clojure.)
>>
>> Thanks,
>> Ambrose
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Daniel
Excellent work. I noticed that function parameter types default to Any when 
not Annotated.  What was the reasoning behind not mirroring this behavior 
for vars, and instead requiring an annotation?


On Wednesday, August 28, 2013 5:28:35 PM UTC-5, Ambrose Bonnaire-Sergeant 
wrote:
>
> Hi,
>
> After 10 months and 26 0.1.x releases of transitioning core.typed from an 
> ambitious student project, I am finally comfortable recommending core.typed 
> for production use.
>
> Production Ready
>
> My interpretation of "production ready" in this context is:
> - core.typed can *find bugs* in real code
> - core.typed will *not slow down* your existing code by loading
>   a large library at production. (core.typed does introduce an extra 
> "identity-like"
>   function call at type annotations, I assume this is a candidate for 
> optimisation via
>   HotSpot)
> - A basic *tutorial*, API docs and example project exist
> - core.typed is *currently used in production* with success (at CircleCI 
> for several months)
> - The core type checking API is mostly *stable*, with only very
>   minor removals/breaking changes in the last few months.
>
> There are several outstanding issues, but I am satisfied that core.typed 
> can bring real utility to real programs *today* and with *no 
> production-time drawbacks*, thus this release.
>
> How to get started
>
> Leiningen dep:
>
> [org.clojure/core.typed "0.2.0"]
> ...; for very recent releases:repositories {"sonatype-oss-public" 
> "https://oss.sonatype.org/content/groups/public/"}
>
> If you like following tutorials try the user/types guide. If you just want 
> to get your hands on some typed code, see the Example project.
>
> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
> Example project <https://github.com/frenchy64/core.typed-example>
> API Reference <http://clojure.github.io/core.typed/>
>
> core.typed Github Home <https://github.com/clojure/core.typed>
> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>
> Please report bugs, ask questions or discuss things on the mailing 
> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
> .
>
> (FWIW I'm ambrosebs on #clojure.)
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Allen Rohner
Awesome. Thanks for your hard work! 

Allen

On Wednesday, August 28, 2013 3:28:35 PM UTC-7, Ambrose Bonnaire-Sergeant 
wrote:
>
> Hi,
>
> After 10 months and 26 0.1.x releases of transitioning core.typed from an 
> ambitious student project, I am finally comfortable recommending core.typed 
> for production use.
>
> Production Ready
>
> My interpretation of "production ready" in this context is:
> - core.typed can *find bugs* in real code
> - core.typed will *not slow down* your existing code by loading
>   a large library at production. (core.typed does introduce an extra 
> "identity-like"
>   function call at type annotations, I assume this is a candidate for 
> optimisation via
>   HotSpot)
> - A basic *tutorial*, API docs and example project exist
> - core.typed is *currently used in production* with success (at CircleCI 
> for several months)
> - The core type checking API is mostly *stable*, with only very
>   minor removals/breaking changes in the last few months.
>
> There are several outstanding issues, but I am satisfied that core.typed 
> can bring real utility to real programs *today* and with *no 
> production-time drawbacks*, thus this release.
>
> How to get started
>
> Leiningen dep:
>
> [org.clojure/core.typed "0.2.0"]
> ...; for very recent releases:repositories {"sonatype-oss-public" 
> "https://oss.sonatype.org/content/groups/public/"}
>
> If you like following tutorials try the user/types guide. If you just want 
> to get your hands on some typed code, see the Example project.
>
> core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
> core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
> Example project <https://github.com/frenchy64/core.typed-example>
> API Reference <http://clojure.github.io/core.typed/>
>
> core.typed Github Home <https://github.com/clojure/core.typed>
> core.typed Wiki <https://github.com/clojure/core.typed/wiki>
>
> Please report bugs, ask questions or discuss things on the mailing 
> list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
> .
>
> (FWIW I'm ambrosebs on #clojure.)
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Ambrose Bonnaire-Sergeant
Hi,

After 10 months and 26 0.1.x releases of transitioning core.typed from an
ambitious student project, I am finally comfortable recommending core.typed
for production use.

Production Ready

My interpretation of "production ready" in this context is:
- core.typed can *find bugs* in real code
- core.typed will *not slow down* your existing code by loading
  a large library at production. (core.typed does introduce an extra
"identity-like"
  function call at type annotations, I assume this is a candidate for
optimisation via
  HotSpot)
- A basic *tutorial*, API docs and example project exist
- core.typed is *currently used in production* with success (at CircleCI
for several months)
- The core type checking API is mostly *stable*, with only very
  minor removals/breaking changes in the last few months.

There are several outstanding issues, but I am satisfied that core.typed
can bring real utility to real programs *today* and with *no
production-time drawbacks*, thus this release.

How to get started

Leiningen dep:

[org.clojure/core.typed "0.2.0"]
...; for very recent releases:repositories {"sonatype-oss-public"
"https://oss.sonatype.org/content/groups/public/"}

If you like following tutorials try the user/types guide. If you just want
to get your hands on some typed code, see the Example project.

core.typed User Guide<https://github.com/clojure/core.typed/wiki/User-Guide>
core.typed Types Guide <https://github.com/clojure/core.typed/wiki/Types>
Example project <https://github.com/frenchy64/core.typed-example>
API Reference <http://clojure.github.io/core.typed/>

core.typed Github Home <https://github.com/clojure/core.typed>
core.typed Wiki <https://github.com/clojure/core.typed/wiki>

Please report bugs, ask questions or discuss things on the mailing
list<https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed>
.

(FWIW I'm ambrosebs on #clojure.)

Thanks,
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] core.typed 0.1.24

2013-08-13 Thread Ambrose Bonnaire-Sergeant
Hi,

Announcing a new release of core.typed<https://github.com/clojure/core.typed>
.

[org.clojure/core.typed "0.1.24"]


There are some breaking changes surrounding the ann-{datatype,protocol}
macros, see the changelog and their corresponding var docs for the details.

We also now support adding annotations directly to a `def`, without the
need for a separate `ann` form.

eg.

(ann ^:no-check add-datatype-ancestors [Symbol (t/Set r/TCType) -> nil])
(defn add-datatype-ancestors
  "Add a set of ancestor overrides for the datatype named sym."
  [sym tset]
  ...)

becomes


 (defn ^:no-check ^{:ann '[Symbol (t/Set r/TCType) -> nil]}
  add-datatype-ancestors
  "Add a set of ancestor overrides for the datatype named sym."
  [sym tset]
  ...)

Note the metadata must be attached during the def, not via alter-meta!.
:ann metadata must also be quoted.

Enjoy!
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] core.typed 0.1.19 - core.async support

2013-08-05 Thread Ambrose Bonnaire-Sergeant
0.1.20 is cut, the examples should work.

[org.clojure/core.typed "0.1.20"]

Also, you probably need to have (clojure.core.typed/typed-deps
clojure.core.typed.async) just below your ns form. core.typed doesn't seem
to infer the companion namespace sometimes.

Thanks,
Ambrose

On Mon, Aug 5, 2013 at 9:29 PM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> This release didn't quite go as planned. While trying release core.typed
> without
> a core.async dependency I managed to break support for core.async.
>
> Fix coming.
>
> Thanks,
> Ambrose
>
>
> On Sun, Aug 4, 2013 at 12:52 PM, Ambrose Bonnaire-Sergeant <
> abonnaireserge...@gmail.com> wrote:
>
>> Hi,
>>
>> This should be exciting news for some, and perhaps the last reason
>> to use Go for others ;)
>>
>> core.typed now includes support for core.async.
>>
>> - typed core.async 
>> examples<https://github.com/clojure/core.typed/tree/master/examples/async>
>> .
>> - companion 
>> namespace<https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/async.clj>
>>
>> There's been some guessing about the types, I need feedback concerning
>> their correctness and utility!
>>
>> Some other interesting things happened in this release. For the fully
>> story see the 
>> changelog<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>
>> .
>>
>> Enjoy!
>> Ambrose
>>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] core.typed 0.1.19 - core.async support

2013-08-05 Thread Ambrose Bonnaire-Sergeant
This release didn't quite go as planned. While trying release core.typed
without
a core.async dependency I managed to break support for core.async.

Fix coming.

Thanks,
Ambrose


On Sun, Aug 4, 2013 at 12:52 PM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Hi,
>
> This should be exciting news for some, and perhaps the last reason
> to use Go for others ;)
>
> core.typed now includes support for core.async.
>
> - typed core.async 
> examples<https://github.com/clojure/core.typed/tree/master/examples/async>
> .
> - companion 
> namespace<https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/async.clj>
>
> There's been some guessing about the types, I need feedback concerning
> their correctness and utility!
>
> Some other interesting things happened in this release. For the fully
> story see the 
> changelog<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>
> .
>
> Enjoy!
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] core.typed 0.1.19 - core.async support

2013-08-03 Thread Ambrose Bonnaire-Sergeant
Hi,

This should be exciting news for some, and perhaps the last reason
to use Go for others ;)

core.typed now includes support for core.async.

- typed core.async
examples<https://github.com/clojure/core.typed/tree/master/examples/async>
.
- companion 
namespace<https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/async.clj>

There's been some guessing about the types, I need feedback concerning
their correctness and utility!

Some other interesting things happened in this release. For the fully story
see the 
changelog<https://github.com/clojure/core.typed/blob/master/CHANGELOG.md>
.

Enjoy!
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] core.typed 0.1.18

2013-07-31 Thread Ambrose Bonnaire-Sergeant
Probably even more exciting is that we can handle (filter identity coll),
although it
currently requires instantiating identity:

(cf (filter (inst identity (U nil Number)) [1 nil 2]))
;=> (Seqable Number)

Finally!
Ambrose



On Thu, Aug 1, 2013 at 2:31 AM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Hi,
>
> To mark the mid-GSoC evaluations, I'm happy to release another
> core.typed version.
>
> Highlights:
>
> - type checking speed enhancements
> - some usages of `every?` now update local types as expected
>   - currently works best on things exactly of type IPersistentCollection
> (aka. a new alias Coll)
>
> eg. cast a (Coll Any) to (Coll Number):
>   (cf (let [a (ann-form [] (Coll Any))]
>  (assert (every? number? a))
>  a))
>   ;=> (Coll Number)
>
> - combining keys/vals with every? updates an IPersistentMap type as you
> would expect
>
> eg. cast a (IPM Any Any) to (IPM Number Any)
> (cf (let [a (ann-form {} (IPersistentMap Any Any))]
>(assert (every? number? (keys a)))
>a))
> ;=> (IPersistentMap Number Any
>
> - New `Extends` type constructor can say which interfaces a type does
> *not* extend (helps fix some unsoundness)
>
> Thanks,
> Ambrose
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] core.typed 0.1.18

2013-07-31 Thread Ambrose Bonnaire-Sergeant
Hi,

To mark the mid-GSoC evaluations, I'm happy to release another
core.typed version.

Highlights:

- type checking speed enhancements
- some usages of `every?` now update local types as expected
  - currently works best on things exactly of type IPersistentCollection
(aka. a new alias Coll)

eg. cast a (Coll Any) to (Coll Number):
  (cf (let [a (ann-form [] (Coll Any))]
 (assert (every? number? a))
 a))
  ;=> (Coll Number)

- combining keys/vals with every? updates an IPersistentMap type as you
would expect

eg. cast a (IPM Any Any) to (IPM Number Any)
(cf (let [a (ann-form {} (IPersistentMap Any Any))]
   (assert (every? number? (keys a)))
   a))
;=> (IPersistentMap Number Any

- New `Extends` type constructor can say which interfaces a type does *not*
extend (helps fix some unsoundness)

Thanks,
Ambrose

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] core.typed 0.1.15

2013-05-14 Thread Ambrose Bonnaire-Sergeant
Hi,

A brief but highly visible release of core.typed: types and forms in error
messages are abbreviated where possible.

See the changelog and check-ns docstring for details.

In a nutshell:

fire.main=> (check-ns 'fire.simulate)
...
Type Error (fire.simulate:72) Expected type: Grid
Actual: (CompleteHMap {:rows (U Long (Value 100)), :grid (APersistentVector
(IPersistentVector State)), :history [], :cols (U Long (Value 100))})
in: {:history [], :grid (clojure.core/vec #), :rows rows, :cols cols}
...

fire.main=> (require '[clojure.core.typed :as typed])
nil


fire.main=> (binding [*typed/*verbose-forms* true, typed/*verbose-types*
true*] (check-ns 'fire.simulate))
...
Type Error (fire.simulate:72) Expected type: fire.simulate/Grid
Actual: (CompleteHMap {:rows (U java.lang.Long (Value 100)), :grid
(clojure.lang.APersistentVector (clojure.lang.IPersistentVector
fire.simulate/State)), :history [], :cols (U java.lang.Long (Value 100))})
in: {:history [], :grid (clojure.core/vec (let* [iter__170__auto__
(clojure.core.typed/ann-form* (fn* iter__19706 ([s__19707] (new
clojure.lang.LazySeq (fn* ([] (clojure.core.typed/loop>-ann ((fn* ([]
(loop* [s__1970721240 s__19707] (let* [temp__4092__auto__ (clojure.core/seq
s__1970721240)] (if temp__4092__auto__ (let* [s__1970721241
temp__4092__auto__] (if (clojure.core/chunked-seq? s__1970721241) (let*
[c__168__auto__ (clojure.core/chunk-first s__1970721241) size__169__auto__
(clojure.lang.RT/intCast (clojure.lang.RT/count c__168__auto__)) b__19709
(clojure.core.typed/ann-form* (clojure.core/chunk-buffer size__169__auto__)
(quote (clojure.lang.ChunkBuffer (IPersistentVector State] (if
(clojure.core.typed/loop>-ann ((fn* ([] (loop* [i__19708
(clojure.lang.RT/longCast (clojure.lang.RT/intCast 0))] (if
(clojure.lang.Numbers/lt i__19708 size__169__auto__) (let* [row
(clojure.lang.RT/nth c__168__auto__ i__19708)] (do
(clojure.core/chunk-append b__19709 (clojure.core.typed/ann-form*
(clojure.core/vec (let* [iter__170__auto__ (clojure.core.typed/ann-form*
(fn* iter__19714 ([s__19715] (new clojure.lang.LazySeq (fn* ([]
(clojure.core.typed/loop>-ann ((fn* ([] (loop* [s__1971521242 s__19715]
(let* [temp__4092__auto__21243 (clojure.core/seq s__1971521242)] (if
temp__4092__auto__21243 (let* [s__1971521244 temp__4092__auto__21243] (if
(clojure.core/chunked-seq? s__1971521244) (let* [c__168__auto__21245
(clojure.core/chunk-first s__1971521244) size__169__auto__21246
(clojure.lang.RT/intCast (clojure.lang.RT/count c__168__auto__21245))
b__19717 (clojure.core.typed/ann-form* (clojure.core/chunk-buffer
size__169__auto__21246) (quote (clojure.lang.ChunkBuffer State)))] (if
(clojure.core.typed/loop>-ann ((fn* ([] (loop* [i__19716
(clojure.lang.RT/longCast (clojure.lang.RT/intCast 0))] (if
(clojure.lang.Numbers/lt i__19716 size__169__auto__21246) (let* [col
(clojure.lang.RT/nth c__168__auto__21245 i__19716)] (do
(clojure.core/chunk-append b__19717 (clojure.core.typed/ann-form* (state-fn
[row col]) (quote State))) (recur (clojure.lang.Numbers/unchecked_inc
i__19716 true) (quote ((U Long Integer (clojure.core/chunk-cons
(clojure.core/chunk b__19717) (iter__19714 (clojure.core/chunk-rest
s__1971521244))) (clojure.core/chunk-cons (clojure.core/chunk b__19717)
nil))) (let* [col (clojure.core/first s__1971521244)] (clojure.core/cons
(state-fn [row col]) (iter__19714 (clojure.core/rest s__1971521244))
nil)) (quote ((clojure.core.typed/Option (clojure.lang.Seqable
AnyInteger)) (quote [(clojure.core.typed/Option
(clojure.lang.Seqable AnyInteger)) -> (clojure.lang.LazySeq State)]))]
(iter__170__auto__ (clojure.core/range cols (quote (IPersistentVector
State (recur (clojure.lang.Numbers/unchecked_inc i__19708 true)
(quote ((U Long Integer (clojure.core/chunk-cons (clojure.core/chunk
b__19709) (iter__19706 (clojure.core/chunk-rest s__1970721241)))
(clojure.core/chunk-cons (clojure.core/chunk b__19709) nil))) (let* [row
(clojure.core/first s__1970721241)] (clojure.core/cons (clojure.core/vec
(let* [iter__170__auto__ (clojure.core.typed/ann-form* (fn* iter__19731
([s__19732] (new clojure.lang.LazySeq (fn* ([]
(clojure.core.typed/loop>-ann ((fn* ([] (loop* [s__1973221247 s__19732]
(let* [temp__4092__auto__21248 (clojure.core/seq s__1973221247)] (if
temp__4092__auto__21248 (let* [s__1973221249 temp__4092__auto__21248] (if
(clojure.core/chunked-seq? s__1973221249) (let* [c__168__auto__
(clojure.core/chunk-first s__1973221249) size__169__auto__
(clojure.lang.RT/intCast (clojure.lang.RT/count c__168__auto__)) b__19734
(clojure.core.typed/ann-form* (clojure.core/chunk-buffer size__169__auto__)
(quote (clojure.lang.ChunkBuffer State)))] (if
(clojure.core.typed/loop>-ann ((fn* ([] (loop* [i__19733
(clojure.lang.RT/longCast (clojure.lang.RT/intCast 0))] (if
(clojure.lang.Numbers/lt i__19733 size__169__auto__) (let* [col
(clojure.lang.RT/nth c__168__auto__ i__19733)] (do
(clojure.core/chunk-append b__19734 (clojure.cor

  1   2   >