600.429 FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.

Slides:



Advertisements
Similar presentations
Data Structures Through C
Advertisements

1 Introduction to Computation and Problem Solving Class 24: Case Study: Building a Simple Postfix Calculator Prof. Steven R. Lerman and Dr. V. Judson Harward.
Reliable Scripting Using Push Logic Push Logic David Greaves, Daniel Gordon University of Cambridge Computer Laboratory Reliable Scripting.
School of Computing and Mathematics, University of Huddersfield CAS810: WEEK 5 LECTURE: DENOTIONAL SEMANTICS OF A SIMPLE LANGUAGE : INTERPRETATION IN HASKELL.
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Administrative This was the last homework for the semester (yay!) First run of games: October 16 nd in class –Short document describing: goal + operational.
ABSTRACT The goal of this project was to create a more realistic and interactive appliance interface for a Usability Science class here at Union. Usability.
Automated Search for Conserved Quantities in Particle Reactions Oliver Schulte School of Computing Science Simon Fraser University
Getting Started with Haskell Tim Sheard. Learning a new language Goals – Learn how to design and use data structures – Learn to write programs using the.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
1 Concurrent and Distributed Systems Introduction 8 lectures on concurrency control in centralised systems - interaction of components in main memory -
IRead Group Members: Oscar Perez, Paul Kennedy, Matt Cardin.
CS 300 – Lecture 23 Intro to Computer Architecture / Assembly Language Virtual Memory Pipelining.
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
COMS S1007 Object-Oriented Programming and Design in Java July 24, 2008.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
CS0007: Introduction to Computer Programming Introduction to Arrays.
The Operating System The operation system (OS) is a set of programs that coordinates: Hardware functions Interaction between application software and computer.
Graphical Tree-Based Scientific Calculator: CalcuWiz Will Ryan Christian Braunlich.
taskbar Notification area Start To change size of taskbar: RMC- uncheck Lock the taskbar Changing Properties : RMC- Properties.
0 PROGRAMMING IN HASKELL An Introduction Based on lecture notes by Graham Hutton The book “Learn You a Haskell for Great Good” (and a few other sources)
JAS3 + AIDA LC Simulations Workshop SLAC 19 th May 2003.
Se Over the past decade, there has been an increased interest in providing new environments for teaching children about computer programming. This has.
©2010 John Wiley and Sons Chapter 12 Research Methods in Human-Computer Interaction Chapter 12- Automated Data Collection.
Due: 2007/11/12. Problem 1 Rewrite function Push and Pop (Program 3.10 and 3.12) using an additional variable lastOp as discussed on Page 146. The queue.
Accelerator Physics SNS EPICS Integration with Web-based Technologies Presentation by Madhan Sundaram.
© M. Winter COSC 4P41 – Functional Programming Programming with actions Why is I/O an issue? I/O is a kind of side-effect. Example: Suppose there.
Reference: The Game Loop Animation / Game loop 1. Update variables 2. [Get input from the user] (GameLoop only) 3. Draw (using variables)
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
1 Simulation Implementation Using high-level languages.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
Chapter 2 Fundamental Simulation Concepts
Probability is a measure of the likelihood of a random phenomenon or chance behavior. Probability describes the long-term proportion with which a certain.
Wiimote/Kinect Lab Midterm Update Senior Design December 2011, Group 16 Adviser: Dr. Tom Daniels Brenton Hankins Rick Hanton Harsh Goel Jeff Kramer.
Review 1 Polish Notation Prefix Infix Postfix Precedence of Operators Converting Infix to Postfix Evaluating Postfix.
Reinforcement Learning with Laser Cats! Marshall Wang Maria Jahja DTR Group Meeting October 5, 2015.
Lee CSCE 314 TAMU 1 CSCE 314 Programming Languages Interactive Programs: I/O and Monads Dr. Hyunyoung Lee.
Elm Signals and Suggestions. Working online  In general, I found working online at to be the best way to program Elmhttp://elm-lang.org/try.
Java Nuts and Bolts Variables and Data Types Operators Expressions Control Flow Statements Arrays and Strings.
CSC 322 Operating Systems Concepts Lecture - 7: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
C LANGUAGE Characteristics of C · Small size
November 2013 Functional Reactive Programming Simplifying Interaction John Peterson Western State Colorado University Gunnison, CO.
CSC USI Class Meeting 4 September 13, 2006.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
10/23/2001Yale University1 Event-driven FRP Zhanyong Wan Joint work with Walid Taha and Paul Hudak Advisor: Paul Hudak O fficial G raduate S tudent T alk.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Program Libraries 1. What is a program library? A library is a collection of implementations of behavior, written in terms of a language, that has a well-defined.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Chapter 1. The principle of relativity Section 1. Velocity of propagation of interaction.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
High degree of user interaction Interactive Systems: Model View Controller Presentation-abstraction-control.
1 PROGRAMMING IN HASKELL An Introduction Based on lecture notes by Graham Hutton The book “Learn You a Haskell for Great Good” (and a few other sources)
What Do Computers Do? A computer system is
CST 1101 Problem Solving Using Computers
EGR 2261 Unit 11 Pointers and Dynamic Variables
Data Types In Text: Chapter 6.
Event Loops and GUI Intro2CS – weeks
Welcome to Visual Programming using C#
COMPUTER 2430 Object Oriented Programming and Data Structures I
Data Structures and Algorithms
106 Data Structure Homework 1
Reactive Android Development
Type & Typeclass Syntax in function
Event loops 17-Jan-19.
Reactive Android Development
Programming Languages
ACM programming contest
Presentation transcript:

FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University

Project Pitches Let’s Go!

Expression Parsing Parsec Library: data Assoc = AssocNone | AssocLeft | AssocRight data Operator tok st a = Infix (GenParser tok st (a -> a -> a)) Assoc | Prefix (GenParser tok st (a -> a)) | Postfix (GenParser tok st (a -> a)) type OperatorTable tok st a = [[Operator tok st a]]

Homework 6 Questions? No homework this week – I’ll give you extra time on the current one. I expect you to start with background research, coding, or other project-related activities.

FRP, Behaviors, and Events Event a Denotes an event stream. Each occurrence delivers value of type a keyboard :: Event Char Behavior a Denotes a continuously available value of type a mouse :: Behavior Point2

Classic FRP Operations lift0 :: a -> Behavior a lift1 :: (a -> b) -> Behavior a -> Behavior b hold :: a -> Event a -> Behavior a when :: Behavior Bool -> Event () snap :: Event a -> Behavior b -> Event b (-=>) :: Event b -> a -> Event a tags :: Event b -> [a] -> Event a (.|.) :: Event a -> Event a -> Event a switch :: Behavior a -> Event (Behavior a) -> Behavior a integral :: Behavior Double -> Behavior Double clock :: Double -> Event Double once :: Event a -> Event a

Laws of FRP Single value: signals have only one value at each time step Evaluation order independence: the update order at each time step is non-observable Purity: Identical signals initialized at the same time have the same value Convergence: continuous signals should converge to an “ideal value” as time steps decrease Immediacy: computations should not be delayed to a later time step

Dark Corners Event clashes in.|. The.|. operator can’t handle simultaneous events Running behaviors Impossible to observe a previously initialized behavior Dynamic interfaces Fixed set of GUI objects to interact with Dynamic collections We needed new primitives to implement “space invaders” Time leaks Stateful signals not yet demanded

Examples in Python Taken from the Western Computer Camp

Examples content/uploads/2011/02/icra99.pdf content/uploads/2011/02/icra99.pdf