1 2 3 4
-- Your second example is completely contrived, seeing as the user has to annotate a type anyway, you could just write: is_complex_simple = False is_complex_complex = True ...
1 2 3 4
data Simple = Myint Int | Mydouble Double | Mystring String deriving (Eq, Show) data Complex = Struct String [(String,Simple)] deriving (Eq, Show) ...
Haskell On Function to check the data ...
by headcrab.myopenid.com,
December 08, 2009 22:19
Have written this variation...
Haskell On radixSort algorithm
by jedai.myopenid.com,
November 21, 2009 20:37
To have an idea of the perf...
1 2 3
import qualified Data.IntSet as IS radixSort = IS.toList . IS.fromList
Haskell On radixSort algorithm
by Thomas Salvador,
November 15, 2009 00:06
hi sargon:
radixsort is fa...
1 2 3 4
# Imports [haskell] import Data.List (groupBy) import Control.Arrow ((&&&)) ...
Haskell On compressing an array of int...
by Kim Burgestrand,
October 21, 2009 04:58
I realize this is old, but ...
Haskell On compressing an array of int...
by sargon,
April 16, 2009 06:08
_geil_
Took a moment befor...
1 2 3 4
import Data.List (group, mapAccumL) compress :: [Int] -> [[Int]] ...
Haskell On compressing an array of int...
by bob,
April 15, 2009 20:40
oops i didn't read the orig...
Haskell On compressing an array of int...
by Alec Leitner,
April 15, 2009 18:37
Oh, I might have to learn H...
1 2 3
compress :: [Int] -> [(Int,Int)] compress (l:ls) = reverse $ foldl (\ o@((c,i):cs) x -> if x == c + i then (c,i+1):cs else (x,1):o) [(l,1)] ls compress [] = []
Haskell On compressing an array of int...
by sargon,
April 15, 2009 17:48
"look and say sequence" has...
1 2 3 4
import Data.List (group) compress :: [Int] -> [[Int]] ...
Haskell On compressing an array of int...
by bob,
April 15, 2009 17:12
By the way your problem is ...
1 2 3 4
data Tag = Tag { tagType :: String, tagAttrs :: [Attr] ...
Haskell On Raytracer in haskell
by Tj Holowaychuk,
April 10, 2009 23:12
Give me a few weeks to lear...
1 2 3 4
import Data.List (transpose) main = putStr . unlines . reverse . rotate . lines =<< getContents ...
1 2 3
pivot ps = minimum ps -- Or in the so-called point-free style: -- pivot = minimum
1 2 3 4
main = do s <- getContents putStr $ unlines $ reverse $ rotate $ lines s ...


it was very interesting to ...