myFoldl :: (a - b - a) - a - [b] - a
myFoldl f z xs = foldr step id xs z
where step x g a = g (f a x)
I know myFoldl implements foldl using foldr. However i really donot know how
it can do it ?
Please shed a light one me, thanks!
--
View this message in context:
yep I had some trouble too, although interestingly less than on linux
pc.
can you provide some error messages and we can see if your problems
are the same one's I saw.
I think most of my problem involved the location of the libraries.
Also I think that you are really going to want to have
zaxis wrote:
myFoldl :: (a - b - a) - a - [b] - a
myFoldl f z xs = foldr step id xs z
where step x g a = g (f a x)
I know myFoldl implements foldl using foldr. However i really donot know
how it can do it ?
Please shed a light one me, thanks!
Hi,
Nice example! Well this is
brian wrote:
yep I had some trouble too, although interestingly less than on linux pc.
can you provide some error messages and we can see if your problems are
the same one's I saw.
If this helps, here is the error message I got:
Configuring hmatrix-0.5.2.2...
Checking foreign libraries...
thanks for your quick answer!
As I understand foldr (\x g - g . (`f`x)) id xs will return a function
such as (`f` 3).(`f` 2).(`f` 1) . You have already made it clear ! However,
why does the step function below has three parameters ? I think foldr
will call step using two parameters, the
I know myFoldl implements foldl using foldr. However i really donot know how
it can do it ?
You will probably like
Graham Hutton
A Tutorial on the Universality and Expressiveness of Fold
JFP, 1999.
http://www.cs.nott.ac.uk/~gmh/fold.pdf
Section 5.1 (actually,
Stefan
You are trying to do something quite delicate here.
The whole idea of solving constraints in a co-inductive way (building a
recursive group of dictionary definitions) relies on spotting something we've
seen before to tie the knot. To date, the main application I knew for this
fairly
Actually, this UAC was already present in Vista no?
On Thu, Sep 10, 2009 at 4:18 AM, Jeff Wheeler j...@nokrev.com wrote:
On Wed, Sep 9, 2009 at 2:19 PM, Sebastian
Sylvansebastian.syl...@gmail.com wrote:
I think it's morally right to run as user by default. Yes, the windows
culture has some
Hi,
lately I've been working on a parallel parser whose core is something like this:
pMap parse blocks
where pMap is a map-like function sparking independent computations
over the elements of the blocks list.
The actual implementation used Control.Parallel.Strategies:
map parse blocks
Interestingly, a sudo for Windows does seem to exist. It's called the
runas command. At first sight it existed already since Windows XP
Also on Sourceforge an open source sudo command for Windows is hosted:
http://sourceforge.net/projects/sudowin
On Thu, Sep 10, 2009 at 11:21 AM, Peter
* zaxis z_a...@163.com [2009-09-10 00:51:21-0700]
thanks for your quick answer!
As I understand foldr (\x g - g . (`f`x)) id xs will return a function
such as (`f` 3).(`f` 2).(`f` 1) . You have already made it clear ! However,
why does the step function below has three parameters ? I
On Wed, 2009-09-09 at 20:19 +0100, Sebastian Sylvan wrote:
On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts
duncan.cou...@worc.ox.ac.uk wrote:
If the Windows users can come to a consensus on whether the
default should be global or user, then we can easily switch
On Thu, Sep 10, 2009 at 10:58 AM, Duncan Coutts duncan.cou...@worc.ox.ac.uk
wrote:
On Wed, 2009-09-09 at 20:19 +0100, Sebastian Sylvan wrote:
On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts
duncan.cou...@worc.ox.ac.uk wrote:
If the Windows users can come to a consensus on
On Wed, 2009-09-09 at 21:18 -0500, Jeff Wheeler wrote:
On Wed, Sep 9, 2009 at 2:19 PM, Sebastian
Sylvansebastian.syl...@gmail.com wrote:
I think it's morally right to run as user by default. Yes, the windows
culture has some legacy that may, on occasion, make it slightly harder to
use
2009/9/10 Sebastian Sylvan sebastian.syl...@gmail.com:
On Thu, Sep 10, 2009 at 10:58 AM, Duncan Coutts
duncan.cou...@worc.ox.ac.uk wrote:
On Wed, 2009-09-09 at 20:19 +0100, Sebastian Sylvan wrote:
On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts
duncan.cou...@worc.ox.ac.uk wrote:
Thanks to reactions!
What do you think about such a function? This function is
still a bit dangerous (I think). I don't know how to make
sure the compiler does not lift cache to something global.
But on the other hand this use of unsafePerformIO is legit
because it doesn't alter the referential
the haskell prelude introduces the type undefined and contains a remark to the
effect that compilers are expected to intrudocue a meaningful error message.
GHC just prints 'Prelude undefined' which is not very informativ.
is there a way to have different kinds of undefined? such that i get a
Hello staafmeister,
Thursday, September 10, 2009, 3:54:34 PM, you wrote:
What do you think about such a function? This function is
a bit of refactoring
-- global variable in haskell way
cache = unsafePerformIO $ newIORef M.empty
memo f x = unsafePerformIO$ do
m -
Hello Andrew,
Thursday, September 10, 2009, 4:02:27 PM, you wrote:
is there a way to have different kinds of undefined? such that i get a message
which one was hit. something like writing in the code 'unefined 'my error 123'
which prints 'undefined - my error 123' when it is accidentally hit.
You can use the error function. It accepts a string that is displayed
when the error is evaluated:
GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ...
Hi Bulat,
Bulat Ziganshin-2 wrote:
Hello staafmeister,
Thursday, September 10, 2009, 3:54:34 PM, you wrote:
What do you think about such a function? This function is
a bit of refactoring
-- global variable in haskell way
cache = unsafePerformIO $ newIORef M.empty
memo f x =
No Windows XP did not have support for roaming profiles yet I think.
But it wouldn't be too difficult to use %LOCALAPPDATA% first, and when
it doesn't exist, use %APPDATA%?
This article explains a lot about the differences; I didn't have time
yet to read it in detail
You might want to watch out for multithreading issues, although in
this case, I don't think it will cause sever problems, besides a
couple of redundant cache updates.
On Thu, Sep 10, 2009 at 2:07 PM, Bulat Ziganshin
bulat.zigans...@gmail.com wrote:
Hello staafmeister,
Thursday, September 10,
On Thu, Sep 10, 2009 at 11:47 AM, Roman Cheplyaka r...@ro-che.info wrote:
step x g a = g (f a x)
is, thanks to currying, another way to write
step x g = \a - g (f a x)
I thought currying just meant
curry f x y = f (x,y)
Isn't the reason that
f x y z = body
is the same as
f = \x - \y
Is there any %LOCALAPPDATA% on Windows XP? If not, what is the
difference between %LOCALAPPDATA% and %APPDATA% in Windows Vista/7?
XP does not define the %LOCALAPPDATA% environment variable, but it is
equivalent to %USERPROFILE%\Local Settings\Application Data.
Data in local application data
Hello staafmeister,
Thursday, September 10, 2009, 4:23:26 PM, you wrote:
This doesn't work and is exactly what I'm afraid the compiler is going to
do. Cache needs to
be associated with the function f.
Otherwise one would get conflicts
well, technique i used is well known, we would have
One way in which cabal can be made UAC aware (and therefore request for
elevation privileges instead of just failing) would be to embed a manifest
in the cabal.exe. This can be done by changing the default manifest (an XML
file) that is embedded at link time by GHC. This is supported by GHC
* Peter Verswyvelen bugf...@gmail.com [2009-09-10 14:43:10+0200]
On Thu, Sep 10, 2009 at 11:47 AM, Roman Cheplyaka r...@ro-che.info wrote:
step x g a = g (f a x)
is, thanks to currying, another way to write
step x g = \a - g (f a x)
I thought currying just meant
curry f x y = f
Dear all,
We like to announce the release of a Haskell binding to Manolis
Lourakis's C levmar library at:
http://www.ics.forth.gr/~lourakis/levmar/
This library implements the Levenberg-Marquardt algorithm which is an
iterative technique that finds a local minimum of a function that is
On Thu, Sep 10, 2009 at 14:43, Peter Verswyvelen wrote:
On Thu, Sep 10, 2009 at 11:47 AM, Roman Cheplyaka wrote:
step x g a = g (f a x)
is, thanks to currying, another way to write
step x g = \a - g (f a x)
I thought currying just meant
curry f x y = f (x,y)
Isn't the reason
Hi Regis,
- use windows API for requesting elevation during the process (ugly)
Why is this ugly? This seems like an elegant solution, to get privileges only
when you actually need them?
Gr.
Matthijs
signature.asc
Description: Digital signature
___
Hello Matthijs,
Thursday, September 10, 2009, 5:24:57 PM, you wrote:
- use windows API for requesting elevation during the process (ugly)
Why is this ugly? This seems like an elegant solution, to get privileges only
when you actually need them?
afaik you need to run special COM server with
I'm not familiar with cabal source code enough to actually assess how much
of a problem it would be but I assumed so because:
- one would need to identify the exact location in the cabal code where
elevation will be required. That means one would have to check if a folder
where cabal wishes to
One last note as it may be confusing in previous message...I mention to use
windows API, but there is no API per-se that can elevate a process already
running. It takes to create another process which, at startup time, will
popup the elevation dialog. The win32 function to call is therefore just
Hello Regis,
Thursday, September 10, 2009, 6:05:19 PM, you wrote:
One last note as it may be confusing in previous message...I mention to use
windows API, but there is no API per-se that can elevate a process already
running. It takes to create another process which, at startup time, will
Hi,
I'm having trouble installing OpenGL through cabal. It fails when it
tries to install OpenGLRaw with this error message:
cabal: Missing dependency on a foreign library:
* Missing C library: GL
I'm running OS X Leopard and have Xcode 3.1.3 installed. Do i have to
install something separate
On Thu, Sep 10, 2009 at 05:23:26AM -0700, staafmeister wrote:
To: haskell-cafe@haskell.org
From: staafmeister g.c.stave...@uu.nl
Date: Thu, 10 Sep 2009 05:23:26 -0700 (PDT)
Subject: Re: Re[Haskell-cafe] [2]: memoization
Hi Bulat,
Bulat Ziganshin-2 wrote:
Hello staafmeister,
Hi everyone,
I want to remind all functional programmers currently in The
Netherlands of the Dutch Haskell User Group [1, 2] meeting tomorrow at
19:00 [3].
The meeting will be in Booth Hall [4] of the Utrecht University
Library, where we'll have three talks. There's free car parking [5] at
the
I have a number of functions which have some arguments and produce a single
result. all the arguments are in a heterogenous list and the results should
update the list. this appears somewhat similar to the keyword-argument
solution for functions proposed by oleg kiselyov in 2004.
i would like
instead o that you can use a key such is:
key :: a - Int
key = unsafePerformIO . hashStableName . makeStableName
that is defined for any kind of data
then, a unique key for the pair f x could be:
key1 f x=(key f , key x)
However my experience is that ocassionally gives different hashes for
My problems were resolved by removing MacPorts from the system and
adding 32-bit flags to runhaskell---apparently its zlib was
interfering, as well as the runhaskell/runghc problems.
Thank you for the advice,
Brian
On Wed, Sep 9, 2009 at 3:49 AM, Christian Maeder
christian.mae...@dfki.de wrote:
key x= unsafePerformIO $makeStableName x = return . hashStableName
sorry
2009/9/10 Alberto G. Corona agocor...@gmail.com
instead o that you can use a key such is:
key :: a - Int
key = unsafePerformIO . hashStableName . makeStableName
that is defined for any kind of data
then, a
2009/9/9 Stefan Holdermans ste...@cs.uu.nl
Dear Martin,
By black-holing you probably mean co-induction. That is,
if the statement to proven appears again, we assume it must hold.
However, type classes are by default inductive, so there's no
easy fix to offer to your problem.
A propos:
One simple solution is to leave the state in Qt.
As of Qt 4.2, in C++ you can use
bool QObject::setProperty(const char * name, const QVariant value)
QVariant QObject::property(const char * name) const
to set and get properties on any QObject (hence any QWidget).
Since I believe these are
On Sun, 6 Sep 2009, Johan Jeuring wrote:
The primary features of Palindromes include:
* Linear-time algorithm for finding exact palindromes
* Linear-time algorithm for finding text palindromes,
ignoring spaces, case of characters, and punctuation
symbols.
You made me curious, whether
On Wed, 2009-09-09 at 18:29 -0700, Michael P Mossey wrote:
I'm trying to learn qtHaskell. I realize few people on this list know
anything
about qtHaskell, but I have a question that probably relates to all GUIs as
implemented in Haskell. I just need a hint that could help me figure out the
Dan Weston wrote:
One simple solution is to leave the state in Qt.
As of Qt 4.2, in C++ you can use
bool QObject::setProperty(const char * name, const QVariant value)
QVariant QObject::property(const char * name) const
to set and get properties on any QObject (hence any QWidget).
Duncan Coutts wrote:
On Wed, 2009-09-09 at 18:29 -0700, Michael P Mossey wrote:
I'm trying to learn qtHaskell. I realize few people on this list know anything
about qtHaskell, but I have a question that probably relates to all GUIs as
implemented in Haskell. I just need a hint that could
Our binding consists of three packages:
* http://hackage.haskell.org/package/bindings-levmar-0.1
Which were the changes you needed to do to the library code? I
believe this is going to cause you two problems: maintenance (as
you can't always be sure the patched version didn't introduce a
bug)
On Thu, Sep 10, 2009 at 6:34 AM, Peter Verswyvelen bugf...@gmail.com wrote:
You might want to watch out for multithreading issues, although in
this case, I don't think it will cause sever problems, besides a
couple of redundant cache updates.
On Thu, Sep 10, 2009 at 2:07 PM, Bulat Ziganshin
Is there any particular reason to not move the instance to the
prelude? A module was failing when imported from one place and ok
when imported from another, so I spent a frustrating 10 minutes
searching for the instance. I couldn't find a way to search haddock
for instances (not even grep on the
On Thu, Sep 10, 2009 at 5:46 PM, Luke Palmer lrpal...@gmail.com wrote:
However, because the body of cache didn't depend on f, we can use
lambda calculus rules to lift the let outside the lambda. So your
transformation is completely valid... And yet, the original code
works, and Bulat's
52 matches
Mail list logo