Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foldl Documentation Example fail #202

Open
michaellindon opened this issue May 8, 2017 · 1 comment
Open

foldl Documentation Example fail #202

michaellindon opened this issue May 8, 2017 · 1 comment

Comments

@michaellindon
Copy link

I'm using 2.1.0 and trying to run the foldr example

(foldl (fn [acc v] (+ acc v)) 0 [1 2 3 4 5])

It produced the following error

1. Unhandled java.lang.IllegalArgumentException
   No implementation of method: :-get-context of protocol:
   #'cats.protocols/Contextual found for class: clojure.lang.PersistentVector

          core_deftype.clj:  568  clojure.core/-cache-protocol-fn
          core_deftype.clj:  560  clojure.core/-cache-protocol-fn
            protocols.cljc:   35  cats.protocols$eval20651$fn__20652$G__20642__20657/invoke
                 core.cljc:  951  cats.core$foldl/invokeStatic
                 core.cljc:  948  cats.core$foldl/invoke
                      REPL:   37  regtrees.core/eval21433
                      REPL:   37  regtrees.core/eval21433
             Compiler.java: 6927  clojure.lang.Compiler/eval
             Compiler.java: 6890  clojure.lang.Compiler/eval
                  core.clj: 3105  clojure.core/eval
                  core.clj: 3101  clojure.core/eval
                  main.clj:  240  clojure.main/repl/read-eval-print/fn
                  main.clj:  240  clojure.main/repl/read-eval-print
                  main.clj:  258  clojure.main/repl/fn
                  main.clj:  258  clojure.main/repl
                  main.clj:  174  clojure.main/repl
               RestFn.java:  137  clojure.lang.RestFn/applyTo
                  core.clj:  646  clojure.core/apply
                  core.clj:  641  clojure.core/apply
                regrow.clj:   18  refactor-nrepl.ns.slam.hound.regrow/wrap-clojure-repl/fn
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   87  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  646  clojure.core/apply
                  core.clj: 1881  clojure.core/with-bindings*
                  core.clj: 1881  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   85  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   55  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  222  clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
    interruptible_eval.clj:  190  clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
                  AFn.java:   22  clojure.lang.AFn/run
   ThreadPoolExecutor.java: 1142  java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java:  617  java.util.concurrent.ThreadPoolExecutor$Worker/run
               Thread.java:  748  java.lang.Thread/run

@metric-space
Copy link

@michaellindon you probably forgot to require cats.builtin. Trying requiring it to see if that gets you going. Your stack trace is reproducible if you only pull the core library and not builtin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants