Richard O'Keefe o...@cs.otago.ac.nz wrote:
If you have a low level of trust, you'll need a great level of
detail, and it still won't help.
Heh. Keep your friends close, your enemies closer.
Freelancing, I was always paid per hour, not per feature. From my
experience, writing something like
Assuming you already think you know what cinits does, you can convince
yourself using induction.
On Tue, Apr 14, 2009 at 11:16 AM, Tsunkiet Man temp.t...@gmail.com wrote:
Let's see, if I execute it by hand:
cinits :: [a] - [[a]]
cinits [] = [[]]
cinits (x:xs) = [] : map (x:) (cinits xs)
And just as IO is unnecessary for behavior (functions of time), it's also
unnecessary for imagery (functions of space). Continuing with the
functional (non-IO) theme, you can give a semantically precise,
composable and simple type of images.
Yes, that's a further separation of concerns.
FFT fft1...@gmail.com wrote:
Has anyone tried Yi?
Yes, and I figured I'd have to edit the keymap to get productive. While
it features a fully functional subset of vim that's more than enough to
efficiently edit files, it's not the subset I use... and then I was too
lazy to actually do it.
Hello Alexandr,
Tuesday, April 14, 2009, 6:37:38 AM, you wrote:
Hi I would like to follow the crowd and find out what text editor everyone
uses for haskell on windows.
* HippoEdit (http://www.hippoedit.com/)
i've tried HippoEdit and don't recommend it. it's work in progress so
i
Interesting. I'm testing it on Window though. You're using Linux? Maybe
the scheduling is different.
Now I tried it on Windows in VirtualBox, and it still looks quite smooth
to me (except that hardware acceleration doesn't seem to work properly
through virtualisation, but it's okay as long as I
Melanie_Green jac_legend_...@hotmail.com wrote:
Hi I would like to follow the crowd and find out what text editor
everyone uses for haskell on windows.
Have you considered using leksah? While it doesn't focus on being an
editor, it's still a darn fine way to edit Haskell.
--
(c) this sig
Let's see, if I execute it by hand:
cinits :: [a] - [[a]]
cinits [] = [[]]
cinits (x:xs) = [] : map (x:) (cinits xs)
cinits [1,2,3] = [] : map (1:) ( [] : map (2:) ( [] : map (3:) ( [[]]) ) )
= [] : map (1:) ( [] : map (2:) ( [] : map (3:) [[]] ) )
= [] :
The recent GHC trac ticket revision reminded me of the old open
type-sharing problem with type tags and record labels:
- if type-level tags (such as 'data TTrue'/'data TFalse') are declared
repeatedly in separate modules, they represent separate types,
preventing shared use (your
Thanks, I was close, but the I was trying to use (something like) this
statement without the return:
maybe (return Nothing) (flip HashTable.lookup 1000)
More or less like this:
maybe (Nothing) (flip HashTable.lookup 1000)
Which did't work... Guess the return is needed because we use a new
monad
Am Dienstag 14 April 2009 10:39:28 schrieb Tsunkiet Man:
Hello,
I can hardly imagine how the following code works:
cinits :: [a] - [[a]]
cinits [] = [[]]
cinits (x:xs) = [] : map (x:) (cinits xs)
can someone give me a good explaination?
Perhaps it's easier to follow as a list
Today I happened to need a large list of prime numbers. Obviously this is a
well-known problem, so I figured there would be something on Hackage that I
could use. Surprisingly, there isn't, or if there is it's not easy to find.
Searching for prime or primes on Hackage reveals nothing. Searching
Some other ideas for things to put in this package possibly:
is_prime :: Int - Bool
nth_prime :: Int - Int -- or Int - Integer
prime_factors :: Int - [Int]
I'm assuming there are faster ways of doing the first 2 than by just simply
looking through all of primes. Someone should also look through
I'd suggest also
primesFrom :: Integer - [Integer]
and probably a separate function
nextPrime :: Integer - Integer
2009/4/14 Andrew Wagner wagner.and...@gmail.com:
Some other ideas for things to put in this package possibly:
is_prime :: Int - Bool
nth_prime :: Int - Int -- or Int - Integer
and Visual Haskell had some unique features (such as hovering tooltips
showing types) that are now found in the F# editor, and should now be easier
to implement with the recent GHC API (I guess).
haskell-mode for Emacs does show the type signature of standard
functions in the mini-buffer when
Call for Copy
The Monad.Reader - Issue 14
Please consider writing something for the next issue of The
Monad.Reader. The deadline for Issue 14 is:
** May 15, 2009 **
The Monad.Reader is a electronic magazine about all things
Niemeijer, R.A. wrote:
Since it’s such a common problem I’d say it would be a good idea to add
a package to Hackage that exports
primes :: [Integer]
and hides the ugly implementation details. Data.Numbers.Primes seems a
logical choice for the namespace, but I’m open to suggestions.
You might want to start with the Sieve of Atkin:
http://en.wikipedia.org/wiki/Sieve_of_Atkin
-Edward
On Tue, Apr 14, 2009 at 8:40 AM, Niemeijer, R.A. r.a.niemei...@tue.nlwrote:
Today I happened to need a large list of prime numbers. Obviously this is
a well-known problem, so I figured there
Hi Reiner,
Fantastic work! User-friendly static dimension checking is an essential
feature for any decent linear algebra library. Your interface using
quasiquotation and view patterns is very elegant and practical. I am
happy that hmatrix is useful, but I'm afraid that its primitive dynamic
What do I need to add to this Color enum type to print a list of them?
Michael
===
data Color
= Red
| Blue
| Green
| Yellow
| Orange
| Brown
| White
| Black
instance Show Color where
show Red = Red
show Blue = Blue
show
1. data Color = Red | Green | Blue deriving (Show)
2. [Red,Black,White]
2009/4/14 michael rice nowg...@yahoo.com:
What do I need to add to this Color enum type to print a list of them?
Michael
===
data Color
= Red
| Blue
| Green
| Yellow
| Orange
|
Dumb, dumb, dumb, dumb, DUMB!, he Lisped.
Thanks.
Michael
--- On Tue, 4/14/09, Andrew Wagner wagner.and...@gmail.com wrote:
From: Andrew Wagner wagner.and...@gmail.com
Subject: Re: [Haskell-cafe] Printing list of enum type
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date:
Am Freitag, 10. April 2009 18:41 schrieb Patai Gergely:
is based on some unsafePerformIO dark magic (that might easily break
depending on many factors)
I wonder if this breaks referential transparency. Say, you define a signal s
and use s twice in some expression. s may be evaluated once and
Am Dienstag, 14. April 2009 11:33 schrieb Patai Gergely:
and then the integration of a Grapefruit-like and a Reactive-like system
could be the ultimate solution in the long run.
What do you think, Grapefruit is lacking, compared to Reactive?
Best wishes,
Wolfgang
Dear Sirs,
I guess this is a very simple question. How can I convert IO [XmlTree] to just a list of XmlTree?
Regards,
Rodrigo.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Tue, Apr 14, 2009 at 8:54 AM, rodrigo.bonifacio
rodrigo.bonifa...@uol.com.br wrote:
Dear Sirs,
I guess this is a very simple question. How can I convert IO [XmlTree] to
just a list of XmlTree?
This is very important: you cannot.
But you can still get your hands on one inside a do block.
Hallo,
On 4/14/09, rodrigo.bonifacio rodrigo.bonifa...@uol.com.br wrote:
Dear Sirs,
I guess this is a very simple question. How can I convert IO [XmlTree] to
just a list of XmlTree?
The short answer is: You cannot. The longer answer is: Only put
things in the IO monad when you need
On Tue, Apr 14, 2009 at 4:54 PM, rodrigo.bonifacio
rodrigo.bonifa...@uol.com.br wrote:
Dear Sirs,
I guess this is a very simple question. How can I convert IO [XmlTree] to
just a list of XmlTree?
Quick and dirty answer: unsafePerformIO.
That's an easy finding on Hoogle:
On Tue, Apr 14, 2009 at 5:01 PM, Luke Palmer lrpal...@gmail.com wrote:
...
This is very important: you cannot.
I'd answer You shouldn't, unless you know what you are doing. In
some cases, not only is unsafePerformIO desirable but also necessary
(I'm thinking of Debug.Trace).
Cristiano
Am Samstag, 11. April 2009 16:57 schrieb Patai Gergely:
Any idea how Elerea compares to Grapefruit? It's great to see a lot of
competition in the FRP arena, but I hope in the end this results in a
really usable and scalable FRP system for Haskell :-)
I think Wolfgang can judge this better,
On Tue, Apr 14, 2009 at 9:01 AM, Cristiano Paris fr...@theshire.org wrote:
On Tue, Apr 14, 2009 at 4:54 PM, rodrigo.bonifacio
rodrigo.bonifa...@uol.com.br wrote:
Dear Sirs,
I guess this is a very simple question. How can I convert IO [XmlTree] to
just a list of XmlTree?
Quick and
Here's another way of looking at what others have already said. The only way
you can do that is within the scope of another IO action. For example:
outputXmlTrees :: IO ()
outputXmlTrees = do
trees - inputXmlTrees;
let newTrees = transform trees;
print . show $ newTrees
Notice a few things:
Quick and dirty answer: unsafePerformIO.
You can do a lot of cool things with a table saw if you take the blade guard
off.
On Tue, Apr 14, 2009 at 11:01 AM, Cristiano Paris fr...@theshire.orgwrote:
On Tue, Apr 14, 2009 at 4:54 PM, rodrigo.bonifacio
rodrigo.bonifa...@uol.com.br wrote:
Dear
Hello rodrigo.bonifacio,
Tuesday, April 14, 2009, 6:54:07 PM, you wrote:
I guess this is a very simple question. How can I convert IO
[XmlTree] to just a list of XmlTree?
IO [XmlTree] is an action returning [XmlTree]. so to convert it to
[XmlTree] you just need to execute it in IO monad:
On Tue, Apr 14, 2009 at 5:09 PM, Luke Palmer lrpal...@gmail.com wrote:
...
Please don't say that. He's a beginner.
You realize that the path of least resistance will be to use it, right?
You see why that's not a good thing?
Even experts don't use this function.
(To the O.P.: don't use it)
Hello Peter,
Wednesday, April 8, 2009, 2:42:24 PM, you wrote:
if you need win64 ghc version - add yourself to CC list of
http://hackage.haskell.org/trac/ghc/ticket/1884
Well, make that 2! :-)
On Wed, Apr 8, 2009 at 11:47 AM, Bulat Ziganshin
bulat.zigans...@gmail.com wrote:
Hello Peter,
On Tue, Apr 14, 2009 at 10:54 AM, rodrigo.bonifacio
rodrigo.bonifa...@uol.com.br wrote:
Dear Sirs,
I guess this is a very simple question. How can I convert IO [XmlTree] to
just a list of XmlTree?
Regards,
Rodrigo.
One good link on this topic is http://haskell.org/haskellwiki/Avoiding_IO
On Tue, Apr 14, 2009 at 9:24 AM, Cristiano Paris fr...@theshire.org wrote:
On Tue, Apr 14, 2009 at 5:09 PM, Luke Palmer lrpal...@gmail.com wrote:
...
Please don't say that. He's a beginner.
You realize that the path of least resistance will be to use it, right?
You see why that's not a
Hello Cristiano,
Tuesday, April 14, 2009, 7:24:40 PM, you wrote:
unsafePerformIO is not evil by itself, it's there for a purpose and,
as for anything else in the language, it's better to understand when
to use it
we just think that author of original question don't yet have good
knowledge of
On Tue, Apr 14, 2009 at 5:42 PM, Luke Palmer lrpal...@gmail.com wrote:
...
However, the way I see it is that unsafePerformIO *is* evil by itself, and
it is only by the addition of Holy Water that it is benign to use.
That's what I meant but your words are indeed more effective :)
Ryan
Cristiano Paris wrote:
On Tue, Apr 14, 2009 at 5:09 PM, Luke Palmer lrpal...@gmail.com wrote:
...
Please don't say that. He's a beginner.
You realize that the path of least resistance will be to use it, right?
You see why that's not a good thing?
Even experts don't use this function.
(To the
On Tue, Apr 14, 2009 at 5:54 PM, Jules Bean ju...@jellybean.co.uk wrote:
...
I'm convinced about what you say and perhaps I answered the way I did
just because I'm convinced that, for a newbie, knowing about the
existence of unsafePerformIO can't cause any harm.
I was a bit surprised by the
rodrigo.bonifacio wrote:
I guess this is a very simple question. How can I convert IO [XmlTree]
to just a list of XmlTree?
You can't, unless you use `unsafePeformIO`, as others have already
pointed out. Yet others have, more correctly, suggested that you use
do notation to bind a variable
rodrigo.bonifacio rodrigo.bonifa...@uol.com.br wrote:
Dear Sirs,
I guess this is a very simple question. How can I convert IO
[XmlTree] to just a list of XmlTree?
unsafeCoerce.
Seriously, you just don't, you weld stuff together using =. It takes
an 'IO a' and a function 'a - IO b' and
Cristiano Paris fr...@theshire.org wrote:
I was a bit surprised by the strong reaction about my citation of
unsafePerformIO. Maybe it'd useful, for the future, to write a
document explaining how to help newbies properly, maybe putting it in
the mailing list charter.
1) Tell them about
On Tue, Apr 14, 2009 at 2:47 PM, Andrew Wagner wagner.and...@gmail.com wrote:
Some other ideas for things to put in this package possibly:
is_prime :: Int - Bool
I'd also add isProbablePrime using a Miller-Rabin test or somesuch,
for use with large numbers. It'd have to be in a monad which
Quoth Cristiano Paris fr...@theshire.org,
I was a bit surprised by the strong reaction about my citation of
unsafePerformIO.
Well, there might be a couple of things going on here. Part of it is
how to guess the unstated context of a question - I'm fairly sure that
given a more thorough
Hi folks,
Apologies in advance because this sounds rantish...
So I went to my friendly API reference at
http://www.haskell.org/ghc/docs/latest/html/libraries/index.html and
noticed that I couldn't find Data.Time there anymore. Though it was
still at
Hello John,
Tuesday, April 14, 2009, 8:44:12 PM, you wrote:
I understand the goal of removing stuff from GHC, but the practical
implications can be rather annoying.
i think that Haskell Platform will eventually replace what GHC was for
a years, i.e. out-of-box solution for practical haskell
Removing a package in a minor release is, to quote, an epic fail.
I don't understand how that could be done.
-- Lennart
On Tue, Apr 14, 2009 at 6:56 PM, Bulat Ziganshin
bulat.zigans...@gmail.com wrote:
Hello John,
Tuesday, April 14, 2009, 8:44:12 PM, you wrote:
I understand the goal of
Never answer such newbie questions with unsafePerformIO.
That's the wrong answer 99.99% of the time, but giving it to a newbie
they might follow your advice.
On Tue, Apr 14, 2009 at 5:01 PM, Cristiano Paris fr...@theshire.org wrote:
On Tue, Apr 14, 2009 at 4:54 PM, rodrigo.bonifacio
You might want to look at Pari/GP ( http://pari.math.u-bordeaux.fr/ ) for ideas
of what kind of functions to supply. Also, as a source of ideas for algorithms.
Mike Matsko
- Original Message -
From: Max Rabkin max.rab...@gmail.com
To: Andrew Wagner wagner.and...@gmail.com
Cc: R.A.
- if type-level tags (such as 'data TTrue'/'data TFalse') are declared
repeatedly in separate modules, they represent separate types,
preventing shared use (your type-level predicate doesn't return
my version of 'TTrue'/'TFalse')
How is the need for a common import for 'data TTrue;
I wonder if this breaks referential transparency. Say, you define a signal
s and use s twice in some expression. s may be evaluated once and it
maybe evaluated twice. Does this make a difference?
I'm not sure about the answer at the moment, but I believe we'd simply
get two identically behaving
I'm finding it hard to write robust code that isn't really ugly. Suppose
I want to write
execute :: FilePath - [String] - IO (Either ExecuteError ExitCode)
where 'ExecuteError' is a data type representing all the ways 'execute'
could fail and that 'execute p args' is supposed to
* ensure p
Michael,
What do I need to add to this Color enum type to print a list of them?
You can also easily print a list of /all/ of them.
Regards,
John
scratch$ cat color.hs
data Color
= Red
| Blue
| Green
| Yellow
| Orange
| Brown
| White
| Black
deriving
What about ErrorT monad transformer? Well, if it's not what you really
want, you can define your own one without ugly Error class, so it'd
be something like
execute :: FilePath - [String] - MyCoolErrorT ExecuteError IO ExitCode
On 14 Apr 2009, at 23:29, br...@lorf.org wrote:
I'm finding it
On Tuesday, 14.04.09 at 23:36, Miguel Mitrofanov wrote:
What about ErrorT monad transformer?
I don't see how it helps in my situation. ErrorT doesn't catch
exceptions, for example. Suppose I did make something like ErrorT that
catches exceptions and turn them into Lefts. Where would (=) get my
There's no way to make all your tests atomically, e.g, between the
test that p exists and executing p, some other process could removce
p.
So the right way to do this (like opening a file), is to try executing
it and let the OS tell you if it failed.
On Tue, Apr 14, 2009 at 9:29 PM,
On Tue, 14 Apr 2009, Miguel Mitrofanov wrote:
What about ErrorT monad transformer? Well, if it's not what you really want,
you can define your own one without ugly Error class, so it'd be something
like
execute :: FilePath - [String] - MyCoolErrorT ExecuteError IO ExitCode
My MyCoolErrorT
On Tue, 14 Apr 2009, br...@lorf.org wrote:
On Tuesday, 14.04.09 at 23:36, Miguel Mitrofanov wrote:
What about ErrorT monad transformer?
I don't see how it helps in my situation. ErrorT doesn't catch
exceptions, for example. Suppose I did make something like ErrorT that
catches exceptions
On Tuesday, 14.04.09 at 22:13, Lennart Augustsson wrote:
So the right way to do this (like opening a file), is to try executing
it and let the OS tell you if it failed.
I know, but the various functions that create processes don't help me
know whether the program actually ran or not. For
I will test it on a couple of machines, desktops and laptops. I think the
problem was my laptop going into power safe mode or something, since
sometimes it runs smooth, sometimes it doesn't. This could indeed be a
problem with GLFW's time attribute on windows (which uses the CPU tick
frequency
Ouch, I did not see Wolfgang's email nor your reply, sorry for the noise
(which I'm doing again with this email ;-)
On Tue, Apr 14, 2009 at 11:01 PM, Peter Verswyvelen bugf...@gmail.comwrote:
I will test it on a couple of machines, desktops and laptops. I think the
problem was my laptop going
I will add myself a million times then :-)
On Tue, Apr 14, 2009 at 5:25 PM, Bulat Ziganshin
bulat.zigans...@gmail.comwrote:
Hello Peter,
Wednesday, April 8, 2009, 2:42:24 PM, you wrote:
if you need win64 ghc version - add yourself to CC list of
I didn't know that, but there's a lot I don't know about Haskell.
It works great.
Thanks!
Michael
--- On Tue, 4/14/09, John Dorsey hask...@colquitt.org wrote:
From: John Dorsey hask...@colquitt.org
Subject: Re: [Haskell-cafe] Printing list of enum type
To: michael rice nowg...@yahoo.com
Cc:
Hello,
I've uploaded last (and latest) significant version on hgettext
module. Currently it works fine, and has bindings to all gettext
functions (from libintl.h). Next versions will be only bug fixes of
this version.
GNU GetText allows you only to create simple, standalone desktop
applications
Hi folks,
I'm having trouble reading the TemplateHaskell docs and trying to do
something that seems like it should be simple. In MetaML, there is a 'lift'
function which does exactly what I want to do. Here's an example function:
let double n = [| 2 * $( litE (integerL n) ) |]
This works as
OK, I figured it out.
The class is Language.Haskell.TH.Syntax.Lift. The function is
Language.Haskell.TH.Syntax.lift. And I can rewrite my function as:
let double n = [| 2 * n |]
I wish this were explained in the TemplateHaskell documentation.
- Lyle
On Tue, Apr 14, 2009 at 2:51 PM, Lyle
Quoth br...@lorf.org,
On Tuesday, 14.04.09 at 22:13, Lennart Augustsson wrote:
So the right way to do this (like opening a file), is to try executing
it and let the OS tell you if it failed.
I know, but the various functions that create processes don't help me
know whether the program
Quoth br...@lorf.org,
execute :: FilePath - [String] - IO (Either ExecuteError ExitCode)
where 'ExecuteError' is a data type representing all the ways 'execute'
could fail and that 'execute p args' is supposed to
* ensure p exists
* get p's permissions
* ensure p is readable
* ensure p
Stefan Monnier monn...@iro.umontreal.ca writes:
I'm a beginner, but I'll chime in and say I use Emacs with
haskell-mode. It's auto-indentation is a bit complex in behavior which is
unappealing (I feel like I never know what it's going to do when I hit tab),
but I would be curious what someone
On Tue, 2009-04-14 at 11:34 +0200, Achim Schneider wrote:
Yes, and I figured I'd have to edit the keymap to get productive. While
it features a fully functional subset of vim that's more than enough to
efficiently edit files, it's not the subset I use... and then I was too
lazy to actually do
On Tue, 14 Apr 2009 08:25:52 +0200, Raja Koduru kscr...@gmail.com wrote:
hi,
I am a beginner to haskell.
I am trying to install glut using cabal install glut
Pasting here a tail of the output
-
checking for unistd.h... yes
On Wed, Apr 15, 2009 at 8:57 AM, Jeff Wheeler j...@nokrev.com wrote:
As one of the Yi developers, I'd love to hear some more specific
feedback on this. Do you remember any specific Vim features that were
missing?
My main gripe with the vi emulation in Yi was in vty mode[1] and how
it was
75 matches
Mail list logo