I think you need to put liftIO in front of the IO actions you want to
do inside the CGI Monad. Like in this example
http://www.haskell.org/haskellwiki/
Practical_web_programming_in_Haskell#File_uploads
(Why did I need to use google to find that? The wiki search in awful.
Searching for
On 2008.06.14 08:05:48 +0200, Adrian Neumann [EMAIL PROTECTED] scribbled 4.0K
characters:
I think you need to put liftIO in front of the IO actions you want to do
inside the CGI Monad. Like in this example
http://www.haskell.org/haskellwiki/
Practical_web_programming_in_Haskell#File_uploads
oops .. my bad ...
If I change data Sigval = SivalInt Int
to newtype Sigval = SivalInt Int
OR
data Sigval = SivalPtr (Ptr Char)
to newtype Sigval = SivalPtr (Ptr Char).
Why should newtype instead of a data type allow my test case to build?
Vasili
On Fri, Jun 13, 2008 at 10:59
Ryan Ingram wrote:
sumns 0 = 0
sumns x = sumns (x-1) + n
Without the monomorphism restriction, computing n is a function call;
it is evaluated each time it is asked for.
I'm relatively new to Haskell, and since this topic already came up, I
was wondering if anyone could explain to me how
On Fri, 2008-06-13 at 22:10 -0400, Gwern Branwen wrote:
I think this may be Cabal's fault anyway. The yi.cabal includes the line:
build-tools: alex = 2.0.1 3
in the 'executable yi' section, right after the build-depends, so Yi
is being straightforward and upfront about its
http://hackage.haskell.org/trac/hackage/ticket/227
One problem is that not all build-tools correspond to haskell
packages. Some do some don't. We have a hard coded list of them
at the moment (which can be extended in Setup.hs files) so we
could extend that with what
Stephen Howard [EMAIL PROTECTED] writes:
I am a newcomer doing my obligatory struggling with
Haskell's type system,
That's your mistake. Don't struggle with the type system,
the type system is your friend; when it tells you you are
doing something wrong, it's usually right.
and I've got a
Hi All,
Topkata is a simple OpenGL Game written in Haskell. It's not very
advanced. Goal so far is to guide a ball trough an labyrinth to the
opposite corner. The web page shows an screenshot. It's only tested
under Linux.
http://home.arcor.de/chr_bauer/topkata.html
FeedbackPatches are
Hi Christoph,
opposite corner. The web page shows an screenshot. It's only tested
under Linux.
Looks cool! Could you upload it to hackage?
http://hackage.haskell.org/
Once its on hackage, using cabal install, it should be possible to get
your game going with as little as:
cabal install
Hiya everyone. I'd like to announce the release of a little CLI program I
whipped up. It's called mueval
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mueval.
WHAT:
Mueval grew out of my discontent with Lambdabot: it's really neat to be able to
run expressions like this:
07:53
It'd seem that (at least the online version of) Hoogle is totally broken
and useless. See, for example, the output when looking for:
Monad m = m a - (a - m b) - m b (i.e. (=)'s type)
over at:
http://haskell.org/hoogle/?q=Monad+m+%3D+m+a+-+(a+-+m+b)+-+m+b
Data.Generics.Sche... everywhere
On Sat, Jun 14, 2008 at 9:10 AM, Richard [EMAIL PROTECTED]
wrote:
It'd seem that (at least the online version of) Hoogle is totally broken
and useless. See, for example, the output when looking for:
Monad m = m a - (a - m b) - m b (i.e. (=)'s type)
over at:
On Fri, 13 Jun 2008, Stephen Howard wrote:
Hi List,
I am a newcomer doing my obligatory struggling with Haskell's type system,
and I've got a nut I've not been able to crack. Given:
import Random
random_test :: Int - String
random_test n = do
g - getStdGen
take n (randoms g)::String
On 14 Jun 2008, at 12:45, Christoph Bauer wrote:
Hi All,
Topkata is a simple OpenGL Game written in Haskell. It's not very
advanced. Goal so far is to guide a ball trough an labyrinth to the
opposite corner. The web page shows an screenshot. It's only tested
under Linux.
Am Samstag, 14. Juni 2008 15:10 schrieb Richard:
It'd seem that (at least the online version of) Hoogle is totally broken
and useless. See, for example, the output when looking for:
Monad m = m a - (a - m b) - m b (i.e. (=)'s type)
over at:
Hi Richard,
It'd seem that (at least the online version of) Hoogle is totally broken
and useless.
To finish your sentance: when searching for types with higher-kinded
type classes. In practice, this usually means Monad and occasionally
Functor.
... and so on. (=) isn't there at all!?
It
On Mon, 9 Jun 2008, Sebastian Sylvan wrote:
Another BIG reason: It's impossible to export a whole hierarchy qualified.
I.e it would be neat if the user could write:
import Graphics.UI.Gtk
And then have Gtk re-export sub-modules qualified, so you could write
Button.new, Window.new etc. etc.
On Mon, 9 Jun 2008, Duncan Coutts wrote:
On Mon, 2008-06-09 at 16:04 +0200, Ketil Malde wrote:
And - is there a way to make GHCi use aliased qualification? I find
my self typing detailed taxonomies all the time there.
The ghci syntax currently is:
:m Data.Set
wouldn't it be much nicer as:
Hi,
Is there any way to query the latest version of a particular package
stored on Hackage, that was successfully built?
I mean, not _how_ to do that (I have some ideas that I have to
download directory listings, looking for failure logs, etc.), but is
there any tool or interface already
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
On Mon, 9 Jun 2008, Sebastian Sylvan wrote:
Another BIG reason: It's impossible to export a whole hierarchy qualified.
I.e it would be neat if the user could write:
import Graphics.UI.Gtk
And then have Gtk re-export sub-modules
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
The problem would be again that no one knows, where Window comes from.
Better would be
I really don't see how this is a big problem. Lots of languages do
hierarchical import (e.g. .Net
Hello Neil,
Looks cool! Could you upload it to hackage?
Thank you. Ok, I uploaded the current version. At the moment you have
to run topkata in the topkata-0.0 directory with
./dist/build/topkata/topkata, because it has to find its texture/sound
files. Furthermore I encounter problems (i.e.
On Sat, Jun 14, 2008 at 10:53 AM, Christoph Bauer
[EMAIL PROTECTED] wrote:
Hello Neil,
Looks cool! Could you upload it to hackage?
Thank you. Ok, I uploaded the current version. At the moment you have
to run topkata in the topkata-0.0 directory with
./dist/build/topkata/topkata, because
Hi
Looks cool! Could you upload it to hackage?
Thank you. Ok, I uploaded the current version. At the moment you have
to run topkata in the topkata-0.0 directory with
./dist/build/topkata/topkata, because it has to find its texture/sound
files.
There's a way to put something in the
hello
could someone explain the following differing results
const id 0 5 - 5 -- ie. 'takes' the 'last' one
const (id 0) 5 - 0 -- ie. 'takes' the 'first' one
Thanks
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi,
I've got a question about lazy IO in Haskell. The most well known
function to do lazy IO is the `hGetContents', which lazily reads all the
contents from a handle and returns this as a regular [Char].
The thing with hGetContents is that is puts the Handle in a semi-closed
state, no one can
On Jun 14, 2008, at 11:14 AM, odtaa48 wrote:
const id 0 5 - 5 -- ie. 'takes' the 'last' one
The type of const is a - b - a. The first argument to const here is
id and the second is 0, so the evaluation of const id 0 is going to
result in id. Then we apply id to 5, yielding 5. Perhaps it
On Jun 14, 2008, at 6:14 PM, odtaa48 wrote:
hello
could someone explain the following differing results const id 0
5 - 5 -- ie. 'takes' the 'last' one
const (id 0) 5 - 0 -- ie. 'takes' the 'first' one
Thanks
You can easily see what is happening by rewriting the equations step
by step.
(Sorry, Sebastiaan, I hit send accidentally)
On Sat, Jun 14, 2008 at 1:18 PM, Sebastiaan Visser [EMAIL PROTECTED] wrote:
readHttpMessage :: IO (Headers, Data.ByteString.Lazy.ByteString)
readHttpMessage = do
myStream - accept http connection from client
request - hGetContents myStream
Sebastiaan Visser wrote:
Hi,
I've got a question about lazy IO in Haskell. The most well known
function to do lazy IO is the `hGetContents', which lazily reads all the
contents from a handle and returns this as a regular [Char].
The thing with hGetContents is that is puts the Handle in a
On Jun 14, 2008, at 6:45 PM, Felipe Lessa wrote:
(Sorry, Sebastiaan, I hit send accidentally)
On Sat, Jun 14, 2008 at 1:18 PM, Sebastiaan Visser
[EMAIL PROTECTED] wrote:
readHttpMessage :: IO (Headers, Data.ByteString.Lazy.ByteString)
readHttpMessage = do
myStream - accept http
On Jun 14, 2008, at 6:49 PM, Isaac Dupree wrote:
Sebastiaan Visser wrote:
Hi,
I've got a question about lazy IO in Haskell. The most well known
function to do lazy IO is the `hGetContents', which lazily reads
all the
contents from a handle and returns this as a regular [Char].
The thing
On Sat, Jun 14, 2008 at 1:50 PM, Sebastiaan Visser [EMAIL PROTECTED] wrote:
Doesn't this imply that the parseHttpHeader must work on ByteStrings instead
of regular Strings?
I made the change because it's easier and faster to go from ByteString
to String than the converse.
Maybe this works for
On 2008 Jun 14, at 12:59, Sebastiaan Visser wrote:
But I'm still curious about how to lazily parse messages with
arbitrary size Unicode headers and plain (possibly) binary bodies.
Sounds like Data.Binary (see hackage) to me.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL
On Jun 14, 2008, at 7:16 PM, Felipe Lessa wrote:
On Sat, Jun 14, 2008 at 1:50 PM, Sebastiaan Visser
[EMAIL PROTECTED] wrote:
Doesn't this imply that the parseHttpHeader must work on
ByteStrings instead
of regular Strings?
I made the change because it's easier and faster to go from
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
The problem would be again that no one knows, where Window comes from.
Better would be
I really don't see how this is a big
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
The problem would be again that no one knows, where Window comes from.
Better would
Igloo (Ian Lynagh) allowed me kindly taking over maintainance on his
printf library using template haskell written in 2003. I've updated it
so that it compiles with ghc-6.8.2.
You can get it from hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Printf-TH
usage looks like this:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
The problem would be
I have a small idea. I'm curios if anybody else thinks it's a good idea...
How about a {-# IMPOSSIBLE #-} pragma that documents the fact that a
particular point in the program *should* be unreachable?
For example, you look up a key in a Map. You know the key is there,
because you just put it
On Sat, 2008-06-14 at 19:58 +0100, Andrew Coppin wrote:
I have a small idea. I'm curios if anybody else thinks it's a good idea...
How about a {-# IMPOSSIBLE #-} pragma that documents the fact that a
particular point in the program *should* be unreachable?
For example, you look up a key
On Sat, 14 Jun 2008, Andrew Coppin wrote:
How about a {-# IMPOSSIBLE #-} pragma that documents the fact that a
particular point in the program *should* be unreachable?
...
When compiled without optimisations, the pragma just causes an exception to
be thrown, rather like error does. When
I think when Andy made HPC he added a way to mark code unreachable so it
wouldn't harm your test coverage report.
On Sat, 2008-06-14 at 19:58 +0100, Andrew Coppin wrote:
I have a small idea. I'm curios if anybody else thinks it's a good idea...
How about a {-# IMPOSSIBLE #-} pragma that
andrewcoppin:
I have a small idea. I'm curios if anybody else thinks it's a good idea...
How about a {-# IMPOSSIBLE #-} pragma that documents the fact that a
particular point in the program *should* be unreachable?
For example, you look up a key in a Map. You know the key is there,
tom.davie:
On 14 Jun 2008, at 12:45, Christoph Bauer wrote:
Hi All,
Topkata is a simple OpenGL Game written in Haskell. It's not very
advanced. Goal so far is to guide a ball trough an labyrinth to the
opposite corner. The web page shows an screenshot. It's only tested
under Linux.
Hi
How about a {-# IMPOSSIBLE #-} pragma that documents the fact that a
particular point in the program *should* be unreachable?
Why not make it a function taking a string and returning a value of
any type. Then we can keep our language and not break various
parsing/type checking properties
Does anybody think this is a useful idea? If so I'll add a feature request
ticket to the GHC Trac. But I want to see if folks like the idea first...
Mmmh.. dont' know. Even Java folks don't allow this kind of creeping
bug and I guess they know why. You never want undefined behaviour at
least
On Sat, 14 Jun 2008, Neil Mitchell wrote:
Hi
How about a {-# IMPOSSIBLE #-} pragma that documents the fact that a
particular point in the program *should* be unreachable?
Why not make it a function taking a string and returning a value of
any type. Then we can keep our language and not
Hi, I've been thinking about template haskell sugar lately.
Some cool libraries are there such as metaHDBC or the template haskell
printf library.
However they all have one thing in common:
$(printf ...) a b c
$(runStmt INSERT INTO ( ) VALUES ( ?, ?, ? ) ) 2 3 4
Would it make sense to
Hi
* error - inserted by the compiler
Example?
Pattern-match errors.
* abort - deliberate aborting because the user made some mistake.
This is an exception. The signature of a function must reflect this by a
Maybe, Either type etc.
Disagree. I mean more like:
when (Delete `elem`
On Sat, 14 Jun 2008, Neil Mitchell wrote:
Hi
* error - inserted by the compiler
Example?
Pattern-match errors.
Calling a function with patterns it cannot process is a programming error.
* abort - deliberate aborting because the user made some mistake.
This is an exception. The
Andrew Coppin wrote:
-- cut --
When compiled without optimisations, the pragma just causes an exception
to be thrown, rather like error does. When compiled with
optimisations, the whole case alternative is removed, and no code is
generated for it. (And if the impossible somehow happens...
On Sat, 2008-06-14 at 23:06 +0200, Marc Weber wrote:
Hi, I've been thinking about template haskell sugar lately.
Some cool libraries are there such as metaHDBC or the template haskell
printf library.
However they all have one thing in common:
$(printf ...) a b c
$(runStmt INSERT INTO
Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
On Sat, 14 Jun 2008, Sebastian Sylvan wrote:
On 6/14/08, Henning Thielemann [EMAIL PROTECTED] wrote:
Neil Mitchell wrote:
* abort - deliberate aborting because the user made some mistake.
This is an exception. The signature of a function must reflect this by a
Maybe, Either type etc.
Disagree. I mean more like:
when (Delete `elem` flags Keep `elem` flags) $
abort User cannot pick both
On Sat, 2008-06-14 at 17:19 +1000, Rafal Kolanski wrote:
Ryan Ingram wrote:
sumns 0 = 0
sumns x = sumns (x-1) + n
Without the monomorphism restriction, computing n is a function call;
it is evaluated each time it is asked for.
I'm relatively new to Haskell, and since this topic
On Jun 14, 2008, at 1:06 PM, Don Stewart wrote:
tom.davie:
In the mean time -- who knows enough to make ghc target ARM, and get
this to link against the iPhone libraries? This would be quite a
coup
if it could be made to run there!
I'd be interested. We should start a wiki page for
57 matches
Mail list logo