kind-projector | Compiler plugin for making type lambdas

 by   typelevel Scala Version: Current License: MIT

kandi X-RAY | kind-projector Summary

kandi X-RAY | kind-projector Summary

kind-projector is a Scala library. kind-projector has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

One piece of Scala syntactic noise that often trips people up is the use of type projections to implement anonymous, partially-applied types. For example:. Many people have wished for a better way to do this. The goal of this plugin is to add a syntax for type lambdas. We do this by rewriting syntactically valid programs into new programs, letting us seem to add new keywords to the language. This is achieved through a compiler plugin performing an (un-typed) tree transformation.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              kind-projector has a medium active ecosystem.
              It has 826 star(s) with 63 fork(s). There are 29 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 6 open issues and 72 have been closed. On average issues are closed in 281 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of kind-projector is current.

            kandi-Quality Quality

              kind-projector has 0 bugs and 0 code smells.

            kandi-Security Security

              kind-projector has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              kind-projector code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              kind-projector is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              kind-projector releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              It has 750 lines of code, 94 functions and 24 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of kind-projector
            Get all kandi verified functions for this library.

            kind-projector Key Features

            No Key Features are available at this moment for kind-projector.

            kind-projector Examples and Code Snippets

            No Code Snippets are available at this moment for kind-projector.

            Community Discussions

            QUESTION

            Set Dependencies / Plugins versions depending on scalaVersion
            Asked 2021-Nov-04 at 20:07

            I am trying to set different versions for the dependencies and plugins on my build.sbt script, depending the value of the scalaVersion on a crossCompiled project.

            Here is a reduced and simplified representation of what I have so far:

            ...

            ANSWER

            Answered 2021-Nov-04 at 20:07

            Regarding the libraries, an approach that I've often seen in projects is to do it like this:

            Source https://stackoverflow.com/questions/69843171

            QUESTION

            value sequence is not a member of cats.Applicative[F]
            Asked 2021-Jun-04 at 12:44

            I'm migrating some scalaz based code to typelevel cats.

            project/plugins.sbt

            ...

            ANSWER

            Answered 2021-May-27 at 22:58

            The idiomatic way to write that would be this:

            Source https://stackoverflow.com/questions/67729866

            QUESTION

            How to optionally add a compiler plugin in SBT
            Asked 2021-May-18 at 12:25

            I have a project which depends on https://github.com/typelevel/kind-projector and is currently cross-compiled against scala 2.12 and 2.13, and I want to add support for scala 3.0. However, kind-projector is not available on scala 3.0 since the syntax it enables is part of the native scala 3 syntax.

            Before, I used this setting to add the compiler plugin:

            ...

            ANSWER

            Answered 2021-May-18 at 12:25

            addCompilerPlugin is a shortcut for libraryDependencies += compilerPlugin(dependency)

            Thus, it should work with something like this

            Source https://stackoverflow.com/questions/67579041

            QUESTION

            Clarifying cross version behavior in Scala
            Asked 2021-Mar-04 at 14:36

            I wonder what is the difference between the two here:

            ...

            ANSWER

            Answered 2021-Mar-04 at 14:35

            I am pretty sure they are the same.

            From Overriding the publishing convention:

            crossVersion setting can override the publishing convention:

            • CrossVersion.disabled (no suffix)
            • CrossVersion.binary (_)
            • CrossVersion.full (_)

            The default is either CrossVersion.binary or CrossVersion.diabled depending on the value of crossPaths.

            From More about using cross-built libraries:

            These are equivalent:

            Source https://stackoverflow.com/questions/66278799

            QUESTION

            Sbt Plugins vs Compiler Plugins
            Asked 2021-Feb-19 at 16:50

            I am trying to understand why Adding sbt plugins in plugins.sbt in the project, works perfectly fine, but if I add the compiler plugins in that file it does not work ?

            I thought any .sbt or .scala file in project, is made available for the build definition.

            The only place where compiler plugins works is in the build.sbt. Hence i am confused as to why ?

            In particular i am working with Kind-Projector

            ...

            ANSWER

            Answered 2021-Feb-19 at 16:50

            Remeber sbt is recursive.

            .sbt define things that are available in the current layer.
            .scala files define thins that will be available in the next layer.

            Adding an sbt plugin in project/bar.sbt is adding that plugin to the meta layer, as such the meta-layer that compiles the sbt you are using to compile your project adds those plugins to the next sbt layer.

            So if you add a compiler plugin in project/foo.sbt then you are adding that compiler plugin to the compiler used to compile the project (meta) layer of sbt, but it will not be available in the current layer of sbt. That is the reason why compiler plugins are added in the build.sbt file, so they are added to the compiler used to compile your code.

            Source https://stackoverflow.com/questions/66281287

            QUESTION

            Scala Compiler Plugin Rewrite Function Definition As A Tuple: error: not found: value scala.Tuple2
            Asked 2020-Dec-20 at 15:56

            I am writing a compiler plugin to rewrite a function definition as a tuple of the function hash + function body

            So the following

            ...

            ANSWER

            Answered 2020-Dec-20 at 15:56

            Thanks to @SethTisue for answering in the comments. I am writing up a answer for anybody who might face a similar issue in the future.

            As Seth mentioned, using mkTuple was the right way to go. In order to use it, you need the following import

            Source https://stackoverflow.com/questions/65371993

            QUESTION

            top-level class without companion can only expand either into an eponymous class or into a block consisting in eponymous companions
            Asked 2020-Jun-20 at 19:36

            I am trying to use https://github.com/estatico/scala-newtype as follows:

            ...

            ANSWER

            Answered 2020-Jun-20 at 19:07

            The README.md of scala-newtype says:

            This expands into a type and companion object definition, so newtypes must be defined in an object or package object.

            Macros are allowed to expand classes into other classes with the same name and companion objects, but from what I can tell, the newtype annotation turns your case class into an object of the same name (along with a type alias like type DbUrl = DbUrl.Type). This behavior (turning a top-level annottee into a tree of some other kind) isn't allowed. If the annotation had generated a class DbUrl, and maybe an object of the same name, though, it would have been all right, but pretty much anything else won't work.

            To fix your problem, all you need to do is move this into a package object (or some other scope, as long as it isn't top-level).

            Edit: As Dmytro Mitin pointed out, the created type is not the type of DbUrl but rather something like type DbUrl = DbUrl.Type with an uppercase "T", where the definition of DbUrl.Type looks something like this (I'm just copying this from the README):

            Source https://stackoverflow.com/questions/62489970

            QUESTION

            How to create WAR instead JAR?
            Asked 2020-May-23 at 23:43

            I would like to compile via sbt to WAR instead of JAR file and I followed this guide.

            I have changed the build.sbt to:

            ...

            ANSWER

            Answered 2020-May-23 at 23:43

            There is a bug in documentation - see https://github.com/sbt/sbt/issues/4490

            Try using dedicated sbt plugin - xsbt-web-plugin - instead of reading that website. According to current docs you need to add to project/plugins.sbt

            Source https://stackoverflow.com/questions/61978812

            QUESTION

            SBT run statement shows: No main class detected
            Asked 2020-May-23 at 22:20

            I have created a web app and when I try to run with sbt run, it shows:

            ...

            ANSWER

            Answered 2020-May-23 at 22:20

            You don't have a main class, the entrypoint to your program defined. On JVM you have to have at least one class which defines

            Source https://stackoverflow.com/questions/61979156

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install kind-projector

            You can download it from GitHub.

            Support

            People are expected to follow the Scala Code of Conduct when discussing Kind-projector on GitHub or other venues.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/typelevel/kind-projector.git

          • CLI

            gh repo clone typelevel/kind-projector

          • sshUrl

            git@github.com:typelevel/kind-projector.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link