On Wed, 15 Apr 2009 23:31:50 -0700
Michael Mossey wrote:
> I was thinking that it might be useful to have a Google-like "do you
> mean this?" feature. If the field name is //customer=, then the
> parser might recognize a huge list of variants
> like //ustomer=, //customor=, etc...
You could redu
2009/4/16 Michael Mossey :
> I was thinking that it might be useful to have a Google-like "do you mean
> this?" feature. If the field name is //customer=, then the parser might
> recognize a huge list of variants like //ustomer=, //customor=, etc... that
> is, recognize them well enough to continue
I'm thinking of writing a parser to load files that my customers have created. I'm a
software requirements engineer; the data consists of the customers' thoughts in
response to the latest release of the requirements doc. In fact, the files will
probably be copies of the requirements doc itself,
I am having problem running GHCI with Haskell files that include imports.
I am running emacs22 on Ubuntu, with haskell-mode-2.4 extensions.
I load my file (Fal.lhs in this case) in emacs. Then try to run the Ghci by
doing C-c C-l. The result is shown below. Ghci fails to find the
Draw.lhs
And i forgot to include the defs of (co)prod:
coprod (<>) i1 i2 = (\a b -> i1 a <> i2 b)
prod (><) p1 p2 = (\a -> p1 a >< p2 a)
diag = foldr (curry (prod mappend
fst
snd
. uncurry (coprod mappend
(spli
*..against Monoid's method names.
On Wed, Apr 15, 2009 at 9:59 PM, Matt Morrow wrote:
> ... against the Monoid method's names.
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I think this has the semantics you're looking for. (it would probably be
somewhat prettier if "mappend" wasn't such an ugly identifier (compared to,
say, (++)), but this is just me trying to sneak a shot in against the Monoid
method's names ;)
ghci> let diag = foldr (curry (prod mappend fst snd .
Thanks guys. It works like a charm.
Michael
--- On Wed, 4/15/09, Rahul Kapoor wrote:
From: Rahul Kapoor
Subject: Re: [Haskell-cafe] Enum to String, and back?
To:
Cc: haskell-cafe@haskell.org
Date: Wednesday, April 15, 2009, 3:20 PM
On Wed, Apr 15, 2009 at 3:13 PM, michael rice wrote:
> Usin
Could you pastebin something that demoes the error?
--
Jason Dusek
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Great. Thanks! This is exactly what I was looking for. Apparently this
issue is also described in the paper Asynchronous Exception in Haskell.
Thanks,
Andrew
On Wed, 15 Apr 2009, Jason Dagit wrote:
On Wed, Apr 15, 2009 at 4:06 PM, Andrew Gallagher wrote:
Hi,
In a program I am writing, I
Peter Verswyvelen wrote:
> The reason why I'm talking about examples and not semantics is
> because the latter seems to be pretty hard to get right for FRP?
>
There's a difference between those two? I've heard much, but never
anyone complaining about specifications overlapping in a compatible
way
On Wed, Apr 15, 2009 at 4:06 PM, Andrew Gallagher wrote:
> Hi,
>
> In a program I am writing, I have many locations where I acquire a resource,
> perform an operation with it, then release it. I have been using the
> 'bracket' function so that the "release" operation would be performed even
> if
Hi,
In a program I am writing, I have many locations where I acquire a
resource, perform an operation with it, then release it. I have been
using
the 'bracket' function so that the "release" operation would be performed
even if the operation threw an exception. This seems to work nicely.
Hello,
Several days ago I posted a question about retargeting GHC to generate
CIL so that Haskell could be a .NET language. One objection was Haskell
"lazy" nature didn't fit well with .NET's CLR. I found a couple publications
http://www.ddj.com/windows/184404967;jsessionid=0AVCEATVAEG
I think it would be nice if we could make a "reactive benchmark" or
something: some tiny examples that capture the essence of reactive systems,
and a way to compare each solution's pros and cons.
For example the "plugging a space leak with an arrow" papers reduces the
recursive signal problem to
e
On Wed, Apr 15, 2009 at 3:13 PM, michael rice wrote:
> Using Show it is possible to establish a relationship between an enum type
> and a String type to display it.
> Can one as easily establish a reverse relationship, i.e., convert a String
> type like "Red" back to its corresponding Color type?
Hi Michael,
michael rice wrote:
Can one as easily establish a reverse relationship, i.e., convert a
String type like "Red" back to its corresponding Color type?
So that
"Red" :: [Char] -> Red :: Color
Yes, simply add Read to your list of to be derived type classes. Then
you can say:
> re
Hi,
Using Show it is possible to establish a relationship between an enum type
data Color
= Red
| Blue
| Green
| Yellow
| Orange
| Brown
| White
| Black
deriving (Show, Eq, Enum, Bounded)
and a String type to display it.
*Main> Red
Red
*Main> [Red,Green,Blue]
Hi Niklas
Good to hear from you, and thanks for providing such a
useful starting point for my experiments.
On 15 Apr 2009, at 19:27, Niklas Broberg wrote:
Hi Conor,
Conor McBride:
The trouble is, the production I've added causes a
reduce/reduce conflict in the grammar, but I don't get
any mo
Hi Conor,
Conor McBride:
> The trouble is, the production I've added causes a
> reduce/reduce conflict in the grammar, but I don't get
> any more precise complaint than that.
To get more precise complaints, you should give the -i flag to happy,
that will cause happy to print the whole parser tabl
but the fact that the breakout example works is an indication that at
least it's not hopelessly broken.
Well, a breakout game does *not* work (yet) in most other FRP
implementations except Yampa, which do have firm theoretical foundations :-)
While certainly more entertaining, the problem looks
There's one sentence I remember from some Extreme Programming books I read:
"the customer only knows what he wants when he gets it"
:-)
On Tue, Apr 14, 2009 at 11:27 AM, Achim Schneider wrote:
> "Richard O'Keefe" wrote:
>
> > If you have a low level of trust, you'll need a great level of
> >
| But the core part of my suggestion (which this example was meant
| to help explain) remains attractive, at least to me: somewhere during
| type inference, GHC *does* unify the *apparently free* 'd' with an
| internal type variable (lets call it 'd1, as in the type error message)
You are specula
Hello all,
I have been rewriting a small utility program of mine from C to Haskell
for fun. This tool reads lines from stdin or from files, shuffles them
one or more times using the Fisher-Yates algorithm, and outputs the
result to stdout.
Since this algorithm is based on in-place updat
I've just uploaded a package with some functions I had lying around.
> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Numbers
Am 14.04.2009 um 14:40 schrieb Niemeijer, R.A.:
Today I happened to need a large list of prime numbers. Obviously
this is a well-known problem, so I figur
I am pleased to announce version 0.3 of the package level-monad.
This package implements breadth-first search directly as an instance
of MonadPlus (without using an intermediate tree representation). In
version 0.3 I have added a MonadPlus instance for iterative deepening
inspired by Michae
On Wed, Apr 15, 2009 at 11:21 AM, David F. Place wrote:
Hi,
Suppose I have installed a number of libraries and have written a
program using them. Now, I want to profile my program. What is the
best way to get the profiling versions of the libraries installed?
Thanks,
David
I'd chuck 'libra
Hi,
Suppose I have installed a number of libraries and have written a
program using them. Now, I want to profile my program. What is the
best way to get the profiling versions of the libraries installed?
Thanks,
David
___
Haskell-Cafe mailing list
Ha
On 15 Apr 2009, at 16:01, Lennart Augustsson wrote:
I'd suggest using some different kind of brackets to relieve the
misery, like {| |}.
That would speed up my tinkering, certainly.
I did have a d'oh moment: you can write
data Foo = Moo {goo :: Int} -- braces where a type goes
and indee
I'd suggest using some different kind of brackets to relieve the
misery, like {| |}.
On Wed, Apr 15, 2009 at 4:10 PM, Conor McBride
wrote:
> Hi folks
>
> In search of displacement activity, I'm trying to tweak
> Language.Haskell.Exts to support a few more perfidious
> Exts I have in mind -- they
Vasyl Pasternak writes:
> 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.
> I don't see any strong reasons to write
Hi folks
In search of displacement activity, I'm trying to tweak
Language.Haskell.Exts to support a few more perfidious
Exts I have in mind -- they only need a preprocessor,
but I do need to work on parsed programs, ideally.
I was hoping to add a production to the grammar of types
to admit expre
Hello John,
Wednesday, April 15, 2009, 5:35:00 PM, you wrote:
> I agree. Is there any chance of 6.10.3 reverting the change?
both 6.6 and 6.8 had last releases at spring, so i don't expect new
6.10.* at all
--
Best regards,
Bulatmailto:bulat.zigans...@gmail.com
Lennart Augustsson wrote:
> Removing a package in a minor release is, to quote, an epic fail.
> I don't understand how that could be done.
I agree. Is there any chance of 6.10.3 reverting the change?
-- John
>
> -- Lennart
>
> On Tue, Apr 14, 2009 at 6:56 PM, Bulat Ziganshin
> wrote:
>> He
Well, a breakout game does *not* work (yet) in most other FRP
implementations except Yampa, which do have firm theoretical foundations :-)
2009/4/15 Patai Gergely
> > I don't think using dirty tricks to implement FRP deserves
> > flak, at all, from my POV, it sounds like complaining that the
> >
Hi,
On 15.04.2009, at 13:28, Sebastian Fischer wrote:
Actually, there are a number of implementations that implement the
same behaviour as the original version, e.g.,
diag = concat . foldr diags []
where
diags [] ys = ys
diags (x:xs) ys = [x] :
- 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; data
diag [[1,2,3],[4],[5,6,7]]
What it should be?
*Main> diag [[1,2,3],[4],[5,6,7]]
[1,2,4,3,5,6,7]
it's basically just "skipping holes":
1 2 3
4
5 6 7
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
Simon Peyton-Jones wrote:
> Yes, Haskell says that in any program there should be only one
> instance for any particular type (here Monoid Int). GHC
> doesn't check that, but it should really do so. It's not
> necessary for soundness (ie no runtime crash) but it is
> necessary for coherence (ie
What about
diag [[1,2,3],[4],[5,6,7]]
?
What it should be?
Sebastian Fischer wrote on 15.04.2009 15:28:
Prelude> let diag = concat . diags where diags ((x:xs):xss) = [x] :
zipWith (:) xs (diags xss)
this has a different semantics on finite lists, so I should add a test
case:
*Main> diag
David Carter wrote:
> I then thought I might work around the problem by converting lazy
> ByteStrings to strict ones in order to do the regex match.
>
strictBS :: LB.ByteString -> B.ByteString
strictBS = B.concat . LB.toChunks
lazyBS :: B.ByteString -> LB.ByteString
lazyBS = LB.fromChunks . pure
Am Dienstag, 14. April 2009 20:01 schrieb Tillmann Rendel:
> How is the need for a common import for 'data TTrue; data TFalse'
> different then the need for a common import for 'data Bool = True | False'?
Why not say
data True
data False,
instead of
data TTrue
data TFalse?
I
Prelude> let diag = concat . diags where diags ((x:xs):xss) = [x] :
zipWith (:) xs (diags xss)
this has a different semantics on finite lists, so I should add a test
case:
*Main> diag [[1,2,3],[4,5,6],[7,8,9]]
[1,2,4,3,5,7,6,8,9]
Your version yields [1,2,4,3,5,7].
Actually, there are a nu
Am Mittwoch, 15. April 2009 09:03 schrieb Achim Schneider:
> I don't think using dirty tricks to implement FRP deserves flak, at
> all, from my POV, it sounds like complaining that the IO monad is
> implemented using C... meaning that if you're that close to bare
> thunks, you have every right to u
Hi,
I am battling with Data.ByteString.Lazy.Char8, and currently losing.
Any help gratefully received. Here's my code:
import qualified Data.ByteString.Lazy.Char8 as B
import Text.Regex.Posix ((=~))
test = B.pack "abc" =~ B.pack "b" :: Bool
This works fine without the ".Lazy", and is also fine u
Sorry, I misread the task :)
/ Emil
Emil Axelsson skrev:
Why not:
diag = [(x, sum-x) | sum <- [2..], x <- [1 .. sum-1]]
/ Emil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
For isPrime you might want to implement the AKS test,
http://en.wikipedia.org/wiki/AKS_primality_test
On Tue, Apr 14, 2009 at 3:05 PM, Edward Kmett wrote:
> 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:4
Why not:
diag = [(x, sum-x) | sum <- [2..], x <- [1 .. sum-1]]
/ Emil
MigMit skrev:
If I understand the problem correctly...
Prelude> let diag = concat . diags where diags ((x:xs):xss) = [x] :
zipWith (:) xs (diags xss)
Prelude> take 10 $ diag [[ (m,n) | n <- [1..]] | m <- [1..]]
[(1,1)
If I understand the problem correctly...
Prelude> let diag = concat . diags where diags ((x:xs):xss) = [x] : zipWith (:)
xs (diags xss)
Prelude> take 10 $ diag [[ (m,n) | n <- [1..]] | m <- [1..]]
[(1,1),(1,2),(2,1),(1,3),(2,2),(3,1),(1,4),(2,3),(3,2),(4,1)]
Sebastian Fischer wrote on 15.04.200
Fancy some Codegolf?
I wrote the following function for list diagonalization:
> diag l = foldr (.) id ((sel l . flip sel) ((:[]).(:))) []
> where
> sel = foldr (\a b c -> id : mrg (a c) (b c)) (const []) . map
(flip id)
>
> mrg [] ys = ys
> mrg xs [] = xs
> mrg (x:xs)
for the API design, always check others before rolling your own.
E.g. the (three) functions with "Prime" in their name from
http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html
I hope they are there for a reason.
While we're at it - do we have modPow? modInverse?
And of course check t
Edward Kmett wrote:
You might want to start with the Sieve of Atkin:
http://en.wikipedia.org/wiki/Sieve_of_Atkin
Also worth reading _Lazy wheel sieves and spirals of primes_:
http://www.cs.york.ac.uk/ftpdir/pub/colin/jfp97lw.ps.gz
--
Live well,
~wren
_
"Patai Gergely" wrote:
> Am I right thinking that the
> NOINLINE pragma on unsafeDupablePerformIO prevents the problem of
> multiple evaluation discussed yesterday?
>
From what I know and experienced, yes. Each individual unsafePerformIO
only ever evaluates its action once, and if they are preven
> I will test it on a couple of machines, desktops and laptops.
Try using a sensible nonzero value with threadDelay. Apparently it
brings CPU usage down under Windows while retaining smoothness. However,
increasing it from zero results in jerkiness under Linux...
> If you take a look what Yampa do
So I am getting a little further, but i am seeing this bizarre behaviour:
I wrote a function that will fold over parameters and push them into a
constructor if it can
given this type:
data Foo = FooC Int
| BarC Int
deriving (Data, Typeable, Show)
i can do this:
> l
> I don't think using dirty tricks to implement FRP deserves
> flak, at all, from my POV, it sounds like complaining that the
> IO monad is implemented using C... meaning that if you're that
> close to bare thunks, you have every right to use any means
> necessary to make them behave properly.
Dirt
Jeff Wheeler 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?
>
Nope, but I'll be writing bug reports next time, at the very least.
--
(c) this sig last receiving data processing entity.
"Patai Gergely" wrote:
> ...
>
I don't think using dirty tricks to implement FRP deserves flak, at
all, from my POV, it sounds like complaining that the IO monad is
implemented using C... meaning that if you're that close to bare
thunks, you have every right to use any means necessary to make the
58 matches
Mail list logo