background preloader

Tools & ref

Facebook Twitter

Structure of a Haskell project. The intention behind this page is to flesh out some semi-standard for the directory structure, and the tool-setup for medium to large-sized Haskell projects. It is intended to make it easier for newcomers to start up projects, and for everybody to navigate others projects. Newcomers should also read How to write a Haskell program for more detailed instructions on setting up a new project.

Especially I hope some focus can be made on how to make the different tools play well together, and giving the project structure that allows scaling. Hopefully someone more qualified than I (the initiator of this page) will be summoned and write their advices, change the faults, add missing bits and discuss differences in opinions. And perhaps a sample project (in the spirit of HNop, but with broader ambitions) should be made, so that can be used as a template. 1 Tools It is recommended to make use of the following tool chain: 2 Directory Structure 3 Technicalities 3.1 The sourcefiles 4 Discussions. The Haskell Road to Logic, Maths and Programming.

Sample from the book (table of contents plus first chapter): compressed postscript Addendum to Chapter 9 of the Book: Direct Computation of Polynomial Representations for Sequences: Errata A list of errata is here. Software Getting Started: GS.hs Talking about Mathematical Objects: TAMO.hs The Use of Logic: Proof: TUOLP.hs Sets, Types and Lists: STAL.hs Database used in `Sets, Types and Lists' Chapter: DB.hs Module used in `Sets, Types and Lists' Chapter: Query.hs Module used in `Sets, Types and Lists' Chapter: SetEq.hs Module used in `Sets, Types and Lists' Chapter: Hierarchy.hs Relations: REL.hs Module used in `Relations' Chapter: SetOrd.hs Functions: FCT.hs Induction and Recursion: IAR.hs Working with Numbers: WWN.hs Module used in `Working with Numbers' Chapter: Nats.hs Polynomials: Corecursion: COR.hs Module used in `Polynomials' and `Corecursion' Chapter: Polynomials.hs Module used in `Corecursion' Chapter: Powerseries.hs Finite and Infinite Sets: FAIS.hs Home Reviews.

Home Page. The Haskell School of Expression: Learning Functional Programming through Multimedia by Paul Hudak, Yale University Cambridge University Press, New York, 2000 416 pp./15 line diagrams/75 exercises Paperback $29.95, ISBN: 0521644089 Hardback $74.95, ISBN: 0521643384 Abstract: 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 mathematical examples commonly found in other programming language textbooks, the author draws examples from multimedia applications, including graphics, animation, and computer music, thus rewarding the reader with working programs for inherently more interesting applications. Author contact information:

Patch-Tag.com (like github for darcs) Highest Voted 'haskell' C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals, Chapter 1 of 13 | Going Deep. Welcome to a new technical series on Channel 9 folded into a different kind of 9 format: C9 Lectures. These are what you think they are, lectures. They are not conversational in nature (like most of what you're used to on 9), but rather these pieces are entirely focused on education, coming to you in the form of a series of high quality technical lectures (1 or more per topic) on a single topic. We kick off C9 Lectures with a journey into the world of Functional Programming with functional language purist and high priest of the lambda calculus, Dr.

Erik Meijer (you can thank Erik for many of the functional constructs that have shown up in languages like C# and VB.NET. When you use LINQ, thank Erik in addition to Anders). Lecture Context: Over the past two years, you've learned a fair amount about the functional programming paradigm's foray into general purpose imperative progamming languages (LINQ, Lambda's, etc in C# and VB.NET). Dr. In Chapter 1, Dr. Welcome to C9 Lectures. Real World Haskell. Learn You a Haskell for Great Good! Hierarchical Libraries. Hoogle - st lib. Hoogle is a Haskell API search engine, which allows you to search many standard Haskell libraries by either function name, or by approximate type signature. Example searches: map (a -> b) -> [a] -> [b] Ord a => [a] -> [a] Data.Map.insert Enter your own search at the top of the page.

The Hoogle manual contains more details, including further details on search queries, how to install Hoogle as a command line application and how to integrate Hoogle with Firefox/Emacs/Vim etc. I am very interested in any feedback you may have. Please email me, or add an entry to my bug tracker. Haskell Platform from Source on Unix-Like. 4.12. Using shared libraries. On some platforms GHC supports building Haskell code into shared libraries. Shared libraries are also sometimes known as dynamic libraries, in particular on Windows they are referred to as dynamic link libraries (DLLs).

Shared libraries allow a single instance of some pre-compiled code to be shared between several programs. In contrast, with static linking the code is copied into each program. Using shared libraries can thus save disk space. In GHC version 6.12 building shared libraries is supported for Linux on x86 and x86-64 architectures and there is partial support on Windows (see Section 11.6, “Building and using Win32 DLLs ”). Building and using shared libraries is slightly more complicated than building and using static libraries. 4.12.1.

To build a simple program and have it use shared libraries for the runtime system and the base libraries use the -dynamic flag: ghc --make -dynamic Main.hs This has two effects. 4.12.2. 4.12.3. Ghc --make -dynamic -shared -fPIC Foo.hs -o libfoo.so. The Haskell 98 Language Report - Contains Prelude. Hayoo! - hackage search. Neil Mitchell - HLint. HLint (formerly Dr. Haskell) reads Haskell programs and suggests changes that hopefully make them easier to read. HLint also makes it easy to disable unwanted suggestions, and to add your own custom suggestions. Running the tool over the darcs source code, we can generate an interactive report with --report, or view the results in the console: $ hlint darcs-2.1.2 CommandLine.lhs:49:1: Warning, eta reduce Found: quotedArg ftable = between (char '"') (char '"') $ quoteContent ftable Why not: quotedArg = between (char '"') (char '"') . quoteContent CommandLine.lhs:94:1: Error, use concatMap Found: concat $ map escapeC s Why not: concatMap escapeC s Ssh.hs:155:17: Error, use isPrefixOf Found: take 1 path == "~" Why not: "~" `isPrefixOf` path ... many other suggestions ...

HLint can only be compiled by GHC 6.10.1 or above (it makes use of view patterns), but does not require any copy of GHC to run. Related work Haskell Style Scanner - check for poor layout/spacing etc. Downloads. Installing leksah, gtk, gtk2hs, and glade on Ubuntu 10.04 LTS -the Lucid Lynx. Mode for Emacs. There are many Emacs packages and modules for Haskell. The most prominent ones are haskell-mode, ghc-mod and Scion. 1 Newbie guide Emacs is an extensible texteditor which can be extended with so-called "modes" and makes great use of keystrokes. Modes are written in Emacs Lisp (.el) programming language and provide additional commands and keystrokes. 2 Haskell-mode The haskell-mode package is a set of major modes for Emacs for writing Haskell code and working with Haskell projects. Haskell-mode is maintained by Philip Weaver. 3 Scion The Scion IDE library can be used to complement the haskell-mode with additional features, such as (quoting the documentation): Highlights error messages directly in the source, together with a tool-tip Optional on-the-fly typechecking (idle-time based, or whenever file is saved) Completion on `LANGUAGE` names, pragmas, external module names and `OPTIONS`-flags Go to definition sites of symbols at point The primary repository is at nominolo/scion. 4 ghc-mod.