Re: [Haskell] Haskell can sing

2013-12-08 Thread Scott Turner
On 2013-12-01 14:28, Henning Thielemann wrote: > it's again Advent time and I took the opportunity to program another > song for you. Those who liked last year's songs [1,2,3] may also be > interested in the new one: > http://www.youtube.com/watch?v=0EQCgi5qa3E "Alta trinita beata" > > It employs t

[Haskell] Re: haskell.org Public Domain

2006-01-12 Thread Scott Turner
On 2006 January 11 Wednesday 18:52, Ashley Yakeley wrote: > How about this one (from > )? > > "I, the creator of this work, hereby release it into the public domain. > This applies worldwide. > > "In case this is not legally pos

Re: [Haskell] new to haskell

2005-05-21 Thread Scott Turner
On 2005 May 21 Saturday 17:52, wenduan wrote: > let n = read number This converts type String to Integer. >return (number : rest) This line is building up the list. Put 'n' on the list rather than 'number', so that the list will be numeric. Then when you try "list <- calcula

[Haskell] specified or not

2005-03-03 Thread Scott Turner
Is the behavior of evaluating z unspecified? z = f (0, z) f x = case x of (1,1) -> z _ -> 0 Hugs and GHC agree that z evaluates to 0. However, if the first line is changed to z = f (z,0) then both implementations loop. In other words, the behavior depends on order of evaluation, which AFA

Re: [Haskell] Better Exception Handling

2004-11-30 Thread Scott Turner
Last week John Goerzen asked about exceptions in Haskell. I responded with some code that supports a hierarchy of exception types. Jules Bean reacted that "the internal implementation with fromDynamic doesn't seem pretty though". Although dynamic types reflect the common implementation of exce

Re: [Haskell] Better Exception Handling

2004-11-24 Thread Scott Turner
John Goerzen wrote: > I note, though, that "making an Either into a Monad" doesn't do > anything to deal with asynchronous exceptions. [ snip] > I was referring to exceptions generated by things such as signals, > interrupts, certain network errors, stack problems, etc. How would you like asynchro

Re: [Haskell] Better Exception Handling

2004-11-24 Thread Scott Turner
On 2004 November 24 Wednesday 13:12, Jules Bean wrote: > On 24 Nov 2004, at 16:21, Scott Turner wrote: > > On 2004 November 23 Tuesday 10:51, John Goerzen wrote: > > The way to deal with those kinds of details is to use Either in a > > monad. > Ok, I glanced through your

Re: [Haskell] Better Exception Handling

2004-11-24 Thread Scott Turner
On 2004 November 23 Tuesday 10:51, John Goerzen wrote: > > for pure functions, returning Either Error Result is the way to go. > One example: I've written an FTP client library. For every operation, > there are several possible outcomes... mainly: success, low-level > network error, or server err

Re: [Haskell] Syntax Q: How do you share RHS's in case expressions!?

2004-10-22 Thread Scott Turner
On 2004 October 22 Friday 12:15, Ben Rudiak-Gould wrote: > Ryan Newton wrote: > > [...] > > case 3 of 3 -> 99; 4 -> 99 > > You can do this: > >let rhs = (some complicated expression) in >case 3 of > 3 -> rhs > 4 -> rhs You can also do case 3 of x | x `elem` [3,4] -> 99 though

Re: [Haskell] Space behaviour & hyperseq

2004-06-17 Thread Scott Turner
On 2004 June 17 Thursday 08:45, Arjan van IJzendoorn wrote: > function hyperseq and then applying it before the next iterations > begins: > hyperseq x y = if x==x then y else error "this is very unlikely" > This is very expensive The concept of DeepSeq bothers me, because usually more limited use

Re: (fromRational (1%5)) :: Double

2001-04-19 Thread Scott Turner
ue. It finds the minimum number of digits which will convert back to the original binary number. 0.2 when converted to binary has the same value 0.200011102230246251565404236316680908203125 therefore 0.2 is printed. -- Scott Turner [EMAIL PR

recip for Ratio

2001-02-26 Thread Scott Turner
the type is consistent about it. -- Scott Turner [EMAIL PROTECTED] http://www.billygoat.org/pkturner ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Doing IO in foldr repeats lines?

2001-01-20 Thread Scott Turner
en putting a string, and then performing io_l _again_. If io_l prints the lines qq, ww, and qq, then the result will involve two such triplets. Try this. Remove either of the occurrences of io_l from the do block, and you will see quite different results. -- Scott Turner [EMAIL PROTECTED] htt

pronunciation of >>=

2000-10-18 Thread Scott Turner
Is there a common way to pronounce ">>=" in discussions or when teaching? I've learned all my Haskell from printed/visual documents. -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner ___ Haskell mailing

RE: static evaluation of dynamics thing

2000-05-21 Thread Scott Turner
icate an additional subtlety, which is quite beyond me. If the effect is dependent on the implementation, that would be a bad thing. -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner

RE: static evaluation of dynamics thing

2000-05-21 Thread Scott Turner
FAIK eagerness isn't addressed by the Haskell language. Since Mechveliani is primarily concerned with compile-time diagnostics rather than efficiency, wouldn't eagerness be irrelevant? -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner

Re: Constrained instances?

2000-04-29 Thread Scott Turner
E x) = x instance Monad TracingEv where return i = TE (\c -> do pr c i return (c+1,i)) m >>= f = TE (\c -> do (c',v) <- (unTE m) c (unTE (f v)) c') But Hugs is not happy with the overlap unless you use -98 +m, and

Re: deBruijn sequence NESL code

2000-03-31 Thread Scott Turner
l lists :: [[Int]] lists = map makeList [0..len - 1] makeList :: Int -> [Int] makeList n = take logLen $ drop n c logi :: Int -> Int logi i = (fromJust $ elemIndex 0 (iterate (`div` 2) i)) - 1 -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner

Re: To all those who don't like ad-hoc overloading

1999-09-30 Thread Scott Turner
v],[w]) (t,u,v,w) etc. left as an exercise. Thus, the uglier cases on Kevin Atkinson's list can be addressed within Haskell's current overloading system. -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner

Re: Looking for TkHaskell

1999-07-20 Thread Scott Turner
>You want TclHaskell, available at > > http://www.dcs.gla.ac.uk/~nww/TkHaskell/TkHaskell.html >but I believe Meurig Sage is working on a much improved version as we >speak. Unfortunately, the links from that web page to the distribution/release are dead. -- Scott Turner [

Looking for TkHaskell

1999-07-19 Thread Scott Turner
ith a similar basis. http://www.cs.chalmers.se/Cs/Research/Functional/Meeting/1999/index.html#Koe n-May-20 -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner

Re: Still confused

1999-03-14 Thread Scott Turner
gt; Int) -> [Char] *** does not match : Int -> [Char] *** Perhaps you intended `div` rather than div. (This message to the Haskell list is based on my experience as a compiler writer, not with Hugs.) -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner

re: Felleisen on Standard Haskell

1998-08-04 Thread Scott Turner
ce, round number that is close enough, given that Haskell 2 won't be finished until well after that year. -- Scott Turner [EMAIL PROTECTED] http://www.ma.ultranet.com/~pkturner

Re: Exceptions are too return values!

1998-06-12 Thread Scott Turner
turn 0)) (return (0 / 0) -- Looks plausible -- but the exception isn't raised yet. print quotient -- Here the expression 0/0 is evaluated -- and the exception is raised with no handler. Is this considered a drawb