[Haskell-cafe] What does it mean to derive equations of restricted from in Haskell?

2013-07-16 Thread Daryoush Mehrtash
In John Hughes's The Design of Pretty printing library paper, he says: The implementations which we are trying to derive consist of equations of a restricted form. We will derive implementations by proving their constituent equations from the specification. By itself this is no guarantee

Re: [Haskell-cafe] What does it mean to derive equations of restricted from in Haskell?

2013-07-16 Thread Johannes Waldmann
Daryoush Mehrtash dmehrtash at gmail.com writes: What does restricted form mean? non-restricted: e.g., f (f x y) z = f x (f y z)) restricted: the shape of function declarations in Haskell (where lhs is a pattern) definitions are terminating ... non-termination: an equation like f x y = f

Re: [Haskell-cafe] what does the '~' mean ?

2010-04-20 Thread Ryan Ingram
On Thu, Apr 15, 2010 at 10:59 PM, zaxis z_a...@163.com wrote: instance (BinaryDefer a, BinaryDefer b) = BinaryDefer (a,b) where    put (a,b) = put2 a b    get = get2 (,)    size x = let ~(a,b) = x in size a + size b    putFixed (a,b) = putFixed2 a b    getFixed = getFixed2 (,) in `size`

Re: [Haskell-cafe] what does the '~' mean ?

2010-04-16 Thread Ivan Miljenovic
On 16 April 2010 15:59, zaxis z_a...@163.com wrote: instance (BinaryDefer a, BinaryDefer b) = BinaryDefer (a,b) where    put (a,b) = put2 a b    get = get2 (,)    size x = let ~(a,b) = x in size a + size b    putFixed (a,b) = putFixed2 a b    getFixed = getFixed2 (,) in `size` function,

Re: [Haskell-cafe] what does the '~' mean ?

2010-04-16 Thread Stefan Holdermans
Ivan, in `size` function, what does the `~` mean ? A lazy pattern match: http://en.wikibooks.org/wiki/Haskell/Laziness (there is a better name for it, but I can't remember). Irrefutable pattern? ;-) Cheers, Stefan ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] what does the '~' mean ?

2010-04-16 Thread Magnus Therning
On 16/04/10 07:09, Ivan Miljenovic wrote: On 16 April 2010 15:59, zaxis z_a...@163.com wrote: instance (BinaryDefer a, BinaryDefer b) = BinaryDefer (a,b) where put (a,b) = put2 a b get = get2 (,) size x = let ~(a,b) = x in size a + size b putFixed (a,b) = putFixed2 a b

Re: [Haskell-cafe] what does the '~' mean ?

2010-04-16 Thread Ivan Lazar Miljenovic
Stefan Holdermans ste...@vectorfabrics.com writes: Irrefutable pattern? ;-) Ahhh, yes, that's it. I knew it started with `i', but that's about it... -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe

[Haskell-cafe] what does the '~' mean ?

2010-04-15 Thread zaxis
instance (BinaryDefer a, BinaryDefer b) = BinaryDefer (a,b) where put (a,b) = put2 a b get = get2 (,) size x = let ~(a,b) = x in size a + size b putFixed (a,b) = putFixed2 a b getFixed = getFixed2 (,) in `size` function, what does the `~` mean ? Sincerely! - fac n

[Haskell-cafe] What does it mean that objects are fixpoints? (OO'Haskell)

2009-09-15 Thread Manuel Simoni
Hello! I'm trying to wrap my head around OO'Haskell's notion of objects as fixpoints. Is OO'Haskell's use of mfix simply a use of something like a monadic Y-combinator to give the object access to its own identity? Thanks, Manuel ___ Haskell-Cafe

Re: [Haskell-cafe] What does it mean that objects are fixpoints? (OO'Haskell)

2009-09-15 Thread Sean Leather
I'm trying to wrap my head around OO'Haskell's notion of objects as fixpoints. Is OO'Haskell's use of mfix simply a use of something like a monadic Y-combinator to give the object access to its own identity? I don't remember the details exactly, but isn't it to support open recursion for

Re: [Haskell-cafe] What does it mean that objects are fixpoints? (OO'Haskell)

2009-09-15 Thread Derek Elkins
On Tue, Sep 15, 2009 at 10:14 AM, Manuel Simoni msim...@gmail.com wrote: Hello! I'm trying to wrap my head around OO'Haskell's notion of objects as fixpoints. Is OO'Haskell's use of mfix simply a use of something like a monadic Y-combinator to give the object access to its own identity?

Re: [Haskell-cafe] what does atomically# mean?

2009-03-20 Thread Daryoush Mehrtash
I am having hard time making sense of GHC.Conc. Is there a writeup that describes the significance of #, or the meaning of primOp and primType? Thanks Daryoush On Sun, Dec 7, 2008 at 11:48 PM, Don Stewart d...@galois.com wrote: dmehrtash: Any idea was the atomically# mean in the

Re: [Haskell-cafe] what does atomically# mean?

2009-03-20 Thread Martijn van Steenbergen
This might be of some help: http://www.haskell.org/ghc/docs/6.10.1/html/users_guide/syntax-extns.html Daryoush Mehrtash wrote: I am having hard time making sense of GHC.Conc. Is there a writeup that describes the significance of #, or the meaning of primOp and primType?

Re: [Haskell-cafe] what does atomically# mean?

2009-01-31 Thread Ryan Ingram
That code is in ghc root/rts/STM.c -- ryan 2009/1/30 Daryoush Mehrtash dmehrt...@gmail.com: I like to look at the code where the runtime detects a TVar, inside an atomic block, has been changed by another thread and hence it aborts the atomic operation. Any suggestion as to where I would

Re: [Haskell-cafe] what does atomically# mean?

2009-01-30 Thread Daryoush Mehrtash
I like to look at the code where the runtime detects a TVar, inside an atomic block, has been changed by another thread and hence it aborts the atomic operation. Any suggestion as to where I would find the code? daryoush On Sun, Dec 7, 2008 at 10:48 PM, Don Stewart d...@galois.com wrote:

[Haskell-cafe] what does atomically# mean?

2008-12-07 Thread Daryoush Mehrtash
Any idea was the atomically# mean in the following code? atomically :: STM a - IO a atomically (STM m) = IO (\s - (*atomically# *m) s ) Code is from GHC.Conc module http://www.haskell.org/ghc/docs/6.6/html/libraries/base/GHC-Conc.html daryoush ___

Re: [Haskell-cafe] what does atomically# mean?

2008-12-07 Thread Don Stewart
dmehrtash: Any idea was the atomically# mean in the following code? atomically :: STM a - IO a atomically (STM m) = IO (\s - (atomically# m) s ) Code is from GHC.Conc module [1]http://www.haskell.org/ghc/docs/6.6/html/libraries/base/GHC-Conc.html It is a primitive hook