Re: Puzzle

2003-08-26 Thread Ralf Hinze
Am Dienstag, 26. August 2003 05:54 schrieb Matt Harden: > Cool! That leads me to this contraption: > > tricky= 0 : enigma tricky tricky > > enigma (k : ks) = (k :) . labyrinth (enigma ks) > > labyrinth f (k : _ : ks) = (k + 1) : f ks > > Figure out what `

Re: Haskell indentation

2003-08-26 Thread John Meacham
On Tue, Aug 26, 2003 at 02:00:32PM +0200, Per Larsson wrote: > I have problems finding a pleasing indentation style for haskell code. > Especially nested do-blocks have a tendency to run away to the right margin. > When looking on source code from experienced haskell programmers, there > seems not

Re: Yet Another Monad Tutorial

2003-08-26 Thread Wolfgang Jeltsch
On Thursday, 2003-08-14, 13:37, CEST, blaat blaat wrote: > [...] Hello, I don't know exactly which of the following questions have already been answered but I decided to answer them all anyway. > What is the difference between putStr "a", (putStr "a", putStr "a"), putStr > (putStr "a"), putStr

Re: Debugging

2003-08-26 Thread Bernard James POPE
> My Haskell experiments have reached a size in which debugging tools would be > more than welcome, so I looked around, and was very disappointed. I tried > Hood, which is a pain to use (lots of editing of the code required), I looked > at Buddha but didn't want to downgrade to GHC 5 for trying

Re: Debugging

2003-08-26 Thread David Roundy
On Tue, Aug 26, 2003 at 05:27:11PM +0200, Konrad Hinsen wrote: > My Haskell experiments have reached a size in which debugging tools would > be more than welcome, so I looked around, and was very disappointed. I > tried Hood, which is a pain to use (lots of editing of the code > required), I looked

Re: Puzzle

2003-08-26 Thread Matt Harden
On Friday 22 August 2003 04:29 pm, Ralf Hinze wrote: > | Seeing as its thst time of year again and everyone is posting their > | homework, has anyone got any good puzzles to do? > | I wouldn't mind having a go at something a bit tricky. > > Here is another one: figure out what `unknown' is. > > > u

Debugging

2003-08-26 Thread Konrad Hinsen
My Haskell experiments have reached a size in which debugging tools would be more than welcome, so I looked around, and was very disappointed. I tried Hood, which is a pain to use (lots of editing of the code required), I looked at Buddha but didn't want to downgrade to GHC 5 for trying it (nor

RE: haskell reify, was sequencing data structures

2003-08-26 Thread Simon Marlow
>- There needs to be some support from the > compilers/interpreters. Hugs > already has this. Ghc has some of it, but I abuse the > profiling system > in order to get the names of constructors to be present > on the heap. > I'm not happy with this. Under normal compilation

AW: Haskell indentation

2003-08-26 Thread Markus . Schnell
If your code goes out to far right, it's a good idea to make a function out of it. > main = do > args <- getArgs > case args of > (fname:_) -> normalOp > _-> helpScreen > > normalOp = do > ... > > helpScreen = putStrLn helpStr Code should be formatted in a way easy to scan

Haskell indentation

2003-08-26 Thread Per Larsson
Hi, I have problems finding a pleasing indentation style for haskell code. Especially nested do-blocks have a tendency to run away to the right margin. When looking on source code from experienced haskell programmers, there seems not to be any consensus at all, everyone uses their own convention

Re: Homework

2003-08-26 Thread oleg
> Here's one: figure out what the following does :-) > puzzle = (!!) $ map (1:) $ iterate (s (lzw (+)) (1:)) [] where > s f g x = f x (g x) > lzw op xs [] = xs > lzw op [] ys = ys > lzw op (x:xs) (y:ys) = op x y : lzw op xs ys Can be written simpler puzzle = (!!) $ iterate (s (