The Haskell School of Music

Total Page:16

File Type:pdf, Size:1020Kb

The Haskell School of Music The Haskell School of Music — From Signals to Symphonies — Paul Hudak Yale University Department of Computer Science Version 2.4 (February 22, 2012) i The Haskell School of Music — From Signals to Symphonies — Paul Hudak Yale University Department of Computer Science New Haven, CT, USA Version 2.4 (February 22, 2012) Copyright c Paul Hudak January 2011 All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a data base or retrieval system, without the prior written permission of the author. Cover image: Euterpe, the Greek Muse of Music (attribution unknown) Contents Preface xiv 1 Overview of Computer Music, Euterpea, and Haskell 1 1.1 The Note vs. Signal Dichotomy ................. 2 1.2 Basic Principles of Programming ................ 3 1.3 Computation by Calculation ................... 4 1.4 Expressions and Values ..................... 8 1.5 Types ............................... 10 1.6 Function Types and Type Signatures .............. 11 1.7 Abstraction, Abstraction, Abstraction ............. 13 1.7.1 Naming .......................... 13 1.7.2 Functional Abstraction .................. 16 1.7.3 Data Abstraction ..................... 19 1.8 Haskell Equality vs. Euterpean Equality ............ 22 1.9 Code Reuse and Modularity ................... 23 1.10 [Advanced] Programming with Numbers ............ 24 2 Simple Music 28 2.1 Preliminaries ........................... 28 2.2 Notes, Music, and Polymorphism ................ 30 2.3 Convenient Auxiliary Functions ................. 33 2.3.1 A Simple Example .................... 35 2.4 Absolute Pitches ......................... 39 ii CONTENTS iii 3 Polymorphic & Higher-Order Functions 43 3.1 Polymorphic Types ........................ 44 3.2 Abstraction Over Recursive Definitions ............. 45 3.2.1 Map is Polymorphic ................... 47 3.2.2 Using map ........................ 48 3.3 Append .............................. 49 3.3.1 [Advanced] The Efficiency and Fixity of Append ... 50 3.4 Fold ................................ 51 3.4.1 Haskell’s Folds ...................... 53 3.4.2 [Advanced] Why Two Folds? .............. 54 3.4.3 Fold for Non-empty Lists ................ 55 3.5 [Advanced] A Final Example: Reverse ............. 56 3.6 Currying .............................. 57 3.6.1 Currying Simplification ................. 59 3.6.2 [Advanced] Simplification of reverse .......... 60 3.7 Errors ............................... 61 4 A Musical Interlude 64 4.1 Modules .............................. 64 4.2 Transcribing an Existing Score ................. 65 4.2.1 Auxiliary Functions ................... 67 4.2.2 Bass Line ......................... 68 4.2.3 Main Voice ........................ 69 4.2.4 Putting It All Together ................. 69 4.3 Simple Algorithmic Composition ................ 71 5 Syntactic Magic 72 5.1 Sections .............................. 72 5.2 Anonymous Functions ...................... 74 5.3 List Comprehensions ....................... 75 5.3.1 Arithmetic Sequences .................. 77 5.4 Function Composition ...................... 78 CONTENTS iv 5.5 Higher-Order Thinking ...................... 79 5.6 Infix Function Application .................... 80 6 More Music 82 6.1 Delay and Repeat ......................... 82 6.2 Inversion and Retrograde .................... 83 6.3 Polyrhythms ........................... 84 6.4 Symbolic Meter Changes ..................... 86 6.5 Computing Duration ....................... 86 6.6 Super-retrograde ......................... 87 6.7 Truncating Parallel Composition ................ 88 6.8 Trills ................................ 89 6.9 Grace Notes ............................ 90 6.10 Percussion ............................. 91 6.11 A Map for Music ......................... 93 6.12 A Fold for Music ......................... 94 6.13 Crazy Recursion ......................... 95 7 Qualified Types and Type Classes 98 7.1 Motivation ............................ 98 7.2 Equality ..............................100 7.3 Defining Your Own Type Classes ................102 7.4 Inheritance ............................106 7.5 Haskell’s Standard Type Classes ................107 7.5.1 The Num Class ......................108 7.5.2 The Show Class .....................111 7.6 Derived Instances .........................112 7.7 Reasoning With Type Classes ..................115 8 Interpretation and Performance 118 8.1 Abstract Performance ......................118 8.2 Players ...............................124 CONTENTS v 8.2.1 Example of Player Construction ............126 8.2.2 Deriving New Players From Old Ones .........128 8.2.3 A Fancy Player ......................129 8.3 Putting it all Together ......................129 9 Self-Similar Music 133 9.1 Self-Similar Melody ........................133 9.1.1 Sample Compositions ..................136 9.2 Self-Similar Harmony .......................137 9.3 Other Self-Similar Structures ..................138 10 Proof by Induction 141 10.1 Induction and Recursion .....................141 10.2 Examples of List Induction ...................142 10.3 Proving Function Equivalences .................144 10.3.1 [Advanced] Reverse ....................145 10.4 Useful Properties on Lists ....................147 10.4.1 [Advanced] Function Strictness .............150 10.5 Induction on the Music Data Type ...............151 10.5.1 The Need for Musical Equivalence ...........156 10.6 [Advanced] Induction on Other Data Types ..........156 10.6.1 A More Efficient Exponentiation Function .......158 11 An Algebra of Music 163 11.1 Musical Equivalance .......................163 11.2 Some Simple Axioms .......................165 11.3 The Axiom Set ..........................168 11.4 Soundness and Completeness ..................169 12 Musical L-Systems 170 12.1 Generative Grammars ......................170 12.2 A Simple Implementation ....................171 12.3 Grammars in Haskell .......................173 CONTENTS vi 12.4 An L-System Grammar for Music ................175 12.5 Examples .............................176 13 Random Numbers ... and Markov Chains 179 13.1 Random Numbers ........................179 13.2 Probability Distributions .....................182 13.2.1 Random Melodies and Random Walks .........186 13.3 Markov Chains ..........................188 13.3.1 Training Data .......................189 14 From Performance to Midi 192 14.1 An Introduction to Midi .....................192 14.1.1 General Midi .......................193 14.1.2 Channels and Patch Maps ................194 14.1.3 Standard Midi Files ...................196 14.2 Converting a Performance into Midi ..............198 14.3 Putting It All Together .....................201 15 Basic Input/Output 202 15.1 IO in Haskell ...........................202 15.2 do Syntax .............................204 15.3 Actions are Just Values .....................205 15.4 Reading and Writing Midi Files .................207 16 Musical User Interface 208 16.1 Signals ...............................209 16.1.1 Numeric Signals .....................210 16.1.2 Time ............................211 16.1.3 Musical Signals ......................212 16.1.4 Useful Signal Operators .................213 16.1.5 Stateful Signals ......................213 16.2 Events and Reactivity ......................214 16.2.1 Manipulating Event Streams ..............214 CONTENTS vii 16.2.2 Turning Signals into Events ...............215 16.2.3 Signal Samplers ......................216 16.2.4 Switches and Reactivity .................216 16.3 The UI Level ...........................217 16.3.1 Input Widgets ......................217 16.3.2 UI Transformers .....................220 16.3.3 MIDI Input and Output .................221 16.3.4 Midi Device IDs .....................222 16.3.5 Timer Widgets ......................224 16.4 Putting It All Together .....................225 16.5 Musical Examples ........................225 16.5.1 Chord Builder ......................225 16.5.2 Bifurcate Me, Baby! ...................227 16.5.3 MIDI Echo Effect .....................229 17 Sound and Signals 231 17.1 The Nature of Sound .......................231 17.1.1 Frequency and Period ..................234 17.1.2 Amplitude and Loudness ................235 17.1.3 Frequency Spectrum ...................239 17.2 Digital Audio ...........................241 17.2.1 From Continuous to Discrete ..............243 17.2.2 Fixed-Waveform Table-Lookup Synthesis .......245 17.2.3 Aliasing ..........................246 17.2.4 Quantization Error ....................249 17.2.5 Dynamic Range ......................251 18 Euterpea’s Signal Functions 253 18.1 Signals and Signal Functions ..................254 18.1.1 The Type of a Signal Function .............256 18.1.2 Four Useful Functions ..................258 18.1.3 Some Simple Examples .................259 CONTENTS viii 18.2 Generating Sound ........................264 18.3 Instruments ............................266 18.3.1 Turning a Signal Function into an Instruement ....266 18.3.2 Envelopes .........................269 19 Spectrum Analysis 273 19.1 Fourier’s Theorem ........................273 19.1.1 The Fourier Transform ..................275 19.1.2 Examples .........................276 19.2 The Discrete Fourier Transform .................277 19.2.1 Interpreting the Frequency Spectrum ..........280 19.2.2 Amplitude and Power of Spectrum ...........282 19.2.3 A Haskell Implementation of the DFT .........284 19.3 The Fast Fourier Transform ...................290 19.4 Further Pragmatics ........................291 19.5
Recommended publications
  • GHC Reading Guide
    GHC Reading Guide - Exploring entrances and mental models to the source code - Takenobu T. Rev. 0.01.1 WIP NOTE: - This is not an official document by the ghc development team. - Please refer to the official documents in detail. - Don't forget “semantics”. It's very important. - This is written for ghc 9.0. Contents Introduction 1. Compiler - Compilation pipeline - Each pipeline stages - Intermediate language syntax - Call graph 2. Runtime system 3. Core libraries Appendix References Introduction Introduction Official resources are here GHC source repository : The GHC Commentary (for developers) : https://gitlab.haskell.org/ghc/ghc https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary GHC Documentation (for users) : * master HEAD https://ghc.gitlab.haskell.org/ghc/doc/ * latest major release https://downloads.haskell.org/~ghc/latest/docs/html/ * version specified https://downloads.haskell.org/~ghc/9.0.1/docs/html/ The User's Guide Core Libraries GHC API Introduction The GHC = Compiler + Runtime System (RTS) + Core Libraries Haskell source (.hs) GHC compiler RuntimeSystem Core Libraries object (.o) (libHsRts.o) (GHC.Base, ...) Linker Executable binary including the RTS (* static link case) Introduction Each division is located in the GHC source tree GHC source repository : https://gitlab.haskell.org/ghc/ghc compiler/ ... compiler sources rts/ ... runtime system sources libraries/ ... core library sources ghc/ ... compiler main includes/ ... include files testsuite/ ... test suites nofib/ ... performance tests mk/ ... build system hadrian/ ... hadrian build system docs/ ... documents : : 1. Compiler 1. Compiler Compilation pipeline 1. compiler The GHC compiler Haskell language GHC compiler Assembly language (native or llvm) 1. compiler GHC compiler comprises pipeline stages GHC compiler Haskell language Parser Renamer Type checker Desugarer Core to Core Core to STG STG to Cmm Assembly language Cmm to Asm (native or llvm) 1.
    [Show full text]
  • The Power of Higher-Order Composition Languages in System Design
    The Power of Higher-Order Composition Languages in System Design James Adam Cataldo Electrical Engineering and Computer Sciences University of California at Berkeley Technical Report No. UCB/EECS-2006-189 http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-189.html December 18, 2006 Copyright © 2006, by the author(s). All rights reserved. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. The Power of Higher-Order Composition Languages in System Design by James Adam Cataldo B.S. (Washington University in St. Louis) 2001 M.S. (University of California, Berkeley) 2003 A dissertation submitted in partial satisfaction of the requirements for the degree of Doctor of Philosophy in Electrical Engineering in the GRADUATE DIVISION of the UNIVERSITY OF CALIFORNIA, BERKELEY Committee in charge: Professor Edward Lee, Chair Professor Alberto Sangiovanni-Vincentelli Professor Raja Sengupta Fall 2006 The dissertation of James Adam Cataldo is approved: Chair Date Date Date University of California, Berkeley Fall 2006 The Power of Higher-Order Composition Languages in System Design Copyright 2006 by James Adam Cataldo 1 Abstract The Power of Higher-Order Composition Languages in System Design by James Adam Cataldo Doctor of Philosophy in Electrical Engineering University of California, Berkeley Professor Edward Lee, Chair This dissertation shows the power of higher-order composition languages in system design.
    [Show full text]
  • State of the Platform Haskell Implementors Workshop - 2012 Stats
    Mark Lentczner, Google State of the Platform Haskell Implementors Workshop - 2012 Stats Number of packages — 47 (21 ghc + 26 hp) Lines of Code — 302k (167k ghc + 135k hp) Releases — 9 (May 2009 ~ present) Distributions — 11+ (Mac, Windows, Linuxes) Stats — June ~ August 2012 Downloads — 20,957 (228/day) 68% Windows 21% Mac OS X 8% Source ?? Linux Mentions of "platform" on #haskell — 983 People Build Maintainers Committee Joachim Breitner — Debian Duncan Coutts Mikhail Glushenkov — Windows Iavor Diatchki Mark Lentczner — OS X Isaac Dupree Andres Löh — NixOS Thomas Schilling Gabor Pali — FreeBSD Johan Tibell Jens Petersen — Fedora Adam Wick Release Team And the many contributors on Mark Lentczner — Chief Meanie haskell-platform@ Duncan Coutts libraries@ Don Stewart Content Packages — Haskell Platform 2012.2.0.0 ghc 7.4.1 time 1.4 random 1.0.1.1 array 0.4.0.0 unix 2.5.1.0 regex-base 0.93.2 base 4.5.0.0 Win32 2.2.2.0 regex-compat 0.95.1 bytestring 0.9.2.1 regex-posix 0.95.1 Cabal 1.14.0 stm 2.3 containers 0.4.2.1 syb 0.3.6.1 deepseq 1.3.0.0 cgi 3001.1.7.4 text 0.11.2.0 directory 1.1.0.2 fgl 5.4.2.4 transformers 0.3.0.0 extensible-exceptions GLUT 2.1.2.1 xhtml 3000.2.1 0.1.1.4 haskell-src 1.0.1.5 zlib 0.5.3.3 filepath 1.3.0.0 html 1.0.1.2 haskell2010 1.1.0.1 HTTP 4000.2.3 haskell98 2.0.0.1 HUnit 1.2.4.2 hpc 0.5.1.1 mtl 2.1.1 cabal-install 0.14.0 old-locale 1.0.0.4 network 2.3.0.13 alex 3.0.1 old-time 1.1.0.0 OpenGL 2.2.3.1 happy 1.18.9 pretty 1.1.1.0 parallel 3.2.0.2 process 1.1.0.1 parsec 3.1.2 template-haskell 2.7.0.0 QuickCheck 2.4.2 Standard
    [Show full text]
  • Notes on Functional Programming with Haskell
    Notes on Functional Programming with Haskell H. Conrad Cunningham [email protected] Multiparadigm Software Architecture Group Department of Computer and Information Science University of Mississippi 201 Weir Hall University, Mississippi 38677 USA Fall Semester 2014 Copyright c 1994, 1995, 1997, 2003, 2007, 2010, 2014 by H. Conrad Cunningham Permission to copy and use this document for educational or research purposes of a non-commercial nature is hereby granted provided that this copyright notice is retained on all copies. All other rights are reserved by the author. H. Conrad Cunningham, D.Sc. Professor and Chair Department of Computer and Information Science University of Mississippi 201 Weir Hall University, Mississippi 38677 USA [email protected] PREFACE TO 1995 EDITION I wrote this set of lecture notes for use in the course Functional Programming (CSCI 555) that I teach in the Department of Computer and Information Science at the Uni- versity of Mississippi. The course is open to advanced undergraduates and beginning graduate students. The first version of these notes were written as a part of my preparation for the fall semester 1993 offering of the course. This version reflects some restructuring and revision done for the fall 1994 offering of the course|or after completion of the class. For these classes, I used the following resources: Textbook { Richard Bird and Philip Wadler. Introduction to Functional Program- ming, Prentice Hall International, 1988 [2]. These notes more or less cover the material from chapters 1 through 6 plus selected material from chapters 7 through 9. Software { Gofer interpreter version 2.30 (2.28 in 1993) written by Mark P.
    [Show full text]
  • The Haskell School of Expression: Learning Functional Programming Through Multimedia
    The Haskell School of Expression: Learning Functional Programming through Multimedia The Haskell School of Expression: Learning Functional Programming through Multimedia - 2000 - Cambridge University Press, 2000 - 1107268656, 9781107268654 - Paul Hudak Functional programming is a style of programming that emphasizes the use of functions (in contrast to object-oriented programming, which emphasizes the use of objects). It has become popular in recent years because of its simplicity, conciseness, and clarity. This book teaches functional programming as a way of thinking and problem solving, using Haskell, the most popular purely functional language. Rather than using the conventional (boring) mathematical examples commonly found in other programming language textbooks, the author uses examples drawn from multimedia applications, including graphics, animation, and computer music, thus rewarding the reader with working programs for inherently more interesting applications. Aimed at both beginning and advanced programmers, this tutorial begins with a gentle introduction to functional programming and moves rapidly on to more advanced topics. Details about progamming in Haskell are presented in boxes throughout the text so they can be easily found and referred to. DOWNLOAD FILE HERE: http://resourceid.org/2fjqbSK.pdf Practical Aspects of Declarative Languages - Paul Hudak, David S. Warren - 10th International Symposium, PADL 2008, San Francisco, CA, USA, January 7-8, 2008, Proceedings - This book, complete with online files and updates, covers a hugely important area of study in computing. It constitutes the refereed proceedings of the 10th International - ISBN:9783540774419 - Computers - Dec 18, 2007 - 342 pages DOWNLOAD FILE HERE: http://resourceid.org/2fjj64I.pdf Advanced Functional Programming - First International Spring School on Advanced Functional Programming Techniques, Bastad, Sweden, May 24 - 30, 1995.
    [Show full text]
  • Modeling User Interfaces in a Functional Language
    Abstract Modeling User Interfaces in a Functional Language Antony Alexander Courtney 2004 It is widely recognized that programs with Graphical User Interfaces (GUIs) are difficult to design and implement. One possible reason for this difficulty is the lack of any clear formal basis for GUI programming. GUI toolkit libraries are typically described only informally, in terms of implementation artifacts such as objects, imperative state and I/O systems. In this thesis, we develop Fruit, a Functional Reactive User Interface Toolkit. Fruit is based on Yampa, an adaptation of Functional Reactive Programming (FRP) to the Arrows computational framework. Yampa has a clear, simple formal se- mantics based on a synchronous dataflow model of computation. GUIs in Fruit are defined compositionally using only the Yampa model and formally tractable mouse, keyboard and picture types. Fruit and Yampa have been implemented as libraries for Haskell, a purely functional programming language. This thesis presents the semantics and implementations of Yampa and Fruit, and shows how they can be used to write concise executable specifications of com- mon GUI programming idioms and complete GUI programs. Modeling User Interfaces in a Functional Language A Dissertation Presented to the Faculty of the Graduate School of Yale University in Candidacy for the Degree of Doctor of Philosophy by Antony Alexander Courtney Dissertation Director: Professor Paul Hudak May 2004 Copyright c 2004 by Antony Alexander Courtney All rights reserved. ii Contents Acknowledgments ix 1 Introduction 1 1.1 Background and Motivation . ...................... 1 1.2 Dissertation Overview . ...................... 4 I Foundations 5 2 Yampa: A Synchronous Dataflow Language Embedded in Haskell 6 2.1 Concepts .
    [Show full text]
  • Graphical User Interfaces in Haskell
    Graphical User Interfaces in Haskell By Gideon Sireling August 2011 Abstract Graphical user interfaces (GUIs) are critical to user friendliness, and are well supported by imperative, particularly object-oriented, programming languages. This report focuses on the development of GUIs with the purely functional language Haskell. We review prior efforts at supporting such interfaces with functional idioms, and investigate why these are rarely used in practice. We argue that there is no overarching solution, but rather, that each class of graphical application should be supported by a domain-specific abstraction. Finally, we present such an abstraction for data-processing applications; a framework for binding data to graphical interfaces. The framework does not attempt to replace existing graphical toolkits; rather, it adds a new layer of abstraction, with interfaces provided to Gtk2Hs and WxHaskell. Simple examples demonstrate how Haskell can be utilised to accomplish this task as easily as any imperative language. 1 Acknowledgement I would like to thank my supervisor, Mr Andy Symons, for the clear direction which he provided throughout this project. I would also like to thank the good folks who so freely donate their time and expertise to the Haskell Platform, EclipseFP, and all the community projects utilised in this work. Finally, I wish to express my deepest gratitude to my family, who tolerated all the time invested in this project with the utmost grace and patience. 2 Table of Contents Abstract ..............................................................................................................................................
    [Show full text]
  • Haskell Und Debian
    Haskell und Debian Joachim Breitner ∗ Karlsruher Institut für Technology [email protected] Abstract gleiche Weise direkt installiert werden: Ein einfaches apt-get install ghc Da die Programmiersprache Haskell immer beliebter wird genügt, und der Haskell-Compiler ist installiert. apt-get upgrade und in immer weiteren Kreisen eingesetzt wird, müssen sich Aktualisierungen laufen problemlos mit apt-get remove nun immer mehr Programmierer auch um die Besonderheiten und nicht benötigte Pakete können mit sau- der Installation von Haskell-Compilern und -Bibliotheken ber und vollständig entfernt werden. Wenn ein zu installie- kümmern. Dies zu vereinfachen und vereinheitlichen ist die rendes Paket ein anderes benötigt, wird dieses automatisch originäre Aufgabe von Distributionen wie Debian. Dieser mit installiert und auch im weiteren Betrieb werden diese Vortrag gibt einen Einblick in die Funktionsweise von Debian, Abhängigkeiten stets geprüft. Kryptographie schützt den An- insbesondere in Bezug auf Haskell-Pakete, erklärt was man wender dabei vor bösartig veränderten Paketen. als Anwender von Debian erwarten kann und was sich Darüber hinaus prüfen die Debian-Entwickler dass die Debian von den Haskell-Bibliotheken wünscht. Programme auch wirklich Freie Software sind. Man kann sich also darauf verlassen, dass man zu jedem Paket in Debian die Categories and Subject Descriptors K.6.3 [Management of Quellen bekommt, diese verändern darf und die Veränderun- Computing and Information Systems]: Software Management— gen auch weitergeben darf. Auch das geht mit einheitlichen Software process Befehlen (apt-get source und dpkg-buildpackage). Keywords linux distribution, package management, Debian Ich erinnere mich noch vage an die Zeit als ich unter Windows Software noch auf irgendwelchen Webseiten direkt heruntergeladen habe und mich durch immer verschiedene 1.
    [Show full text]
  • Haskell Communities and Activities Report
    Haskell Communities and Activities Report http://tinyurl.com/haskcar Twenty-Second Edition — May 2012 Janis Voigtländer (ed.) Andreas Abel Iain Alexander Heinrich Apfelmus Emil Axelsson Christiaan Baaij Doug Beardsley Jean-Philippe Bernardy Mario Blažević Gwern Branwen Joachim Breitner Björn Buckwalter Douglas Burke Carlos Camarão Erik de Castro Lopo Roman Cheplyaka Olaf Chitil Duncan Coutts Jason Dagit Nils Anders Danielsson Romain Demeyer James Deng Dominique Devriese Daniel Díaz Atze Dijkstra Facundo Dominguez Adam Drake Andy Georges Patai Gergely Jürgen Giesl Brett G. Giles Andy Gill George Giorgidze Torsten Grust Jurriaan Hage Bastiaan Heeren PÁLI Gábor János Guillaume Hoffmann Csaba Hruska Oleg Kiselyov Michal Konečný Eric Kow Ben Lippmeier Andres Löh Hans-Wolfgang Loidl Rita Loogen Ian Lynagh Christian Maeder José Pedro Magalhães Ketil Malde Antonio Mamani Alp Mestanogullari Simon Michael Arie Middelkoop Dino Morelli JP Moresmau Ben Moseley Takayuki Muranushi Jürgen Nicklisch-Franken Rishiyur Nikhil David M. Peixotto Jens Petersen Simon Peyton Jones Dan Popa David Sabel Uwe Schmidt Martijn Schrage Tom Schrijvers Andrew G. Seniuk Jeremy Shaw Christian Höner zu Siederdissen Michael Snoyman Jan Stolarek Martin Sulzmann Doaitse Swierstra Henning Thielemann Simon Thompson Sergei Trofimovich Marcos Viera Janis Voigtländer David Waern Daniel Wagner Greg Weber Kazu Yamamoto Edward Z. Yang Brent Yorgey Preface This is the 22nd edition of the Haskell Communities and Activities Report. As usual, fresh entries are formatted using a blue background, while updated entries have a header with a blue background. Entries for which I received a liveness ping, but which have seen no essential update for a while, have been replaced with online pointers to previous versions.
    [Show full text]
  • Haskell-Like S-Expression-Based Language Designed for an IDE
    Department of Computing Imperial College London MEng Individual Project Haskell-Like S-Expression-Based Language Designed for an IDE Author: Supervisor: Michal Srb Prof. Susan Eisenbach June 2015 Abstract The state of the programmers’ toolbox is abysmal. Although substantial effort is put into the development of powerful integrated development environments (IDEs), their features often lack capabilities desired by programmers and target primarily classical object oriented languages. This report documents the results of designing a modern programming language with its IDE in mind. We introduce a new statically typed functional language with strong metaprogramming capabilities, targeting JavaScript, the most popular runtime of today; and its accompanying browser-based IDE. We demonstrate the advantages resulting from designing both the language and its IDE at the same time and evaluate the resulting environment by employing it to solve a variety of nontrivial programming tasks. Our results demonstrate that programmers can greatly benefit from the combined application of modern approaches to programming tools. I would like to express my sincere gratitude to Susan, Sophia and Tristan for their invaluable feedback on this project, my family, my parents Michal and Jana and my grandmothers Hana and Jaroslava for supporting me throughout my studies, and to all my friends, especially to Harry whom I met at the interview day and seem to not be able to get rid of ever since. ii Contents Abstract i Contents iii 1 Introduction 1 1.1 Objectives ........................................ 2 1.2 Challenges ........................................ 3 1.3 Contributions ...................................... 4 2 State of the Art 6 2.1 Languages ........................................ 6 2.1.1 Haskell ....................................
    [Show full text]
  • Preview Haskell Tutorial (PDF Version)
    Haskell Programming About the Tutorial Haskell is a widely used purely functional language. Functional programming is based on mathematical functions. Besides Haskell, some of the other popular languages that follow Functional Programming paradigm include: Lisp, Python, Erlang, Racket, F#, Clojure, etc. Haskell is more intelligent than other popular programming languages such as Java, C, C++, PHP, etc. In this tutorial, we will discuss the fundamental concepts and functionalities of Haskell using relevant examples for easy understanding. Audience This tutorial has been prepared for beginners to let them understand the basic concepts of functional programming using Haskell as a programming language. Prerequisites Although it is a beginners’ tutorial, we assume that the readers have a reasonable exposure to any programming environment and knowledge of basic concepts such as variables, commands, syntax, etc. Copyright & Disclaimer © Copyright 2017 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at [email protected] i Haskell Programming Table of Contents About the Tutorial ......................................................................................................................................
    [Show full text]
  • TU Kaiserslautern Functional Programming
    Prof. Dr. Ralf Hinze TU Kaiserslautern M.Sc. Sebastian Schweizer Fachbereich Informatik AG Programmiersprachen Functional Programming: Exercise 1 Sheet published: Wednesday, April 17th Submission deadline: Tuesday, April 23rd, 12:00 noon Registration deadline: Thursday, April 18th, 12:00 noon Submission Instructions After you have registered for the exercise (see task 1), you will get access to your team's Git repository on our GitLab server. Please do the submission for tasks 3 and 4 into that repository by Tuesday, April 23rd, 12:00 noon. 1 Register for Exercises In order to take this course you need to register for the exercises. Please form teams of 3{4 students each. Send an email including your name, contact email address, matrikulation number, as well as the names of your teammates (names only) to Sebastian Schweizer ([email protected]). The registration deadline is Thursday, April 18th, 12:00 noon. If you cannot find colleagues for a team then we will arrange something during the first exercise session. We will register an account for you on our GitLab server and create a repository for your team. You have to submit your exercise solutions for this and the following sheets into that repository. We will provide the following exercise sheets directly into your repository. Furthermore, you will get read access to an additional repository containing the lecture slides. 2 Tool Setup In this course, we use the standard lazy functional programming language Haskell. In order to solve the exercises, you need a Haskell compiler. Furthermore, you need Git to submit your solutions into your team's repository and to obtain the lecture material.
    [Show full text]