background preloader


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. Related:  Haskell

Why the world needs Haskell - Devalot This is a technical review of Haskell and why software developers should care about functional programming. For a non-technical review of why your company should be using Haskell you might want to watch this introduction to Haskell video by FP Complete. TL;DR: Writing high-quality, bug-free software isn’t easy. Haskell (and similar languages) provide the programmer with the tools necessary to get closer than ever before. By removing entire categories of bugs (such as those caused by null pointers and nil objects, type coercions, accidental mutation, etc.) and introducing a powerful type system, programmers can write better code in the same amount of time (and often less) than more traditional languages. Null Pointers and Undefined Values The code we write eventually executes in the real world and things don’t always go as we would like. These are exceptional situations that we don’t have much control over and which we have to deal with gracefully. getUserByName :: String -> Maybe User

Haskell Haskell is a functional programming language. If you've programmed before and would like to see a little bit of how Haskell works and is different from other programming languages, see the overview. Haskell is unique in two ways. First, it is a pure functional programming language. If you have a function and you call it twice in two different places with the same arguments then it will return exactly the same value both times. Second, Haskell provides a very modern type system which incorporates features like typeclasses and generalized algebraic data types. So, why do Haskellers like their language? In this book we aim to introduce you both to the Haskell language, from the very basics to the most advanced features, and to computer programming in general. Overview[edit] The book is divided into three sections: the Beginner's Track, the Advanced Track, and Haskell in Practice, which is designed to cover the more day-to-day issues, and is readable with knowledge of the Beginner's Track.

Math.Statistics modes :: Ord a => [a] -> [(Int, a)]Source Modes returns a sorted list of modes in descending order quantile :: (Fractional b, Ord b) => Double -> [b] -> bSource Sample variance Interquartile range Arbitrary quantile q of an unsorted list. linreg :: Floating b => [(b, b)] -> (b, b, b)Source Least-squares linear regression of y against x for a |collection of (x, y) data, in the form of (b0, b1, r) |where the regression is y = b0 + b1 * x with Pearson |coefficient r devsq :: Floating a => [a] -> aSource Returns the sum of square deviations from their sample mean. On undoing, fixing, or removing commits in git A git choose-your-own-adventure!ⓡ <h3><em>Warning!</em> Javascript has been disabled. This means that you will not get the bread crumbs representing what path you took. If you need further help, copy-pasting these bread crumbs would be extremely useful to anyone trying to provide help to you or improve this website. This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. If you have problems after clicking through this document, please copy-paste the "Path" you took (what links you clicked on, automatically presented to you if javascript is available) when asking for further help, since doing so will explain very precisely what you were trying to do, and that you at least tried to help yourself. First step Strongly consider taking a backup of your current working directory and .git to avoid any possibility of losing data as a result of the use or misuse of these instructions. Proceed to the first question Have you pushed?

AJAX Control Toolkit ASP.NET AJAX Control Toolkit Welcome to the ASP.NET AJAX Control Toolkit. Choose from any of the samples on the left to see the live controls in action, and experiment with their different possibilities. What is the ASP.NET AJAX Control Toolkit? The ASP.NET AJAX Control Toolkit is an open-source project built on top of the Microsoft ASP.NET AJAX framework. The AJAX Control Toolkit contains more than 30 controls that enable you to easily create rich, interactive web pages. To get started, and to install the Ajax Control Toolkit, visit the AJAX Control Toolkit Project Page on CodePlex. To learn more, read the Getting Started Tutorial, or the other walkthroughs, tutorials and videos shown on the left.

VsHaskell See also [LanguageComparisons]. Haskell Haskell is a modern functional language (like lisp). It's not commonly used but the language is used for some "real" projects (not just an experimental language) and is becoming more common in industry. For example, the darcs version control system is written in Haskell. More information can be found at Haskell and Python are a somewhat odd pair to compare, because they are so different in many ways. Functional vs Procedural: Haskell is a lazy (evaluate by need), so-called pure functional (no assignments or side-effects) language. Compiled vs Interpreted: Python's primary implementation is an interpreter. The pythonic philosophy of dropping into C for critical sections applies equally well to haskell. Static vs Dynamic Typing: Both Haskell and Python have strong (not weak) typing, meaning instances of a type cannot be cast into another type. a = 5 The fact that it's an integer is inferred by the Haskell compiler. Learning Curve:

Tutorial for C Programmers Haskell Tutorial for C Programmers, by Eric Etheridge version 3.0 - please increment with major updates original author: Eric Etheridge last major update by the original author: August 28, 2011 year of original release (on old site): 2005 1 Introduction 1.1 Abstract Many people are accustomed to imperative languagues, which include C, C++, Java, Python, and Pascal. I write this assuming that you have checked out the Gentle Introduction to Haskell, but still don't understand what's going on. Haskell is not 'a little different,' and will not 'take a little time.' I am going to put many pauses in this tutorial because learning Haskell hurt a lot, at least for me. Haskell has both more flexibility and more control than most languages. I wrote this tutorial because Haskell was very hard for me to learn, but now I love it. This abstract was pieced together by Mark Evans, here, from my own work. 1.2 Downloads ExampleSectionsCode.hs ExampleSectionsTry.txt 1.3 License 1.4.1 GHC and Hugs or

Data.ByteString.Char8 O(n) The unfoldrN function is analogous to the List 'unfoldr'. unfoldrN builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is a prepending to the ByteString and b is used as the next element in a recursive call. To preven unfoldrN having O(n^2) complexity (as prepending a character to a ByteString is O(n), this unfoldr requires a maximum final size of the ByteString as an argument. cons can then be implemented in O(1) (i.e. a poke), and the unfoldr itself has linear complexity. The depth of the recursion is limited to this size, but may be less. For lazy, infinite unfoldr, use unfoldr (from List). Examples: unfoldrN 10 (\x -> Just (x, chr (ord x + 1))) '0' == "0123456789" The following equation connects the depth-limited unfoldr to the List unfoldr: unfoldrN n == take n $ List.unfoldr

Project Rain World by Rain World » AMAZING! ASTONISHING! Thanks to your overwhelming support and enthusiasm for Rain World, we are ~80% funded in less than 2 days. Unreal! Our inbox is absolutely brimming with messages of encouragement, thank you all so much! Also, today we are Kickstarter's "Project of the day", and anyone going to will be greeted by that cute slugcat face. So a huge "thank you" to Kickstarter staff as well! We have had a ton of questions from curious funders, and we will try to tackle as many as we can in this and subsequent updates. Q: Will Rain World be available on Steam? A: We would like for it to be! Q: Will you be doing a Linux version? A: We would like to do that too! Q: Do you accept PayPal? A: Yes! Although, it must be said: PayPal funds won't help us achieve our Kickstarter fundraising goal, so if you *do* have the option to use Kickstarter please do that instead. Now onto some fun stuff! You can see some of this leg and body movement action with the help of our little friend the see-through slugcat. How to read Haskell like Python tl;dr — Save this page for future reference. Have you ever been in the situation where you need to quickly understand what a piece of code in some unfamiliar language does? If the language looks a lot like what you’re comfortable with, you can usually guess what large amounts of the code does; even if you may not be completely familiar how all the language features work. For Haskell, this is a little more difficult, since Haskell syntax looks very different from traditional languages. But there's no really deep difference here; you just have to squint at it just right. Here is a fast, mostly incorrect, and hopefully useful guide for interpreting Haskell code like a Pythonista. Types. Arguments. f a b c translates into f(a, b, c). Dollar sign. In some code, you may see a variant of $: <$> (with angled brackets). Backticks. x `f` y translates into f(x,y). Equals sign. doThisThing a b c = ... ==> def doThisThing(a, b, c): ... let a = b + c in ... ==> a = b + c ... Left arrow. Right arrow.

Reference card 1 General Syntax {- A multiline comment which can continue for many lines -} -- a single line comment 1.2 Conditionals 1.2.1 if if conditional then truePart else falsePart if a == 12 then 14 else 22 1.2.2 case case exp of Pattern1 -> action1 Pattern2 -> action2 _ -> else_action case x of [] -> 0 [x] -> 1 _ -> -1 1.2.3 Function pattern matching f [ ] = 0 f [x] = 1 f _ = -1 1.2.4 Function conditionals (guards) f x | x == [] = 1 | length x == 12 = 15 | otherwise = -1 1.3 Saving work 1.3.1 where f x = i * i where i = g x 1.3.2 let in f x = let i = g x in i * i 1.4 Declaring types 1.4.1 data data List = Cons Int List | Nil deriving (Eq, Show, Ord) 1.4.2 type (type synonymns) type String = [Char] type Name = TypeValue 1.4.3 class class Check a where test :: a -> Bool force :: a -> a 1.4.4 instance instance Show List where show x = "No show" 1.5 Calling functions 1.5.1 Named functions myFunc :: Int -> Int -> Int result = myFunc 1 2 result = 1 `myFunc` 2 result = (myFunc 1) 2 result = (`myFunc` 2) 1 1.5.3 Useful functions

Data.Map An efficient implementation of maps from keys to values (dictionaries). Since many function names (but not the type name) clash with Prelude names, this module is usually imported qualified, e.g. import Data.Map (Map) import qualified Data.Map as Map The implementation of Map is based on size balanced binary trees (or trees of bounded balance) as described by: Stephen Adams, "Efficient sets: a balancing act", Journal of Functional Programming 3(4):553-562, October 1993, Note that the implementation is left-biased -- the elements of a first argument are always preferred to the second, for example in union or insert. Operation comments contain the operation time complexity in the Big-O notation