Hi Hugh,
2007/6/25, Donald Bruce Stewart [EMAIL PROTECTED]:
hughperkins:
Just noticed that all my responses have been going only to
Neil, not to the group.
Anyway, the jist of our conversation was that it's not
possible to create arbitrary datatypes/constructors from
2007/6/25, Michael T. Richter [EMAIL PROTECTED]:
Now I've got a situation I can't figure out how to resolve. I want to have a
set of actions which are executed sequentially, but which, before I even start
to execute the first one, have been inspected for legality and/or plausibility.
On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
Imagine all performActions contain their checks somehow. Let
performActionB take an argument.
do
x - performActionA
y - performActionB x
z - performActionC
return $ calculateStuff x y z
Now
On Mon, 25 Jun 2007, Tomasz Zielonka wrote:
On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
Imagine all performActions contain their checks somehow. Let
performActionB take an argument.
do
x - performActionA
y - performActionB x
z - performActionC
Hi Michael,
On 25 Jun 2007, at 06:39, Michael T. Richter wrote:
do
x - performActionA
y - performActionB
z - performActionC
return $ calculateStuff x y z
I don't know about you're exact example, but here's what I'd do.
Control.Monad has functions like when, unless, and guard that
There is a related discussion, with a lot of pointers, in a recent
D.Piponi blog post:
http://sigfpe.blogspot.com/2007/04/homeland-security-threat-level-
monad.html
On 25/06/2007, at 10:58, peterv wrote:
I'm baffled. So using the Arrow abstraction (which I don't know
yet) would
solve
On Jun 22, 2007, at 3:11 PM, Brandon S. Allbery KF8NH wrote:
(1) any way to flag a pattern match as I know this is okay, don't
warn about it without shutting off pattern match warnings completely?
GHC doesn't issue warnings about patterns on the left of =
For example, the following code
OK, just to prevent this getting side-tracked: I'm absolutely
uninterested in the results of performActionA before determining if
performActionB is permitted/possible/whatever. Think more in terms of
security permissions or resource availability/claiming than in terms of
chaining results. I want
Hi Peter,
2007/6/25, peterv [EMAIL PROTECTED]:
I'm baffled. So using the Arrow abstraction (which I don't know yet) would
solve this problem? How can (perfectActionB x) be checked with without ever
executing performActionA which evaluates to x? This can only be done when x
is a constant
I'm baffled. So using the Arrow abstraction (which I don't know yet) would
solve this problem? How can (perfectActionB x) be checked with without ever
executing performActionA which evaluates to x? This can only be done when x
is a constant expression no?
-Original Message-
From: [EMAIL
On Mon, 25 Jun 2007, Daniil Elovkov wrote:
2007/6/25, Michael T. Richter [EMAIL PROTECTED]:
Now I've got a situation I can't figure out how to resolve. I want to
have a set of actions which are executed sequentially, but which, before I
even start to execute the first one, have been
Hi all,
The scrap your boilerplate with class sytstem [1] has two big
advantages over the plain SYB system from Data.Generics, IMHO: One, it
lets you declare an 'open' generic function as a type class, to which
new cases can be added by adding new instances (emphasized in the
paper); and two, it
2007/6/25, Michael T. Richter [EMAIL PROTECTED]:
OK, just to prevent this getting side-tracked: I'm absolutely
uninterested in the results of performActionA before determining if
performActionB is permitted/possible/whatever. Think more in terms of
security permissions or resource
Wouter Swierstra wrote:
I don't think you really want arrows here. The right idiom is
applicative functors (see Control.Applicative). You could then write the
above as:
calculateStuff $ x * y * z
I think you mean
calculateStuff $ performActionA * performActionB * performActionC
Regards,
On Mon, 25 Jun 2007, Michael T. Richter wrote:
OK, just to prevent this getting side-tracked: I'm absolutely
uninterested in the results of performActionA before determining if
performActionB is permitted/possible/whatever. Think more in terms of
security permissions or resource
Benja Fallenstein wrote:
Hi Peter,
2007/6/25, peterv [EMAIL PROTECTED]:
I'm baffled. So using the Arrow abstraction (which I don't know yet) would
solve this problem? How can (perfectActionB x) be checked with without
ever executing performActionA which evaluates to x? This can only be done
Micheal, I think you mean
do
x - if .. then ..
else ..
y - if ... then..
else...
etc etc
On 6/25/07, Michael T. Richter [EMAIL PROTECTED] wrote:
Now I've got a situation I can't figure out how to resolve. I want to
have a set of actions which are executed sequentially,
Now I've got a situation I can't figure out how to resolve. I want to
have a set of actions which are executed sequentially, but which, before
I even start to execute the first one, have been inspected for legality
and/or plausibility. Consider this kind of sequence:
do
x - performActionA
y
Claus Reinke wrote:
apfelmus wrote:
True enough, in a sense, a dynamically typed language is like a
statically typed language with only one type (probably several by
distinguishing function types) and many incomplete pattern matches.
So, you can embed a dynamically typed language into a
On Mon, 2007-25-06 at 12:19 +0300, Benja Fallenstein wrote:
2007/6/25, Michael T. Richter [EMAIL PROTECTED]:
OK, just to prevent this getting side-tracked: I'm absolutely
uninterested in the results of performActionA before
determining if performActionB is
Michael T. Richter wrote:
It looked to me like there were people arguing about whether the x
returned from one action was going to be used in the next action.
Let me try and rephrase the question. :)
[rephrase]
Yes, and that's an important constellation your problem description does
not
On Mon, 25 Jun 2007, apfelmus wrote:
Michael T. Richter wrote:
It looked to me like there were people arguing about whether the x
returned from one action was going to be used in the next action.
Let me try and rephrase the question. :)
[rephrase]
Yes, and that's an important
The intention is that it should be straightforward to suppress warnings.
Warning about defaulting is important, because it's a place where a silent
choice affects the dynamic semantics of your program. You can suppress the
warning by supplying a type signature. In your example:
| main =
|
We don't recommend calling shutdownHaskell() from DllMain(). Some information
here:
http://haskell.org/haskellwiki/GHC/Using_the_FFI#Debugging_Haskell_DLLs
It should be safe to call shutdownHaskell() (aka hs_exit()) *before* unloading a
DLL, and before exiting the program.
Cheers,
Hello Michael,
Monday, June 25, 2007, 2:10:28 PM, you wrote:
Does this make more sense now? And can it be done somehow in Haskell?
runCheckedCode = checkBeforeRun [actionA x y, actionB z t, actionC]
actionA x y b | b = -- check conditions
| otherwise = -- perform action
Hi Conal
2007/6/24, Conal Elliott [EMAIL PROTECTED]:
By embedded DSL, we usually mean identifying meta-language (Haskell)
expressions with object language (DSL) expressions, rather than having an
Exp data type. Then you just use meta-language variables as
object-language variables. The new
Hello all,
Given an HList (http://homepages.cwi.nl/~ralf/HList/) would it be
possible to do the following:
Create a class/function/magicks that would essentially do what
hOccursMany does, except it would not return a list of elements, but a
new HList. For example, would this allow us to be able
On Jun 25, 2007, at 4:48 AM, Simon Peyton-Jones wrote:
The intention is that it should be straightforward to suppress
warnings.
Simply add a type signature for 'z', or for the naked 3 in z's
definition.
I constructed my example from larger modules peppered with small
integer constants;
| Unless I misunderstand and it is already possible, I'd now prefer a
| language extension that allows the explicit declarations
|
| 2,3 :: Int
|
| once for each affected numeric literal.
i2 = 2 :: Int
i3 = 3 :: Int
S
___
Haskell-Cafe mailing list
On Monday 25 June 2007, Michael T. Richter wrote:
On Mon, 2007-25-06 at 01:05 -0500, Jon Cast wrote:
What exactly are you trying to do?
I'm trying to model a transactional system which could fail
mid-transaction without an easy rollback on conditions which could be
checked in advance.
snip
On Jun 25, 2007, at 8:15 AM, Simon Peyton-Jones wrote:
i2 = 2 :: Int
i3 = 3 :: Int
The code
{-# OPTIONS_GHC -Wall -Werror #-}
module Main where
i2 = 2 :: Int
i3 = 3 :: Int
main :: IO ()
main = putStrLn $ show (i2,i3)
generates the errors
Main.hs:5:0: Warning: Definition but no type
As others have explained, you can't analyse your do-constructs, because
functions are opaque -- at the value level.
The canonical option would indeed seem to be to use arrows (or applicative
functors), instead of monads.
--
If you want to stick to monads, there is another possibility: carry
On Thu, 21 Jun 2007 11:55:04 +0100
Philip Armstrong [EMAIL PROTECTED] wrote:
In odd spare moments, I took John Harrops simple ray tracer[1] made
a Haskell version:
http://www.kantaka.co.uk/cgi-bin/darcsweb.cgi?r=ray
darcs get http://www.kantaka.co.uk/darcs/ray
It's pretty much a
On Sun, 2007-06-24 at 13:33 +0100, Claus Reinke wrote:
if you have a strongly and dynamically typed language, you can embed
strongly and statically typed languages into it. by default, that means
you get more type-checks than necessary and type-errors later than
you'd wish, but you still get
I wrote:
If you want to stick to monads, there is another possibility: carry around
the necessary checks *at the type level*. Below is a sketch of how you
could do this.
Importantly, the given code still requires you to specify the checks by
hand, when running the action; it only checks that
Hello,
Hello all,
Given an HList (http://homepages.cwi.nl/~ralf/HList/) would it be
possible to do the following:
Create a class/function/magicks that would essentially do what
hOccursMany does, except it would not return a list of elements, but a
new HList. For example, would this
I've been going over my code trying to get it all to compile with
ghc -Wall -Werror
I recently ran across what may be a good reason not to use -Wall in
combination with -Werror (and similar combinations in other
compilers), at least not as the standard build switches for software
you intend to
Are there any currently maintained tools for interfacing Haskell with COM
objects? It appears that both Haskell script and Haskell direct haven't
been updated since the turn of the century, and have fallen out of step with
recent library changes.
if you have a strongly and dynamically typed language, you can embed
strongly and statically typed languages into it. by default, that means
you get more type-checks than necessary and type-errors later than
you'd wish, but you still get them.
Are you sure this is true in a meaningful way?
On Fri, Jun 22, 2007 at 11:37:15AM -0700, Dave Bayer wrote:
z = r Prelude.^ 3
I don't know if (^) in particular is what is causing you problems, but
IMO it has the wrong type; just as we have
(!!) :: [a] - Int - a
genericIndex :: (Integral b) = [a] - b
Felipe Almeida Lessa wrote:
On 6/23/07, Andrew Coppin [EMAIL PROTECTED] wrote:
It's nice that you can have millions of threads if you want to do
something very concurrent. What I tend to want is parallel - doing
stuff that *could* be done in a single thread, but I want it to go
faster using my
Lennart Augustsson wrote:
If you don't run into graphs you are either solving very peculiar
problems, or you don't recognize them when you see them. They are
everywhere.
I see lots of *trees*, but no general graphs. (As in, *data* structures
having cycles in them. My *code* is often
On Mon, Jun 25, 2007 at 07:31:09PM +0100, Ian Lynagh wrote:
I don't know if (^) in particular is what is causing you problems, but
IMO it has the wrong type; just as we have
(!!) :: [a] - Int - a
genericIndex :: (Integral b) = [a] - b - a
we should also have
On Fri, Jun 22, 2007 at 03:32:19PM +0200, Daniel Fischer wrote:
Am Freitag, 22. Juni 2007 04:29 schrieb Donald Bruce Stewart:
The file system was down here, sorry. Should be up now.
Ah, just unlucky timing.
darcs got, installed, all well.
I Know I'm probably late, but with the darcs
Andrew Coppin wrote:
Lennart Augustsson wrote:
If you don't run into graphs you are either solving very peculiar
problems, or you don't recognize them when you see them. They are
everywhere.
I see lots of *trees*, but no general graphs. (As in, *data* structures
having cycles in them. My
Bryan,
I downloaded your FileManip library and Duncan's zlib library, but I
kept getting a Too many open files exception (it matches over 9000
files). I tried to get around this using unsafeInterleaveIO as Greg
had suggested, so now I have this:
foo = namesMatching */*.z =
fmap B.concat .
apfelmus wrote:
Andrew Coppin wrote:
I see lots of *trees*, but no general graphs. (As in, *data* structures
having cycles in them. My *code* is often cyclic...)
So what does a compiler do to typecheck it? It represents your code as a
graph and calculates strongly connected
Andrew Coppin wrote:
Felipe Almeida Lessa wrote:
Have you seen this paper?
http://www.macs.hw.ac.uk/~dsg/gph/papers/html/Strategies/strategies.html
It's probably want you want, I think.
Well, it certainly looks interesting... thanks.
Does anybody know where I can find a version of this
On 25 jun 2007, at 20.38, Andrew Coppin wrote:
Lennart Augustsson wrote:
If you don't run into graphs you are either solving very peculiar
problems, or you don't recognize them when you see them. They are
everywhere.
I see lots of *trees*, but no general graphs. (As in, *data*
On Mon, Jun 25, 2007 at 07:31:09PM +0100, Ian Lynagh wrote:
I don't know if (^) in particular is what is causing you problems, but
IMO it has the wrong type; just as we have
(!!) :: [a] - Int - a
genericIndex :: (Integral b) = [a] - b - a
we should also have
Hi,
after many test I found out that System.Process.runInteractiveProcess
leaks memory while runInteractiveCommand does.
The issue of memory leaks related to running external program was
raised here:
http://www.haskell.org/pipermail/haskell-cafe/2007-June/027234.html
and Bryan noted that after a
I also tried gzipping a different, smaller file, and I changed the
string in bar accordingly. No error in that case. So it seems to be
a problem with myData.z, but why would it gunzip from the command line
with no trouble in that case?
Thanks,
Chad
Because gunzip is smarter than your program
Sebastian Sylvan wrote:
On 25/06/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Does anybody know where I can find a version of this paper that actually
has the diagrams in it?
On Mon, 25 Jun 2007, Ian Lynagh wrote:
On Fri, Jun 22, 2007 at 11:37:15AM -0700, Dave Bayer wrote:
z = r Prelude.^ 3
I don't know if (^) in particular is what is causing you problems, but
IMO it has the wrong type; just as we have
(!!) :: [a] - Int - a
Hopefully this is just about on topic enough..
(Oh and it's not home work, I just can't bring myself to let it go!)
Taken from Simon Thompson: Type Theory and Functional Programming
Section 1.1
Exercise 1.3
Question: Give a proof of (A = (B = C)) = ((A /\ B) = C).
Now I can easily perform
Hello Chad,
Monday, June 25, 2007, 10:47:11 PM, you wrote:
bar = fmap decompress $ B.readFile myData.gz
try it with non-lazy bytestrings:
import qualified Data.ByteString as B
--
Best regards,
Bulatmailto:[EMAIL PROTECTED]
Jedaï,
Are you sure you're not confusing .z with .Z?
http://kb.iu.edu/data/afcc.html
And is it possible that gzip is smarter somehow? Doesn't
Codec.Compression.GZip call the same C library used by gzip?
Chad
On 6/25/07, Chaddaï Fouché [EMAIL PROTECTED] wrote:
Because gunzip is smarter than
Hello,
But here I am only entitled to discharge (A /\ B) in the preceding
proof and not A and B on their own.
What proof which would allow me to discharge my assumptions A and B?
I can see in my head how it makes perfect sense, but can't jiggle a
way to do it using only the given
Whoops, okay after two lines (thanks to oerjan) on #haskell I realise
that yes, it is as easy as it should have been.
For completeness:
[A /\ B]1
(/\ E1) [A = (B = C)]2
A
- (= E)
Bulat,
I don't think I can. (1) (de)compress is defined for lazy bytestrings,
and (2) my data comes to me compressed in order to fit it all on a
single DVD. So even if I could uncompress each file strictly, I
couldn't hold such a big strict bytestring in memory at once.
On 6/25/07, Bulat
This seems rather complicated! What about this:
A = (B = C)
= { X = Y == ¬X \/ Y }
¬A \/ (¬B \/ C)
= {associativity}
(¬A \/ ¬B) \/ C
= { DeMorgan }
¬(A /\ B) \/ C
= { X = Y == ¬X \/ Y }
A /\ B = C
E.
Dave Tapley wrote:
Whoops, okay after two lines
On Mon, Jun 25, 2007 at 12:48:27PM -0700, Chad Scherrer wrote:
Jedaï,
Are you sure you're not confusing .z with .Z?
http://kb.iu.edu/data/afcc.html
And is it possible that gzip is smarter somehow? Doesn't
Codec.Compression.GZip call the same C library used by gzip?
gzip: supports gzip,
Chad Scherrer wrote:
Now it doesn't complain about too many open files, but instead I get
this runtime error:
LPS *** Exception: user error (Codec.Compression.Zlib: incorrect header
check)
Are you sure you really have gzip files? If you're on a Linux or
similar box, what does file
On Mon, Jun 25, 2007 at 08:53:18AM -0700, Dave Bayer wrote:
It continues to appear to me that ghc -Wall -Werror doesn't support
small Int constants without a per-use penalty, measured in code length.
Why not use ghc -Wall -Werror -fno-warn-defaulting, maybe with
default(Int)? It removes the
On 6/25/07, Bryan O'Sullivan [EMAIL PROTECTED] wrote:
Are you sure you really have gzip files? If you're on a Linux or
similar box, what does file myfile.z report to you? It should say
something like gzip compressed data.
Aarrgh, that's the problem - it does use compress. Is the distinction
On Mon, Jun 25, 2007 at 02:13:05PM -0700, Chad Scherrer wrote:
On 6/25/07, Bryan O'Sullivan [EMAIL PROTECTED] wrote:
Are you sure you really have gzip files? If you're on a Linux or
similar box, what does file myfile.z report to you? It should say
something like gzip compressed data.
On 6/25/07, Stefan O'Rear [EMAIL PROTECTED] wrote:
.z : always pack
.Z : always compress
.gz : always gzip
gzip can handle all three, zlib only the last. (Are you *sure* your
file is compress?)
This means it's compress, doesn't it?
$ file myData.z
myData.z: compress'd data 16 bits
I
On Mon, Jun 25, 2007 at 02:42:18PM -0700, Chad Scherrer wrote:
On 6/25/07, Stefan O'Rear [EMAIL PROTECTED] wrote:
.z : always pack
.Z : always compress
.gz : always gzip
gzip can handle all three, zlib only the last. (Are you *sure* your
file is compress?)
This means it's compress,
On Jun 25, 2007, at 14:47 , Chad Scherrer wrote:
LPS *** Exception: user error (Codec.Compression.Zlib: incorrect
header check)
Keep in mind that GNU gunzip also handles the old compress (.Z) and
System V pack (.z) formats; I'd expect the Zlib codec to only
handle gzip format and not
On Jun 25, 2007, at 17:24 , Stefan O'Rear wrote:
.z : always pack
.Z : always compress
...unless it's gone through a Windows system or a CD somewhere along
the way.
Note that gunzip accepts a wide variety of extensions but recognizes
the files by magic number, *not* by the extension.
On Mon, 2007-06-25 at 20:41 +0100, Dave Tapley wrote:
Hopefully this is just about on topic enough..
(Oh and it's not home work, I just can't bring myself to let it go!)
Taken from Simon Thompson: Type Theory and Functional Programming
Section 1.1
Exercise 1.3
Question: Give a proof of
Hey everyone. So I've been learning Haskell for a while now, and I've found the
best way to move from theory to practice is to just write something useful for
yourself. Now, I'm keen on editing Wikipedia and I've long wanted some way to
stop links to external websites from breaking on me. So I
Hi
You may find that the slow down is coming from your use of the TagSoup
library - I'm currently reworking the parser to make sure its fully
lazy and doesn't space leak. I hope that the version in darcs tomorrow
will have all those issues fixed.
Thanks
Neil
On 6/26/07, Gwern Branwen [EMAIL
Hello Darrell,
On Tue, 26 Jun 2007 03:08:02 +0900, Lewis-Sandy, Darrell [EMAIL PROTECTED]
wrote:
Are there any currently maintained tools for interfacing Haskell with COM
objects? It appears that both Haskell script and Haskell direct haven't
been updated since the turn of the century, and
gwern0:
Hey everyone. So I've been learning Haskell for a while now, and I've
found the best way to move from theory to practice is to just write
something useful for yourself. Now, I'm keen on editing Wikipedia and
I've long wanted some way to stop links to external websites from
breaking on
75 matches
Mail list logo