Haskish is a no-fuss Haskell-style functional programming playground for students, teachers, and curious professionals. Open your browser and start exploring, no installation required. It covers AQA A Level Computer Science 4.12 and also works well as a compact REPL for trying out real functional ideas.
if condition then expr1 else expr2, let/in, case/of, lazy built-in ranges ([n..], [n,m..]), first-class functions, currying, partial application, composition, backtick infix application, multi-line lambdas, closures, recursion, mutual recursion, guards, where clauses, and operator sections.x:xs, wildcards, nested constructor and AST shapes, and literal patterns for numbers, booleans, tuples, and strings.String = [Char]), so map, filter, and comprehensions work uniformly over both. Lists built with : evaluate both head and tail immediately, so user-defined infinite lists do not work, but syntactic ranges are lazy infinite sequences that cooperate with functions like take.Note: Type signatures such as add :: Int -> Int -> Int are accepted but not enforced. Data declarations are parsed for constructors, but full Haskell typing and module features are not implemented. Real Haskell code snippets can still be pasted in without modification for the supported subset.
Created by Neil Kendall © 2025-2026
More @ www.korovatron.co.uk
Contact me
Use the menu at the top right to access:
Lessons - step-by-step tutorials and challenges
Examples - syntax and working programs
Version
Created by Neil Kendall © 2025-2026
More @ www.korovatron.co.uk
The built-in library is intentionally minimal: building standard functions yourself is one of the best ways to learn functional programming. If you prefer, a richer set of Haskell Prelude functions is available by clicking here to load them into the function panel.
a ^ b - Exponentiation: 2^10 → 1024mod a b - Modulo (remainder)div a b - Integer divisionmin a b - Minimum of two valuesmax a b - Maximum of two valuesNote: All list functions work on strings as well as lists, since strings are lists of characters (String = [Char]).
head list - First element of a listtail list - All but the first elementlength list - Length of a listnull list - Check if list is emptyreverse list - Reverse a listtake n list - Take first n elementsdrop n list - Drop first n elements: - Cons (prepend element to list): 1:[2,3] → [1,2,3]++ - Concatenate lists: [1,2]++[3,4] → [1,2,3,4]!! - Index into list: [10,20,30]!!1 → 20map fn list - Apply function to each elementmap (*2) [1,2,3] → [2,4,6]filter predicate list - Filter list by predicatefilter (>5) [3,7,2,9] → [7,9]fold fn acc list - Reduce list with accumulatorfold (+) 0 [1,2,3] → 6Note: fold is implemented as a left fold (same behaviour as foldl). foldr is also available.
(+1) - Partial application: map (+1) [1,2,3] → [2,3,4](<10) - Comparison: filter (<10) [5,15,3] → [5,3](*) - Binary operator as function: fold (*) 1 [2,3,4] → 24[expr | x <- list] - Map over list[x*2 | x <- [1,2,3]] → [2,4,6][expr | x <- list, guard] - Filter with guard[x | x <- [1..10], x > 5] → [6,7,8,9,10][expr | x <- list1, y <- list2] - Nested generators[(x,y) | x <- [1,2], y <- ['a','b']] → [(1,'a'),(1,'b'),(2,'a'),(2,'b')]not bool - Boolean negationord char - Convert character to Unicode code pointchr code - Convert Unicode code point to charactershow value - Convert any value to a stringshow 42 → "42", show True → "True"putStr string - Print a string to the REPL without quotesputStr "hello\nworld" → renders on two linesputStrLn string - Print a string followed by a newlineputStrLn "done" → done with trailing newlineString escape sequences: \n (newline), \t (tab), \\ (backslash), \" (double quote) are supported in string literals.
if condition then expr1 else expr2 - Conditional expression (both branches required)if x > 0 then "positive" else "non-positive"_ - Wildcard pattern (matches any value without binding)getThird _ _ x = xlet ... in ... - Local bindings inside expressions, including multiline layout-sensitive formscase ... of - Pattern matching with constructors, tuples, lists, wildcards, and guardsdata Type = Ctor ... - Haskell-style data declarations (constructors work for values and pattern matching; no full type inference/checking)where - Define local variables and functions scoped to the enclosing functionerror message - Throw an errorcompose g f - Function composition (also g . f)True / False - Boolean values (capitalised)otherwise - Always true (for guards):help - Show all available REPL commands:show - Show all defined functions and variables:functions - List all user-defined functions:vars - List all user-defined variables:info functionName - Show definition(s) of a specific function:timeout 15000 - Set execution timeout for current session only (:timeout to view, :timeout reset for default)