Function Programming in Scala.
A lot of my examples here comes from the book
Functional programming in Scala By Paul Chiusano and Rúnar Bjarnason, It is a good book, buy it.
Function Programming in Scala.
A lot of my examples here comes from the book
Functional programming in Scala By Paul Chiusano and Rúnar Bjarnason, It is a good book, buy it.
After a recap of implicits I introduce the type class mechanics in Scala. Then I have a look at ways for good non-intrusive type class design. The main focus of this presentation are type classes in Scala. In the last chapter I show the Haskell implementation of my example.
Stuck with your Ruby Programming Assignment. Get 24/7 help from tutors with Phd in the subject. Email us at support@helpwithassignment.com
Reach us at http://www.HelpWithAssignment.com
Some languages, like SML, Haskell, and Scala, have built-in support for pattern matching, which is a generic way of branching based on the structure of data.
While not without its drawbacks, pattern matching can help eliminate a lot of boilerplate, and it's often cited as a reason why functional programming languages are so concise.
In this talk, John A. De Goes talks about the differences between built-in patterns, and so-called first-class patterns (which are "do-it-yourself" patterns implemented using other language features).
Unlike built-in patterns, first-class patterns aren't magical, so you can store them in variables and combine them in lots of interesting ways that aren't always possible with built-in patterns. In addition, almost every programming language can support first-class patterns (albeit with differing levels of effort and type-safety).
During the talk, you'll watch as a mini-pattern matching library is developed, and have the opportunity to follow along and build your own pattern matching library in the language of your choice.
Quicksort - a whistle-stop tour of the algorithm in five languages and four p...Philip Schwarz
Quicksort - a whistle-stop tour of the algorithm in five languages and four paradigms.
Programming Paradigms: Functional, Logic, Imperative, Imperative Functional
Languages: Haskell, Scala, Java, Clojure, Prolog
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1TpXAZV.
Scalaz-Stream (soon to be called "FS2" or "Functional Streams for Scala") is a library that lets us write compositional, modular, safe, and efficient asynchronous I/O using an expressive purely functional API. Runar Bjarnason presents how to get started with the library, shows some examples, and how we can combine functional streams into large distributed systems. Filmed at qconlondon.com.
Runar Bjarnason is software engineer in Boston, the author of the book Functional Programming in Scala, and an occasional speaker on topics in functional programming.
Remotely is an elegant, purely functional machine-to-machine communication library developed in Scala at Verizon. Remotely is fast, lightweight, and models network operations as a monad. It features compositional, reusable protocols and codecs, where the compatibility between client and server is enforced using Scala's type system. It has support for TCP endpoints, with combinators for encryption, circuit-breaking, and load-balancing. In this talk we describe the API of Remotely, and delve into its design and implementation.
After a recap of implicits I introduce the type class mechanics in Scala. Then I have a look at ways for good non-intrusive type class design. The main focus of this presentation are type classes in Scala. In the last chapter I show the Haskell implementation of my example.
Stuck with your Ruby Programming Assignment. Get 24/7 help from tutors with Phd in the subject. Email us at support@helpwithassignment.com
Reach us at http://www.HelpWithAssignment.com
Some languages, like SML, Haskell, and Scala, have built-in support for pattern matching, which is a generic way of branching based on the structure of data.
While not without its drawbacks, pattern matching can help eliminate a lot of boilerplate, and it's often cited as a reason why functional programming languages are so concise.
In this talk, John A. De Goes talks about the differences between built-in patterns, and so-called first-class patterns (which are "do-it-yourself" patterns implemented using other language features).
Unlike built-in patterns, first-class patterns aren't magical, so you can store them in variables and combine them in lots of interesting ways that aren't always possible with built-in patterns. In addition, almost every programming language can support first-class patterns (albeit with differing levels of effort and type-safety).
During the talk, you'll watch as a mini-pattern matching library is developed, and have the opportunity to follow along and build your own pattern matching library in the language of your choice.
Quicksort - a whistle-stop tour of the algorithm in five languages and four p...Philip Schwarz
Quicksort - a whistle-stop tour of the algorithm in five languages and four paradigms.
Programming Paradigms: Functional, Logic, Imperative, Imperative Functional
Languages: Haskell, Scala, Java, Clojure, Prolog
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1TpXAZV.
Scalaz-Stream (soon to be called "FS2" or "Functional Streams for Scala") is a library that lets us write compositional, modular, safe, and efficient asynchronous I/O using an expressive purely functional API. Runar Bjarnason presents how to get started with the library, shows some examples, and how we can combine functional streams into large distributed systems. Filmed at qconlondon.com.
Runar Bjarnason is software engineer in Boston, the author of the book Functional Programming in Scala, and an occasional speaker on topics in functional programming.
Remotely is an elegant, purely functional machine-to-machine communication library developed in Scala at Verizon. Remotely is fast, lightweight, and models network operations as a monad. It features compositional, reusable protocols and codecs, where the compatibility between client and server is enforced using Scala's type system. It has support for TCP endpoints, with combinators for encryption, circuit-breaking, and load-balancing. In this talk we describe the API of Remotely, and delve into its design and implementation.
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1gZiqcN.
Runar Bjarnason explains how to approach I/O from a purely functional perspective, exploring the space of existing solutions, their benefits, and drawbacks.Filmed at qconnewyork.com.
Runar Bjarnason is an independent software developer, co-author of "Functional Programming in Scala" (Manning, 2013), and a functional programming extremist.
Succinct Data Structure for Analyzing Document CollectionPreferred Networks
Invited talk at the workshop ALSIP2011. The topic includes, Rank/Select data structure, and its implementation, wavelet trees and its applications, suffix arrays, suffix trees, Burrows Wheeler's Transform, FM-index, Top-k document query.
In a weird parallel world where programming is based on type theory, every term has a type, if you declare it or not, every function has a type, and polymorphic functions can't know the type of their argument or see what's inside.
Even if you don't use languages from that world, they can still be an inspiration.
Functional programming in kotlin with Arrow [Sunnytech 2018]Emmanuel Nhan
Slides from my talk about Kotlin & Functional programming with Arrow which I gave at Sunny Tech 2018 (http://sunny-tech.io)
It showcases how Kotlin is a good fit for functional programming, thanks to Arrow.
What's the best way to model modular, composable effects in your purely functional program? In this presentation, I take a look at monad transformers and free monads, discuss their history, and compare how effectively they solve the problem.
Slides accompanying talk at : https://youtu.be/vtUiZkHVi-w
Come learn about Python typing, and we'll cover the type system as well as the mypy tool and all the tools that you need for your typing needs.
Given to HSV.py on Nov 8th, 2019
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
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.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Peyton jones-2009-fun with-type_functions-slide
1. Simon Peyton Jones (Microsoft Research)
Chung-Chieh Shan (Rutgers University)
Oleg Kiselyov (Fleet Numerical Meteorology and Oceanography Center)
Tony Hoare’s 75th birthday celebration, April 2009
2. “Program correctness is a basic scientific ideal
for Computer Science”
“The most widely used tools [in pursuit of
correctness] concentrate on the detection of
programming errors, widely known as bugs.
Foremost among these [tools] are modern
compilers for strongly typed languages”
“Like insects that carry disease, the least
efficient way of eradicating program bugs is by
squashing them one by one. The only sure
safeguard against attack is to pursue the ideal
of not making the errors in the first place.”
“The ideal of program correctness”, Tony Hoare, BCS lecture and debate, Oct 2006
3. Static typing eradicates whole species of bugs
The static type of a function is a partial
specification: its says something (but not too
much) about what the function does
reverse :: [a] -> [a]
Increasingly precise specification
The spectrum of confidence
Increasing
confidence that the
program does what
you want
4. The static type of a function is like a weak
specification: its says something (but not too
much) about what the function does
reverse :: [a] -> [a]
Static typing is by far the most widely-used
program verification technology in use today:
particularly good cost/benefit ratio
Lightweight (so programmers use them)
Machine checked (fully automated, every compilation)
Ubiquitous (so programmers can’t avoid them)
5. Static typing eradicates whole species of bugs
Static typing is by far the most widely-used
program verification technology in use today:
particularly good cost/benefit ratio
Increasingly precise specification
The spectrum of confidence
Hammer Increasing
(cheap, easy confidence that the Tactical nuclear weapon
to use, (expensive, needs a trained
program does what
limited user, but very effective
effectivenes) you want indeed)
6. The type system designer seeks to
Retain the Joyful Properties of types
While also:
making more good programs pass the type
checker
making fewer bad programs pass the type
checker
7. Programs that All programs
work
Programs that are
well typed
Make this bit
bigger!
8. The type system designer seeks to retain
the Joyful Properties of types
While also:
making more good programs pass the type
checker
making fewer bad programs pass the type
checker
One such endeavour:
Extend Haskell with
Indexed type families
9. The type system designer seeks to retain
the Joyful Properties of types
I fear that
While also: Haskell is
doomed to
making more good programs pass the type
checker succeed
making fewer bad programs pass the type
checker
One such endeavour: Tony
Hoare
Extend Haskell with (1990)
Indexed type families
10. Class decl gives type
signature of each
method
class Num a where
(+), (*) :: a -> a -> a
negate :: a -> a
Instance decl gives a square :: Num a => a -> a
“witness” for each
square x = x*x
method, matching the
signature
instance Num Int where
(+) = plusInt
(*) = mulInt
negate = negInt
plusInt :: Int -> Int -> Int
mulInt :: Int -> Int -> Int
negInt :: Int -> Int test = square 4 + 5 :: Int
11. plusInt :: Int -> Int -> Int
plusFloat :: Float -> Float -> Float
intToFloat :: Int -> Float
class GNum a b where
(+) :: a -> b -> ???
instance GNum Int Int where
(+) x y = plusInt x y
instance GNum Int Float where
(+) x y = plusFloat (intToFloat x) y
test1 = (4::Int) + (5::Int)
test2 = (4::Int) + (5::Float)
Allowing more good
programs
12. class GNum a b where
(+) :: a -> b -> ???
Result type of (+) is a function of the
argument types SumTy is an
associated type of
class GNum a b where class GNum
type SumTy a b :: *
(+) :: a -> b -> SumTy a b
Each method gets a type signature
Each associated type gets a kind signature
13. class GNum a b where
type SumTy a b :: *
(+) :: a -> b -> SumTy a b
Each instance declaration gives a “witness”
for SumTy, matching the kind signature
instance GNum Int Int where
type SumTy Int Int = Int
(+) x y = plusInt x y
instance GNum Int Float where
type SumTy Int Float = Float
(+) x y = plusFloat (intToFloat x) y
14. class GNum a b where
type SumTy a b :: *
instance GNum Int Int where
type SumTy Int Int = Int :: *
instance GNum Int Float where
type SumTy Int Float = Float
SumTy is a type-level function
The type checker simply rewrites
SumTy Int Int --> Int
SumTy Int Float --> Float
whenever it can
But (SumTy t1 t2) is still a perfectly good type,
even if it can’t be rewritten. For example:
data T a b = MkT a b (SumTy a b)
15. Simply omit instances for incompatible types
newtype Dollars = MkD Int
instance GNum Dollars Dollars where
type SumTy Dollars Dollars = Dollars
(+) (MkD d1) (MkD d2) = MkD (d1+d2)
-- No instance GNum Dollars Int
test = (MkD 3) + (4::Int) -- REJECTED!
16. Consider a finite map, mapping keys to values
Goal: the data representation of the map
depends on the type of the key
Boolean key: store two values (for F,T resp)
Int key: use a balanced tree
Pair key (x,y): map x to a finite map from y to
value; ie use a trie!
Cannot do this in Haskell...a good program
that the type checker rejects
17. data Maybe a = Nothing | Just a
Map is indexed by k,
class Key k where but parametric in its
data Map k :: * -> * second argument
empty :: Map k v
lookup :: k -> Map k v -> Maybe v
...insert, union, etc....
18. data Maybe a = Nothing | Just a
Optional value
class Key k where
for False
data Map k :: * -> *
empty :: Map k v
lookup :: k -> Map k v -> Maybe v
...insert, union, etc.... Optional value
for True
instance Key Bool where
data Map Bool v = MB (Maybe v) (Maybe v)
empty = MB Nothing Nothing
lookup True (MB _ mt) = mt
lookup False (MB mf _) = mf
19. data Maybe a = Nothing | Just a
class Key k where
Two-level
data Map k :: * -> *
map
empty :: Map k v
lookup :: k -> Map k v -> Maybe v Two-level
...insert, union, etc.... lookup
instance (Key a, Key b) => Key (a,b) where
data Map (a,b) v = MP (Map a (Map b v))
empty = MP empty
lookup (ka,kb) (MP m) = case lookup ka m of
Nothing -> Nothing
Just m2 -> lookup kb m2
See paper for lists as keys: arbitrary depth tries
20. Goal: the data representation of the map
depends on the type of the key
Boolean key: SUM
Pair key (x,y): PRODUCT
List key [x]: SUM of PRODUCT + RECURSION
Easy to extend to other types at will
21. Client Server
addServer :: In Int (In Int (Out Int End))
addClient :: Out Int (Out Int (In Int End))
Type of the process expresses its protocol
Client and server should have dual protocols:
run addServer addClient -- OK!
run addServer addServer -- BAD!
22. Client Server
addServer :: In Int (In Int (Out Int End))
addClient :: Out Int (Out Int (In Int End))
data In v p = In (v -> p)
data Out v p = Out v p
data End = End
NB punning
23. data In v p = In (v -> p)
data Out v p = Out v p
data End = End
addServer :: In Int (In Int (Out Int End))
addServer = In (x -> In (y ->
Out (x + y) End))
Nothing fancy here
addClient is similar
24. run :: ??? -> ??? -> End
A process A co-process
class Process p where
type Co p
run :: p -> Co p -> End
Same deal as before: Co is a type-level
function that transforms a process type into
its dual
25. class Process p where data In v p = In (v -> p)
type Co p data Out v p = Out v p
run :: p -> Co p -> End data End = End
instance Process p => Process (In v p) where
type Co (In v p) = Out v (Co p)
run (In vp) (Out v p) = run (vp v) p
instance Process p => Process (Out v p) where
type Co (Out v p) = In v (Co p)
run (Out v p) (In vp) = run p (vp v)
Just the obvious thing really
26. The hoary printf chestnut
printf “Name:%s, Age:%i” :: String -> Int -> String
Can’t do that, but we can do this:
printf (lit “Name:” <> string <> lit “, Age:” <> int)
:: String -> Int -> String
Machine address computation
add :: Pointer n -> Offset m -> Pointer (GCD n m)
Tracking state using Hoare triples
acquire :: (Get n p ~ Unlocked)
=> Lock n -> M p (Set n p Locked) ()
Lock-state before Lock-state after
27. Types have made a huge contribution
Theorem provers
to this ideal
Powerful, but
• Substantial manual More sophisticated type systems
assistance required threaten both Happy Properties:
• PhD absolutely essential
(100s of daily users) 1. Automation is harder
2. The types are more complicated
(MSc required)
Some complications (2) are exactly
Today’s due to ad-hoc restrictions to ensure
experiment full automation
At some point it may be best to say
Type systems
“enough fooling around: just use Coq”.
Weak, but
• Automatically checked But we aren’t there yet
• No PhD required Haskell is a great place to play this
(1000,000s of daily users) game