With apologies, I now announce docidx-1.0.1 which fixes a problem kindly
pointed out by Jack Henahan. If you tried to install docidx using "cabal
install" over the weekend and failed, please try again now.
The docidx-1.0.0.tar.gz uploaded to hackage on Friday was missing most of its
source cod
531/focus=53572 ; then I
wrote a static version in Python later that year:
http://gimbo.org.uk/blog/2009/09/23/ ; then Andy Price ported that to Haskell:
https://github.com/andyprice/docidx.hs ; finally, I rewrote that to build the
index via Cabal rather than walking the filesystem directly -
eChar :: String -> GenParser Char st String
maybeChar as = option "" (choice (map char as) >>= \a ->
return [a])
You can also break it immediately before do, which I think is
sometimes more clear.
If not an extra space is added following "do" this leads to an "odd"
indentation of at least one line.
I'm curious: which line in the above is indented oddly? Oh, wait: you
don't mean odd as in "strange", do you? You mean odd as in "not
even"? So, e.g. the "spaces" line starts at column 5? What's wrong
with that?
Cheers!
-Andy
--
Andy Gimblett
http://gimbo.org.uk/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
out? I'm hoping I'm not going
to have to completely override the install machinery - that would feel
somewhat self-defeating.
Many thanks,
-Andy
--
Andy Gimblett
http://gimbo.org.uk/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.o
$ concat [n, w, ".", f, e]
where liftCtoS a = option "" (char a >> return [a])
Thanks for all the help, again.
-Andy
--
Andy Gimblett
http://gimbo.org.uk/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
n <- option "" (char '-' >> return
"-") -- Optional negation in exponent
m <- many1 digit
return $ n ++ m
case e of Nothing -> return $ read $ w ++ ".&
hing obvious I'm missing.
As hpaste.org seems to be down, I'll attach a code example here instead.
Thanks!
-Andy
--
Andy Gimblett
http://gimbo.org.uk/
TestParse.hs
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
and thus can fix it. :-)
Cheers,
-Andy
--
Andy Gimblett
http://gimbo.org.uk/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
, at 20:48, Andy Gimblett wrote:
Ack. I've just realised that P/Q is not a functional dependency. I
need to use a multi-parameter type class there. So my question is
probably completely pointless - sorry!
Thanks anyway,
-Andy
On 13 Nov 2009, at 20:26, Andy Gimblett wrote:
Hi all,
Ack. I've just realised that P/Q is not a functional dependency. I
need to use a multi-parameter type class there. So my question is
probably completely pointless - sorry!
Thanks anyway,
-Andy
On 13 Nov 2009, at 20:26, Andy Gimblett wrote:
Hi all,
This email is literate Haskell.
Hi all,
This email is literate Haskell. I'm trying to use type families to
express some dependencies between type classes, and I'm running into
trouble, I think because I'm producing chains of dependencies which
the checker can't resolve... Here's a minimised version of the state
I've got mysel
Hi all,
Further to earlier discussion on this topic, I've just released a
first version of this package to hackage:
http://hackage.haskell.org/package/simple-observer
It is a fairly simple implementation of subject/observer which I've
recently used to good effect in an GUI written using wx
On 9 Nov 2009, at 17:41, Neil Brown wrote:
Just to clarify -- I meant access to another MVar. Basically, if I
do this:
do v <- newMVar
addObserver sub (putMVar v)
If when the observers are run, the MVar v (that I've allocated) is
non-empty, my code will block until it is empty, which w
On 9 Nov 2009, at 16:47, Eduard Sergeev wrote:
Andy Gimblett-2 wrote:
Possibly. Care to expand? If you have a more elegant solution,
which
fits in well with ordinary wxHaskell, I'd be interested.
I believe there are a few experimental frameworks built on top of
wxHaskell
whic
On 9 Nov 2009, at 15:21, Eduard Sergeev wrote:
Andy Gimblett-2 wrote:
To help manage dependencies between state and UI elements, I looked
for a
Haskell version of the Observer design pattern
Isn't Reactive Programming approach more suitable than Observer if
we talk
about Ha
Hi Neil,
On 9 Nov 2009, at 14:50, Neil Brown wrote:
1. Does anyone have any comments, on either version?
There is no way to remove an observer, which is something I'd expect
to have available. I realise this would require assigning a key to
each observer (and thus perhaps storing them in a
Hi all,
I've been doing some GUI programming recently, using wx. To help
manage dependencies between state and UI elements, I looked for a
Haskell version of the Observer design pattern, and I found an
implementation written by Bastiaan Heeren of ou.nl [1].
It pretty much did what I want
Dear friends,
It is my pleasure to announce the formation of fp-southwales, a user
group for anybody interested in functional programming in the area of
south Wales, UK. We're based out of Swansea University's Computer
Science department, where there are a few of us using Haskell for our
On 24 Sep 2009, at 20:10, Duncan Coutts wrote:
On Thu, 2009-09-24 at 19:48 +0100, Andy Gimblett wrote:
That's great news for me, except: that's what I tried first, and I've
just tried it again and it still doesn't seem to work for me.
Perhaps
I am doing something wron
On 24 Sep 2009, at 18:28, Duncan Coutts wrote:
On Thu, 2009-09-24 at 17:49 +0100, Andy Gimblett wrote:
So: am I right that this is the intended/expected behaviour? If not,
how does one get round it? If so, could someone perhaps comment on
the prospects/complexity of implementing this - or
Hi all,
I've developed a bit of a taste for literate Haskell lately, being a
verbose sort of guy. Unfortunately, it doesn't seem to interact with
Haddock in the way I'd like/expect. I just wanted to check that my
understanding of the situation is correct before I (regretfully) give
up o
On 21 Sep 2009, at 09:14, Martijn van Steenbergen wrote:
Michael Shulman wrote:
Is there a way to make it automatically update a single contents page
with links to the documentation of all installed packages?
See:
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/53531/
focus=53560
htt
On 17 Sep 2009, at 18:01, Ryan Ingram wrote:
Here's a way that works more closely to your original version:
instance Enumerated a => Target a where
convert n
| n >= 0 && n < numConstrs = Just (constrs !! n)
| otherwise = Nothing
where
constrs = constructors
n
On 17 Sep 2009, at 16:50, Daniel Fischer wrote:
Yes, the second appearance of 'constructors' is at an unspecified
type.
instance (Enumerated a) => Target a where
convert n
| n < 0 = Nothing
| otherwise = case drop n constructors of
(x:_) -> Just x
On 17 Sep 2009, at 15:21, José Pedro Magalhães wrote:
> > E.g. here's a type Bar with three constructors:
> > > data Bar = X | Y | Z deriving (Show)
> > > instance Enumerated Bar where
> > > constructors = [X, Y, Z]
> >
> > (This is certainly ugly. Any suggestions?)
> >
> |constructors| is
Hi all. This email is in literate Haskell; you should be able to load
it into ghci and verify what I'm saying (nb: it won't compile without
alteration: see below).
I'm trying to do something which may anyway be stupid / not the best
approach to what I'm trying to achieve; however, it's not worki
On 23 Jul 2009, at 11:59, Matthias Görgens wrote:
Round-to-even means x.5 gets rounded to x if x is even and x+1 if x
is
odd. This is sometimes known as banker's rounding.
OK. That's slightly unusual indeed.
It's meant to minimise total rounding error when rounding over large
data sets;
Hi all,
This email is literate Haskell. I have a question about default
implementations of typeclasses.
> {-# LANGUAGE TypeSynonymInstances #-}
> module Thing where
> import Text.PrettyPrint.HughesPJ
Let say I want to pretty-print some values, enclosed in double quotes.
The natural thing to
rd, the rest is in English). Chapter 2
answers the questions asked above, with copious examples and
exercises.
Hope this helps,
-Andy
--
Andy Gimblett
Computer Science Department
University of Wales Swansea
http://www.cs.swan.ac.uk/~csandy/
___
Haskell-Caf
m that) are a
> consequence of the way they transform under (smooth) maps. But perhaps this
> is
> better discussed on a differential geometry mailing list?
I assumed he was just trying not to sing the "Spider Pig" song.
( http://uk.youtube.c
> saying is: get used to it, it's not so bad.
At AngloHaskell, one of Phillipa's slides referred to Haskell as a
"programming language theory gateway drug" - and was clearly of the
opinion that this was A Good Thing.
--
Andy Gimblett
Computer Science Depa
be
fine/usable.
If, with real data, it turns out to be too slow then yes, I'll ditch
this naive method and look at graph algorithms, which is of course the
Smart thing to do. However, it's beautiful (to me) code right now,
which strongly reflects the definition of the problem, so
On Wed, Aug 01, 2007 at 01:42:52PM -0700, Dan Weston wrote:
> Andy Gimblett wrote:
> >
> >>cartesian :: Ord a => S.Set a -> S.Set (a,a)
> >>cartesian x = S.fromList [(i,j) | i <- xs, j <- xs]
> >>where xs = S.toList x
>
> Your list com
red if there were any
hidden gotchas. I'm particularly concerned by toList (O(n)) fromList
(O(n log n)) - but for other reasons I'd really like to be using Set
rather than List for this (I think).
Many thanks for any thoughts,
-Andy
--
Andy Gimblett
Computer Science Department
Univer
On Fri, Sep 09, 2005 at 01:54:20PM +0200, Stephane Bortzmeyer wrote:
>
> > I'm surrounded by Sun boxes here.
>
> One solution is to install Debian/GNU Linux on these, ghc runs fine
> on it :-)
Or NetBSD - very good on older hardware, in particular.
-Andy
--
Andy Gi
"convert to
string", btw).
Is there a facility like this in Haskell? Or something else I should
be using, other than lots of ++ ?
Thanks,
-Andy
--
Andy Gimblett
Computer Science Department
University of Wales Swansea
http://www.cs.swan.ac.uk/~csandy/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ur immediate problem, add "-package fgl" to your compilation
> line.
*slaps forehead*
Of course! I remember reading this now, but I had forgotten about it.
And I've already come across this requirement in the past with Parsec,
so I really should have thought of it...
Many thanks fo
is, or tell me what stupid thing I'm
doing wrong, I'd really appreciate it.
Many thanks,
-Andy
--
Andy Gimblett
Computer Science Department
University of Wales Swansea
http://www.cs.swan.ac.uk/~csandy/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
38 matches
Mail list logo