cetin tozkoparan [EMAIL PROTECTED] writes:
sublist :: Eq a = [a] - [a] - Bool
sublist [] _ = True
sublist (_:_) [] = False
This can be simplified a bit, I think (Reformatted to one line):
sublist (x:xs) (y:ys)
| x == y = if isEqual (x:xs) (y:ys) == False then sublist (x:xs) ys else
On 24 Apr 2008, at 12:02, apfelmus wrote:
Sounds good. But I wonder what obscure optimization comes next;
can we have a toy-model of STM? I mean, it should be possible to
express both the continuation-logging and read-only-fail
optimization in terms of
type STM a = Maybe a
or similar?
| 1) Why is the Prelude mapM so slow? It seems like running 10x slower
| than mapM_ when generating only 50,000 return values is a problem.
All this does seem odd. I've submitted a ticket so we don't forget it
http://hackage.haskell.org/trac/ghc/ticket/2236
It appears to be some bad (possibly
On 18 Apr 2008, at 20:04, Martin Sulzmann wrote:
Let's consider our running example
class D a b | a - b
instance D a b = D [a] [b]
which we can write in CHR notation
D a b, D a c == b=c(FD)
D [a] [b] = D a b (Inst)
These rules overlap.
I experimented with translations into GNU
Ryan Ingram wrote:
More FRP stuff: a new type for Future that came to me in an
inspiration this morning. But it's ugly and I need someone with
better theoretical underpinnings than me to tell me what I've really
built :)
data Future t a = Known t a | Unknown (t - IO (STM (Maybe (Future t
You may want to study the code form Data.List first:
isInfixOf :: (Eq a) = [a] - [a] - Bool
isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack)
cetin tozkoparan wrote:
I wrote this code and Can it be less?
[2,4,5] list is sub list of [3,7,*2,4,5*,9] list and
Christian Maeder wrote:
isEqual :: Eq a = [a] - [a] - Bool
isEqual [] _ = True
isEqual (_:_) [] = False
isEqual (x:xs) (y:ys)
| x==y = isEqual xs ys
| otherwise= False
isEqual is not needed, because Eq provides == over lists, too.
Ah, isEqual isn't ==, but isPrefixOf.
C.
On Fri, 25 Apr 2008, Hans Aberg wrote:
On 18 Apr 2008, at 20:04, Martin Sulzmann wrote:
Let's consider our running example
class D a b | a - b
instance D a b = D [a] [b]
which we can write in CHR notation
D a b, D a c == b=c(FD)
D [a] [b] = D a b (Inst)
These rules overlap.
I
Hi, Haskellers,
This email is only remotely connected to this list. Recently I am doing some
research on the fat tails (in fact, I simply bumped into it) on the stock
market. I came up with an equation which I think solves the fat tails --
which is really the Levy stable distribution. During the
On 25 Apr 2008, at 14:20, Tom Schrijvers wrote:
Prolog works under the assumption of a closed world. That's
contrary to the open world view of regular type classes. So these
aren't the intended semantics.
By which I gather you mean the interpretation of :- as logical
connective = rather
On Fri, 25 Apr 2008, Hans Aberg wrote:
On 25 Apr 2008, at 14:20, Tom Schrijvers wrote:
Prolog works under the assumption of a closed world. That's contrary to the
open world view of regular type classes. So these aren't the intended
semantics.
By which I gather you mean the interpretation
On Apr 24, 2008, at 11:33 AM, Adrian Hey wrote:
Also, if you're likely to be using union/intersection a lot you should
know that Data.Map/Set are very slow for this because they use the
not efficient hedge algorithm :-)
OK, I'm going to bite here: What's the efficient algorithm for union
Hi,
What is the fastest way to set up a web server that can redirect requests to
a haskell application and serve results returned by it?
I need to demonstrate a simple visualization tool I have written for
analytic tableaux on Monday and need something easy and simple.
Best Regards,
Cetin Sert
On 25 Apr 2008, at 15:38, Tom Schrijvers wrote:
Prolog works under the assumption of a closed world. That's
contrary to the open world view of regular type classes. So these
aren't the intended semantics.
By which I gather you mean the interpretation of :- as logical
connective = rather
cetin.sert:
Hi,
What is the fastest way to set up a web server that can redirect requests
to a haskell application and serve results returned by it?
I need to demonstrate a simple visualization tool I have written for
analytic tableaux on Monday and need something easy and
I've just been investigating a performance oddity in using splitAt
on a long stream of random numbers. I don't understand why GHC
appears to want to traverse the first part of the list twice.
GHC seems to implement the splitAt function something like
splitAt n xs = (take n xs, drop n xs)
Hi all,
This is my first post, and I'm a n00b, so go easy if I breach protocol. :-)
I have a graph where the nodes contain a number of fields of various types. The
values for one of those fields -- call it Mass -- need to reside in a separate
file from the main graph definition (this is for
Thanks everyone, this is all good stuff.
I did look at Clean and it looks like it has somewhat nicer record
syntax... but it doesn't look like anything haskell couldn't do better
if it one day got a real record system. As for the rest of Clean, I'm
afraid that spending too much time with it will
On Apr 25, 2008, at 11:54 AM, Jennifer Miller wrote:
I have a circular dependency in my modules that I don't know how to
resolve in Haskell.
I'm pretty sure that GHC will sort out those dependencies for you as
long as you are exporting the correct things from each module.
- Jake
On Apr 25, 2008, at 9:54 AM, Jennifer Miller wrote:
So, I have a circular dependency in my modules that I don't know how
to resolve in Haskell. I went looking for the equivalent of #include
which is how I would have solved this in C++. I'm sure there is a
simple answer to this and I'm
Hello Jennifer,
Friday, April 25, 2008, 8:54:42 PM, you wrote:
So, I have a circular dependency in my modules that I don't know
how to resolve in Haskell.
1. haskell standard allows circular deps between modules
2. ghc supports this part of standard in a rather awkward way - you
need to
Hi,
(for those who follow planet.haskell.org this is old news, but I thought
I’d tell the others)
In
http://www.joachim-breitner.de/blog/archives/291-Pausable-IO-actions-for-better-GUI-responsiveness.html
I describe how I wrote a monad transformer that allows me to pause a
computation from
I guess like minds think alike! See the very recent e-mail thread
started by Ryan Ingram:
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/39155/focus=39159
Take a look at the code referenced in Luke Palmer's reply:
Hi,
Am Freitag, den 25.04.2008, 11:49 -0700 schrieb Dan Weston:
I guess like minds think alike! See the very recent e-mail thread
started by Ryan Ingram:
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/39155/focus=39159
Take a look at the code referenced in Luke Palmer's reply:
Is there a Haskell Wiki page (or blog) on Monad Suspension? This looks
like a nice paradigm that apfelmus points out can be used to
considerably shorten your code, but only if the rest of us learn how!
If not, maybe someone can be persuaded to write one?
Dan
Joachim Breitner wrote:
Hi,
Am
2008/4/25, Niklas Broberg [EMAIL PROTECTED]:
Wow. A 10x slowdown for a very commonly used function that in 99.8% of
all use cases has no need for the extra laziness at all. No wonder
some people say Haskell is a toy language...
A toy language that is still much faster than many currently
Jonathan Cast wrote:
Type case is easy:
genericShow :: Typeable a = a - String
genericShow x = fromJust $ do
s - cast x :: Maybe String
return s
`mplus` do
n -
Wow. A 10x slowdown for a very commonly used function that in 99.8% of
all use cases has no need for the extra laziness at all. No wonder
some people say Haskell is a toy language...
A toy language that is still much faster than many currently popular
languages so... Is
On Fri, 25 Apr 2008, Jennifer Miller wrote:
I have a graph where the nodes contain a number of fields of various types. The
values for one of those fields -- call it Mass -- need to reside in a separate
file from the main graph definition (this is for workflow reasons and is given
to me as
On Fri, Apr 25, 2008 at 3:45 PM, Dan Weston [EMAIL PROTECTED] wrote:
Is there a Haskell Wiki page (or blog) on Monad Suspension? This looks like
a nice paradigm that apfelmus points out can be used to considerably
shorten your code, but only if the rest of us learn how!
There are a few papers
Problem summary
Trying to build a stand-alone executable GLUT app with ghc, Windows XP
Problem description
I compile and link (without errors) a simple GLUT application under Windows
XP.
When I run it, XP pops an error window saying the app cannot start due to a
missing glut32.dll.
I want to
Perhaps try:
$ ghc --make -static -optl-static -lpath to libHSGLUT.a here x.hs
The -optl-static passes the '-static' argument to ld so it will link
statically; you may also need a copy of a compatable GLUT library in .a
format on your windows machine which should be linked in with -l as well
Google download glut32.dll and pull that file down and put it in the
directory with your executable. I'd attach it myself, but gmail won't let
me. I use that all the time, though.
2008/4/25 Peter Schmitz [EMAIL PROTECTED]:
Problem summary
Trying to build a stand-alone executable GLUT app
Thanks for the suggestions. The #include worked but I will look for ways to
remove the circular dependency altogether.
Jennifer
On Friday, April 25, 2008, at 02:48PM, Henning Thielemann [EMAIL PROTECTED]
wrote:
On Fri, 25 Apr 2008, Jennifer Miller wrote:
I have a graph where the nodes
34 matches
Mail list logo