Thanks all for the suggestions!
VIM and I have never gone together well, probably mostly my fault I
know. Maybe some day... Emacs isn't my favorite either. I do have
Notepad++, but it only seems to support a small portion of the unicode
I need. Normally I use TextPad, but it wouldn't show me any
Fellow Haskelleers,
it is my pleasure to announce the new release of the haskell-src-exts
package, version 0.4.8:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src-exts-0.4.8
darcs get http://code.haskell.org/HSP/haskell-src-exts
This is a bug-fix release in the wake of the
Is it possible to change a particular node of the
doubly linked list? That is to say, that would like
to have a function:
update :: DList a - a - DList a
where
update node newValue
returns a list where only the value at the node
which is passed in is set to the new Value and
all other
It seems like the line numbers could be a bit more accurate:
./Network/Yogurt/IO.hs:54:3: Use liftM
Found:
rec = return . (c :)
Why not:
liftM (c :) rec
Where the code is:
50 -- Waits for input, but once the first character is read, waits
51 -- no longer than the specified number of
. some parser errors I encountered: import Data.Generics hiding ((:*:))
type instance Rep Id x = x
The first is due to a bug in HSE which I've now fixed, thanks a lot
for reporting! The second is parsed just fine by HSE so I don't know
what's
Hi Gwern,
2) I think I found a parsing bug. One line in Mueval/Interpreter.hs runs:
fmap (take n exceptionMsg ++) $ render' (n-length exceptionMsg) s
which gives the error:
Mueval/Interpreter.hs:145:59: Parse failure, Parse error
No relevant suggestions
Adding spaces between 'n'
All of these get one thing right that the current and most of the proposed
Haskell logos do not: they don't make any reference to the syntax of the
language itself. Doing so seems to miss the point of a logo: it's supposed
to appeal visually, rather than semantically. So I'd like to see some
An homage to syntax at least gives an easily recognizable icon, far more
iconic than a camel or a grid of colours, and I would consider several
of the lambda based ideas on the wiki simple, elegant and visually
appealing.
Exactly!
Cheers,
/Niklas
And who knows category theory? Almost nobody. If you insist on naming stuff
after things that nobody will have heard of and which sound highly
technical, you're going to seriously limit your potential audience.
If you insist on naming stuff ad hoc, you're going to seriously limit
the appeal of
Indeed, I just found that. I wonder where in the universe this is
documented. Oh well. I also had to change -- $x and -- $( comments. A
darcs diff -u patch is attached.
Thanks a lot Chris, patch applied to the repo and will appear in the
next release.
Cheers,
/Niklas
Are SrcSpan's on the TODO list?
Seeing how this is the first I hear of them, I can't say that they
have been, but they could be. :-)
Could you give me a rundown on what usecases you'd need SrcSpans for,
and where HSE currently fails you in this regard?
Cheers,
/Niklas
Apart from this, HSE now also parses any unrecognized pragma in option
(e.g. LANGUAGE), declaration (e.g. RULES) or expression (e.g. SCC)
position, allowing user-customized pragmas. Unrecognized pragmas in
other positions will (unfortunately) give a parse error. If this ever
means a problem
(CC libraries)
So when will we simply declare that haskell-src-exts is the new
haskell-src? :-)
I talked about this with Ross Paterson at one point, and his main
objection (which I very much agree with) was that haskell-src-exts
doesn't let you *optionally* handle extensions, so in some cases
So: does anybody have a haiku I missed? Or even better, is anyone
feeling poetically inspired tonight? :)
Sunday mornings* are made for poetic inspiration. :-)
Trapped in a monad,
use unsafePerformIO !
Purity tainted...
Cheers,
/Niklas
* 2 pm is still morning right?
The full list of pragmas supported by 0.4.4 is: SOURCE, RULES,
DEPRECATED, WARNING, INLINE, NOINLINE, SPECIALISE, CORE, SCC,
GENERATED and UNPACK.
The newly released version 0.4.4.1 adds to the list of pragmas
supported by adding support for the following: LANGUAGE, OPTIONS,
OPTIONS_{GHC,
The only pragmas supported by GHC that HSE supports are, to my
knowledge, ANN and LINE.
Umm, right, insert a does not in the proper place there...
Cheers,
/Niklas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Fellow Haskelleers,
it is my pleasure to announce the new release of the haskell-src-exts
package, version 0.4.4:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src-exts-0.4.4
darcs get http://code.haskell.org/HSP/haskell-src-exts
The new feature in this release is support
On Sun, Nov 23, 2008 at 8:23 AM, John A. De Goes [EMAIL PROTECTED] wrote:
Though many see it as losing information, I agree wholeheartedly with your
proposal to change the AST.
It's better to have an AST that conveys less information, but truthfully,
than to have an AST that purports to
No, I believe it wouldn't. The left-biased tree cannot distinguish
where parentheses have been used from where HSE inserted its own left
fixities. For instance, if we have the expressions
xs ++ ys ++ zs
(xs ++ ys) ++ zs
Then HSE will return something like (I'm using strings for the
Of course, this would require a change to Template Haskell, so a
second-best solution would be to forbid unparenthesised expressions in
my quasiquoter. Then, parsing can proceed correctly without knowing
the fixities. This would be easiest to do if haskell-src-exts changed
its AST in a
Any chance of including support for view patterns in a future release?
http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#view-patterns
. The project I'm writing using HSE makes significant use of view
patterns, and it would be lovely if I could be self applicable :-)
Any chance of including support for view patterns in a future release?
http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#view-patterns
. The project I'm writing using HSE makes significant use of view
patterns, and it would be lovely if I could be self applicable :-)
Fellow Haskelleers,
it is my pleasure to announce the new release of the haskell-src-exts
package, version 0.4.1:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src-exts-0.4.1
darcs get http://code.haskell.org/HSP/haskell-src-exts
This is a new major release, the first of
2008/11/11 Hugo Pacheco [EMAIL PROTECTED]:
When installing package haskell-src-exts via cabal install, I get the error
Language/Haskell/Exts/Syntax.hs:102:7:
Could not find module `Data.Data':
it is a member of package base, which is hidden
However, when manually installing
On Tue, Oct 28, 2008 at 7:56 AM, Reiner Pope [EMAIL PROTECTED] wrote:
I've tried it out and it looks good so far. I had to fiddle with
haskell-src-ext's .cabal file to get it to install with GHC 6.10,
which is surprising since it isn't listed as a broken package... ah
well.
Care to tell me
Think of any real programming language out there. For example, in many
languages statements may contain expressions, and expressions in turn may
contain statements (in Java through anonymous inner classes, for example).
... and as an example of this you could have a look at the
*HTML toString $ tag b [] [tag i [] [text ], text test]
bilt;gt;/itest/b
I'd say the big problem is that your embedded language for describing
HTML is way more complex for a domain expert than
doc = renderHTML $(q bi#{v1}/i#{v2}/b)
where
v1 =
v2 = test
How
Ivan:
In this case, it isn't SourceGraph's fault: Haskell-Src-Exts can't parse it.
Maybe it doesn't parse CPP stuff properly? I'm not sure how I can get
SourceGraph to parse files only after they've been pre-processed...
haskell-src-exts doesn't include a CPP processor no, but will discard
This could be a game changer.
Great work Andrew!!
Totally agreed, on both accounts. Really interesting to see.
-- Don
What, no Arch Linux port? :-)
Cheers,
/Niklas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
* the dependency on haskell-src-exts says any version should do, but
the one shipped in Debian Sid
(http://packages.debian.org/sid/libghc6-src-exts-dev) doesn't do, so
some extra versioning info seems to be required
Ouch, that one's pretty old. Don't the wheels of debian packaging spin
for each package you have to type (*) :
runhaskell Setup.hs configure
runhaskell Setup.hs build
sudo runhaskell Setup.hs install
(*) sometimes it'll be Setup.lhs, I'm annoyed that it's not always the
same name, can't rely on shell history :(
That's why you should always write e.g.
Hi Jean-Philippe,
Using cabal install:
cabal install yi-0.4.1
when I do this on my Windows machine, cabal-install tries to download
the unix-2.3.0.0 package, which clearly won't work. How do I get yi to
install on Windows?
Cheers,
/Niklas
___
Thanks, after installing gtk2hs and using the flags you told me I
managed to install it just fine. However...
$ yi -f pango
Launching custom yi: /home/dons/.yi/yi-x86_64-linux
yi: exception :: System.Glib.GError.GError
Anyone seen this?
Consistently on x64. The pango
The gtk frontend should not suffer from this:
yi -fgtk
C:\Documents and Settings\Niklas Brobergyi -fgtk
yi: exception :: System.Glib.GError.GError
:-(
Cheers,
/Niklas
ps. If I installed it with -f-vty -fgtk, shouldn't gtk be the default
when running? :-)
Hi all,
I'm pleased to report that haskell-src-exts is now updated to
understand Template Haskell syntax (it used to understand pre-6.4 TH,
but now it works with the current version). At least I hope so, I
didn't have much TH code to try it on so if you find some bugs just
let me know. It wasn't
Can one represent the ''Type template Haskell syntax of
$( makeMergeable ''FileDescriptorProto )
in haskell-src.exts Language.Haskell.Exts.Syntax ?
And what are the HsReify data (e.g. HsReifyType and HsReifyDecl and
HsReifyFixity )?
I don't see any pretty print capability to
On 4/27/08, Paul Johnson [EMAIL PROTECTED] wrote:
I'm trying to write an AMQP framing layer. AMQP has two very similar union
types: there is a variant that contains a single item, and an array
which consists of a list of elements of the same type. So I thought I could
define a Unit type
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
Hi Ben,
mapM2 :: Monad m = (a - m b) - [a] - m [b]
{-# INLINE mapM2 #-}
mapM2 fn lst = mapM2accum fn lst []
where mapM2accum _ [] accum = return accum
mapM2accum fn (x:xs) accum = do
r - fn x
mapM2accum fn xs (r:accum)
Not that it should matter for
2) Is there a reason to not use mapM3 above?
Yes, there certainly is. mapM3 is not equivalent to mapM; it is too strict:
*Main take 3 $ head $ mapM return [1,2,3,4,undefined]
[1,2,3]
*Main take 3 $ head $ mapM3 return [1,2,3,4,undefined]
[*** Exception: Prelude.undefined
So,
I'd love to see this functionality available cross-platform. Are there
plans for a unified library with a single API?
Yep, that's the plan (not too far) down the line, me and Lennart (who
wrote the hinotify bindings) have already discussed it to some extent.
I think the work order will be
-
Hi Emil,
On 4/17/08, Emil Axelsson [EMAIL PROTECTED] wrote:
Hello!
I'm trying to rewrite some FD classes to use associated types instead. The
Port class is for type structures whose leaves have the same type:
class Port p
where
type Leaf p
type Struct p
toList
Hi all,
I wanted to use hinotify, which gives notifications on file system
changes, but found (quite naturally) that it wouldn't run on my
windows machine (since it's a binding to the linux kernel). So I
started writing a library that would give similar functionality on
Windows. This is the first
I would like to ask something that results in when I have the following
commands
data Color = Red | Green | Blue | Indigo | Violet deriving (Enum,Show,Read)
(read.show) x
interactive:1:1:
Ambiguous type variable `a' in the constraint:
`Read a' arising from a use of `read' at
Although I have tried to make sense what lexicographic order means I haven't
figured out. Maybe an example with a simple application of this would be
helpful. To be honest I can't understand what the symbol = really means.
= means less than or equal to.
Normally, lexicograpic order is the
HSP: big on dynamic pages. I don't want to make my webserver able
to compile Haskell code. Develop code, compile, test, make sure it's
right, then push to production every 6 months around here.
Being one of the main developers of HSP, I guess I should reply to this. :-)
HSP is indeed big
Greetings fellow Haskelleers,
I am very pleased to announce a new chapter in the Haskell Server
Pages saga. After a two-year long hiatus, while we in the team have
been busy with Other Stuff, we have resumed work on Project HSP, and
this release marks the first milestone.
=
===
I'm pleased to announce a new release for the haskell-src-exts package.
Twice in two days even. :-)
haskell-src-exts 0.3.3 - now with support for type equality constraints.
cabal sdist:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src-exts-0.3.3
darcs repo:
Could this be used to add support for refactoring of source files
containing language extensions?
Because if I'm correct, the current most popular refactoring solution (I
forgot the name) for Haskell does not support extensions.
I supppose you're talking about HaRe, that Thomas Schilling
Hi all,
I'm pleased to announce a new release for the haskell-src-exts package.
haskell-src-exts 0.3.2
===
haskell-src-exts is a package for handling and manipulating Haskell
source code. It is based on the haskell-src package that is part of
the standard libraries, but
The problem is that, when I run it with strings containing a number
more then 10 digit long, I get unexpected integers back:
*Main runP number1 1234567890 and the rest
[(1234567890, and the rest)]
*Main runP number1 12345678901 and the rest
[(-539222987, and the rest)]
This has nothing to do
c2Str c = c:[]
This function is often known as box, its much more general than char
to string, it puts any single element in a list like box
... or 'return', which is in the Prelude already, but which is even
more general, it puts any single element into any (dare I say it)
monad, where a
Hi Oleg,
Thanks a lot for your reply. I see now where my attempt went wrong and
why it couldn't work in the first place, the instances will indeed
overlap. I'm not completely satisfied with your solution though, but
seeing how you did it has lead me to the solution I want. Details
below. :-)
]
| It seems you might benefit from local functional dependencies, which
| are asserted per instance rather than for the whole class. They are
| explained in
|
| http://pobox.com/~oleg/ftp/Haskell/typecast.html
Unfortunately I come crawling back with a failure. Either my fu was
not strong
Note that there are many people who will not do work on a BSD project since a
company can just come along and take it. People are free to choose GPL or BSD
for their work and then other people are free to choose whether to derive work
from them.
But this is just the thing, isn't it? The GPL
Yes, this will surely do the trick, thanks a lot! :-)
I got as far as defining a TypeEq class myself in one of my attempts,
trying to trick the inference engine, but now seeing the full
ingenuity of the TypeCast class I realize how far from the solution I
really was. Again, thanks a million!
Hi fellow Haskelleers,
I have a tricky problem that I just can't seem to solve. The problem
is one of unresolved overloading, much like the (show . read) issue,
but unlike that particular problem I feel there should be a solution
to the one I'm wrestling with.
I've tried to strip away all the
If you want the non-labelledness to be guaranteed by the type system,
you could combine a GADT with some type level hackery. Note the flags
to GHC - they're not that scary really. :-)
In the following I've used the notion of type level booleans (TBool)
to flag whether or not an expression could
Oops, sorry, I think I'm getting too addicted to flags. ;-)
The module I wrote actually doesn't need neither overlapping nor
undecidable instances, so just -fglasgow-exts will do just fine.
/Niklas
On 8/3/06, Niklas Broberg [EMAIL PROTECTED] wrote:
If you want the non-labelledness
instance Or TFalse TFalse TFalse
instance (TBool x) = Or TTrue x TTrue
instance Or TFalse TTrue TTrue
Still no flags needed as there is no overlap between the instances.
And this time I've actually verified that it works. ;-)
/Niklas
On 8/3/06, Niklas Broberg [EMAIL PROTECTED] wrote:
Oops, sorry
On 8/3/06, Klaus Ostermann [EMAIL PROTECTED] wrote:
thanks for your suggestion. Can you explain how your solution is better than
the very simple one, i.e.,
data Exp e = Num Int | Add e e
data Labeled = L String e
newtype SimpleExp = Exp SimpleExp
newtype LabeledExp = Labelled (Exp LabeledExp)
I often find myself at odds with this choice. The reason is that I use
Haskell as a host for embedded languages, and these often come with
their own control flows. So I find myself wanting to write my own
definition of the if-then-else construct that works on terms of some
other type, e.g. tests
could even overload the
bool:
cond :: Boolean a = a - b - b
This could be done with a few hours work. But not a few minutes. Want
to put a feature request in Trac?
Simon
| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Niklas
| Broberg
| Sent: 27
On 7/27/06, Doaitse Swierstra [EMAIL PROTECTED] wrote:
Given the ever increasing complexity of Haskell as understood by the
GHC, I think very
few people are looking forward to see further complications that do
not really add much.
We alreday are at a stage where first year students trying to
On 7/27/06, Niklas Broberg [EMAIL PROTECTED] wrote:
I would be happy to write up a trac-ticket for this - I could even try
to implement it in GHC. However, I'm surprised that you agree with it
so easily since it breaks some Haskell 98-ish stuff in un-nice ways.
:-)
I have now added a trac
On 7/27/06, David House [EMAIL PROTECTED] wrote:
How about we drop the idea of an auxilary cond function, and instead
just use a Boolean typeclass?
class Boolean b where
isTrue :: b - Bool
isFalse :: b - Bool
Then the semantics of if-then-else would change to something like this:
if b then
On 7/13/06, Jared Warren [EMAIL PROTECTED] wrote:
Haskell's type checking language is a logical programming language.
The canonical logical language is Prolog. However, Idealised Prolog
does not have data structures, and does Peano numbers like:
natural(zero).
natural(x), succ(x,y) :-
So here are some options:
1. the proposal as it is now, keeping exposed/hidden state in the
package database, don't support available
2. Add support for available. Cons: yet more complexity!
3. Drop the notion of exposed/hidden, all packages are available.
(except for
On 7/5/06, Joel Reymont [EMAIL PROTECTED] wrote:
Do you have examples of using Haskell as a DSL in an environment NOT
targeted at people who know it already?
Lava: http://www.cs.chalmers.se/~koen/Lava/
Lava is a hardware description language based upon the functional
programming language
On 6/28/06, David Roundy [EMAIL PROTECTED] wrote:
On Wed, Jun 28, 2006 at 11:52:51AM +0200, Joel Bjrnson wrote:
Hi. I came a cross the following phenomena which, at least to me,
occurs kind of awkward. The code below:
data MyData a where
DC1 :: (Show a ) = a - MyData a
GADTs don't yet
On 2/10/06, Ross Paterson [EMAIL PROTECTED] wrote:
On Fri, Feb 10, 2006 at 05:20:47PM +0100, Niklas Broberg wrote:
- when looking at the definition of MonadWriter the Monoid constraint
is not strictly necessary, and none of the other mtl monads have
anything similar. Is it the assumption
Hi,
I'm playing around with associated type synonyms (ATS) [1] and the
PHRaC interpreter, trying to model existing uses of FDs. I really
enjoy working with ATS, but I've come across a situation that I don't
quite know how to handle, or indeed if it can be handled at all.
The scene is
hsp can be run in two different modes. Running the full-blown version
with runtime system will probably be hard on a professional site, you
would have to convince them to install hsp. But if you can do without
the fancier bits, in particular application-scoped data, you can run
hsp pages as
professional site to
install hsp, before I go to the cgi solution. If I want to do that, what
should I ask them to install to get a full working environment, with
access to SQL and other stuff?
MaurĂcio
Niklas Broberg wrote:
hsp can be run in two different modes. Running the full-blown
Why is it that everything that OO steals from the functional
paradigm is always marketed as something new that will revolution the
way we program? Can't they at least give some credit where credit is
due? :-p
Regexps and XML are, IMHO, also must haves.
By the way, it should be possible to handle regular expressions in an
Haskell-like way.
Harp? :-)
http://www.cs.chalmers.se/~d00nibro/harp
/Niklas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Shameless plug warning.
From what I can tell, there are two problems with WASH:
1) Everything must be done the WASH way
2) WASH is mostly broken with GHC 6.4
Let me elaborate a bit on #1.
Let's say I have a CGI interface pre-defined; I take certain parameters
from a GET request and
1) Is Niklas Broberg's HSP. Niklas has said:
| Indeed, we have a working server that does runtime loading of HSP
| pages (i.e. Haskell apps) using hs-plugins. We'll be releasing a first
| version some time really soon, but if you want a preview just send me
| a mail. =)
I
I've just started experimenting with the new Cabal system, and I must
say it's really sweet. Thanks a lot to all involved!
After trying it on some simple tasks I have collected a few questions:
* What about 'setup uninstall'? Surely there should be an automatic
way of uninstalling packages and
-- Explicitly recursive continuation type
data C t a = forall t2 . C (C t2 a - IO t a)
If you write
data C t a = C (forall t2 . C t2 a - IO' t a),
it will compile (versions 6.2.2, 6.4). Whether that'll do exactly what you
want, I don't know :-(
Actually, I think it does. Originally
I just can't see why the following code will not type check. I have
scaled it down as much as possible:
-
-- IO with an extra level annotation
newtype IO' t a = MkIO' (IO a)
-- levels
data H
data L
-- Explicitly recursive continuation type
data C t a = forall
Alastair Reid wrote:
3. Can I define my own exception types?
Sadly, no. There is only one 'exception type'.
You can use dynamics and encode new kinds of exceptions as Strings
but that isn't very satisfactory.
But not at all, allowing you to declare your own exception types is
*exactly* what
Marco Righele wrote:
Ideally each session would work more or less as follows:
do(hdl,hn,pn) - accept socket
text - hGetContents hdl
inputs - parse text
replies - sequence $ map reply inputs
sequence $ map (hPrint hdl) replies
...
Where parse and reply are IO functions
/changed syntax?
Or even better, is there anyone out there who has already extended the
haskell-src bundle with support for any of them?
regards,
Niklas Broberg (d00nibro[at]dtek.chalmers.se)
_
Add photos to your e-mail with MSN 8. Get 2
I am part of a project working on an implementation of an HSP system, very
much inspired by the paper you mention by Eric Meijer and Daan Leijen. It is
our goal to make a complete HSP system with a model for HTML in Haskell, a
pre-processor, and a runtime system/plugins for various web servers.
101 - 185 of 185 matches
Mail list logo