[Haskell-cafe] Monad laws

2010-03-02 Thread David Sabel
Hi, when checking the first monad law (left unit) for the IO-monad (and also for the ST monad): return a >>= f ≡ f a I figured out that there is the "distinguishing" context (seq [] True) which falsifies the law for a and f defined below > let a = True > let f = \x -> (undefined::IO Bool)

Re: [Haskell-cafe] Monad laws

2010-03-03 Thread David Sabel
Prelude.undefined Regards, David Andrés Sicard-Ramírez schrieb: > > On 2 March 2010 15:44, Luke Palmer <mailto:lrpal...@gmail.com>> wrote: > > On Tue, Mar 2, 2010 at 1:17 PM, David Sabel > <mailto:sa...@ki.informatik.uni-frankfurt.de>> wrote: >

Re: [Haskell-cafe] On the purity of Haskell

2012-01-02 Thread David Sabel
A perhaps acceptable notion of the property we want (purity etc.) is that all the extensions of the purely functional core language of Haskell (say the lazy lambda calculus extended with data constructors, etc) are _conservative_, that is all the equations that hold in the pure core language still

Re: [Haskell-cafe] unsafeInterleaveST (and IO) is really unsafe

2013-04-15 Thread David Sabel
Am 13.04.2013 00:37, schrieb Timon Gehr: On 04/12/2013 10:24 AM, o...@okmij.org wrote: Timon Gehr wrote: I am not sure that the two statements are equivalent. Above you say that the context distinguishes x == y from y == x and below you say that it distinguishes them in one possible run. I

Re: [Haskell-cafe] unsafeInterleaveST (and IO) is really unsafe

2013-04-18 Thread David Sabel
Am 18.04.2013 15:17, schrieb Duncan Coutts: On Mon, 2013-04-15 at 20:44 +0200, David Sabel wrote: A very interesting discussion, I may add my 2 cents: making unsafeInterleaveIO nondeterministic indeed seems to make it safe, more or less this was proved in our paper: http

Re: [Haskell-cafe] Papers discussing interpreters for call by need?

2010-11-17 Thread David Sabel
As a starting point I would suggest Peter Sestoft : Deriving a lazy abstract machine, Journal of Functional Programming 7(3), 1997 ( http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.4314 ) Different abstract machines for call-by-need evaluation are built starting from Launchburys natu

Re: [Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-30 Thread David Sabel
Hi, the definition in the book is a syntactic one, you are not allowed to beta-reduce when applying the definition. In particular E = E1 E2 = (\x.xy)(\z.z) The definition speaks about the term (\x.xy)(\z.z) and not about (\z.z)y and the definition does not speak about occurences of variables

Re: [Haskell-cafe] Defining show for a function type.

2006-07-10 Thread David Sabel
Hi, you can make every function being an instance of class Show, this works for me: instance Show (a -> b) where show _ = "FUNCTION" data Element = Int Int | Float Float | Func (Machine -> Machine) deriving Show David Johan Grönqvist wrote: I am a haskell-beginner and I wish to write a Forth

Re: [Haskell-cafe] beginner's problem about lists

2006-10-11 Thread David Sabel
Malcolm Wallace wrote: Matthias Fischmann <[EMAIL PROTECTED]> wrote: No, your Fin type can also hold infinite values. let q = FinCons 3 q in case q of FinCons i _ -> i ==> _|_ does that contradict, or did i just not understand what you are saying? That may be the result in

Re: [Haskell-cafe] lazy readFile

2005-01-03 Thread David Sabel
Hi! I'm also interested, how to get this example working: http://www.haskell.org/pipermail/haskell/2001-November/008336.html This seems to be an old discussion: http://www.haskell.org/pipermail/libraries/2001-April/000358.html Was a strictReadFile implemented in the meantime? Here's my implemen

Re: tracing Haskell programs

2003-10-20 Thread David Sabel
Hi, Maybe "Hat" - The Haskell Tracer can help: http://haskell.org/hat/ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, October 19, 2003 10:25 AM Subject: tracing Haskell programs > Hi folk > > Is there a way to follow the "execution" of a Haskell