Henning Thielemann wrote:
[...]
http://haskell.org/haskellwiki/Case
Maybe we (i. e. someone with a wiki account ;) ) should add Jeremy's
proposal - using let and guards - to the page (under section 2.2,
syntactic suger)? IMHO this is much clearer than case () of _.
foo =
let x | 1 1
On Wed, Jun 24, 2009 at 11:13 PM, Hector Guilarte hector...@gmail.comwrote:
Thanks! Actually, if I understood well what you proposed, that's how I
first tought of doing it, but with a [Maybe String] and only append whenever
I actually had a (Just string), but as I said before, I don't think
2009/6/25 Hector Guilarte hector...@gmail.com:
On Fri, Jun 26, 2009 at 12:58 AM, Brandon S. Allbery KF8NH
allb...@ece.cmu.edu wrote:
On Jun 26, 2009, at 00:43 , Hector Guilarte wrote:
Thanks! Actually, if I understood well what you proposed, that's how I
first tought of doing it, but
On Jun 26, 2009, at 01:11 , Hector Guilarte wrote:
Ok, I got it this time, thanks! I should really talk this with my
teacher. I'll post whatever he tells me... Let's hope he lets me
just acumulate all the strings and print them in the end.
You're still missing what lazy evaluation means.
It's too bad that indexes are `Int` instead of `Word` under
the hood. Why is `Int` used in so many places where it is
semantically wrong? Not just here but also in list indexing...
Indices/offsets can only be positive and I can't see any good
reason to waste half the address space -- yet we
Hello Claus,
Thursday, June 25, 2009, 11:50:12 AM, you wrote:
PS. You could, of course, rebase your array indices to make
use of the negatives, so the address space isn't wasted, just
made difficult to use.
no, he can't - internally indexes are always counted from 0, so array
cannot
Luke Palmer lrpal...@gmail.com writes:
mult2 x = unsafePerformIO $ do { print x; return (2*x) }
main = do
let answer = mult2 21
print answer
print answer
[this] would print 21,42,42. Thus our *correct* transformation of programs
changed behavior.
Just to expand a bit on
What about extending haskell (or ghc) with mixfix operators, Agda style?. At
first sigth it would permit the creation of custom control structures and
perhaps more readable DSLs.
2009/6/25 Stephan Friedrichs deduktionstheo...@web.de
Henning Thielemann wrote:
[...]
Hi,
In many language, both thread and process are supported. But in
haskell's document, the only thing I could find called fork is to make
a thread. So how to fork the program itself, like fork () in C?
Thanks.
--
竹密岂妨流水过
山高哪阻野云飞
___
Haskell-Cafe
On Jun 25, 2009, at 05:01 , Magicloud Magiclouds wrote:
In many language, both thread and process are supported. But in
haskell's document, the only thing I could find called fork is to make
a thread. So how to fork the program itself, like fork () in C?
Internal threads can be done
Hi all,
I'm puzzled by something. Suppose I have some code that does lots of
IO, and also occasionally refers to some global state. No problem, use
ReaderT for the state, combining with the IO monad. Except... since IO
is on the bottom, simple uses of do-notation such as foo - ask work
in
Richard Silverman wrote:
I'm puzzled by something. Suppose I have some code that does lots of IO,
and also occasionally refers to some global state. No problem, use
ReaderT for the state, combining with the IO monad. Except... since IO
is on the bottom, simple uses of do-notation such as foo -
By the way, how would one write the following with Monad Transformers?
newtype IOMayfail a = IOMayfail (IO (Maybe a))
instance Monad IOMayfail where
return = IOMayfail . return . return
(=) a f = IOMayfail (bind (run a) (run . f))
fail s = trace s (IOMayfail $ return Nothing)
Well, without fail part:
newtype IOMayfail a = IOMayfail (MaybeT IO a) deriving Monad
Matthias Görgens wrote on 25.06.2009 17:14:
By the way, how would one write the following with Monad Transformers?
newtype IOMayfail a = IOMayfail (IO (Maybe a))
instance Monad IOMayfail where
return
Thanks. Can I add something like fail?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I have a program that optimizes train schedules. It employs an
external solver for Integer Linear Programs. The solve function has
the following type:
solve :: Constraints - IO (Maybe Solution)
And this works. However, my external solver also behaves like a pure
function from input to
Matthias Görgens wrote:
I have a program that optimizes train schedules. It employs an
external solver for Integer Linear Programs. The solve function has
the following type:
solve :: Constraints - IO (Maybe Solution)
And this works. However, my external solver also behaves like a pure
Sure:
newtype IOMayfail a = IOMayfail {runIOMayfail :: MaybeT IO a}
instance Monad IOMayfail where
return = IOMayfail . return
IOMayfail m = f = IOMayfail $ m = runIOMayfail . f
fail = whatever you like
Matthias Görgens wrote on 25.06.2009 17:28:
Thanks. Can I add something like fail?
On Thu, Jun 25, 2009 at 03:38:41PM +0200, Matthias Görgens wrote:
I have a program that optimizes train schedules. It employs an
external solver for Integer Linear Programs. The solve function has
the following type:
solve :: Constraints - IO (Maybe Solution)
And this works. However,
On Thu, Jun 25, 2009 at 3:49 PM, John Meachamj...@repetae.net wrote:
However, if the algorithm takes a signifigant amount
of time or resources, you may want to keep it in IO just so users can
have control over exactly when and how often it is run.
If you had a pure function written in Haskell
Adding 'unsafePerformIO' will work, but a better idea might be to
understand why your solver has IO in its type signature. Is this because
of FFI calls? You can remove IO in FFI calls if they are free from side
effects as well.
My solver has IO in the type signature, because I said so. :o)
Is it possible to determine the arity of a value's constructor?
Suppose I have a value x of type
data A = B Int | C
They typeOf function returns its TypeRep, which contains its type
constructor, but I don't see how to decide whether that
constructor's arity is 0 or 1. If the type has field
Dear Group,
I am posting this here even though it probably belongs on the
apache list because I suspect other haskell users will be able to
find it here more easily. I am playing around with hack, and am
having trouble with configuring apache with fastcgi to make
things work. My understanding
Regarding how to make the show instructions cause printout as soon as
they are executed:
If you write your interpreter to return a list of printout lines
(strings), you get this behavior for free. Haskell's laziness enables
the printing to start right away, while in an imperative language the
Hey David,
For instance:
arity :: (Data a) = a - Int
arity = length . gmapQ (const ())
Cheers,
Pedro
On Thu, Jun 25, 2009 at 17:31, David Fox dds...@gmail.com wrote:
Is it possible to determine the arity of a value's constructor?
Suppose I have a value x of type
data A = B Int | C
Is there a relationship between sessions and coroutines?
--
Jason Dusek
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Could you or anyone else briefly explain how mmtl solves the
combinatorical explosion problem? Reading the source code is not very
productive for newbies like me. Thanks!
On Tue, Jun 23, 2009 at 5:34 AM, Luke Palmerlrpal...@gmail.com wrote:
On Tue, Jun 23, 2009 at 2:20 AM, papa.e...@free.fr
OK, I found two papers by the author, Mauro Jaskelioff, that seem
relevant. One paper Modular Monad Transformers is all category
theoretical. Maybe I should read the other one Monatron: An
Extensible Monad Transformer Library.
On Thu, Jun 25, 2009 at 12:17 PM, Wei Huwei@gmail.com wrote:
Henry Laxen wrote:
I have tried several things, the most recent being:
RewriteEngine on
RewriteRule ^/(.*)$ /hackTest?input=$1 [T=application/x-httpd-cgi]
Location /
SetHandler fastcgi-script
Options ExecCGI FollowSymLinks
/Location
but the pathInfo field is always null.
Path info
On Thu, Jun 25, 2009 at 12:17 PM, Wei Huwei@gmail.com wrote:
Could you or anyone else briefly explain how mmtl solves the
combinatorical explosion problem? Reading the source code is not very
productive for newbies like me. Thanks!
It's a good question, since from what I can tell mmtl does
Oh, that make sense!
2009/6/25 José Pedro Magalhães j...@cs.uu.nl
Hey David,
For instance:
arity :: (Data a) = a - Int
arity = length . gmapQ (const ())
Cheers,
Pedro
On Thu, Jun 25, 2009 at 17:31, David Fox dds...@gmail.com wrote:
Is it possible to determine the arity of a
Anton van Straaten anton at appsolutions.com writes:
Path info is path-like data that directly follows the name of the
resource being referenced, e.g.: /myfiles/foo.html/this/is/path/info
A rule that would give you path info in the case you describe would be
more like this:
Hi
I have some code, but never got round to uploading it or turning it in
to a package. If the graphviz package doesn't have what you want I'm
happy to give you a copy. (I would attach the code but I don't have it
on this machine)
Thanks
Neil
On Wed, Jun 24, 2009 at 7:38 AM, minh
harack ? *Harack*. Excuse me.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
2009/06/24 Greg Meredith lgreg.mered...@biosimilarity.com:
Better support for std Haskell syntax
What does this mean, actually? Better support for standard
Haskell syntax than what?
--
Jason Dusek
___
Haskell-Cafe mailing list
Thanks. I'll go with the monad for now.
Geoffrey
On Sat, Jun 20, 2009 at 4:40 PM, Lennart
Augustssonlenn...@augustsson.net wrote:
Use 1. You'll probably need a monad in the type checker soon or later
anyway, e.g., for handling errors.
On Sun, Jun 21, 2009 at 5:13 AM, Zsolt
Jason,
CAL's syntax is not std Haskell syntax.
Best wishes,
--greg
On Thu, Jun 25, 2009 at 11:10 AM, Jason Dusek jason.du...@gmail.com wrote:
2009/06/24 Greg Meredith lgreg.mered...@biosimilarity.com:
Better support for std Haskell syntax
What does this mean, actually? Better support
Having read some of the material, it seems that sessions are
far richer than would be needed for most coroutines.
--
Jason Dusek
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Thu, Jun 25, 2009 at 1:10 PM, David Menendezd...@zednenem.com wrote:
On Thu, Jun 25, 2009 at 12:17 PM, Wei Huwei@gmail.com wrote:
Could you or anyone else briefly explain how mmtl solves the
combinatorical explosion problem? Reading the source code is not very
productive for newbies
Bulat Ziganshin wrote:
Hello wren,
Thursday, June 25, 2009, 6:35:36 AM, you wrote:
Rank2Types, RankNTypes, ExistentialQuantification, ScopedTypeVariables,
and GADTs are fairly benign ---though this is where you start loosing
compatibility with non-GHC compilers.
afair, except for GADTs
Richard Silverman wrote:
Hi all,
I'm puzzled by something. Suppose I have some code that does lots of IO,
and also occasionally refers to some global state. No problem, use
ReaderT for the state, combining with the IO monad. Except... since IO
is on the bottom, simple uses of do-notation
Some of us on #haskell last night (well, night for me :p) were
discussing this, and we're going to start a new project to implement an
extended version of my proposal. The working project name is simply
graph (hey, we couldn't think of anything better!). If you want to
join in the fun, talk to
42 matches
Mail list logo