John Meacham wrote:
On Fri, Jan 27, 2006 at 12:28:23PM +1100, Donald Bruce Stewart wrote:
john:
I have often wanted a shorthand syntax for testing if a value
matches a given pattern. I want to implement such an extension for
jhc but can't decide an appropriate syntax so I thought I'd ask the
On 27/01/06, Brian Hulley [EMAIL PROTECTED] wrote:
John Meacham wrote:
On Fri, Jan 27, 2006 at 12:28:23PM +1100, Donald Bruce Stewart wrote:
john:
I have often wanted a shorthand syntax for testing if a value
matches a given pattern. I want to implement such an extension for
jhc but
Hi -
To avoid the problems with so many names being put into a module's
namespace, data declarations could implicitly define sub-modules and
class/instance declarations as follows:
module M where
data Foo = FooCon {x : Int}
would declare (as seen from inside M)
Foo, Foo.FooCon,
Apologies - I've noticed some mistakes corrected as follows:
Brian Hulley wrote:
class //x a b where
x : a - b
class //FooCon a b where
FooCon : a - b
class //x a b | a - b where-- I think this fundep is
correct
x :: a-b
Joel Koerwer wrote:
On 1/26/06, *Donald Bruce Stewart* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Ah, i just do: ghc A.hs -O2 -ddump-simpl | less
and then read the Core, keeping an eye on the functions I'm interested
in, and checking they're compiling to the kind of
Another correction...
Brian Hulley wrote:
data Col1 a = One a
data Col2 a = One a | Two a
useOne :: ( //One col a) = col - a
useOne (One x) = x
should be
useOne :: (//One a col) = col - a
___
Haskell-Cafe
Dear
Haskellers,
since this is my
first post,
"Hello all"
I have a problem
with a function taken from class Arrow.
arr :: (b - c) - a b c
To build my own
arrow, i need to distinguish between different kinds of b or
c.
For instance, if
bhas the form(d,e), i want to construct
Hi Sven,
since this is my first post,
Hello all
Welcome!
I have a problem with a function taken from class Arrow.
arr :: (b - c) - a b c
To build my own arrow, i need to distinguish between different kinds
of b or c. For instance, if b has the form (d,e), i want to construct
On Fri, Jan 27, 2006 at 08:20:07PM +0100, Sven Biedermann wrote:
I have a problem with a function taken from class Arrow.
arr :: (b - c) - a b c
To build my own arrow, i need to distinguish between different kinds
of
b or c.
For instance, if b has the form (d,e), i want to
Haskell beginner using GHC.
I have a function to do some simple arithmetic at run time:
myeval :: Int - Int - String - Int
myeval x y + = (+) x y
myeval x y - = (-) x y
myeval x y * = (*) x y
-- ...
While that works, I'm curious to know if it can be done more
elegantly. I'm thinking of
Andrew Savige wrote:
Haskell beginner using GHC.
Hello there!
How about,
opTable
= [ (+, (+))
, (-, (-)) ... ]
myeval x y op
= let Just fun = lookup op opTable
in x `fun` y
?
I have a function to do some simple arithmetic at run time:
myeval :: Int - Int - String - Int
BTW: There isn't an easy way to magically derive opTable. We're relying
on the fact that these simple functions all have the same type.
Ben Lippmeier wrote:
opTable
= [ (+, (+))
, (-, (-)) ... ]
myeval x y op
= letJust fun = lookup op opTable
in x `fun` y
You could also
On 28/01/06, Andrew Savige [EMAIL PROTECTED] wrote:
Haskell beginner using GHC.
I have a function to do some simple arithmetic at run time:
myeval :: Int - Int - String - Int
myeval x y + = (+) x y
myeval x y - = (-) x y
myeval x y * = (*) x y
-- ...
While that works, I'm curious to
13 matches
Mail list logo