>I have two functions
>
>> fos:: Num a -> [a] -> [a]
>> fos a x = fos' a 0 x
>
>> fos':: Num a -> a -> [a] -> [a]
>> fos' _ _ [] = []
>> fos' a y1 (x:xs) = y : fos' a y xs
>>where y = a * y1 + x
First of all, I think your type signatures are wrong, unless
I'm guessing that the problem is that
fos -0.5 [1,1,1,1]
is being parsed as
((fos) - (0.5)) [1,1,1,1]
so that the 0.5 implies an instance of class Fractional which implies
by the type of (-)
(-) :: Num a => a -> a -> a
that fos is al
At 03:12 -0800 1998/11/09, Simon Peyton-Jones wrote:
>* Default default. Still undecided (sigh). Should it be
> (Int, Float)
> (Integer, Double)
> (Integer, Rational)
> Several folk want Integer, but don't say whether they want Float,Double,
> Rational.
I think the def
At 01:58 -0800 1998/11/09, Simon Peyton-Jones wrote:
>Following many protests, the right thing to do seems
>to be to move MonadPlus to the Monad library. Specifically:
>
> class Monad m => MonadPlus m where
> mzero :: m a
> mplus :: m a -> m a -> m a
It seems me that the
| Twenty years later, must we really settle for primitive modulo-word-size
| arithmetic as the default?
|
| And many others support Integer over Int as the default default.
|
| So do I, if it's done right. But we already decided that doing it right
| is too hard for Haskell 98; it will have
I have been reading about the integrated runtime system between GHC and
Hugs. Now that GHC 4.0 is out, what is the status of the hugs ghc
integration project?
1. Does hugs now support mutually recursive modules?
2. Does the new GHC support TREX? If yes, how does one enable it?
3. Are the lite
Hi Simon, you spake of simple-context restriction:
> My default position is not to change. Question: who, apart from
> Ralf, has actually tripped over the lack of contexts of the
> form (C (a t1 .. tn)) in Haskell 1.4?
*raises hand and jumps up and down* Me, mememe! I provided you
with
Lennart wrote:
>PS. Or maybe you're firmly in the Microsludge camp now
>where source code is never revealed? :-) :-)
H/Direct and HaskellScript are neither trick nor treat to them
(http://www.opensource.org/halloween.html) yet.
Anyway, you probably don't *want* to see their source code, judging
I have two functions
> fos:: Num a -> [a] -> [a]
> fos a x = fos' a 0 x
> fos':: Num a -> a -> [a] -> [a]
> fos' _ _ [] = []
> fos' a y1 (x:xs) = y : fos' a y xs
>where y = a * y1 + x
Why does
> fos -0.5 [ 1, 1, 1, 1 ]
give me
[a] -> b -> [b] -> [b] i
Koen Claessen:
> Clearly, one would like to define the following default definition as
> well:
>
> negate x = 0 - x
Perhaps somebody noticed that already, but also for Fractional
objects (which I would love to see belonging to the Field class...)
one should have the default: x/y = x * re
Colin writes:
Another aspect of your comment that troubles me is the strong
implication that if the default were Integer, things would not be `done
right'. Presumably you mean that it would be painful to make use of a
Prelude with Int-based standard functions? If so, then the current
On Sat, 7 Nov 1998, Fergus Henderson wrote:
> > Well, it depends on what you call *strong*. The only reason that I heard is
> > that it prevents users from making possibly unwanted errors.
>
> Another reason is that allowing definitions to be split up
> without any special syntax indicating this
I have posted a literate Haskell module "Fuzzy_oscillator"
in our collection of Haskell modules:
http://www.numeric-quest.com/haskell/
You may also download it as a gzipped bundle (containingg 9 plots)
according to downloading instructions on that page.
Credits go to Gary Meehan and Mike
> This message summarises where we are. The web page
> http://research.microsoft.com/Haskell/haskell98-final.html
> is up to date.
I am sorry to be so careless. The URL should be
http://research.microsoft.com/Users/simonpj/Haskell/haskell98-final.html
Simon
Folks,
I want to thank everyone who's contributed to the Haskell 98
discussion; it's been very helpful to me. However, to save
the bandwidth of those who are less interested, pls consider
replying direct to me, and other contributors on a particular
topic, where the focus is narrow. (I'd start
Following many protests, the right thing to do seems
to be to move MonadPlus to the Monad library. Specifically:
class Monad m => MonadPlus m where
mzero :: m a
mplus :: m a -> m a -> m a
filterM :: MonadZero m => (a -> m Bool) -> [a] -> m [a]
guard
16 matches
Mail list logo