Hello Cetin,
Wednesday, November 5, 2008, 8:34:14 AM, you wrote:
> let emp (has -> True) = False; emp (has -> False) = True
> Warning: Pattern match(es) are overlapped
proibably it's because GHC can't check view patterns for overlaps?
--
Best regards,
Bulatm
Hello Chad,
Wednesday, November 5, 2008, 6:34:01 AM, you wrote:
> ghc --make -j4 Foo.hs
afair, it was implemented and not shown speed improvements. ask Simon
--
Best regards,
Bulatmailto:[EMAIL PROTECTED]
___
Haskell-Caf
Hello Jason,
Wednesday, November 5, 2008, 3:12:29 AM, you wrote:
> Many useful programs that I would like to write in Haskell
> don't fall into this category -- for example, network servers
> -- but a lot of their components do. Can these components can
> be Haskell functions without IO i
let has [] = False; has _ = True
-- this one is ok
let empty list = case has list of True -> False; False -> True
-- the following is problematic
let emp (has -> True) = False; emp (has -> False) = True
:1:4:
Warning: Pattern match(es) are overlapped
In the definition of `emp':
On Tue, Nov 4, 2008 at 7:34 PM, Chad Scherrer <[EMAIL PROTECTED]> wrote:
> T Willingham gmail.com> writes:
>> I am thinking of our troglodytic friend 'make', which will run (for
>> example) 4 parallel jobs when given the option "make -j4". Even
>> 'rake', the ruby version of make, now has a branc
T Willingham gmail.com> writes:
> I am thinking of our troglodytic friend 'make', which will run (for
> example) 4 parallel jobs when given the option "make -j4". Even
> 'rake', the ruby version of make, now has a branch (called drake)
> which does the parallel -j option.
>From the replies I've
G'day all.
Quoting Achim Schneider <[EMAIL PROTECTED]>:
Considering that he's talking about a mud, I figure the grammar is a
quite straightforward
command = l[eft] | r[ight] | ... | t[ake] | c[ast]
That is, I'd be very surprised if you even need more than two or three
characters lookahead,
G'day all.
Quoting Achim Schneider <[EMAIL PROTECTED]>:
Considering that he's talking about a mud, I figure the grammar is a
quite straightforward
command = l[eft] | r[ight] | ... | t[ake] | c[ast]
That is, I'd be very surprised if you even need more than two or three
characters lookahead,
Oh my, how silly of me. The page has moved to
http://www.weather.gov/xml/current_obs/KAGC.xml ! Firefox simply
follows the redirect.
Thanks for the putStrLn suggestion, George.
On Tue, Nov 4, 2008 at 5:28 PM, George Pollard <[EMAIL PROTECTED]> wrote:
> On Tue, 2008-11-04 at 17:04 -0800, Brian Tro
Hello all,
I'm working through the practical HXT examples and have gotten stumped
with the weather example[1]. I'm using GHC 6.8.3 and HXT 8.1.0. I
compile the example like so...
> [EMAIL PROTECTED]:~
> $ ghc --make weather.hs
> [1 of 1] Compiling Main ( weather.hs, weather.o )
> Link
On 2008 Nov 4, at 19:12, Jason Dusek wrote:
Many useful programs that I would like to write in Haskell
don't fall into this category -- for example, network servers
-- but a lot of their components do. Can these components can
be Haskell functions without IO in their signatures?
I'm workin
You're essentially describing functional reactive programming. You end
up with the system being described as pure, reactive values and
plugging IO based streams in at the edges.
Have a look at the wiki description
(http://www.haskell.org/haskellwiki/Functional_Reactive_Programming)
and especially
Informally, a "pure program" an executable such that the
stream of bytes entering it totally determines the stream of
bytes leaving it.
Many useful programs that I would like to write in Haskell
don't fall into this category -- for example, network servers
-- but a lot of their compone
Nonsense, isum is strict in s. If s is bottom, isum will always return bottom.
This is the definition of being strict.
-- Lennart
On Mon, Nov 3, 2008 at 10:35 PM, Don Stewart <[EMAIL PROTECTED]> wrote:
> frantisek.kocun:
>>yet I need to add a $! to the recursive call of isum to get a truly
On Wed, Nov 5, 2008 at 12:43 AM, Bas van Dijk <[EMAIL PROTECTED]> wrote:
> 2008/11/5 Daryoush Mehrtash <[EMAIL PROTECTED]>:
>> Are there cases (function or list) where the result of foldl (or foldr)would
>> be different that foldl' (or foldr')?
>
> Maybe this wiki article I wrote some time ago will
2008/11/5 Daryoush Mehrtash <[EMAIL PROTECTED]>:
> Are there cases (function or list) where the result of foldl (or foldr)would
> be different that foldl' (or foldr')?
Maybe this wiki article I wrote some time ago will answer your question:
http://haskell.org/haskellwiki/Foldr_Foldl_Foldl'
regar
On Tue, 2008-11-04 at 12:18 +0100, Patai Gergely wrote:
> Thanks everyone for the answers. I understood the underlying mechanism,
> and I did see that turning on optimisation helps, as I said in the
> comments. I just wasn't aware that this analysis is not turned on by
> default, my bad for not rea
On Tue, 2008-11-04 at 10:02 -0800, Dan Piponi wrote:
> On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider <[EMAIL PROTECTED]> wrote:
> > Martijn van Steenbergen <[EMAIL PROTECTED]> wrote:
> > For anything remotely connected to parsing, always use parsec.
> >
> > I'd not be surprised if the beast is to
Am Mittwoch, 5. November 2008 00:08 schrieb Daryoush Mehrtash:
> Are there cases (function or list) where the result of foldl (or
> foldr)would be different that foldl' (or foldr')?
>
> thanks,
>
> daryoush
Simple example:
import Data.List
weird :: Int -> Int -> Int
weird _ 0 = 0
weird x y = x*y
On Tue, 2008-11-04 at 15:08 -0800, Daryoush Mehrtash wrote:
>
> Are there cases (function or list) where the result of foldl (or
> foldr)would be different that foldl' (or foldr')?
There is no foldr'. And yes, foldl and foldl' are different functions
and thus return different results on some inp
"Daryoush Mehrtash" <[EMAIL PROTECTED]> wrote:
> Are there cases (function or list) where the result of foldl (or
> foldr)would be different that foldl' (or foldr')?
>
Yes, in two cases folds can differ:
a) You've got an infinite list, in which case you don't want to go to
the end of it before s
Are there cases (function or list) where the result of foldl (or foldr)would
be different that foldl' (or foldr')?
thanks,
daryoush
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Tue, Nov 4, 2008 at 9:05 AM, Martijn van Steenbergen
<[EMAIL PROTECTED]> wrote:
>
> For my mud client Yogurt (see hackage) I'm currently working on
> improving the efficiency of the hooks. Right now several hooks, each
> consisting of a regex and an action can be active at the same time.
> Every
John,
On Thu, Oct 30, 2008 at 2:48 PM, John Goerzen <[EMAIL PROTECTED]> wrote:
> I would certainly happily reference anyone's native Oracle HDBC
> backend too, though!
You may want to reference mine, given that there aren't any others
currently. Just be aware that it really isn't ready for mass
c
On Thu, Oct 30, 2008 at 11:53 AM, Daniil Elovkov
<[EMAIL PROTECTED]> wrote:
> Yes, HSQL supports Oracle natively, through OCI. hsql-oracle isn't on
> hackage, only in the repository.
That's exactly what I was looking for, but for HDBC instead. Since OCI
bindings for HDBC don't seem to exist, I gue
On Tue, Nov 04, 2008 at 08:34:37PM +0100, Achim Schneider wrote:
>
> Parsec is a thousand times more efficient for such things than regular
> expressions, and you can just lazily parse all the input into a list
> of data constructors and happily fold it into your state...
I would recommend you to
The regex-tdfa package (and regex-posix) implement subexpressions capture.
So if you want to match alpha beta and gamma in parallel you could write
"(alpha)|(beta)|(gamma)" and check which subexpression has the non-empty match.
This becomes slightly complicated if there are parenthesis and capt
"Dan Piponi" <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider <[EMAIL PROTECTED]>
> wrote:
> > Martijn van Steenbergen <[EMAIL PROTECTED]> wrote:
> > For anything remotely connected to parsing, always use parsec.
> >
> > I'd not be surprised if the beast is touring comp
On Mon, Nov 3, 2008 at 3:45 PM, Svein Ove Aas <[EMAIL PROTECTED]> wrote:
> On Mon, Nov 3, 2008 at 11:31 AM, Tobias Bexelius
> <[EMAIL PROTECTED]> wrote:
> > Before Direct3D 10, its too costly to read back the updated vertex data
> > in every frame, which force you to make this kind of operations o
On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider <[EMAIL PROTECTED]> wrote:
> Martijn van Steenbergen <[EMAIL PROTECTED]> wrote:
> For anything remotely connected to parsing, always use parsec.
>
> I'd not be surprised if the beast is touring complete in itself...
Actually, this can count against y
Hi Martijn,
It's not that tricky if you do a regular expression state machine yourself, but
that's probably a bit too much work. One way to get a speed up might be to take
the regular expressions a,b,c,d and generate a regex a+b+c+d, and one a+b. You
can then check any string s against a+b+c+d,
On Tue, 2008-11-04 at 18:26 +0100, Achim Schneider wrote:
> Martijn van Steenbergen <[EMAIL PROTECTED]> wrote:
>
> > Does anyone have any experience with this? What's the best way to
> > achieve this?
> >
> For anything remotely connected to parsing, always use parsec.
>
> I'd not be surprised
Martijn van Steenbergen <[EMAIL PROTECTED]> wrote:
> Does anyone have any experience with this? What's the best way to
> achieve this?
>
For anything remotely connected to parsing, always use parsec.
I'd not be surprised if the beast is touring complete in itself... or
can parse something that
Hello all,
For my mud client Yogurt (see hackage) I'm currently working on
improving the efficiency of the hooks. Right now several hooks, each
consisting of a regex and an action can be active at the same time.
Every time a line of input is available (usually several times a second)
I run the li
Dear Haskellers,
I've just uploaded a few packages to Hackage which I have produced
while working at Anygma. I thought that people might be interested in
knowing about these:
obj-0.1:
A library for loading and writing obj 3D models. This is still an
early version and rather limited, bu
>> About this teste code:
>>
>> module Main (main) where {
>> import Foreign hiding (unsafePerformIO,Foreign.Ptr,Data.Bits,) ;
>> blo = xor 10 10 :: Int ;
>> main = return ()
>> }
>>
> You're only hiding the typeclass Data.Bits, not
> the function xor. To do that, you have to write
>
> import For
Maurcio <[EMAIL PROTECTED]> wrote:
> About this teste code:
>
> module Main (main) where {
> import Foreign hiding (unsafePerformIO,Foreign.Ptr,Data.Bits,) ;
> blo = xor 10 10 :: Int ;
> main = return ()
> }
>
You're only hiding the typeclass Data.Bits, not the function xor. To do
that, you
Hello Maurício,
Tuesday, November 4, 2008, 3:47:17 PM, you wrote:
> Haskell syntax allows a comma at the end of names
> to be imported or exported, like in the second
> line. What does that mean?
it simplifies editiing of lists: you can add/remove lines without
changing surrounding ones:
impor
> > I think using Template Haskell for your work would fit very
> nicely, so
> > is a good choice to learn :-)
> >
> I already got used to TH a bit, but I am not sure if it is
> appropriate for my purpose, or at least not completely.
>
> I want to load Haskell code into my program at runtime
Hi,
About this teste code:
module Main (main) where {
import Foreign hiding (unsafePerformIO,Foreign.Ptr,Data.Bits,) ;
blo = xor 10 10 :: Int ;
main = return ()
}
Data.Bits is in the 'hiding' list. According to
the syntax reference, this seems not to be allowed.
GHC allows it, but do allow foll
Sorry for referring to a post, a bit ago.
> http://www-users.cs.york.ac.uk/~ndm/derive/ (Deriving Generic Functions
> by Example).
>
Thanks for the pointer, it was already on my to-read-pile :-)
> I think using Template Haskell for your work would fit very nicely, so
> is a good choice to learn
"Patai Gergely" <[EMAIL PROTECTED]> writes:
> My only problem is that if I try to write a program without
> thinking about performance first and not bothering with annotations as
> long as "it works", I end up with something that's practically
> impossible to profile as the costs spread everywhere
wren ng thornton freegeek.org> writes:
[snick]
> > isum 0 s = s
> > isum n s = isum (n-1) (s+n)
>
> This is tail recursive, and will be optimized to an iterative loop;
[snick]
>
> In terms of having a compiler 'smart enough', it's not clear that
> functions of this sort ought to be inferre
Thanks everyone for the answers. I understood the underlying mechanism,
and I did see that turning on optimisation helps, as I said in the
comments. I just wasn't aware that this analysis is not turned on by
default, my bad for not reading the FM.
So the final verdict is that type and strictness a
David Menendez-2 wrote:
>
>> On Mon, 3 Nov 2008, Luke Palmer wrote:
>>
>> I was actually being an annoying purist. "f is strict" means "f _|_ =
>> _|_", so strictness is a semantic idea, not an operational one.
>
> I think Luke was commenting on the terminology, not the optimization.
> We have
On Thu, Jul 31, 2008 at 6:37 PM, Don Stewart <[EMAIL PROTECTED]> wrote:
> agentzh:
>> On Thu, Jul 31, 2008 at 1:56 AM, Don Stewart <[EMAIL PROTECTED]> wrote:
>> >
>> > We've had no problems with this and apache at least. Is lighttpd
>> > doing something funny with error logging?
>>
>> It seems that
Hello Nun,
Monday, November 3, 2008, 11:53:08 PM, you wrote:
> 2) the Win32 package in this link gives a type error during the
> "setup build" phase (expecting exception and given ioerror?) but you
> can compile the example against the Win32 package in ghc 6.8.3
of course - it's written against
Achim Schneider web.de> writes:
> >
> That's about what I meant with a screenshot. Linking a copy of the html
> generated for e.g. the Prelude would greatly help people who are just
> browsing Hackage and are trying to figure out what your package is all
> about.
>
Well, I can't do the Prelude
On Mon, Nov 3, 2008 at 7:55 PM, minh thu <[EMAIL PROTECTED]> wrote:
> Well, it seems you can't really write
>
> (fromJust . fromDynamic) someDynamic
>
> without giving the type of what you expect.
Well not by itself. But context will usually determine the type. For example:
putStrLn . fromJu
2008/11/4, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> minh thu asked a tricky question, about writing
> > extract :: Typeable a => TypeRep -> Dynamic -> a
>
> The question here is what determines the type 'a'. One answer is that
> 'a' is determined from the context, e.g.,
>(extract tr dyn)
50 matches
Mail list logo