On Wed, Feb 4, 2009 at 1:09 PM, Manlio Perillo manlio_peri...@libero.it wrote:
In Haskell, something like
(/) :: (Num a, Real b) = a - a - b
You probably want (Real a, Fractional b) = a - a - b. Int is an
instance of Real... Real is the class of types that can be converted
to Rational.
Then
On Wed, Feb 4, 2009 at 2:03 PM, Manlio Perillo manlio_peri...@libero.it wrote:
Max Rabkin ha scritto:
[...]
Then we can define
(/.) :: (Real a1, Real a2, Fractional a) = a1 - a2 - a
x /. y = fromRational $ toRational x / toRational y
[...]
(//) :: (Integral b, Real a, Real a1
On Wed, Feb 4, 2009 at 9:38 PM, Benjamin L. Russell
dekudekup...@yahoo.com wrote:
Is it possible to write a self-referential function in Haskell that
modifies itself?
Is it possible to write *any* kind of function in Haskell that
modifies *anything*?
--Max
2009/1/30 Bryan O'Sullivan b...@serpentine.com:
On Fri, Jan 30, 2009 at 1:11 PM, Antony Courtney antony.court...@gmail.com
wrote:
A 2-D vector graphics library such as Java2D ( or Quartz on OS/X or
GDI+ on Windows ) supports things like computing tight bounding
rectangles for arbitrary
This traverses the list three times (reverse, init and last are each
linear time):
fromListEnd xs = Zipper (reverse $ init xs) (last xs) []
But we only need to do it once:
fromListEnd xs = let x:xs' = reverse xs in Zipper xs' x []
I don't *think* this has an effect on strictness/laziness, since
On Fri, Jan 16, 2009 at 7:46 AM, Dave Bayer ba...@cpw.math.columbia.edu wrote:
As a mathematician, Haskell has renewed my interest in category theory. I
had thought one learns category theory most easily at age 20, because it
paints such an eviscerated view of flesh-and-blood subjects like
2009/1/16 Andrew Wagner wagner.and...@gmail.com:
I've been playing around with this, but haven't been able to come up with
anything.
myFunc f (a,b) (c,d) = (f a c, f b d)
It feels as if there should be a nice simple version of this using some
combination of {un,}curry, on, , ***, or something
On Thu, Jan 15, 2009 at 3:16 PM, Cale Gibbard cgibb...@gmail.com wrote:
However, Appendable carries baggage with it which is highly
misleading. Consider, for instance, the monoid of rational numbers
under multiplication (which, by the way, is quite useful with the
writer transformed list monad
On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Do you have an example of
a macro that can't be replaced by higher-order functions and laziness?
I believe I do: one macro I found useful when writing a web app in
Lisp was something I called hash-bind, which binds
On Wed, Jan 14, 2009 at 11:11 AM, Alex Queiroz asand...@gmail.com wrote:
I have one for binding GET/POST variables to regular variables
transparently and with error checking, just inside the body of the
macro.
N! You reinvented PHP. What happens if a request variable shadows
the name
2009/1/14 Tim Wawrzynczak inforichl...@gmail.com:
The reason the macro is better is that the length of the list is known at
compile time, so you don't need to traverse the list to calculate the length
of the list.
Or you could use a real compiler (perhaps even a glorious one) that
does
On Thu, Jan 8, 2009 at 4:51 PM, Niklas Broberg niklas.brob...@gmail.com wrote:
So unless someone can
point out a good Unicode-aware editor for Windows, I'm afraid this is
a feature that won't be implemented.
A Windows port of a Unix editor? I know Vim is available on Windows.
Otherwise,
On Thu, Jan 8, 2009 at 6:36 AM, Cristiano Paris fr...@theshire.org wrote:
This avoids the possibility of having an unwanted/unknown behavior
from the run-time stack (for example, having the web server returning
a generic 500 Internal Server error report, filled with every sort of
goods a
On Thu, Jan 8, 2009 at 4:51 PM, Niklas Broberg niklas.brob...@gmail.com wrote:
So unless someone can
point out a good Unicode-aware editor for Windows, I'm afraid this is
a feature that won't be implemented.
A Windows port of a Unix editor? I know Vim is available on Windows.
Otherwise,
2009/1/5 Galchin, Vasili vigalc...@gmail.com:
Hello,
I have the following:
B.intercalate $ B.intercalate
ByteString
[ByteString]
[ByteString]
I get a type error with this. If I comment out the 2nd
On Mon, Jan 5, 2009 at 10:17 AM, Galchin, Vasili vigalc...@gmail.com wrote:
Hi Max,
That is what should happen The inner B.intercalate will produce
the ByteString to be used by the B.intercalate. ??
Vasili
Of course. My mistake. Ross Mellgren seems to be on the money though.
On Thu, Dec 18, 2008 at 3:55 PM, Duncan Coutts
duncan.cou...@worc.ox.ac.uk wrote:
However QuickCheck seems to be a case where
people now expect to use QC-2, but old packages that don't specify a
version typically only work with QC-1.x.
Can't we just fix those .cabal files?
--Max
On Thu, Dec 18, 2008 at 4:15 PM, Henning Thielemann
schlepp...@henning-thielemann.de wrote:
Extrapolating the habit of programmers from the past to the future, I
predict that Haskell can only become a mainstream language once there is
a cleaner, simpler, safer and more powerful programming
Hoogle is your friend:
Searching for String - [String] - String
Data.List intercalate :: [a] - [[a]] - [a]
base
intercalate xs xss is equivalent to (concat (intersperse xs xss)). It
inserts the...
Regards,
Max
On Wed, Dec 17, 2008 at 10:36 AM, Brian Hurt bh...@spnz.org wrote:
I know
On Sun, Nov 30, 2008 at 9:30 AM, Luke Palmer [EMAIL PROTECTED] wrote:
cross :: [a] - [b] - [(a,b)]
It's just kind of a pain (you build [(a,(b,(c,d)))] and then flatten
out the tuples). The applicative notation is a neat little trick
which does this work for you.
It seems to me like this
On Sat, Nov 22, 2008 at 11:31 AM, Owen Smith [EMAIL PROTECTED] wrote:
I'm a longtime Haskell-curious programmer who, after a few aborted
attempts at getting started and long nights staring at academic
papers, finally managed to get the bug. I've been pleased with my
progress so far, but a
On Thu, Nov 13, 2008 at 10:20 AM, Benjamin L. Russell
[EMAIL PROTECTED] wrote:
They also seem to have duplicated at least part of the rest of the
HaskellWiki.
It's a mirror that substitutes Monad for Warm, fuzzy thing
everywhere (if you follow links, you'll see the Haddocks for class
Warm,
HMM is a library for creating and manipulating Hidden Markov Models.
It contains implementations of the forward algorithm and Viterbi's
algorithm. It is still experimental, but I hope it can be of some
interest or use.
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hmm-0.1
--Max
101 - 123 of 123 matches
Mail list logo