Here's something that should be an easy extension of Wouter's approach
to extensible datatypes, but I'm failing (possibly since it's 2:20am).
I several classes of expressions I'm trying to represent (thus,
Wouter's approach), and my first operation to implement over them is
printing.
Attached is
Darrin Thompson wrote:
> On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer
> <[EMAIL PROTECTED]> wrote:
> > I'm pleased to announce yet another tool for importing darcs repositories
> > to git. [...]
>
> What's the appeal of this? I personally love git, but I thought all
> the cool kids at this s
On Tue, Jun 3, 2008 at 6:48 PM, Ronald Guida <[EMAIL PROTECTED]> wrote:
> filter (\x -> case x of A -> True; otherwise -> False) sampleTypes
> ==> [A]
>
> filter (\x -> case x of B _ -> True; otherwise -> False) sampleTypes
> ==> [B 5]
There's a neat little mini-trick for these types of pattern
adam.smyczek:
> Example:
>
> data SampleType = A | B Int | C String | D -- etc.
>
> sampleTypes = [A, B 5, C "test"] :: [SampleType]
>
> How do I find for example element A in the sampleTypes list?
> Do I have to create e.g.:
>
> isA :: SampleType -> Bool
> isA A = True
> isA _ = False
>
On 4/06/2008 1:05 PM, Greg Matheson wrote:
I'm getting a 'Parse error in pattern' error.
C:\Documents and Settings\Administrator>ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude> :m Database.HDBC.ODBC Database.HDBC
[...]
Prelud
On Tue, 03 Jun 2008, John Goerzen wrote:
> Hi,
> HDBC-odbc version 1.1.4.4 has been uploaded to Hackage. It fixes the
> problems some here have encountered regarding ODBC crashes or other
> similar odd behavior on Windows.
I'm getting a 'Parse error in pattern' error.
C:\Documents and Setting
Dan Weston <[EMAIL PROTECTED]> wrote:
> There's always one more way to do things in Haskell! :)
>
> Here's yet another way to get at the payloads in a list. You don't
> have to know how this works to use it:
>
Bastard. He's going to try and find out how it works.
To get back to the filters:
m
There's always one more way to do things in Haskell! :)
Here's yet another way to get at the payloads in a list. You don't have
to know how this works to use it:
data SampleType = A | B Int | C String
unA :: SampleType -> [()]
unA A = return ()
unA _ = fail "Not an A"
unB :: SampleTy
On Tue, 2008-06-03 at 20:12 -0400, Ronald Guida wrote:
> Don Stewart wrote:
> >> 2. Is there any way to systematically search for or detect laziness
> >>leaks?
> >
> > Profiling, and looking at the Core. Being explicit about the
> > evaluation strategy you want is a fine idea though.
>
> Alber
Achim Schneider <[EMAIL PROTECTED]> wrote:
> filter (\x -> case x of
> { A -> True
> ; B b | b > 2 -> True
> ; C c | c == "foo" -> True
> ; _ -> False}) sampleTypes
coming to think of it: Why can't I write
filter (\A -> True
\B b | b > 2 -> True
\C c | c
Adam Smyczek <[EMAIL PROTECTED]> wrote:
> data SampleType = A | B Int | C String | D -- etc.
deriving (Eq)
> sampleTypes = [A, B 5, C "test"] :: [SampleType]
>
If you derive from Eq, you can do
isA = (==) A
filter isA sampleTypes
or ad-hoc:
filter ((==) A) sampleTypes
things li
Adam Smyczek wrote:
> data SampleType = A | B Int | C String | D -- etc.
>
> sampleTypes = [A, B 5, C "test"] :: [SampleType]
>
> How do I find for example element A in the sampleTypes list?
Here's one way to do it:
filter (\x -> case x of A -> True; otherwise -> False) sampleTypes
==> [A]
On Tue, Jun 3, 2008 at 5:11 PM, Adam Smyczek <[EMAIL PROTECTED]> wrote:
> Example:
>
> data SampleType = A | B Int | C String | D -- etc.
>
> sampleTypes = [A, B 5, C "test"] :: [SampleType]
>
> How do I find for example element A in the sampleTypes list?
> Do I have to create e.g.:
>
> isA ::
I think it's hard to overstate how awesome the RULES pragma is.
Thanks for the example.
-- ryan
On 6/3/08, Don Stewart <[EMAIL PROTECTED]> wrote:
> I wrote up the second part of the tour of understanding low level
> performance in GHC here,
>
>http://reddit.com/r/programming/info/6lx36/com
Don Stewart wrote:
>> 2. Is there any way to systematically search for or detect laziness
>>leaks?
>
> Profiling, and looking at the Core. Being explicit about the
> evaluation strategy you want is a fine idea though.
Albert Y. C. Lai wrote
> A true cause of laziness is in accumulating a chain
Example:
data SampleType = A | B Int | C String | D -- etc.
sampleTypes = [A, B 5, C "test"] :: [SampleType]
How do I find for example element A in the sampleTypes list?
Do I have to create e.g.:
isA :: SampleType -> Bool
isA A = True
isA _ = False
for every constructor and use find?
It
Ronald Guida wrote:
I was looking at the real time queues in [1] and I wanted to see what
would happen if I tried to write one in Haskell. The easy part was
translating the real time queue from [1], p43 into Haskell.
The hard part is testing to see if the rotations really happen what
they shoul
* Jim Snow <[EMAIL PROTECTED]> [080531 15:23]:
> Without looking at the code to verify that this is how it has really
> been implemented, a bloom filter is like a series of hash tables, where
> the hash table entries are one bit. The bit is set if there is an item
> that hashes to that value
On Tue, 2008-06-03 at 10:23 -0700, Don Stewart wrote:
> A new version of happs was written on a Monday a couple of months ago,
> using fastcgi and takusen. We're running it at galois, and you can
> find the code on code.haskell.org/hpaste. So not quite what you wanted,
> but another data point.
T
On 2008 Jun 3, at 16:40, Galchin, Vasili wrote:
1) How do I get the "local" package.conf built and populated?
2) How do I get a test case to link against this experimental
local version of "unix"? Is there a "--prefix" or something like
that I pass on runhaskell Setup.hs build?
> What is the status of hs-plugins? I recently tried to install the
> version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9
> and ghc-6.8.2, but didn't get past the configure stage (see config.log
> below).
I am getting exactly the same error on a Gentoo box. I've tracked it down to
oddron:
> I was looking at the real time queues in [1] and I wanted to see what
> would happen if I tried to write one in Haskell. The easy part was
> translating the real time queue from [1], p43 into Haskell.
>
> The hard part is testing to see if the rotations really happen what
> they should.
I was looking at the real time queues in [1] and I wanted to see what
would happen if I tried to write one in Haskell. The easy part was
translating the real time queue from [1], p43 into Haskell.
The hard part is testing to see if the rotations really happen what
they should. Basically, I decid
Thank you, apfelmus. That was a wonderful explanation; the debit
method in [1] finally makes sense.
[1]: Chris Okasaki. Purely Function Data Structures.
http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf
___
Haskell-Cafe mailing list
Haskell-Cafe@haskel
This is drifting off-topic, but...
On 2008-06-03, Peter Hercek <[EMAIL PROTECTED]> wrote:
> Aaron Denney wrote:
>> On 2008-06-03, Peter Hercek <[EMAIL PROTECTED]> wrote:
>>> Loup Vaillant wrote:
2008/6/3 Darrin Thompson <[EMAIL PROTECTED]>:
> <--cut-->
> What's the appeal of this? I pe
> Something like that yes.
>
> You're running runhaskell Setup.lhs and that loads and runs code from
> the Cabal library. The Cabal library depends on the process library
> which depends on the unix library. So by replacing the same version of
> the unix package you're breaking everything else whic
Hi,
HDBC-odbc version 1.1.4.4 has been uploaded to Hackage. It fixes the
problems some here have encountered regarding ODBC crashes or other
similar odd behavior on Windows. Thanks to Andrew Appleyard for
tracking down the problem and sending me a patch.
The detailed explanation, if you're inte
This was how it was originally done in HStringTemplate, as I recall.
The mptcs were introduced in order to maintain lookup-maps of the
correct type, and particularly to allow embedding of templates within
one another. There may have been some other corner-cases involved as
well. However, un
Probably best not to keep this discussion in -cafe after this, as
this is more of a debugging-type issue, but in my experience, I bet
the lighttpd server is trying to serve the hvac-board fcgi file
directly as a binary, rather than launching it as a fastcgi instance
at all. The configurati
On Thu, May 29, 2008 at 5:15 AM, Peter Gavin <[EMAIL PROTECTED]> wrote:
> Has anyone else tried implementing type-level integers using type families?
When I started to work on thetype-level and parameterized data
packages, I considered using type-families and GADTs, but I found
quite a few proble
Aaron Denney wrote:
On 2008-06-03, Peter Hercek <[EMAIL PROTECTED]> wrote:
Loup Vaillant wrote:
2008/6/3 Darrin Thompson <[EMAIL PROTECTED]>:
<--cut-->
What's the appeal of this? I personally love git, but I thought all
the cool kids at this school used darcs and that was that.
Disclaimer: I'
Ah yes, the url was incorrect. Well spotted.
tphyahoo:
> note to the curious that this is a git and not a darcs repo
>
> git clone http://code.haskell.org/hpaste.git
>
> thomas.
>
> 2008/6/3 Don Stewart <[EMAIL PROTECTED]>:
> > A new version of happs was written on a Monday a couple of months a
I wrote up the second part of the tour of understanding low level
performance in GHC here,
http://reddit.com/r/programming/info/6lx36/comments/
Follows on from the discussion last week about various performance
related things.
Enjoy.
-- Don
___
Ha
note to the curious that this is a git and not a darcs repo
git clone http://code.haskell.org/hpaste.git
thomas.
2008/6/3 Don Stewart <[EMAIL PROTECTED]>:
> A new version of happs was written on a Monday a couple of months ago,
> using fastcgi and takusen. We're running it at galois, and you can
A new version of happs was written on a Monday a couple of months ago,
using fastcgi and takusen. We're running it at galois, and you can
find the code on code.haskell.org/hpaste. So not quite what you wanted,
but another data point.
-- Don
tphyahoo:
> Note however that hpaste runs off an earlier
Note however that hpaste runs off an earlier version of HAppS, which
has changed radically from v8 to v9.
I seem to remember discussion of porting hpaste to the latest HAppS as
a demo app... are there still plans to do that?
Thomas.
2008/6/2 Don Stewart <[EMAIL PROTECTED]>:
> aditya_siram:
>>
>>
Darrin Thompson wrote:
I thought that I should be able to write something like the toHtml
function below with pure H98, but when I went to write it I ended up
needing fundeps. Is there a way to express this without using any
extensions?
The idea was to take a remotely Dom-like tree and flatten i
On 2008-06-03, Peter Hercek <[EMAIL PROTECTED]> wrote:
> Loup Vaillant wrote:
>> 2008/6/3 Darrin Thompson <[EMAIL PROTECTED]>:
>>> <--cut-->
>>> What's the appeal of this? I personally love git, but I thought all
>>> the cool kids at this school used darcs and that was that.
>>
>> Disclaimer: I'm
I just tried out hvac. I was trying to run the hvac examples
after following the readme in the samples directory.
sudo lighttpd -D -f lh.conf
[sudo] password for thartman:
2008-06-03 09:30:02: (log.c.75) server started
so that's okay, but
http://localhost:3000/hvac-board/board/1
in firefox atte
Loup Vaillant wrote:
2008/6/3 Darrin Thompson <[EMAIL PROTECTED]>:
<--cut-->
What's the appeal of this? I personally love git, but I thought all
the cool kids at this school used darcs and that was that.
Disclaimer: I'm no expert, this is what I've heard. Anyone please
confirm or deny the foll
Duncan Coutts wrote:
modify :: k -> Map k e -> (e, Maybe e -> Map k e)
so it's a lookup that returns the element at k and also a continuation
that lets you rebuild a new map with an altered element. I guess that
doesn't account for the element not existing. There's probably a
generalisation that
I thought that I should be able to write something like the toHtml
function below with pure H98, but when I went to write it I ended up
needing fundeps. Is there a way to express this without using any
extensions?
The idea was to take a remotely Dom-like tree and flatten it into a
string, but not
2008/6/3 Darrin Thompson <[EMAIL PROTECTED]>:
> On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer
> <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I'm pleased to announce yet another tool for importing darcs repositories
>> to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in
>> Haskell, o
Thanks, Edsko.
My version of gcc is 4.3.0. It may well be that some other piece of
software in the Fedora 9 distribution is incompatible with the hs-plugins
installation script.
Has anyone installed hs-plugins on Fedora? I was able to get it to
compile on Fedora 4, using ghc-6.4, two or three y
On Tue, Jun 03, 2008 at 03:07:33PM +0100, John O'Donnell wrote:
> Hi,
>
> What is the status of hs-plugins? I recently tried to install the
> version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9
> and ghc-6.8.2, but didn't get past the configure stage (see config.log
> below).
>
>
On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm pleased to announce yet another tool for importing darcs repositories
> to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in
> Haskell, on top of the darcs2 source code. The result is a much f
Hi,
What is the status of hs-plugins? I recently tried to install the
version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9
and ghc-6.8.2, but didn't get past the configure stage (see config.log
below).
The installation script is invoking gcc with a -V command line argument
but acc
Hello Krasimir,
Krasimir Angelov wrote:
Hi,
I have to write ParseChart implementation with Data.Map/Set. The chart
is type like this:
type Chart k v = Map k (Set v)
now I need operation like:
insert :: k -> v -> Chart k v -> Maybe (Chart k v)
where the result is (Just _) if the (k,v) is act
I actually made my own copy of Data.Map and added an extra:
alterLookúp :: Ord k => (Maybe a -> (b,Maybe a)) -> k -> Map k a -> (b,Map k a)
function. I also changed my data type to:
type ParseChart k v = Map k (Map v ())
so I don't have to copy the Data.Set module also. Unfortunately this
doesn
Krasimir Angelov wrote:
>> but notice that the set is still traversed twice.
Neil Mitchell wrote:
> I don't see any way of reducing that
Yeah, it looks like the Data.Set (and Data.IntSet) library
is missing the functions
insertMember :: Ord a => a -> Set a -> (Bool, Set a)
deleteMember :: Ord a
First version is available at:
http://www.kierun.org/backdropper-1.0.tbz2
It is minimal but does the trick of randomly rotating backgrounds.
Features to add are only rotate during work hours, making sure that all
images are shown within a day and a nice GUI.
Criticism welcome.
--
[EMAIL PROT
Hello Alberto,
Tuesday, June 3, 2008, 12:56:50 PM, you wrote:
> Good! So you can easily "hide" the IO operations in the ST monad. I will
> definitely look into it.
from implementation POV ST monad is nothing but renamed IO monad which
exports only subset of its operations which are guaranteed to
Abhay Parvate wrote:
I somehow thought it would be easy to talk about complexity of calculating
individual elements in an infinite list should be sufficient, but that seems
to be involved, and my over-generalization doesn't seem to work. Thanks for
the link; particularly it has reference to Wadle
On Tue, 2008-06-03 at 00:04 -0500, Galchin, Vasili wrote:
> Duncan,
>
> By installing localling, I "runhaskell Setup.hs configure
> --prefix=$HOME" plus add local path to LD_LIBRARY_PATH and
> LD_RUN_PATH? On Linux, does ghc use .so's or is it linked statically?
ghc is linked statically but
On Mon, 2008-06-02 at 23:11 -0500, Galchin, Vasili wrote:
> at this point rebuild and install the "unix" package ...
>
> [EMAIL PROTECTED]:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell
> Setup.lhs clean
> cleaning...
> [EMAIL PROTECTED]:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell
> Setup.lh
Bulat Ziganshin wrote:
Hello Alberto,
Tuesday, June 3, 2008, 11:27:54 AM, you wrote:
Yes, I will try to write a simple version of Data.Array.ST...
That's right, the correspondence with StorableArray is direct, and
efficient conversion can be easily added to the library. I mentioned the
idea o
"Thomas Hartman" <[EMAIL PROTECTED]> writes:
> What kind of speed do you get on your laptop for Data.Set? How much
> faster is the bloom filter?
I tried to modify examples/Words.hs to use Data.Set insted. The
results look like this (first Bloom, second Data.Set, both compiled
with -O2):
nmd
Hello Alberto,
Tuesday, June 3, 2008, 11:27:54 AM, you wrote:
>>> Yes, I will try to write a simple version of Data.Array.ST...
> That's right, the correspondence with StorableArray is direct, and
> efficient conversion can be easily added to the library. I mentioned the
> idea of Data.Array.ST t
Anatoly Yakovenko wrote:
do you have any plans to provide an interface for inplace updates?
Yes, I will try to write a simple version of Data.Array.ST...
I can try to help you, although I still dont quite grok monads.
Wouldn't it be more efficient to use StorableArray, so you can cast
from an
59 matches
Mail list logo