Hello jim,
Monday, October 23, 2006, 11:29:07 PM, you wrote:
I want to split a string into 5 parts of equal length, with the last fifth
padded if necessary, but can't get it right - here's what I've got -
fifths :: String - String
fifths s = unwords [a1,a2,a3,a4,a5]
where l = (length
Hello Bas,
Tuesday, October 24, 2006, 1:03:55 AM, you wrote:
Great it works! I didn't know about unsafeInterleaveIO [1].
Why is it called 'unsafe'?
And how does the laziness work? Is it because of the 'let r = ... in (s, r)'?
read either http://haskell.org/haskellwiki/IO_inside
or Simon's
Hi,
Am Dienstag, den 24.10.2006, 00:44 +0300 schrieb Misha Aizatulin:
hello all,
why is it not possible to use guards in do-expressions like
do
(a, b) | a == b - getPair
return a and b are equal
Probably because it is not well-defined for all Monad what a
On 24/10/06, Joachim Breitner [EMAIL PROTECTED] wrote:
Am Dienstag, den 24.10.2006, 00:44 +0300 schrieb Misha Aizatulin:
hello all,
why is it not possible to use guards in do-expressions like
do
(a, b) | a == b - getPair
return a and b are equal
Probably
Joachim Breitner wrote:
Hi,
Am Dienstag, den 24.10.2006, 00:44 +0300 schrieb Misha Aizatulin:
hello all,
why is it not possible to use guards in do-expressions like
do
(a, b) | a == b - getPair
return a and b are equal
Probably because it is not
I don't know why these unsafe* functions are suggested so easily. Their
name is chosen for good reason.
On Mon, 23 Oct 2006, Bas van Dijk wrote:
--
module Main where
import Text.ParserCombinators.Parsec
data T
I wrote:
jim burton [EMAIL PROTECTED] wrote:
Thankyou! It's http://www.rubyquiz.com - They are mostly well suited to
haskell, lot of mazes etc. I've done 5 or 6 with varying degrees of success
but have learned a lot. This thing about strings in fifths is from #1, the
solitaire cipher.
Hi,
Am Dienstag, den 24.10.2006, 12:48 +0200 schrieb Benjamin Franksen:
Am Dienstag, den 24.10.2006, 00:44 +0300 schrieb Misha Aizatulin:
hello all,
why is it not possible to use guards in do-expressions like
do
(a, b) | a == b - getPair
return a and
Bas van Dijk wrote:
On Monday 23 October 2006 21:50, Tomasz Zielonka wrote:
unsafeInterleaveMapIO f (x:xs) = unsafeInterleaveIO $ do
y - f x
ys - unsafeInterleaveMapIO f xs
return (y : ys)
unsafeInterleaveMapIO _ [] = return []
Great it works! I didn't know
I'm a beginner having a go at implementing the Solitaire cipher
(http://www.rubyquiz.com/quiz1.html as mentioned in another post) and I'd be
really grateful if you could help me improve the code to be neater use
more functions from the Prelude etc, or errors (eg at the moment I can't
work out
Cybertronic wrote:
Hi all, I'm pretty much new to Haskell however I'm stuck on something
which is that I'm trying to create a function called display where I type
in a DVD name, e.g. dvd1, it returns d (String) and the multiplication of
q (Int) and i (Double)
Here's what I've done so
There are several problems with the behavior:
*Main encrypt
X
*Main decrypt $ encrypt
TANZP X
So fixing this case would be the first thing to do, followed by:
*Main encrypt hello
LBVJW X
*Main decrypt $ encrypt hello
HELLO YFRTQ X
Gah! Brain AWOL. I'm surprised no-one picked me up on
that. Why didn't I use:
splitAtMb n [] = Nothing
splitAtMb n l = Just $ splitAt n l
Actually, I've some code lying around doing exactly this (but without
the padding ;)), written with the coalgebra inlined:
split n = unfoldr $ \xs -
Chris Kuklewicz wrote:
There are several problems with the behavior:
*Main encrypt
X
*Main decrypt $ encrypt
TANZP X
So fixing this case would be the first thing to do, followed by:
*Main encrypt hello
LBVJW X
*Main decrypt $ encrypt hello
HELLO YFRTQ X
Hello,
I have a similar question. When I use getChar with Hugs the newline
(caused by pressing 'Enter') seems to be carried over into the next
call of main, where it is treated as a single input character.
The workaround is getLine and head, but it would be nice to drop the
newline right away.
Hi
I have a similar question. When I use getChar with Hugs the newline
(caused by pressing 'Enter') seems to be carried over into the next
call of main, where it is treated as a single input character.
The workaround is getLine and head, but it would be nice to drop the
newline right away. I
On Tuesday 24 October 2006 13:03, Henning Thielemann wrote:
Is it possible to turn it into
parseFiles :: [IO T]
?
Then you can easily do
sequence (take 3 parseFiles)
Thanks, I think I go for this sollution:
parseFiles :: IO [IO a]
parseFiles = liftM (map parseFile) getFileFPs
test =
jim burton [EMAIL PROTECTED] writes:
In addition to Chris's comments, here are some more:
data Card = Clubs Int | Spades Int | Diamonds Int | Hearts Int | JokerA |
JokerB
They aren't really Ints; better to define something like
data FaceValue = Ace | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 |
Joachim Breitner wrote:
Am Dienstag, den 24.10.2006, 12:48 +0200 schrieb Benjamin Franksen:
Am Dienstag, den 24.10.2006, 00:44 +0300 schrieb Misha Aizatulin:
hello all,
why is it not possible to use guards in do-expressions like
do
(a, b) | a == b - getPair
Jón Fairbairn-2 wrote:
jim burton [EMAIL PROTECTED] writes:
In addition to Chris's comments, here are some more:
[snip]
Thanks for your comments Jon. I thought about making Cards an instance of
Enum but didn't realise how helpful it would be in various places.
I will use the shorter
No, it happens with Hugs on Fedora Core 5 (the fc5 Hugs package), not
WinHugs.
Thanks,
Hans
On Tue, 2006-10-24 at 17:27 +0100, Neil Mitchell wrote:
Hi
I have a similar question. When I use getChar with Hugs the newline
(caused by pressing 'Enter') seems to be carried over into the next
Hi
getChar doesn't return until I press Enter. I need something that
returns immediately after I press any key.
It's a problem with buffering:
hSetBuffering stdin NoBuffering
This usually doesn't work on Windows:
GHC 6.4.2 and 6.6: requires enter
Hugs (console)
No, it happens with Hugs on Fedora Core 5 (the fc5 Hugs package), not
WinHugs.
Woops, the previous post in a different thread was talking about
WinHugs, and I forgot to context-switch :)
Does GHCi give the different behaviour? If so, one of them is probably a bug.
Thanks
Neil
Thanks,
Hi!Sorry if it is a bit off-topic in this thread.How can I input EOF symbol in WinHugs? Ctrl-Z and Ctrl-D don't work for me,so I can't use getContents function. Maybe there is a piece of documentationthat I should read?
Thanks!-- Dimitri
___
Haskell-Cafe
H
How can I input EOF symbol in WinHugs?
No possible way. If you could type the NUL character that might
possibly work, but even then 1) you can't, 2) it might not.
Do you have a particular need for typing the end of getContents in
WinHugs? If so, I can open a bug and might be able to fix it
On Tue, Oct 24, 2006 at 06:14:14PM +0200, Hans van Thiel wrote:
I have a similar question. When I use getChar with Hugs the newline
(caused by pressing 'Enter') seems to be carried over into the next
call of main, where it is treated as a single input character.
The workaround is getLine and
On 10/25/06, Neil Mitchell [EMAIL PROTECTED] wrote:
How can I input EOF symbol in WinHugs?No possible way. If you could type the NUL character that mightpossibly work, but even then 1) you can't, 2) it might not.Do you have a particular need for typing the end of getContents in
WinHugs? If so, I
On Wed, Oct 25, 2006 at 01:06:28AM +0400, Dimitri Timofeev wrote:
Sorry if it is a bit off-topic in this thread.
How can I input EOF symbol in WinHugs? Ctrl-Z and Ctrl-D don't work for me,
so I can't use getContents function. Maybe there is a piece of documentation
that I should read?
does F6
On 10/25/06, John Meacham [EMAIL PROTECTED] wrote:
does F6 work? it used to back with DOS something or another.It works in console Hugs, as well as Ctrl-Z, but does not work in WinHugs.-- Dimitri
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi
Surely I can get along without getContents in WinHugs: last time I thought
about
it I just wanted to show getContents function to my students (and using
hGetContents
on a file handle seems to be better example). Another function that
could be useful when teaching IO is 'interact', and it
On 10/24/06, Duncan Coutts [EMAIL PROTECTED] wrote:
On the other hand, in Gtk2Hs I know one case where we do this. We have aGraphics.UI.Gtk.Cairo api module that is only included if Gtk was builtagainst Cairo. In any case it could be faked by using cpp to just not
export anything rather than not
Google now lets us create our own custom search engine pages, so I
whipped one up for Haskell,
http://www.google.com/coop/cse?cx=015832023690232952875%3Acunmubfghzq
also, as a demo, embedded
http://www.cse.unsw.edu.au/~dons/search.html
Seems to do a reasonable job of targetting just
32 matches
Mail list logo