The document discusses union types and literal singleton types in Scala and Dotty. It begins by explaining what union and intersection types are, and how they can be modeled in Scala using implicit evidence. It then shows how to define union types in 3 lines of code in Scala. The document also discusses how union types are currently implemented in Dotty, including some bugs when combining union types with literal singleton types. It concludes by noting that Dotty is still pre-beta.
This document provides an overview of key concepts in Java programming including:
- Comments can be added using //, /* */, or /** */.
- Java has primitive data types like int, double, boolean and reference types like String.
- Variables are declared with a type and initialized through assignment.
- Operators perform tasks like arithmetic, comparison, and assignment.
- Control flow is managed through conditionals like if/else and loops like for.
- Arrays store multiple values of the same type and can be one or multi-dimensional.
The document discusses a new compiler architecture for the Dotty Scala Compiler (dsc) that takes inspiration from functional databases. The architecture treats all values as time-varying functions indexed by compilation phase. This allows the compiler to answer questions about program elements by looking up their meaning at a specific point in time. The core data types include time-indexed abstract syntax trees, types, references to declarations, and denotations, which capture the meaning of references. Caching is used to efficiently store and retrieve values across phases.
Typescript: enjoying large scale browser developmentJoost de Vries
Programming with types has traditionally been something done on the server side.
For browser developers I show in my presentation how the type support in Typescript makes your life easier as your codebase increases.
For server side developers I explain what some of the challenges are when it comes to programming with types in the browser. And how Typescript adresses them.
Finally I show some of the cool useful features in Typescript 2.0 that go beyond what most server side languages offer right now.
It turns out that with enough code browser development and server side development have a lot in common.
Slides of a talk given at Join 2016, October 5th, Mechelen Belgium
The document discusses four approaches to implementing higher-kinded types in the Dotty compiler: the simple encoding, projection encoding, refinement encoding, and direct representation. It describes each approach and its limitations. The simple encoding provides a modest way to support basic higher-kinded concepts but has difficulty explaining legality. The projection and refinement encodings had problems and were ultimately less successful than initially hoped. A direct representation of higher-kinded types through special type forms was needed for robust support. While compiler hacking validated ideas, a better theoretical foundation relating higher-kinded types to the DOT calculus may have avoided some experiments.
This document provides an overview of collective bargaining in the context of an MBA course on human resource management. It defines collective bargaining as a procedure that regulates the terms and conditions of workers through agreements negotiated between worker representatives and employers. The objectives of collective bargaining are to settle disputes around wages and working conditions, protect worker interests, and resolve differences between workers and management through voluntary negotiations. The key aspects of collective bargaining covered include the bargaining process, subjects of negotiation, types of bargaining, and factors that influence effective bargaining.
Trade unions are organized groups of workers that protect and advance the interests of their members. Unions are created for economic, protection of rights, and social reasons. Workers join unions to gain increased wages and benefits, job security, protection from unfair treatment, cooperation with fellow workers, and peer pressure. Unions represent workers in both the public and private sectors, except for students, professional/managerial groups, minors, and part-time workers. The main types of unions are public sector employees' unions, private sector employees' unions, and employers' unions.
The document summarizes Martin Odersky's talk at Scala Days 2016 about the road ahead for Scala. The key points are:
1. Scala is maturing with improvements to tools like IDEs and build tools in 2015, while 2016 sees increased activity with the Scala Center, Scala 2.12 release, and rethinking Scala libraries.
2. The Scala Center was formed to undertake projects benefiting the Scala community with support from various companies.
3. Scala 2.12 focuses on optimizing for Java 8 and includes many new features. Future releases will focus on improving Scala libraries and modularization.
4. The DOT calculus provides a formal
This document provides an overview of key concepts in Java programming including:
- Comments can be added using //, /* */, or /** */.
- Java has primitive data types like int, double, boolean and reference types like String.
- Variables are declared with a type and initialized through assignment.
- Operators perform tasks like arithmetic, comparison, and assignment.
- Control flow is managed through conditionals like if/else and loops like for.
- Arrays store multiple values of the same type and can be one or multi-dimensional.
The document discusses a new compiler architecture for the Dotty Scala Compiler (dsc) that takes inspiration from functional databases. The architecture treats all values as time-varying functions indexed by compilation phase. This allows the compiler to answer questions about program elements by looking up their meaning at a specific point in time. The core data types include time-indexed abstract syntax trees, types, references to declarations, and denotations, which capture the meaning of references. Caching is used to efficiently store and retrieve values across phases.
Typescript: enjoying large scale browser developmentJoost de Vries
Programming with types has traditionally been something done on the server side.
For browser developers I show in my presentation how the type support in Typescript makes your life easier as your codebase increases.
For server side developers I explain what some of the challenges are when it comes to programming with types in the browser. And how Typescript adresses them.
Finally I show some of the cool useful features in Typescript 2.0 that go beyond what most server side languages offer right now.
It turns out that with enough code browser development and server side development have a lot in common.
Slides of a talk given at Join 2016, October 5th, Mechelen Belgium
The document discusses four approaches to implementing higher-kinded types in the Dotty compiler: the simple encoding, projection encoding, refinement encoding, and direct representation. It describes each approach and its limitations. The simple encoding provides a modest way to support basic higher-kinded concepts but has difficulty explaining legality. The projection and refinement encodings had problems and were ultimately less successful than initially hoped. A direct representation of higher-kinded types through special type forms was needed for robust support. While compiler hacking validated ideas, a better theoretical foundation relating higher-kinded types to the DOT calculus may have avoided some experiments.
This document provides an overview of collective bargaining in the context of an MBA course on human resource management. It defines collective bargaining as a procedure that regulates the terms and conditions of workers through agreements negotiated between worker representatives and employers. The objectives of collective bargaining are to settle disputes around wages and working conditions, protect worker interests, and resolve differences between workers and management through voluntary negotiations. The key aspects of collective bargaining covered include the bargaining process, subjects of negotiation, types of bargaining, and factors that influence effective bargaining.
Trade unions are organized groups of workers that protect and advance the interests of their members. Unions are created for economic, protection of rights, and social reasons. Workers join unions to gain increased wages and benefits, job security, protection from unfair treatment, cooperation with fellow workers, and peer pressure. Unions represent workers in both the public and private sectors, except for students, professional/managerial groups, minors, and part-time workers. The main types of unions are public sector employees' unions, private sector employees' unions, and employers' unions.
The document summarizes Martin Odersky's talk at Scala Days 2016 about the road ahead for Scala. The key points are:
1. Scala is maturing with improvements to tools like IDEs and build tools in 2015, while 2016 sees increased activity with the Scala Center, Scala 2.12 release, and rethinking Scala libraries.
2. The Scala Center was formed to undertake projects benefiting the Scala community with support from various companies.
3. Scala 2.12 focuses on optimizing for Java 8 and includes many new features. Future releases will focus on improving Scala libraries and modularization.
4. The DOT calculus provides a formal
This document provides a summary of key topics from the third lecture in a Scala programming course, including:
1) Reviewing fold operations like foldLeft and foldRight.
2) Exploring Scala classes in more detail, covering abstract classes, implementing abstract values lazily, overriding methods and values, and the Scala type hierarchy.
3) Introducing algebraic data types through sum and product types, and how case classes and pattern matching are used to represent them in Scala.
4) Examples of different pattern matching techniques like wildcard, constant, variable, constructor, typed and guarded patterns.
5) Revisiting for expressions and examples of using generators, definitions, and filters
This document summarizes a presentation about practical type mining in Scala using reflection. It discusses how Salat used pickled Scala signatures before 2.10 to mine types without runtime reflection. It covers benefits of 2.10 reflection like choosing runtime vs compile-time reflection. It provides an overview of universes, mirrors, symbols and trees, and how to navigate and inspect them. It also discusses limitations like non-thread-safe reflection and provides examples of macros libraries.
Typescript is a superset of JavaScript that adds optional static typing and classes. It was created by Microsoft in 2010 and the first version was released in 2012. Although initially not widely adopted due to lack of IDE support, Typescript has grown in popularity over time. It provides benefits like type safety, IDE autocompletion, and catch bugs early. Typescript code compiles to plain JavaScript.
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 1Philip Schwarz
slides can look grainy and/or out of focus when seen on slideshare - download for flawless quality - Based on Scott Wlaschin’s great book 'Domain Modeling Made Functional' and on Martin Odersky's talk 'A Tour of Scala 3'.
The document discusses closures and enumerations in Swift. It provides examples of different closure types - global functions, nested functions, and closure expressions. It demonstrates how closures can capture values from their surrounding context. It also shows how to define enumerations with associated values and raw values, and how to match enumeration values with switch statements.
This presentation comes with many additional notes (pdf): http://de.slideshare.net/nicolayludwig/4-collections-algorithms-38613530
- Object-based vs. generic Collections
-- Generics Types in Java
- Sequential and associative Collections
- Associative Collections
-- Equivalence-based associative Collections: .Net's SortedDictionary
-- Operations on .Net's IDictionarys
-- Comparison and Implementation of .Net's Interfaces IComparable and IComparer
This document provides an overview of various C++ data types including fundamental, derived, and user-defined data types. It discusses integer, character, float, double, and void fundamental data types. It also covers integer, character, and floating-point type modifiers. Additionally, it summarizes arrays, functions, pointers, references, constants, classes, structures, unions, and enumerations as derived or user-defined data types in C++.
Automatic Type Class Derivation with Shapelessjcazevedo
This document provides an overview of how to do automatic type class derivation using Shapeless. It discusses type classes, HLists, generics, and how Shapeless allows deriving implementations of a Random type class for case classes and sealed traits by exploiting their shape. It provides examples showing how to derive Random instances for products, coproducts, and the spray-json AST in a generic way using Shapeless. Attendees should learn the basic building blocks Shapeless provides and how to apply patterns like this to derive their own type classes.
This document discusses schemas in GraphQL. It explains that a schema defines the types and fields that are available in a GraphQL application. It provides examples of scalar types like String and Int and object types like Person with fields for name, id, age, and student status. It also describes special root types for queries, mutations, and subscriptions that define the entry points for GraphQL operations. Queries are executed against fields defined in the query type. Resolvers associate fields with data fetching logic and will be covered in the next session.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
More Related Content
Similar to Union Types and Literal Singleton Types in Scala (and Typescript)
This document provides a summary of key topics from the third lecture in a Scala programming course, including:
1) Reviewing fold operations like foldLeft and foldRight.
2) Exploring Scala classes in more detail, covering abstract classes, implementing abstract values lazily, overriding methods and values, and the Scala type hierarchy.
3) Introducing algebraic data types through sum and product types, and how case classes and pattern matching are used to represent them in Scala.
4) Examples of different pattern matching techniques like wildcard, constant, variable, constructor, typed and guarded patterns.
5) Revisiting for expressions and examples of using generators, definitions, and filters
This document summarizes a presentation about practical type mining in Scala using reflection. It discusses how Salat used pickled Scala signatures before 2.10 to mine types without runtime reflection. It covers benefits of 2.10 reflection like choosing runtime vs compile-time reflection. It provides an overview of universes, mirrors, symbols and trees, and how to navigate and inspect them. It also discusses limitations like non-thread-safe reflection and provides examples of macros libraries.
Typescript is a superset of JavaScript that adds optional static typing and classes. It was created by Microsoft in 2010 and the first version was released in 2012. Although initially not widely adopted due to lack of IDE support, Typescript has grown in popularity over time. It provides benefits like type safety, IDE autocompletion, and catch bugs early. Typescript code compiles to plain JavaScript.
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 1Philip Schwarz
slides can look grainy and/or out of focus when seen on slideshare - download for flawless quality - Based on Scott Wlaschin’s great book 'Domain Modeling Made Functional' and on Martin Odersky's talk 'A Tour of Scala 3'.
The document discusses closures and enumerations in Swift. It provides examples of different closure types - global functions, nested functions, and closure expressions. It demonstrates how closures can capture values from their surrounding context. It also shows how to define enumerations with associated values and raw values, and how to match enumeration values with switch statements.
This presentation comes with many additional notes (pdf): http://de.slideshare.net/nicolayludwig/4-collections-algorithms-38613530
- Object-based vs. generic Collections
-- Generics Types in Java
- Sequential and associative Collections
- Associative Collections
-- Equivalence-based associative Collections: .Net's SortedDictionary
-- Operations on .Net's IDictionarys
-- Comparison and Implementation of .Net's Interfaces IComparable and IComparer
This document provides an overview of various C++ data types including fundamental, derived, and user-defined data types. It discusses integer, character, float, double, and void fundamental data types. It also covers integer, character, and floating-point type modifiers. Additionally, it summarizes arrays, functions, pointers, references, constants, classes, structures, unions, and enumerations as derived or user-defined data types in C++.
Automatic Type Class Derivation with Shapelessjcazevedo
This document provides an overview of how to do automatic type class derivation using Shapeless. It discusses type classes, HLists, generics, and how Shapeless allows deriving implementations of a Random type class for case classes and sealed traits by exploiting their shape. It provides examples showing how to derive Random instances for products, coproducts, and the spray-json AST in a generic way using Shapeless. Attendees should learn the basic building blocks Shapeless provides and how to apply patterns like this to derive their own type classes.
This document discusses schemas in GraphQL. It explains that a schema defines the types and fields that are available in a GraphQL application. It provides examples of scalar types like String and Int and object types like Person with fields for name, id, age, and student status. It also describes special root types for queries, mutations, and subscriptions that define the entry points for GraphQL operations. Queries are executed against fields defined in the query type. Resolvers associate fields with data fetching logic and will be covered in the next session.
Similar to Union Types and Literal Singleton Types in Scala (and Typescript) (11)
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Zilliz
Join us to introduce Milvus Lite, a vector database that can run on notebooks and laptops, share the same API with Milvus, and integrate with every popular GenAI framework. This webinar is perfect for developers seeking easy-to-use, well-integrated vector databases for their GenAI apps.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
17. PROGRAMMING IS LIKE LOGIC
if it is thursday there's a scala meeting
if there's a scala meeting the term 'monad' will come up
it is thursday
-------------------------------------------------------
the term 'monad' will come up
18. PROGRAMMING IS LIKE LOGIC
it is thursday → there's a scala meeting
there's a scala meeting → the term 'monad' will come up
it is thursday
-------------------------------------------------------
the term 'monad' will come up