On Wed, Feb 4, 2009 at 5:32 AM, Benjamin L. Russell
dekudekup...@yahoo.com wrote:
If neither #haskell nor #haskell-in-depth is appropriate,
perhaps they would feel more comfortable in a
Haskell-beginners-specific channel?
The danger with that is the only people who go there are beginners
On Wed, Feb 4, 2009 at 04:42, Thomas Davie tom.da...@gmail.com wrote:
Shinyness indeed – a quick note though, as ghc doesn't support dynamic
linking of Haskell code, the above is equivalent to the GPL.
I always use LGPL. Anyway, I will keep it that way, as I still have hopes on
dynamic
On Wed, 4 Feb 2009 09:35:03 +, Dougal Stanton ith...@gmail.com
wrote:
On Wed, Feb 4, 2009 at 5:32 AM, Benjamin L. Russell
dekudekup...@yahoo.com wrote:
If neither #haskell nor #haskell-in-depth is appropriate,
perhaps they would feel more comfortable in a
Haskell-beginners-specific
Hello,
I would like to announce the first release of UrlDisp.
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/UrlDisp
It's a small library for URL dispatching (aka routing). Right now it works
with CGI, and should be compatible with FastCGI as well (not tested).
Happstack
Max Vasin wrote:
Wouldn't it be more correct to separate binary IO, which
return [Word8] (or ByteString) and text IO which return
[Char] and deal with text encoding? IIRC that was done in
Bulat Ziganshin's streams library.
That's exactly what I meant.
Text IO could be then implemented on
Ian Lynagh wrote:
On Fri, Jan 16, 2009 at 06:42:46AM -0800, eyal.lo...@gmail.com wrote:
Closed-unqualified import:
import Data.Map(Map, lookup)
One problem with this style is that you can get lots of conflicts from
your VCS if you have multiple people working on the same module.
Right; in
On Wed, 2009-02-04 at 13:31 +, Simon Marlow wrote:
Duncan Coutts wrote:
On Tue, 2009-02-03 at 11:03 -0600, John Goerzen wrote:
Will there also be something to handle the UTF-16 BOM marker? I'm not
sure what the best API for that is, since it may or may not be present,
but it
Hi,
has anyone yet been using Sigbjorns COM package?
Sigbjorn hasn't had the time yet to gather some docs on how to use it, so
I wonder if someone else could post some examples on how to use it. I'm
asking because I need to do some COM stuff with excel, which I know how to
do in another
Simon Marlow wrote:
The only change to the existing behaviour is that by default, text IO
is done in the prevailing encoding of the system. Handles created by
openBinaryFile use the Latin-1 encoding, as do Handles placed in
binary mode using hSetBinaryMode.
wouldn't be semantically correct
Matt's code is pretty comprehensive.
His LU implementation is much cleaner, essentially because he used the
ijk format, while I used the kij.
I'll take a look and e-mail him eventually.
Thanks!
On Tue, Feb 3, 2009 at 23:26, Paulo Tanimoto tanim...@arizona.edu wrote:
Hi Rafael,
2009/2/3
Hi.
During some experiments with Python and Haskell I found some important
differences about how some integer and float operations are implemented.
The first difference is about a `mod` b, when a and b are Float types.
Python use the fmod function, and it also implement divmod; Haskell
Bulat Ziganshin wrote:
Hello haskell-cafe,
pure functional denotation for crisis:
(_|_)
Buy ⊥, sell ⊤!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Sun, Feb 1, 2009 at 1:37 AM, John MacFarlane j...@berkeley.edu wrote:
Not too hard, I think. Here's code for something similar (for graphviz
diagrams), derived from plugins/DotPlugin.hs in SVN pandoc.
transform :: Block - IO Block
transform (CodeBlock (id, classes, namevals)
You might be interested in some of the recent work by Leo Meyerovich
et al. at Berkeley. They wanted to parallelize CSS processing, and
found they had to construct a simplified, orthogonal version of CSS
and express their algorithms in terms of that subset.
This is very much work in
Duncan Coutts wrote:
On Tue, 2009-02-03 at 11:03 -0600, John Goerzen wrote:
Will there also be something to handle the UTF-16 BOM marker? I'm not
sure what the best API for that is, since it may or may not be present,
but it should be considered -- and could perhaps help autodetect encoding.
Conal Elliott wrote:
I've been wondering for a while now what a well-designed alternative to CSS
could be, where well-designed would mean consistent, composable, orthogonal,
functional, based on an elegantly compelling semantic model (denotational).
Me too. I think there are several aspects
Paolo Losi пишет:
wouldn't be semantically correct for a binary handle
to return [Word8]?
Wouldn't it be more correct to separate binary IO, which
return [Word8] (or ByteString) and text IO which return
[Char] and deal with text encoding? IIRC that was done in
Bulat Ziganshin's streams
Paolo Losi wrote:
Simon Marlow wrote:
The only change to the existing behaviour is that by default, text IO
is done in the prevailing encoding of the system. Handles created by
openBinaryFile use the Latin-1 encoding, as do Handles placed in
binary mode using hSetBinaryMode.
wouldn't be
I put up a small Monad explanation (I wouldn't quite call it
a tutorial):
http://www.thenewsh.com/~newsham/haskell/monad.html
The intent here is to is to have a short description of what
a Monad is that is approachable by Haskell beginners or non-
Haskell programmers who are looking for an
This is nice and simple. My only concern is I'm not sure there's enough of a
distinction between Monad and State Monad. That is, I'm not sure it's
clear enough that the way you're binding the small programs together in the
initial example is only one way you could bind them together, and thus it's
Hello Haskell Cafe,
I just wanted to inform you that the Happstack project has shipped it's 0.1
release. For those of you who don't know, Happstack is the successor for the
HAppS project. More details on the release can be found at
http://blog.happstack.com/2009/02/03/happstack-01-released .
Manlio Perillo wrote:
The first difference is about a `mod` b, when a and b are Float types.
Python use the fmod function, and it also implement divmod; Haskell seems to
lack support for this operation.
Yes, Haskell does not implement the full IEEE. There are
differing opinions about that:
2009/2/3 Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com:
After a discussion on whether is possible to compile hmatrix in
Windows, I decided to go crazy and do a LU decomposition entirely in
Haskell...
import Data.Array.IArray
...
e_an i j=a!(i,j)-(lik
Manlio Perillo wrote:
The first difference is about a `mod` b, when a and b are Float types.
Python use the fmod function, and it also implement divmod; Haskell seems to
lack support for this operation.
I wrote:
Yes, Haskell does not implement the full IEEE.
I spoke too soon. Data.Fixed.mod'
I am somewhat of a beginner with DPH and wanted to ask a few (maybe
elementary) questions.
There appear to be two main libraries - regular and unlifted. I was a
little unclear on the difference between the two and was hoping to get some
clarification. If you use the 'regular' api, it seems that
For me, the key to understanding monads was that monad is a value
that know how to apply functions to itself. Or, more correctly, a
container that knows how to apply functions to whatever is inside it.
Before understanding this I read a lot of tutorials that presented
monads as computations, IO
For me, the key to understanding monads was that monad is a value
that know how to apply functions to itself. Or, more correctly, a
container that knows how to apply functions to whatever is inside it.
Before understanding this I read a lot of tutorials that presented
monads as computations, IO
On Wed, Feb 4, 2009 at 12:16 PM, Tymur Porkuian
shooshpanch...@gmail.com wrote:
For me, the key to understanding monads was that monad is a value
that know how to apply functions to itself. Or, more correctly, a
container that knows how to apply functions to whatever is inside it.
You've just
On Wed, 2009-02-04 at 22:16 +0200, Tymur Porkuian wrote:
For me, the key to understanding monads was that monad is a value
that know how to apply functions to itself. Or, more correctly, a
container that knows how to apply functions to whatever is inside it.
Close. (Monads are not `values'
On Wed, Feb 4, 2009 at 17:09, Dan Piponi dpip...@gmail.com wrote:
2009/2/3 Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com
:
After a discussion on whether is possible to compile hmatrix in
Windows, I decided to go crazy and do a LU decomposition entirely in
Yitzchak Gale ha scritto:
Manlio Perillo wrote:
[...]
The second difference is about the division of two integers.
fac(777) / fac(777)
1.0
Here CPython does not convert the two integers to float before to divide
them, but make use of a special algorithm.
GHC, instead, returns NaN
No,
Actually, I understand these types in terms of containers that
override standard method of function application for their contents.
In fact, there may be no contents, or several items, or nothing at
all, or something strange, but the container behaves like there is a
value of some type inside it.
On Wed, Feb 4, 2009 at 12:57 PM, Rafael Gustavo da Cunha Pereira Pinto
rafaelgcpp.li...@gmail.com wrote:
Those different representations are derived from my (very) low Haskell
handicap! :-D
BTW That wasn't intended in any way as a criticism. I think it's
interesting to look at real matrix code
On Wed, Feb 4, 2009 at 11:41 AM, Tim Newsham news...@lava.net wrote:
I put up a small Monad explanation (I wouldn't quite call it
a tutorial):
http://www.thenewsh.com/~newsham/haskell/monad.htmlhttp://www.thenewsh.com/%7Enewsham/haskell/monad.html
The values of the IO monad are programs
On Wed, 2009-02-04 at 23:13 +0200, Tymur Porkuian wrote:
Actually, I understand these types in terms of containers that
override standard method of function application for their contents.
Huh? You can't actually over-ride function application --- Haskell's
built-in application always does
Manlio Perillo ha scritto:
[...]
I personally prefer the Python solution, where we have two operators
with the same behaviour over all the numbers.
In Haskell, something like
(/) :: (Num a, Real b) = a - a - b
This should be
(/) :: (Num a, Fractional b) = a - a - b
but I'm not sure it is
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
Prelude let i2fDiv a b = fromIntegral a / fromIntegral b
Prelude :t i2fDiv
i2fDiv :: (Integral a, Fractional b, Integral a1) =
a - a1 - b
Prelude 10 `i2fDiv` 3
3.3335
That what you're looking for?
-Ross
On Feb 4, 2009, at 4:22 PM, Manlio Perillo wrote:
Manlio
On Wed, Feb 4, 2009 at 19:14, Dan Piponi dpip...@gmail.com wrote:
On Wed, Feb 4, 2009 at 12:57 PM, Rafael Gustavo da Cunha Pereira Pinto
rafaelgcpp.li...@gmail.com wrote:
Those different representations are derived from my (very) low Haskell
handicap! :-D
BTW That wasn't intended in any
On Wed, Feb 4, 2009 at 1:50 AM, Achim Schneider bars...@web.de wrote:
I don't believe that it's possible to draw a clear destinction between
concerns the programmer and concerns the designer. In fact, I get
offended by the notion that I'm inherently incapable of distinguishing
readable from
Ross Mellgren ha scritto:
Prelude let i2fDiv a b = fromIntegral a / fromIntegral b
Prelude :t i2fDiv
i2fDiv :: (Integral a, Fractional b, Integral a1) =
a - a1 - b
Prelude 10 `i2fDiv` 3
3.3335
Prelude fac 777 `i2fDiv` fac 777
NaN
That what you're looking for?
No.
I'm looking for an exact integer division that avoids overflows, if
possible.
Use Data.Ratio:
*Main Data.Ratio (fac 777) / (4 * fac 776) :: Ratio Integer
777%4
Convert to a float , if you want, before displaying it.
___
Haskell-Cafe mailing
Manlio Perillo wrote:
fac(777) / fac(777)
1.0
Here CPython does not convert the two integers to float before to divide
them, but make use of a special algorithm.
GHC, instead, returns NaN
I wrote:
No, actually here Haskell shines. Perhaps this GHCi session
will illuminate the issue for
Hi
I'm currently working on hacking Data.Generics for my master thesis.
I'm basically trying to find out whether it can be made a bit faster
using e.g. rewrite rules. The problem I'm having is that I need an
easy way to import my own modified version of Data.Generics (currently
located in the
Huh? You can't actually over-ride function application --- Haskell's
built-in application always does exactly the same thing, at every type.
It's a metaphor. In every case container has its own method of
applying functions to its contents - e.g. instead of f x we write x
fmap f.
You can,
It's a metaphor. In every case container has its own method of
applying functions to its contents - e.g. instead of f x we write x
fmap f.
x `fmap` f, of course
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
x `fmap` f
disregard that, f `fmap` x
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Manlio Perillo wrote:
No.
I'm looking for...
Manlio - can you describe exactly what you want?
Do you know exactly what you want?
You have said that you want division like in Python -
but that even that is not well defined:
Python 2.6.1
3/5
0
Python 3.1
3/5
0.59998
Please tell
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) = a - a1 - b
x // y = floor $ toRational x / toRational y
Hope that helps,
Max
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) = a
Yitzchak Gale ha scritto:
Manlio Perillo wrote:
No.
I'm looking for...
Manlio - can you describe exactly what you want?
Do you know exactly what you want?
You have said that you want division like in Python -
but that even that is not well defined:
Python 2.6.1
3/5
0
You have to:
from
Yitzchak Gale ha scritto:
[...]
exactDiv :: (Real a, Real b, Fractional c) = a - b - c
x `exactDiv` y = realToFrac x / realToFrac y
Python does that same type coercion automatically at runtime.
No, this is not correct.
CPython converts to float only for a simple integer (since conversion
Manlio Perillo ha scritto:
[...]
Here is an Haskell version:
http://paste.pocoo.org/show/102801/
On my system it takes 30 seconds.
Sorry, I compiled without optimizations enabled.
With -O2 it now runs in 20 seconds.
What other optimizations should I enable?
Thanks Manlio Perillo
What other optimizations should I enable?
-fexcess-precision or some such
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Max Rabkin ha scritto:
[...]
Here is an Haskell version:
http://paste.pocoo.org/show/102801/
On my system it takes 30 seconds.
You're only dividing integers by integers to get Doubles.
x /. y = fromIntegral x / fromIntegral y
works just fine in this case.
No, this *does not works*.
I
On Wed, 2009-02-04 at 23:55 +0200, Tymur Porkuian wrote:
Huh? You can't actually over-ride function application --- Haskell's
built-in application always does exactly the same thing, at every type.
It's a metaphor.
Oh, right. That one word that means `inaccurate way of putting things'!
Thomas DuBuisson ha scritto:
What other optimizations should I enable?
-fexcess-precision or some such
There is pratically no performance gain (maybe about 1 second).
Thanks Manlio Perillo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
For low-level or obscure questions about GHC such as this, it might be
better to use glasgow-haskell-us...@haskell.org. There are one or two
people who don't read haskell-cafe because it's so busy (and they're so
busy).
--
Robin
On Wed, 4 Feb 2009 22:54:15 +0100
Deniz Dogan
Manlio Perillo wrote:
However there is still a *big* problem: it is inefficient.
Here is a Python version of the Chudnovsky algorithm [1] for computing Pi:
http://paste.pocoo.org/show/102800/
On my system it takes 10 seconds.
Here is an Haskell version:
http://paste.pocoo.org/show/102801/
Yitzchak Gale ha scritto:
Manlio Perillo wrote:
However there is still a *big* problem: it is inefficient.
Here is a Python version of the Chudnovsky algorithm [1] for computing Pi:
http://paste.pocoo.org/show/102800/
On my system it takes 10 seconds.
Here is an Haskell version:
On Thu, 2009-02-05 at 01:10 +0100, Manlio Perillo wrote:
Yitzchak Gale ha scritto:
In our case, the Python division first does a quick estimate
of the sizes of the two integers, and just returns zero if it
sees that there will be underflow on conversion to double.
So I made the following
On Wed, 4 Feb 2009, Simon Marlow wrote:
Ian Lynagh wrote:
On Fri, Jan 16, 2009 at 06:42:46AM -0800, eyal.lo...@gmail.com wrote:
Closed-unqualified import:
import Data.Map(Map, lookup)
One problem with this style is that you can get lots of conflicts from
your VCS if you have multiple
On Wed, Feb 4, 2009 at 4:22 PM, Henning Thielemann
lemm...@henning-thielemann.de wrote:
On Wed, 4 Feb 2009, Simon Marlow wrote:
Ian Lynagh wrote:
On Fri, Jan 16, 2009 at 06:42:46AM -0800, eyal.lo...@gmail.com wrote:
Closed-unqualified import:
import Data.Map(Map, lookup)
One problem
On 5 Feb 2009, at 10:20 am, Gregg Reynolds wrote:
That's a fairly common representation, seems to work for lots of
people, but it caused me no end of trouble. Values are mathematical
objects; how, I asked myself, can they possibly /be/ programs that
do IO (or actions, or computations, or
On 5 Feb 2009, at 10:38 am, Manlio Perillo wrote:
I'm looking for an exact integer division that avoids overflows, if
possible.
What this sounds like to me is a request that the Prelude
function 'fromRational' should work well. Since
The floating point literal f is equivalent to
On Thu, Feb 5, 2009 at 2:52 AM, Seth Gordon se...@ropine.com wrote:
Bulat Ziganshin wrote:
Hello haskell-cafe,
pure functional denotation for crisis:
(_|_)
Buy ⊥, sell ⊤!
so you're saying the T industry is going to be the next growth industry?
-markb
Shall I send this patch? (1/1) [ynWvpxqadjk], or ? for help: y
Error in execvp: No such file or directory
darcs: timer_settime: Invalid argument
Failed to execute external command: /usr/sbin/sendmail -i -t
Lowlevel error: execvp: Illegal seek
Redirects: (File
On Thu, 5 Feb 2009 15:18:09 +1300, Richard O'Keefe
o...@cs.otago.ac.nz wrote:
On 5 Feb 2009, at 10:20 am, Gregg Reynolds wrote:
That's a fairly common representation, seems to work for lots of
people, but it caused me no end of trouble. Values are mathematical
objects; how, I asked
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/2/5 Galchin, Vasili vigalc...@gmail.com:
Shall I send this patch? (1/1) [ynWvpxqadjk], or ? for help: y
Error in execvp: No such file or directory
darcs: timer_settime: Invalid argument
Failed to execute external command: /usr/sbin/sendmail -i -t
Lowlevel error: execvp: Illegal seek
70 matches
Mail list logo