G'day all.
Quoting wren ng thornton :
Most of the (particular) problems OO design patterns solve are
non-issues in Haskell because the language is more expressive.
...and vice versa. Some of the "design patterns" that we use in
Haskell, for example, are to overcome the fact that Haskell does
Hi all:
I have just created an haskell work toolset project in google code.
Currently there are only a few tools to process YUV image files I wrote
before.
Welcome you attend in to improve my code or to add in your tools.
And also pleasure to get your advices.
http://code.googl
i can try to fix it if i can get some help. i've never used cabal.
any idea why i am getting this:
anato...@anatolyy-linux /shared/anatolyy/hsffig-1.0 $ cabal install
Warning: HSFFIG.cabal: The field "hs-source-dir" is deprecated, please use
"hs-source-dirs"
Warning: HSFFIG.cabal: The field "hs-s
On Sun, Mar 15, 2009 at 8:40 PM, Alexander Dunlap <
alexander.dun...@gmail.com> wrote:
>
> I have noticed that in both Data.Binary and Data.Text (which is still
> experimental, but still), the "decode" functions can be undefined
> (i.e. bottom) if they encounter malformed input.
>
For decoding Un
By default GMP builds for x86_64. Do ./configure ABI=32 to build 32-
bit libraries for GHC.
On Mar 15, 2009, at 10:54 PM, Dean Herington wrote:
I'm trying to install GHC 6.10.1 on Mac OS X 10.5 (PowerPC). I
installed Xcode 3.1.2. I built libgmp 4.2.4 and installed it in /
usr/local/lib.
I'm trying to install GHC 6.10.1 on Mac OS X 10.5 (PowerPC). I
installed Xcode 3.1.2. I built libgmp 4.2.4 and installed it in
/usr/local/lib. When I do "./configure" in GHC's dist directory,
however, I get:
bash-3.2$ ./configure
checking build system type... powerpc-apple-darwin9.6.0
check
Hi all,
I have noticed that in both Data.Binary and Data.Text (which is still
experimental, but still), the "decode" functions can be undefined
(i.e. bottom) if they encounter malformed input.
What is the preferred way to use these functions in a safe way? For
example, if one writes data to a dis
On Sun, 2009-03-15 at 18:11 -0700, Ryan Ingram wrote:
> On Sun, Mar 15, 2009 at 1:56 PM, Jonathan Cast
> wrote:
> >> But not if you switch the (x <- ...) and (y <- ...) parts:
> >>
> >> main = do
> >> r <- newIORef 0
> >> v <- unsafeInterleaveIO $ do
> >> writeIORef r 1
> >>
On Sun, Mar 15, 2009 at 1:56 PM, Jonathan Cast
wrote:
>> But not if you switch the (x <- ...) and (y <- ...) parts:
>>
>> main = do
>> r <- newIORef 0
>> v <- unsafeInterleaveIO $ do
>> writeIORef r 1
>> return 1
>> y <- readIORef r
>> x <- case f v of
>>
Yusaku Hashimoto wrote:
Hello,
I was studying about what unsafeInterleaveIO is.I understood
unsafeInterleaveIO takes an IO action, and delays it. But I couldn't
find any reason why unsafeInterleaveIO is unsafe.
I have already read an example in
http://www.haskell.org/pipermail/haskell-cafe/2009
On Mon, 2009-03-16 at 01:04 +0100, Daniel Fischer wrote:
> Am Montag, 16. März 2009 00:47 schrieb Jonathan Cast:
> > On Mon, 2009-03-16 at 00:14 +0100, Daniel Fischer wrote:
> >
> > > > > However, I understand
> > > > > "unsafeInterleaveIO allows IO computation to be deferred lazily. When
> > > > >
R J wrote:
I need to write an implementation using foldl, and a separate implementation using foldr,
of a function, "remdups xs", that removes adjacent duplicate items from the
list xs. For example, remdups [1,2,2,3,3,3,1,1]= [1,2,3,1].
My approach is first to write a direct recursion, as fol
R J schrieb:
This Bird problem vexes me, in the first instance because it doesn't
seem to specify a unique solution:
Given a list xs = [x_1, x_2, . . . , x_n], the sequence of successive
maxima "ssm xs" is the
longest subsequence [x_j1, x_j2, x_j3..x_jk] such that j_1 = 1 and j_m <
j_n => x_j
Am Montag, 16. März 2009 00:47 schrieb Jonathan Cast:
> On Mon, 2009-03-16 at 00:14 +0100, Daniel Fischer wrote:
>
> > > > However, I understand
> > > > "unsafeInterleaveIO allows IO computation to be deferred lazily. When
> > > > passed a value of type IO a, the IO will only be performed when the
Except that there is nothing like =~ s in haskell, as far as I can tell.
I was mulling over this and thinking, the nicest solution for this --
from the lens of perl evangelism anyway -- would be to have some way
of accessing the perl6 language =~ s mechanism in pugs, which would
get us everything
Am Sonntag, 15. März 2009 21:09 schrieb R J:
> This Bird problem vexes me, in the first instance because it doesn't seem
> to specify a unique solution:
>
> Given a list xs = [x_1, x_2, . . . , x_n], the sequence of successive
> maxima "ssm xs" is the longest subsequence [x_j1, x_j2, x_j3..x_jk] su
Peter Verswyvelen schrieb:
> ouch, I was confusing the mtl and transformers package...
>
> so basically transformers is a better replacement for mtl?
>
> or does mtl offer things transformers does not?
transformers and monad-fd are cleanly separated, transformers is Haskell
98 and monad-fd uses
On Mon, 2009-03-16 at 00:14 +0100, Daniel Fischer wrote:
> Am Sonntag, 15. März 2009 23:30 schrieb Jonathan Cast:
> > On Sun, 2009-03-15 at 23:18 +0100, Daniel Fischer wrote:
> > > Am Sonntag, 15. März 2009 22:20 schrieb Jonathan Cast:
> > > > There is *no* guarantee that main0 prints 0, while main
main = do
r <- newIORef 0
v <- unsafeInterleaveIO $ do
writeIORef r 1
return 1
x <- case f v of
0 -> return 0
n -> return (n - 1)
y <- readIORef r
print y
-- a couple of examples:
f x = 0 -- program prints "0"
-- f x = x -- program prints "1"
Am Sonntag, 15. März 2009 23:30 schrieb Jonathan Cast:
> On Sun, 2009-03-15 at 23:18 +0100, Daniel Fischer wrote:
> > Am Sonntag, 15. März 2009 22:20 schrieb Jonathan Cast:
> > > There is *no* guarantee that main0 prints 0, while main1 prints 1, as
> > > claimed. The compiler is in fact free to pr
On Sun, 2009-03-15 at 23:18 +0100, Daniel Fischer wrote:
> Am Sonntag, 15. März 2009 22:20 schrieb Jonathan Cast:
> > There is *no* guarantee that main0 prints 0, while main1 prints 1, as
> > claimed. The compiler is in fact free to produce either output given
> > either program, at its option. S
Am Sonntag, 15. März 2009 22:20 schrieb Jonathan Cast:
> There is *no* guarantee that main0 prints 0, while main1 prints 1, as
> claimed. The compiler is in fact free to produce either output given
> either program, at its option. Since the two programs do in fact have
> exactly the same set of p
fft1976:
> I noticed that on Programming Reddit, where I lurk, there is a big
> discussion about the disconnect between how much Haskell is advocated
> there and the number of applications written in it.
>
> http://www.reddit.com/r/programming/comments/84sqt/dear_reddit_i_am_seeing_12_articles_in/
I noticed that on Programming Reddit, where I lurk, there is a big
discussion about the disconnect between how much Haskell is advocated
there and the number of applications written in it.
http://www.reddit.com/r/programming/comments/84sqt/dear_reddit_i_am_seeing_12_articles_in/
The difficulty of
On Sun, 2009-03-15 at 22:09 +0100, Daniel Fischer wrote:
> Am Sonntag, 15. März 2009 21:56 schrieb Jonathan Cast:
> > On Sun, 2009-03-15 at 21:43 +0100, Daniel Fischer wrote:
> > > Am Sonntag, 15. März 2009 21:25 schrieb Jonathan Cast:
> > > > On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote:
>
Am Sonntag, 15. März 2009 21:56 schrieb Jonathan Cast:
> On Sun, 2009-03-15 at 21:43 +0100, Daniel Fischer wrote:
> > Am Sonntag, 15. März 2009 21:25 schrieb Jonathan Cast:
> > > On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote:
> > > > Furthermore, due to the monad laws, if f is total, then re
On Sun, 2009-03-15 at 21:43 +0100, Daniel Fischer wrote:
> Am Sonntag, 15. März 2009 21:25 schrieb Jonathan Cast:
> > On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote:
> >
> > > Furthermore, due to the monad laws, if f is total, then reordering the
> > > (x <- ...) and (y <- ...) parts of the p
Am Sonntag, 15. März 2009 21:09 schrieb R J:
> This Bird problem vexes me, in the first instance because it doesn't seem
> to specify a unique solution:
>
> Given a list xs = [x_1, x_2, . . . , x_n], the sequence of successive
> maxima "ssm xs" is the longest subsequence [x_j1, x_j2, x_j3..x_jk] su
Am Sonntag, 15. März 2009 21:25 schrieb Jonathan Cast:
> On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote:
>
> > Furthermore, due to the monad laws, if f is total, then reordering the
> > (x <- ...) and (y <- ...) parts of the program should have no effect.
> > But if you switch them, the progr
On Sun, 2009-03-15 at 13:02 -0700, Ryan Ingram wrote:
> unsafeInterleaveIO allows embedding side effects into a pure
> computation. This means you can potentially observe if some pure
> value has been evaluated or not; the result of your code could change
> depending how lazy/strict it is, which
Fixed on hackage.
$ cabal update
$ cabal install plugins-1.4.1
Or via the web:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/plugins-1.4.1
-- Don
yuri.kashnikoff:
> Thanks. Problem solved now!
>
> On Sun, Mar 15, 2009 at 7:20 PM, Duncan Coutts
> wrote:
> > On Sun, 2
This Bird problem vexes me, in the first instance because it doesn't seem to
specify a unique solution:
Given a list xs = [x_1, x_2, . . . , x_n], the sequence of successive maxima
"ssm xs" is the
longest subsequence [x_j1, x_j2, x_j3..x_jk] such that j_1 = 1 and j_m < j_n =>
x_jm < x_jn.
For
unsafeInterleaveIO allows embedding side effects into a pure
computation. This means you can potentially observe if some pure
value has been evaluated or not; the result of your code could change
depending how lazy/strict it is, which is very hard to predict!
For example:
> -- given
> f :: Inte
Hello,
I was studying about what unsafeInterleaveIO is.I understood
unsafeInterleaveIO takes an IO action, and delays it. But I couldn't
find any reason why unsafeInterleaveIO is unsafe.
I have already read an example in
http://www.haskell.org/pipermail/haskell-cafe/2009-March/057101.html
says la
On Mar 15, 4:03 am, Anatoly Yakovenko wrote:
> is there a version of hsffig that builds on a recent versin of haskell?
> ___
> Haskell-Cafe mailing list
> haskell-c...@haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe
Unfortunately no. The
Thanks. Problem solved now!
On Sun, Mar 15, 2009 at 7:20 PM, Duncan Coutts
wrote:
> On Sun, 2009-03-15 at 11:38 +0600, Yuri Kashnikoff wrote:
>> Hi!
>>
>> I was trying to install hs-plugins both from sources "$./Setup.lhs
>> ..." and with "$cabal fetch&&cabal install" and both failed.
>> It alway
Lingappan, Loganathan wrote:
> If I include
>
> import Text.Regex.Posix ((=~))
>
> into a Haskell code, I get the following link error:
>
> FindBBUsage.o:fake:(.text+0x44d): undefined reference to
> `__stginit_regexzmposixzm0zi72zi0zi3_TextziRegexziPosix_'
> collect2: ld returned 1 exit status
Hi,
If I include
import Text.Regex.Posix ((=~))
into a Haskell code, I get the following link error:
FindBBUsage.o:fake:(.text+0x44d): undefined reference to
`__stginit_regexzmposixzm0zi72zi0zi3_TextziRegexziPosix_'
collect2: ld returned 1 exit status
Any ideas on how to fix this? I am using G
Hello!
I'm please to announce dzen-utils 0.1. I don't feel like it is ready
to be released, but let's see how everything goes. :)
== WHAT ==
dzen-utils contains various utilities for creating dzen input strings
in a type-safe way using some combinators, including the ability to
apply colors loca
Why don't you just swap the pattern match order?
remdups :: (Eq a) => [a] -> [a]
remdups (x : xx : xs) = if x == xx then remdups (x : xs) else x :
remdups (xx : xs)
remdups xs= xs
This should cover all cases no?
Also I prefer guards, but I guess that is persona
ouch, I was confusing the mtl and transformers package...
so basically transformers is a better replacement for mtl?
or does mtl offer things transformers does not?
On Sun, Mar 15, 2009 at 12:04 AM, Henning Thielemann <
lemm...@henning-thielemann.de> wrote:
>
> On Sat, 14 Mar 2009, Peter Verswyv
2009/3/15 R J :
> What, if any, is the implementation using only two cases?
This version considers 2 cases 2 times :-) But only the 'go' function
is recursive, so it could probably be written using some kind of fold.
The value being build by the fold should probably be some kind of
tuple so you ca
2009/3/15 R J
> I need to write an implementation using foldl, and a separate
> implementation using foldr, of a function, "remdups xs", that removes
> adjacent duplicate items from the list xs. For example, remdups
> [1,2,2,3,3,3,1,1]= [1,2,3,1].
>
> My approach is first to write a direct recu
On Sun, 2009-03-15 at 11:38 +0600, Yuri Kashnikoff wrote:
> Hi!
>
> I was trying to install hs-plugins both from sources "$./Setup.lhs
> ..." and with "$cabal fetch&&cabal install" and both failed.
> It always reports that Linker.h is missing.
> Setup.lhs: Missing dependency on a foreign library:
I need to write an implementation using foldl, and a separate implementation
using foldr, of a function, "remdups xs", that removes adjacent duplicate items
from the list xs. For example, remdups [1,2,2,3,3,3,1,1]= [1,2,3,1].
My approach is first to write a direct recursion, as follows:
re
The following theorem is obviously true, but how is it proved (most cleanly and
simply) in Haskell?
Theorem: (nondecreasing xs) => nondecreasing (insert x xs), where:
nondecreasing :: (Ord a) => [a] -> Bool
nondecreasing []= True
nondecreasing xxs@(x : xs)
> "Peter" == Peter Hercek writes:
Peter> Colin Paul Adams wrote:
>>> "Adrian" == Adrian Neumann
>>> writes:
>>
Adrian> You can use the ghci debugger
>> >>
>> http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-
Adrian> debugger.html
>>
Mark Spezzano wrote:
In other words my best guess is that the ordering of tuples is by
comparing the first tuple elements and then the seconds, thirds etc,
until there’s an element less than another.
...until there's an element not equal to the other, yes.
It finds the first position at which
is there a version of hsffig that builds on a recent versin of haskell?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi,
Does anyone know how Haskell’s tuple ordering works? Presumably for some
tuple T1 (x1,x2,...xn) and another tuple T2 (y1,y2,...yn) Haskell would
compare T1 and T2 as follows:
T1 < T2 if:
x1 < y1 OR otherwise if x1 == y1 then if
x2 < y2 OR otherwise if x2 == y2 then if
x3 < y3 OR othe
> "Claus" == Claus Reinke writes:
Claus> None of which is satisfactory. You might also want to add
Claus> yourself to this ticket:
>>
Claus> "index out of range" error message regression
Claus> http://hackage.haskell.org/trac/ghc/ticket/2669
>>
>> How do I do tha
51 matches
Mail list logo