News aggregator
What's the new type ?
type Parser a = GenParser Char () a
newtype GenParser tok st a = Parser (State tok st -> Consumed (Reply tok st
a))
As i know, the Parser type is just an alias of GenParser. Then can the
second line be replaced as below?
newtype GenParser tok st a = GenParser Char () (State tok st -> Consumed
(Reply tok st a))
If it can , then what is the new type ?
Sincerely!
-----
fac n = foldr (*) 1 [1..n]
Categories: Offsite Discussion
debugging
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
Master's thesis topic sought
Hello, -Cafe,
I'm looking for an interesting topic to hack on in my thesis.
The thesis should be rather "theoretical"/abstract (writing a mail
client in Haskell is not, for example), dealing with FP or related
fields. I've had a few (blurry) ideas, ranging from investigating
(possibilities for) Haskell extensions, to zygohistomorphic
prepromorphisms, but nothing concrete, possibly because I'm not familiar
with these areas enough to see what could be done -- which brings up a
question whether it is a good idea to even try hacking on a topic like
this.
However, I'm eager to learn so if you have a topic you'd need somebody
to work on, or just an interesting (or maybe even an uninteresting)
idea, i'd be grateful for suggestions. :)
Thanks,
Matus
Categories: Offsite Discussion
Strict Monad
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
question
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
Interactive chatbot
Hi!
My students have the task to program an interactive chatbot. We have
run into a problem that I can't solve either:
When we read the user's input through
> t <- getLine
it is not possible to delete typos before hitting enter and thereby
sending the input off to the system (at least in OS X, bash). I didn't
find that terribly problematic, but of course it is a bit of a show
stopper from their point of view.
The input is then used to generate a reply in purely functional code,
and the reply sent to the command line via putStr. Is there a more
clever way to interact with the user that would allow editing ones
text before sending it to the bot?
I guess we could try with a website, but don't know off hand how to do
that, either, although I've seen beautiful webservers made in Haskell...
Regards,
Torsten Otto
Categories: Offsite Discussion
representing Haskell objects in a uniform way
Hi,
I am writing a little IPC system to make Haskell values and functions
remotely invokable.
To do so, I need (or so I believe) to make my objects accessible via a
generic interface as in:
class AFun f where
afun :: Data a => f -> ([Dynamic] -> a)
So my generic object is something that takes an array of parameters,
that being Dynamic can be anything, and returns a Data, that I can
easily serialise and send back on the wire.
I start by defining an instance for functions:
instance (Typeable a,AFun b) => AFun (a->b) where
afun f (p:ps) = let Just v = fromDynamic p in afun (f v) ps
afun _ _ = error "Too few arguments"
So far so good, but when I try to define an instance for values:
instance Data v => AFun v where
afun f [] = f
afun _ _ = error "Too many arguments"
I get:
Couldn't match expected type `a' against inferred type `v'
`a' is a rigid type variable bound by
the type signature for `afun'
at /home/titto/.quid2/state/ubuntu.local.8080/wikidata/haskell
Categories: Offsite Discussion
Data.IntMap/IntSet inconsistencies
_______________________________________________
Libraries mailing list
Libraries< at >haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Categories: Offsite Discussion
ANN: fdo-notify 0.1,a client for the Desktop Notifications protocol
Haskellers,
I present to you fdo-notify, a client library for FreeDesktop.org's
Desktop Notifications protocol. This is the DBUS protocol served by
NotifyOSD and other notifications systems, which allows a wide variety
of applications to present notifications to the user in a uniform way.
The library should not require knowledge of DBus or the Desktop
Notifications protocol itself, at least once fully documented (there
should be enough haddocumentation for basic use already).
Hackage: http://hackage.haskell.org/package/fdo-notify
Mercurial: http://bitbucket.org/taejo/fdo-notify/
Basic notifications and updated/replacement notifications are
supported. Images are not yet supported (adding support should be
easy, but which Image type? Is there a de facto standard imaging
library like the Python Imaging Library?) and nor are signals. Signals
allow an application to be informed when some action is taken on the
notification (NotifyOSD doesn't support actions, but other
implementations might).
The library is r
Categories: Offsite Discussion
Emacs: Haskell snippets for YASnippet
Hi List,
this is rather trivial, but maybe someone else finds these useful:
darcs get http://code.haskell.org/~daniels/haskell-snippets/
Especially the LANGUAGE ones have saved me quite some typing :) Additions
welcome.
Usage: If not already installed, get YASnippet:
http://code.google.com/p/yasnippet/
and put this into your .emacs:
(load-file "some-path/haskell-snippets.el")
to expand a snippet, just enter the macro string (these are listed in the
haskell-snippets.el file) and press <tab>. If the snippet has holes, press
<tab> again to jump to the next hole.
Greetings,
Daniel
Categories: Offsite Discussion
Porting to DragonFly BSD
When GHC 6.12.1 is released, I'm going to have a go at porting it to
DragonFly BSD (32-bit incarnation). Is the porting page on the
wikiup-to-date?
Categories: Offsite Discussion
Bas van Gijze: Comparing Parser Construction Techniques
Already a few months ago I completed my Bachelor computer science by writing a small paper and attending and presenting at a student conference. Well anyway, the topic I wrote about is parser construction techniques. The paper talks about parser generators (ANTLR in specific), parser combinators (Parsec 2) and a nice novel combination of the two (Tinadic Parsing, still to published somewhere in the future).
Anyway I hope this paper might be interesting to some people reading my blog. The paper comes with quite some code examples and it's probably not a very hard read. So you might consider it a small tutorial on parser construction techniques (or even learn some Parsec while you're at it :) ).
My paper can be found here at the website of the University of Twente.
The accompanying code examples can be found here. If someone would really appreciate it, I might consider writing some more documentation.
As you might have noticed blog posts were a bit scarce the last weeks, because of my silly ambition of taking 3 instead of 2 courses :P. Anyway, I'm liking the pace but my side activities suffer a bit, so I'll probably switch back after next period.
(People waiting for the extended state monad implementation: I haven't given up yet!)
Anyway I hope this paper might be interesting to some people reading my blog. The paper comes with quite some code examples and it's probably not a very hard read. So you might consider it a small tutorial on parser construction techniques (or even learn some Parsec while you're at it :) ).
My paper can be found here at the website of the University of Twente.
The accompanying code examples can be found here. If someone would really appreciate it, I might consider writing some more documentation.
As you might have noticed blog posts were a bit scarce the last weeks, because of my silly ambition of taking 3 instead of 2 courses :P. Anyway, I'm liking the pace but my side activities suffer a bit, so I'll probably switch back after next period.
(People waiting for the extended state monad implementation: I haven't given up yet!)
Categories: Offsite Blogs
ANN: haskell-src-exts-1.3.0
Fellow Haskelleers,
I'm pleased to announce the release of haskell-src-exts-1.3.0!
* On hackage: http://hackage.haskell.org/package/haskell-src-exts
* Via cabal: cabal install haskell-src-exts
* Darcs repo: http://code.haskell.org/haskell-src-exts
Version 1.3.0 is a new major release, following the PVP, as it
contains a few backwards-incompatible changes, making the 1.2.x branch
a very short parenthesis in history. There are two main new things in
1.3.0: fixity application is now handled uniformly regardless of which
AST you use, simple or annotated, and the parser now supports multiple
modules in the same source file.
haskell-src-exts-1.3.0:
====================
* The *.Fixity modules now export the same Fixity type (incidentally
the one previously used by the simple un-annotated parsing) and the
same helper functions. If you've done all your Fixity handling using
the helper functions (infix_, infixl_, infixr_), or if you've only
used fixities for the un-annotated AST, you're safe. Only if you've
manua
Categories: Incoming News
Writing concurrent programs with gtk2hs
Categories: Incoming News