Re: [Haskell-cafe] do notation strangeness

2007-12-08 Thread Ilya Tsindlekht
On Sat, Dec 08, 2007 at 02:59:16PM -0200, Felipe Lessa wrote: Hello! I see from http://www.haskell.org/haskellwiki/Monads_as_computation#Do_notation that do { v - x ; stmts } = x = \v - do { stmts } However, look at this GHCi session: Prelude let return' = return :: a - Maybe a

Re: [Haskell-cafe] do notation strangeness

2007-12-08 Thread Ilya Tsindlekht
On Sat, Dec 08, 2007 at 03:28:58PM -0200, Felipe Lessa wrote: On Dec 8, 2007 3:12 PM, Ilya Tsindlekht [EMAIL PROTECTED] wrote: On Sat, Dec 08, 2007 at 02:59:16PM -0200, Felipe Lessa wrote: Prelude do {1 - return 3; return' ok} Nothing Prelude return 3 = \1 - return' ok *** Exception

Re: [Haskell-cafe] Israel Haskell Programmers

2007-09-16 Thread Ilya Tsindlekht
On Sun, Sep 16, 2007 at 06:11:03PM +0200, B K wrote: Hello, Are there any Haskell Hackers on this mailing list who live in Israel? I am interested in starting an Israel Haskell User Group. I am here, although I probably do not really count for Haskell Hacker.

Re: [Haskell-cafe] Very simple parser

2007-07-04 Thread Ilya Tsindlekht
On Thu, Jul 05, 2007 at 12:58:06AM +1000, Alexis Hazell wrote: On Tuesday 03 July 2007 09:51, Arie Peterson wrote: No, there is a 'State s' monad provided (for arbitrary state type 's'), which implements the 'get' and 'put' methods. In other words, 'State s' is an instance of the

Re: [Haskell-cafe] Haskell's

2007-07-03 Thread Ilya Tsindlekht
On Tue, Jul 03, 2007 at 10:53:33AM +, Peter Verswyvelen wrote: Ah, thanks for the correction. So if I understand it correctly, this is currying: when f :: (a,b) - c then g :: a - (b,c) g :: a-b-c is the curried form of f? So currying has to do with tuples? And partial

Re: [Haskell-cafe] Redefining Disjunction

2007-06-13 Thread Ilya Tsindlekht
On Wed, Jun 13, 2007 at 02:37:37PM +0100, PR Stanley wrote: Hi Can you think of a fourth way of redefining disjunct using pattern matching? vee :: Bool - Bool - Bool vee _ True = True vee True _ = True vee _ _ = False ve :: Bool - Bool - Bool ve True True = True ve True False = True ve

Re: [Haskell-cafe] Finding points contained within a convex hull.

2007-06-06 Thread Ilya Tsindlekht
On Wed, Jun 06, 2007 at 12:23:03PM +1200, Daniel McAllansmith wrote: Hello. I've got a system of linear inequalities representing half-spaces. The half-spaces may or may not form a convex hull. I need to find the integral coordinates that are contained within the convex hull, if there

Re: [Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Ilya Tsindlekht
On Wed, Jun 06, 2007 at 01:39:32PM +0400, Dmitri O.Kondratiev wrote: Monad class contains declaration *fail* :: String - m a and provides default implementation for 'fail' as: fail s = error s On the other hand Prelude defines: * error* :: String - a which stops execution and

Re: [Haskell-cafe] standard function

2007-06-06 Thread Ilya Tsindlekht
On Wed, Jun 06, 2007 at 03:48:18PM +0200, Steffen Mazanek wrote: Hello, is there a function f::[a-b]-a-[b] in the libraries? Couldn't find one using hoogle although this seems to be quite a common thing... Steffen Just to add to what others have said, yet another way to implement it

Re: [Haskell-cafe] newbie question on Parsers from Programming In Haskell

2007-06-05 Thread Ilya Tsindlekht
On Mon, Jun 04, 2007 at 05:42:35PM +0300, Juozas Gaigalas wrote: Hello, I am a somewhat experienced programmer and a complete Haskell newbie, so I hope this is the correct ML for my question. I have decided to learn Haskell and started with Graham Hutton's book. Everything was going

Re: [Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Ilya Tsindlekht
On Tue, Jun 05, 2007 at 10:41:44AM +0100, Rodrigo Queiro wrote: To back him up, it seems that the lhaskell.vim syntax highlighter is broken with Vim 7.1. Here, it is definitely using lhaskell.vim, but doesn't seem to be parsing the code in between \begin{code} and \end{code} as Haskell. Works

Re: [Haskell-cafe] Language extensions

2007-05-28 Thread Ilya Tsindlekht
On Sun, May 27, 2007 at 05:34:33PM -0400, Brandon S. Allbery KF8NH wrote: On May 27, 2007, at 17:23 , Andrew Coppin wrote: Personally, I try to avoid ever using list comprehensions. But every now and then I discover an expression which is apparently not expressible without them - which

Re: [Haskell-cafe] Re: Debunking tail recursion

2007-05-19 Thread Ilya Tsindlekht
On Sat, May 19, 2007 at 04:10:29PM +0100, Jon Fairbairn wrote: [...] foldl f z l = case l of (x:xs) - foldl f (f z x) xs [] - z which reveals that foldl in the RHS isn't really the leftmost outermost function, but case is -- the tail call is to case. It

Re: [Haskell-cafe] Re: Debunking tail recursion

2007-05-19 Thread Ilya Tsindlekht
On Sat, May 19, 2007 at 09:16:46PM +0100, Jon Fairbairn wrote: Ilya Tsindlekht [EMAIL PROTECTED] writes: By definition, tail recursive function is recursive function in which the value returned from a recursive call is immediately returned without modification as value of the top-level

[Haskell-cafe] Re: Monad definition question

2007-05-05 Thread Ilya Tsindlekht
On Sat, May 05, 2007 at 12:09:03AM -0700, [EMAIL PROTECTED] wrote: Ilya Tsindlekht wrote: Does the definition of monad silently assume that if f and f' are equal in the sense that they return the same value for any argument o correct type then m = f = m = f' Of course NOT! Here's

[Haskell-cafe] Monad definition question

2007-05-04 Thread Ilya Tsindlekht
Does the definition of monad silently assume that if f and f' are equal in the sense that they return the same value for any argument o correct type then m = f = m = f' More specifically, the definition says x = return = x. How does one justify from this that x = (return . id) = x? Are values of