Penguin

Differences between version 7 and predecessor to the previous major change of Haskell.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 7 Last edited on Saturday, September 13, 2003 1:08:00 pm by GerwinVanDeSteeg Revert
Older page: version 5 Last edited on Tuesday, February 25, 2003 7:59:35 pm by GlynWebster Revert
@@ -7,20 +7,19 @@
 It does have some quite cool concepts though. One in particular is the dot . operator. If you remember your calculus, you use the . for functional composition: so does Haskell! This allows you to do something similar to the pipe operator used in shell scripting. 
  
 It also does stuff like LazyEvaluation, supports generic or PolymorphicTypes, and is 'purely functional' -- this means you can even do mathematical proof on your programs. 
  
-See [http://www.haskell.org] for more info. A short snippet of some Haskell code from a book:  
+See [http://www.haskell.org] for more info. 
  
- mergE (a:x) (b:y)  
- | (a<b)  
- = a : mergE x (b:y)  
- | (a==b)  
- = a : mergE x y  
- | otherwise  
- = b : mergE (a:x) y  
- mergE (a:x) [[] = (a:x)  
- mergE [[] (b :y ) = (b :y)  
- mergE [[] [[] = [[] 
+!!!Example  
+  
+ -- sieve : prints the number of prime numbers between 2 and 100000  
+  
+ sieve :: [[Int] -> [[Int]  
+ sieve [[] = [[]  
+ sieve (h :t ) = h : sieve [[x| x <- t, x `mod` h /= ]  
+  
+ main = (putStrLn . show . length . sieve) [[2..100000
  
 !!!Implementations 
  
 __HUGS__ - __H__askell __U__sers' __G__ofer[1] __S__ystem. An interpreter for Haskell. This is good for playing around learning Haskell (which is what you do with Haskell, unless you're serious computer scientist). See: http://haskell.org/hugs 
@@ -28,4 +27,7 @@
 __GHC__ - __G__lasglow __H__askell __C__ompiler. A big, optimising compiler for Haskell. See: http://www.haskell.org/ghc/ 
  
 ---- 
 [1] Gofer was a subset of Haskell, HUGS now implements full Haskell. 
+  
+-----  
+CategoryProgrammingLanguages