TP wrote:
pr :: Name - ExpQ
pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |]
The example is indeed problematic. Let's consider a simpler one:
foo :: Int - ExpQ
foo n = [|n + 1|]
The function f, when applied to an Int (some bit pattern in a machine
register), produces _code_.
As you say if I omit references to superclass methods in the subclasses then I get different compile time behaviour.But then the question is that if a putative subclass has no reference to superclass methods should it be a subclass at all?I deliberately want to model the case where each subclass
I am not trying to say every building is a shelter, rather anything
that is a building must provide sheltering services.
Well if it walks like a shelter and quacks like a shelter... /shrug
The is a relationship is not a good way to think about type classes, in
my opinion. The interface or
It sounds like the following example may help:
class A alpha where
a :: alpha - Int
class A beta = B beta where
b :: beta - Int
class C gamma where
c :: gamma - Int
foo :: B beta = beta - Int
foo x = a x + b x
-- the (A beta) is implied by the superclass constraint)
bar :: C
Richard,Yes, that example makes things clear.Thanks,PatOn 30/06/13, Richard Eisenberg e...@cis.upenn.edu wrote:It sounds like the following example may help: class A alpha where a :: alpha - Int class A beta = B beta where b :: beta - Int class C gamma where c :: gamma - Int foo :: B beta =
o...@okmij.org wrote:
pr :: Name - ExpQ
pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |]
The example is indeed problematic. Let's consider a simpler one:
foo :: Int - ExpQ
foo n = [|n + 1|]
The function f, when applied to an Int (some bit pattern in a machine
register),
I hope I'm not starting a holy war with this, but I'm curious about an
aspect of coding style that's been bugging me for a while, and I'm not
finding much discussion of this question on the web or in the mailing list
archives.
Two questions:
1) Are there wide-spread conventions in the Haskell
On Mon, Jul 1, 2013 at 6:01 AM, TP paratribulati...@free.fr wrote:
o...@okmij.org wrote:
pr :: Name - ExpQ
pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |]
The example is indeed problematic. Let's consider a simpler one:
foo :: Int - ExpQ
foo n = [|n + 1|]
The
Hi Richard,
This page helped me when starting out:
http://en.wikibooks.org/wiki/Haskell/Indentation
On 2013-06-30 4:55 PM, Richard Cobbe co...@ccs.neu.edu wrote:
I hope I'm not starting a holy war with this, but I'm curious about an
aspect of coding style that's been bugging me for a while,
On Sun, Jun 30, 2013 at 05:41:46PM -0700, Darren Grant wrote:
Hi Richard,
This page helped me when starting out:
http://en.wikibooks.org/wiki/Haskell/Indentation
On 2013-06-30 4:55 PM, Richard Cobbe co...@ccs.neu.edu wrote:
snip
1) Are there wide-spread conventions in the Haskell
The Haskell Style Guide is quite popular:
https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
(accompying
elisp module:
https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.el)
I am not sure what the verdict is on functions spanning multiple lines,
other
On 1/07/2013, at 1:04 PM, Richard Cobbe wrote:
I should have been clearer in my original question: I'm curious about what
to do when a multi-argument function application gets split across lines.
That wiki page dicsusses how the layout rule interacts with various special
forms (let, where,
12 matches
Mail list logo