Ryan Ingram wrote:
>
> No, that doesn't work; it's close, but not quite. liftM doesn't have the
> right type signature.
>
> liftM :: Monad m => (a -> r) -> (m a1 -> m r)
>
> What would work is if you could define a function
> liftLast :: Monad m => (a0 -> a1 -> ... -> aN -> r) -> (a0 -> a1 -
Haskellians,
Belay that. i see the problem.
Best wishes,
--greg
On Dec 6, 2007 11:11 PM, Greg Meredith <[EMAIL PROTECTED]>
wrote:
> Haskellians,
>
> i'm sure i don't understand type classes, yet. Still, i was surprised at
> ghci's response to the code below. Clues gratefully accepted.
>
> Best
Haskellians,
i'm sure i don't understand type classes, yet. Still, i was surprised at
ghci's response to the code below. Clues gratefully accepted.
Best wishes,
--greg
-- transcript
-- Prelude> :l grn
-- [1 of 1] Compiling GeneticRegulatoryNetwork ( grn.hs, interpreted )
-- grn.hs:33:35:
--
Is there some way to compile the following function in yhc?
works in ghc with glasgow exts deactivated, yhc complains context for
Prelude.read needed (in final line)
readfloat :: String -> Maybe Float
readfloat x | null parse || not (null leftover) = fail $ "myRead: "++x
| otherwise
On Thu, Dec 06, 2007 at 11:40:58PM +0100, Ben Franksen wrote:
> Aaron Denney wrote:
> > On 2007-12-06, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote:
> >> list comprehensions deal with specific operations (map, filter, etc.)
> >> of a specific type ([]).
> >
> > Ah, so we should bring back monad comp
Who: Portland Functional Programmers Group
Web: http://groups.google.com/group/pdxfunc
Time and location:
Monday, December 10th, 7pm at CubeSpace, 622 SE Grand, Portland,
OR 97214. Directions: http://www.cubespacepdx.com/directions
Topic
Functional concurrency with
On Fri, Dec 07, 2007 at 10:16:43AM +1000, Ivan Miljenovic wrote:
> On 07/12/2007, Tommy McGuire <[EMAIL PROTECTED]> wrote:
> >
> > I was actually thinking that something like that would be more valuable
> > for a language like C, where types are not represented in the control flow.
> >
> > By the w
Hi,
Monadius is awesome! I've made a video of me playing it and kicking
some serious ass:
http://www.youtube.com/watch?v=zqFgQiPKtOI
Peace,
Bit
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 07/12/2007, Tommy McGuire <[EMAIL PROTECTED]> wrote:
>
> I was actually thinking that something like that would be more valuable
> for a language like C, where types are not represented in the control flow.
>
> By the way, in a completely different context I just ran across a couple
> of referen
Ivan Miljenovic wrote:
On 07/12/2007, Tommy McGuire <[EMAIL PROTECTED]> wrote:
It just occurred to me that this idea is more general than the control
or data flow analysis that are the focus of similar ideas I've seen
before. For example, you could trace type usage through the code (which
would
Hoogle is an amazing tool, thanks for all your work on it!
Let me put my vote in to include cgi and html/xhtml in the next revision. It
might help dons convert another person or two to Haskell ... not that he needs
any help.
Thanks,
- Hitesh
___
Hask
On 07/12/2007, Tommy McGuire <[EMAIL PROTECTED]> wrote:
> > How I envisage it happening is that a parser would be used to find all
> > "functions" in the given code, treat these as nodes in the graph and
> > then use directed edges to indicate which functions call other
> > functions. This resulta
Am Donnerstag, 6. Dezember 2007 22:47 schrieb Aaron Denney:
> On 2007-12-06, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote:
> > list comprehensions deal with specific operations (map, filter, etc.)
> > of a specific type ([]).
>
> Ah, so we should bring back monad comprehensions?
No, we already have
On Tue, Dec 04, 2007 at 03:07:01PM -0800, Ryan Ingram wrote:
> Is there a reason why strictness is defined as
> > f _|_ = _|_
>
> instead of, for example,
> > forall x :: Exception. f (throw x) = throw x
There's discussion along these lines in
http://hackage.haskell.org/trac/ghc/ticket/1171
Tha
On Thu, 2007-12-06 at 15:21 -0500, Thomas Hartman wrote:
> Is there a cabal equivalent for yhc?
One day we hope Cabal will support yhc. It currently supports ghc, hugs
and has partial support for nhc98 and jhc.
The main thing holding it back is dependency chasing in Cabal or the
lack thereof. C
Aaron Denney wrote:
> On 2007-12-06, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote:
>> list comprehensions deal with specific operations (map, filter, etc.)
>> of a specific type ([]).
>
> Ah, so we should bring back monad comprehensions?
I don't miss monad comprehension much, but I'd like to have a
OK, last post. I clearly need more sleep.
On 12/6/07, Ryan Ingram <[EMAIL PROTECTED]> wrote:
>
> mergeMaybes f x y = liftM2 f `mplus` x `mplus` y
>
mergeMaybes f x y = liftM2 f x y `mplus` x `mplus` y
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell
On 12/6/07, Ryan Ingram <[EMAIL PROTECTED]> wrote:
>
> On 12/6/07, Luke Palmer <[EMAIL PROTECTED]> wrote:
> >
> > I have actually seen this pattern a lot recently. Recently I have
> > started using a function:
> >
> > mergeMaybes :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
> > mergeMaybes f
On 12/6/07, Luke Palmer <[EMAIL PROTECTED]> wrote:
>
> I have actually seen this pattern a lot recently. Recently I have
> started using a function:
>
> mergeMaybes :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
> mergeMaybes f Nothing y = y
> mergeMaybes f x Nothing = x
> mergeMaybes f (Just x
vigalchin:
>Hello,
>
> Who started this effort? Who is currently doing work on the Unix
>package?
>
>Kind regards, Vasya
It is maintained by [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.has
Hello,
Who started this effort? Who is currently doing work on the Unix package?
Kind regards, Vasya
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 2007-12-06, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote:
> list comprehensions deal with specific operations (map, filter, etc.)
> of a specific type ([]).
Ah, so we should bring back monad comprehensions?
--
Aaron Denney
-><-
___
Haskell-Cafe maili
Thomas Hartman wrote:
>
> Is there some way to use any of the various regex packages on hackage
> via yhc? Has anyone installed one them successfully?
>
> I'd like regex-tdfa, but would settle for regex-posix, or really,
> anything that brings the convenience of regex to yhc.
>
> In general, is
"Philip Weaver" <[EMAIL PROTECTED]> writes:
> You'll find that the pattern that it's failing to match is:
>
>[('b',[5,4]),('b',[1]),('b',[6])]
You could also use ghc with -Wall, which will tell you exactly which
cases you've omitted.
-k
--
If I haven't seen further, it is by standing in the
On Thu, 6 Dec 2007, Thomas Hartman wrote:
> On a related note... is there some easy way to be sure that a program I am
> compiling uses only haskell 98? (Because any pure haskell 98 should always
> compile on yhc... right?)
You can for instance use 'haskell98' as dependent package instead of
'ba
Neil Mitchell wrote:
> I've just finished updating Hoogle (http://haskell.org/hoogle/) to
> work with the latest GHC API, in particular all the base split that
> has occurred and the few functions that were added. It took rather
> longer than I would have liked, because of paper deadlines etc, but
On a related note... is there some easy way to be sure that a program I am
compiling uses only haskell 98? (Because any pure haskell 98 should always
compile on yhc... right?)
Say I have
module M where
import A
...
I compile this with ghc, no options, and iIt doesn't have any {-#-#}
options,
On Tue, Dec 04, 2007 at 12:21:40PM -0500, Brent Yorgey wrote:
>
> I'm looking for good examples of using Template Haskell to evaluate CAFs at
> compile time, e.g. if I have some expensive-to-calculate lookup table which
> I'd rather have evaluated at comile time and included in the executable as a
Is there some way to use any of the various regex packages on hackage via
yhc? Has anyone installed one them successfully?
I'd like regex-tdfa, but would settle for regex-posix, or really, anything
that brings the convenience of regex to yhc.
In general, is there a straightforward way to instal
you need to write a parser.
Parser is a popular library on hackage that should do what you want. (I
have never used it though.)
Or read
http://citeseer.ist.psu.edu/50754.html
and adopt the code from there to your purposes.
I found this paper extremely helpful when I needed to build a parser.
If you add a third pattern, you can see exactly what it's failing to match:
kmerge x = error (show x)
In order to do this, you just need to add Show constraints for a and b in
the type of kmerge:
kmerge :: (Show a, Show b, Eq a) => [(a,[b])]->[(a,[b])]
You'll find that the pattern that i
Jules Bean wrote:
> ChrisK wrote:
>> A safer gimmick...
>>
>> Ben Franksen wrote:
>>> tickWhileDoing :: String -> IO a -> IO a
>>> tickWhileDoing msg act = do
>>> hPutStr stderr msg >> hPutChar stderr ' ' >> hFlush stderr
>>> start_time <- getCPUTime
>>> tickerId <- forkIO ticker
>> ... an as
> kmerge ((x,[y]):[]) = [(x,[y])]
>
Matching on [y] like this will only match lists with a single element (and
bind y to that element). You probably just want to say
kmerge ((x,y):[]) = [(x,y)]
etc., which will bind y to the entire list.
-Brent
___
H
Hello!
I need to write a function which should is supposed to merge multiple
entries with the same
key (out of a sorted key-value-list) into one single entry.
However, I keep getting a pattern matching error.
(For example, for input [('b',[5]),('b',[4]),('b',[1]),('b',[6])]:
"Program error: patt
Hi Dennis,
> Not sure if this qualifies in any category above, but I just searched for:
>
> Monad m => m (m a) -> m a
>
> And I couldn't find Control.Monad.join on any of the first 4 pages or
> so of results. If I search for join, of course, the first result is:
>
> Control.Monad. jo
Hi
> Is there a way to search on module names? If I put in Data.Map then
> the one thing that doesn't come up is a link to the library page for
> Data.Map. That would be a really good short-cut.
As Tillman says, you can search for "Map" alone to find Data.Map. The
new version (Hoogle 4) already s
Ivan Miljenovic wrote:
How I envisage it happening is that a parser would be used to find all
"functions" in the given code, treat these as nodes in the graph and
then use directed edges to indicate which functions call other
functions. This resultant graph can then be analysed in various ways
s
hi
Can anyone advise me on how to check whether a string contains ints, chars,
bools, etc
"2345 + 6767" shoudl give IntAdd (2345) (6767)
"2345" should give IntT 2345
Ryan
_
Who's friends with who and co-starred in what?
htt
Ben Franksen wrote:
Ryan Ingram wrote:
On 12/5/07, Ben Franksen <[EMAIL PROTECTED]> wrote:
You would have to use functional dependencies or associated types to
eliminate this error. Alternatively, you can add a dummy argument of type
"block" and pass "undefined :: BlockType" in to help choose t
Daniel Fischer wrote:
Then I tried to build zlib-0.4.0.1:
$ runghc ./Setup.hs configure --user --prefix=$HOME
Configuring zlib-0.4.0.1...
Setup.hs: At least the following dependencies are missing:
base >=2.0&&<2.2
??? okay, there was something with flag bytestring-in-base, removed that, so
Ryan Ingram wrote:
> On 12/5/07, Ben Franksen <[EMAIL PROTECTED]> wrote:
> You would have to use functional dependencies or associated types to
> eliminate this error. Alternatively, you can add a dummy argument of type
> "block" and pass "undefined :: BlockType" in to help choose the instance
> d
Dougal Stanton wrote:
Is there a way to search on module names? If I put in Data.Map then
the one thing that doesn't come up is a link to the library page for
Data.Map. That would be a really good short-cut.
You can already search for unqualified module names:
http://haskell.org/hoogle/?q=Ma
david48 wrote:
Threads won't give you a speedup unless you run the program on a
multi-core/multi-proc machine.
That's actually not true. Threads allow you managing your IO blocking
better, and not making IO block your whole program can certainly speed
it up by a couple of orders of magnitude.
ChrisK wrote:
A safer gimmick...
Ben Franksen wrote:
tickWhileDoing :: String -> IO a -> IO a
tickWhileDoing msg act = do
hPutStr stderr msg >> hPutChar stderr ' ' >> hFlush stderr
start_time <- getCPUTime
tickerId <- forkIO ticker
... an async exception here will leave the ticker runnni
On Dec 6, 2007 10:50 AM, Neil Mitchell <[EMAIL PROTECTED]> wrote:
> So now, if there is a function you are looking for in the core
> libraries which you can't find, tell me. Equally, if any of the
> documentation links lead to a 404, please do tell me.
Thanks for your work on Hoogle! It is an ext
On 06/12/2007, Neil Mitchell <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've just finished updating Hoogle (http://haskell.org/hoogle/) to
> work with the latest GHC API, in particular all the base split that
> has occurred and the few functions that were added. It took rather
> longer than I would have
Hi,
I've just finished updating Hoogle (http://haskell.org/hoogle/) to
work with the latest GHC API, in particular all the base split that
has occurred and the few functions that were added. It took rather
longer than I would have liked, because of paper deadlines etc, but
its now sufficiently aut
Peter Padawitz wrote:
Yes, the recursive calls of compCommand are supposed to be calls of
compBlock.
The intention of the program is a generic evaluator comp... of
Sigma-terms in arbitrary Sigma-algebras. The signature Sigma is given by
the first 4 types (and the corresponding functions in th
This sounds like a fun project and it is certainly feasible to do. I
thought I'd give you some pointers to fun stuff that people have been
doing in the past.
Thomas Reps have been doing program analysis since the dawn of time,
but one paper that seems particularly related to what you try to do is
On Thu, Dec 06, 2007 at 09:34:30AM +0100, Ketil Malde wrote:
> "Tim Chevalier" <[EMAIL PROTECTED]> writes:
> > This is very well-trodden ground, but if you familiarize yourself with
> > the literature on the subject, then who knows, you may discover
> > something new.
>
> I'll just add that having
if you want to make something like this for haskell (and
i'd very much like to use it!-), there are several issues,
including:
1 handling code:
- going for a portable intermediate representation,
such as bytecode, is most promising, especially
if the code representation is fai
HOgg 0.3.0 Released
---
The HOgg package provides a commandline tool for manipulating Ogg files,
and a corresponding Haskell library. HOgg is in hackage, or on the web at:
http://www.kfish.org/~conrad/software/hogg/
This is the second public release. The focus is on correctness
Luis Cabellos wrote:
>> I have a question, what's the best way to program?
>> - put all the signatures in the Haskell Code?
>> - Only put the type signatures needed to compile (like monomorphism errors
>> or ambiguous signature)?
Wolfgang Jeltsch wrote:
> Inserting all type signatures is definit
Yes, the recursive calls of compCommand are supposed to be calls of
compBlock.
The intention of the program is a generic evaluator comp... of
Sigma-terms in arbitrary Sigma-algebras. The signature Sigma is given by
the first 4 types (and the corresponding functions in the class
declaration),
Jules Bean wrote:
> I think the 'right' answer for this case is to drop the maybes and just
> use lists, which is what the OP himself realised.
Yes, part of the fun of programming is when
you realize that you have been re-implementing the
right data type inside of a wrong one.
Alistair Bayley wro
Am Donnerstag, 6. Dezember 2007 10:03 schrieb Simon Peyton Jones:
> [redirecting to Haskell Cafe]
>
> | > It is clear that this situation must not stay this way. Bit by bit,
> | > disciples of Perl and Python discover Haskell and demand that Haskell
> | > will be plastered with syntactic sugar unt
> >Is it already a known problem that the preprocessor cannot cope with
> >the whole set of possible string declarations?
> >
> Yes, it is:
>
> According to the ticket, cpphs (a Haskell-oriented CPP replacement)
> does get it right.
http://www.cs.york.ac.uk/fp/cpphs
After installing, give ghc
Alistair Bayley wrote:
Nested Maybe cases put me in mind of the Maybe monad. Although in this
case it''s not trivial; we also need to involve the Maybe [a] instance
of Data.Monoid too (for the mappend function). I do wonder if I'm
abusing the monadic instances of Maybe though; is this really any
Bernd Brassel wrote:
Is it already a known problem that the preprocessor cannot cope with the
whole set of possible string declarations?
Yes, it is:
http://hackage.haskell.org/trac/hackage/ticket/146
I ran into it lately. I was totally unaware of what caused GHC's parse
error on a valid lin
On Dec 6, 2007 9:30 AM, Alistair Bayley <[EMAIL PROTECTED]> wrote:
> > Use of isNothing and fromJust and a cascade of ifs is generally a poor
> > sign, much better to use case:
> >
> > findAllPath pred (Branch lf r rt)
> > | pred r =
> > case (findAllPath pred lf,findAllPath pred rt)
Dan Piponi wrote:
There's a bit of work required to make this code good enough for
general consumption, and I don't know much about Haskell internals.
(1) What is the "official" way to find the size of a word? A quick
look at 6.8.1's base/GHC/Num.lhs reveals that it uses a #defined
symbol.
I'm
| (2) Is it safe to assume an underlying implementation based on GMP?
| (In Num.lhs there is an alternative definition for .NET. Is that ever
| used?) Is it safe to assume the size of a GMP "limb" is the same as
| the word size? (I'm assuming it is for now.)
I think it's safe for now. In principl
> Use of isNothing and fromJust and a cascade of ifs is generally a poor
> sign, much better to use case:
>
> findAllPath pred (Branch lf r rt)
> | pred r =
> case (findAllPath pred lf,findAllPath pred rt) of
>(Nothing,Nothing) -> Nothing
>(Nothing,Ju
Jan-Willem Maessen wrote:
On Dec 5, 2007, at 3:58 AM, Simon Marlow wrote:
Ah, so I was thinking of the following readIVar:
readIVar = unsafePerformIO . readIVarIO
But clearly there's a better one. Fair enough.
Hmm, so unsafePerformIO doesn't deal with any operation that blocks?
Well,
[redirecting to Haskell Cafe]
| > It is clear that this situation must not stay this way. Bit by bit,
| > disciples of Perl and Python discover Haskell and demand that Haskell will
| > be plastered with syntactic sugar until the simplicity of the functional
| > approach isn’t visible anymore. Sa
Hello,
Isaac, this works for me.
Thx a lot,
Steffen
2007/12/5, Isaac Dupree <[EMAIL PROTECTED]>:
>
> Steffen Mazanek wrote:
> > Hi,
> >
> > Stefan and Isaac, thx for providing quick advice.
> >
> > @Stefan: Unfortunately I have to use a list.
> > @Isaac: I do not get it. Could you please pr
"Tim Chevalier" <[EMAIL PROTECTED]> writes:
> aka a "call graph". This is called "control flow analysis" and the
> classic paper on it is Olin Shivers' dissertation
> This is very well-trodden ground, but if you familiarize yourself with
> the literature on the subject, then who knows, you may di
67 matches
Mail list logo