I've looked around with no success… this surprises me actually. Has
anyone embedded SpiderMonkey, V8, or any other relatively decent
JavaScript interpreters in GHC (using the FFI)?
I just started something [1].
Cheers,
Simon
[1] https://github.com/sol/v8
Out of curiosity: wouldn't it make
Well, it doesn't quite have the same drawbacks as submodules, because our solution places a burden
only on someone who wants to recover a particular repository state, rather than on everyone doing
development.
I think it's worth keeping an eye on submodules in case they fix the gotchas in the
Have we become a bit complacent about RT?
We're not complacent, we just know things without having to
check references. Just kidding, of course, functional programmers
tend to enjoy improving their understanding!-)
The Strachey reference is worth reading - great that it is online
these days,
I have the opportunity to make a presentation to folks (developers and
managers) in my organization about Haskell - and why it's important - and
why it's the only way forward.
Haskell is important, but not the only way forward. Also, there have been
other great languages, with limited impact -
Look how one can watch the evaluation tree of a computation, to debug
laziness-related problems.
You might like the old Hood/GHood:
http://hackage.haskell.org/package/hood
http://hackage.haskell.org/package/GHood
Background info/papers:
http://www.ittc.ku.edu/csdl/fpg/Tools/Hood
My stance is that it is possibly better if we do not try to include a
one-size-fits-it-all record system into the language, but if the
language provided support for basic things that almost all record
system *libraries* would need.
Agreed. To the extent that such libraries could be improved
I am unsure which of this list of proposals you are referring to. The
URL you quote is this
http://hackage.haskell.org/trac/haskell-prime/wiki/FirstClassLabels
That sounds familiar, I think I wrote that when I was younger;-)
but it doesn't seem to actually contain a design, merely some
* syb: toJSON and fromJSON from the Data.Aeson.Generic module. Uses
the Data type class.
..
As can be seen, in most cases the GHC Generics implementation is much
faster than SYB and just as fast as TH. I'm impressed by how well GHC
optimizes the code!
Not that it matters much if you're going
I am planning to give a workshop on FP using Haskell.
The audience will be programmers with quite a bit of
experience with conventional languages like Java and
.net . I want to give them some feeling about FP. And
hopefully, they will become interested so they want more...
My
The world needs programmers to accept and take seriously Greg
Wilson's extensible programming, and stop laughing it off as lolwut
wysiwyg msword for programming, and start implementing it.
http://third-bit.com/blog/archives/4302.html
Who is the world? For starters, I don't think it is Greg
suggests using :etags in GHCI or hasktags, or gasbag. Of the three,
hasktags comes closest to working but it has (for me) a major
inconvenience, namely it finds both function definitions and type
signatures, resulting in two TAGS entries such as:
Some customization required? Tweaking the
It is a common situation when one has two implementations of
the same function, one being straightforward but slow, and the
other being fast but complex. It would be nice to be able to check
if these two versions are equal to catch bugs in the more complex
implementation.
This common
#4510: No links will be generated to these packages: base-4.3.0.0
-+--
Reporter: claus |Owner: igloo
Type: bug | Status: infoneeded
Priority: high |
I am very curious about the readiness of trading and banking
industries to adopt FPLs like Haskell:
.. Why are are trading/banking diving into FPLs?
Some possible reasons have been given, but to keep things
in perspective, you might want to consider that it isn't just
FPLs. Smalltalk, for
Lately I've been trying to go the other direction: make a large
section of formerly strict code lazy.
There used to be a couple of tools trying to make suggestions
when a function could be made less strict (Olaf Chitil's StrictCheck
and another that escapes memory at the moment). Often, it
You are misunderstanding what 'undecidable instances' does.
s/undecidable/incoherent/g
Claus
GHC wants to solve the constraint (D Foo beta) where beta is
as-yet-unconstrained type variable. It finds that one instance *matches*
(by instantiating only the instance declaration, not the
Is there any way to have a moderate first comment by new submitter
policy for trac, to avoid the kind of ticket spam we have at the moment?
They seem to have started commenting on existing tickets now (#4510),
which could turn into a real mess really quickly, if the currently known
spam accounts
Is there any way to have a moderate first comment by new submitter
policy for trac, to avoid the kind of ticket spam we have at the moment?
They seem to have started commenting on existing tickets now (#4510),
which could turn into a real mess really quickly, if the currently known
spam accounts
I've recently had the opportunity to explain in prose what denotational
semantics are to a person unfamiliar with it. I was trying to get across
the concept of distilling the essence out of some problem domain. I
wasn't able to get the idea across so I'm looking for some simple ways
to explain
Earlier today I was trying to set up a Windows build bot for the
'network' package. That turned out to be quite difficult. Too much
playing with PATHs, different gcc versions, etc. Does anyone have a
repeatable, step-by-step process to install GHC and get a build
environment (where I could build
The main advantages to darcs are that it can manipulate the sequence of
patches better than git.
The main advantage of git is that every version is accurately named. If
two people have a commit with a given hash, they will have exactly the
same files and history.
I've been wondering about
We can't even do this reliably with darcs. Several times I've tried to
unpull one of Simon's patches to work around a bug, and the dependencies
end up being more than just the textual dependencies. Then I have to
fall back to unpulling by date, which is what git would do. And then
sometimes
You can emulate darcs's patch re-ordering in git if you put each
independent sequence of patches on a separate branch. Then you can
re-merge the branches in whatever order you want. This is a fairly
common git workflow.
What happens after the merges? Does one maintain the branches
somehow, or
Everyone keeps saying the move is complete but I'm not sure it's
really true. I understand in theory that people were given ample time
and warning to migrate content, but in practice it has not worked.
.. Are there any
plans to copy over things like this? Relying on maintiners to do it
has
Beginning this week, the majority of mails from haskell.org
lists seem to end up in my ISP's spam filter.
Legitimate list mails, rather than spams making it through to the list,
presumably?
Yes, with no obvious difference between the few that got through
and the many that did not.
Perhaps ghc should also ignore all group-writable *.hs, *.lhs, *.c, *.o,
*.hi files.
dot-ghci files are *run* if you just start ghci (or ghc -e) in that
directory
(even if you don't intend to compile, load, or run any Haskell code).
Claus
___
ghci :set -XOverloadedStrings
ghci $name ate a banana. % [(name, Johan)]
Johan ate a banana.
class Context a where
lookup :: a - T.Text - T.Text
instance Context [(T.Text, T.Text)] where
lookup xs k = fromMaybe (error $ KeyError: ++ show k) (P.lookup
k xs)
The haskell.org server migration is now complete.
Please let us know if you have any problems.
Beginning this week, the majority of mails from haskell.org
lists seem to end up in my ISP's spam filter. That would be
Yahoo! - I wonder whether others here have seen a similar
effect when checking
This is obviously a personal preference issue, but I try to avoid the
Cabal macros since they don't let my code run outside the context of
Cabal. I often times like to have a test suite that I can just use
with runhaskell, and (unless you can tell me otherwise) I can't run it
anymore.
Also, I
We plan to have some haskell.org downtime on Tuesday Nov 30th,
while we migrate to the new server.
yay!-)
If you think something is missing from
http://new-www.haskell.org/
then please let us know as soon as possible!
oops.
Just visited, and even the home page had borked layout
and an
scion-server mimics a GHCi command line, of sorts. scion-server
is used very successfully to syntax-highlight the Eclipse editor,
show a source's outline, provide type information when hovering
over a name, and provide completions.
That's not the problem, per se. Let's say I'm hovering over a
Hello, I'm the maintainer for EclipseFP, which involves using the scion
library and the GHC API to provide IDE functionality. I have a little
issue
that no doubt stems from me not understanding the GHC API well, and I
would
be grateful for any light on the matter.
A meta-comment: the GHC API
but if improved records are never going to happen
Just to inject the usual comment: improved records have
been here for quite some time now. In Hugs, there is TREX;
in GHC, you can define your own. No need to wait for them.
Using one particular random variation of extensible records
and
instance (EmbedAsChild m c, m1 ~ m) = EmbedAsChild m (XMLGenT m1 c)
That looked to me like a long-winded way of saying:
instance (EmbedAsChild m c) = EmbedAsChild m (XMLGenT m c)
Unless I'm missing something?
These two instances are not equivalent:
- the first matches even if m and m1
instance (EmbedAsChild m c, m1 ~ m) = EmbedAsChild m (XMLGenT m1 c)
That looked to me like a long-winded way of saying:
instance (EmbedAsChild m c) = EmbedAsChild m (XMLGenT m c)
Unless I'm missing something?
These two instances are not equivalent:
- the first matches even if m and m1
I opted to host them there rather than uploading them to Hackage,
because
they're part of a wider project.
Note that this means they won't be cabal installable or searchable. Was
that your intention?
I am curious about this: wasn't cabal designed with the
option of having several package
I haven't the faintest idea what SML is doing with the third
version, but clearly it shouldn't.
Those numbers are worrying, not just because of the third
version - should doubling the tree size have such a large effect?
I find your report that GHC doesn't do as well with the third
version
The bottom line is that
- in logic programming languages, building a list by working on
a pair of arguments representing a segment of the list is the
NORMAL way to build a list; it's as fast as it gets, and the
list is inspectable during construction.
modulo usage patterns: e.g., mostly
remote-repo: myhackage:http://myhackage/packages
However, when I try to unpack my package with cabal:
$ cabal unpack MyPackage
Downloading MyPackage-0.0.1...
cabal: Failed to download
http://myhackage/packages/package/MyPackage-0.0.1.tar.gz : ErrorMisc
Unsucessful HTTP code: 404
Why is cabal
The characteristics of the logical variable are as follows.
An incomplete data structure (ie. containing free variables)
may be returned as a procedure's output. The free variables
can later be filled in by other procedures, giving the effect
of implicit assignments to a data structure
Interesting discussion. I still think it is the same idea,
namely to represent not-yet-known list tails by variables,
embedded into two different kinds of languages.
\rest-start++rest
[start|rest]\rest-- '\' is an infix constructor
Savvy Prolog programmers wouldn't *DREAM* of
using
I often find myself writing example code that I'd like
to distribute via cabal, but without further burdening
hackage with not generally useful packages.
1. The simplest approach would be if cabal could expose
its internal 'unpackPackage' as a command, so that
author: cabal sdist
user:
To simplify, the difference in persistence between the two
representations is enough to consider them very different
as it makes a dramatic difference in interface.
Interesting discussion. I still think it is the same idea,
namely to represent not-yet-known list tails by variables,
embedded
Stack Overflow and Reddit are at least improvements over the traditional
web forums, starting to acquire some of the features Usenet had twenty
years ago. Much like Planet-style meta-blogs and RSS syndication makes
it liveable to follow blogs.
Very much this. I mourn Usenet's potential as
2) If there is a problem, here's what you could do about it,
in descending order of attractiveness:
y) specify the requirements (a sample application
of what needs to be supported would be a start)
z) review the existing options wrt to those requirements
(which ones are you aware about,
I'm occasionally working on making a friendly yet performant library that
simultaneously builds parsers and generators, but it's non-trivial. If you
I'm probably missing something in the friendly yet performant
requirements, but I never quite understood the difficulty:
A typical translation of
Some questions about Haddock usage:
1. Haddock executable and library are a single hackage package,
but GHC seems to include only the former (haddock does not
even appear as a hidden package anymore). Is that intended?
2. Naively, I'd expect Haddock processing to involve three stages:
After it catches this error, the function returns (line 376):
return (fail (show e))
The fail is running in the Either monad (The Result type = Either).
This calls the default Monad implementation of fail, which is just a
call to plain old error. This basically causes the entire program to
Please test as much as possible; bugs are much cheaper if we find them
before the release!
Could you please have a look at the documentation issues
in the Windows installer before release? Points 4-6 in:
http://hackage.haskell.org/trac/ghc/ticket/4292
(documentation links in haddock and
The problem is that my code for redirecting the output
of GHCi commands still works for things like :type, but
no longer for things like :info (this is my smallest example
demonstrating the effect).
The difference seems to be between commands that use
old-style GHCi output (works with
Message-
| From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-
| users-boun...@haskell.org] On Behalf Of Claus Reinke
| Sent: 22 September 2010 16:05
| To: GHC users
| Subject: Re: GHCi 6.12.3 stdout redirection works for :type, but not for
| :info
|
|
| The problem is that my
Dear GHCi / IO experts,
I'm encountering some odd GHCi behaviour with some
old ghci.conf code of mine (used to work in older GHCis).
The problem is that my code for redirecting the output
of GHCi commands still works for things like :type, but
no longer for things like :info (this is my
Johan:
I started writing a manual traversal of the RenamedSource AST
(as I want qualified names) but I thought I check if I'm going
about this right before I spend all the time required to write
the traversal for the whole AST.
Manual traversal code on ASTs tends to consist mainly
of
On the topic of cabal odisseys:
I think it would help to document (prominently) what Cabal
fundamentally doesn't (try to) do, to avoid optimistic
expectations (and hence the surprises when Cabal doesn't
meet those expectations), and to point out the design choices
behind many bug tickets
That sort of code (stripped out):
In Game.hs:
data Game = Game { ...
activeRules :: [Rule]}
applyTo :: Rule - Game - Game
applyTo r gs = ...
Often, it helps to parameterize the types/functions (instead
of using recursive modules to hardcode the parameters).
Would
For another programs (that compile fine with ghc --make), I didn't
bother making the package. But I had to find out the package
dependencies by building, checking where it fails, and trying to add a
package to the dependency list. Maybe there's a better way, didn't
find it.
We do plan to fix
One of the problems is that the anchors that Haddock
currently generate aren't always legal in HTML, XHTML,
or XML. I'd like to fix the anchor generation so that they
are. If I do, then links between old and new generated
Haddock pages will land on the right page, but won't
always get to the
I am making use of the Data.Array.Repa module to achieve data-parallelism.
On running my program I get the error:
thread blocked indefinitely on an MVar operation
Haven't seen any responses yet, so here are some suggestions:
Two questions:
1. What could be some of the potential causes for
Prelude :t id :: Eq b = b - b
id :: Eq b = b - b :: (Eq b) = b - b
Prelude id :: Eq b = b - b
interactive:1:0:
No instance for (Show (b - b))
arising from a use of `print' at interactive:1:0-19
Possible fix: add an instance declaration for (Show (b - b))
In a stmt of a
Most languages today provide a certain glue to bring everything
together.
Most languages today provide several kinds of glue and, while some
of those kinds are not recommended, Haskell unfortunately doesn't
provide all useful kinds of glue. Especially the module system is a
weak point: in SML,
class C a b | a-b where
op :: a - b
instance C Int Bool where
op n = n0
data T a where
T1 :: T a
T2 :: T Int
-- Does this typecheck?
f :: C a b = T a - Bool
f T1 = True
f T2 = op 3
The function f should typecheck because inside the T2 branch we know
that
f :: forall a b. C a b = T a - Bool
f T1 = True
f T2 = (op :: a - b) 3
as that results in the counter-intuitive
Couldn't match expected type `Bool' against inferred type `b'
`b' is a rigid type variable bound by
the type signature for `f'
at
Indeed, though I don't think this is the case, because I get lots of
lag even when no logs are written.
In the part you deleted I mentioned one source of lag that does
not disappear when no logs are written, and a way of using
profiling cost centers to track down other sources (the ones
I
Claus -- cafe5 is pretty much where it's at. You're right, the proggy
was used as the bug finder, actually at cafe3, still using ByteString.
It would be useful to have a really tiny data source - no more than
100 entries per Map should be sufficient to confirm or reject hunches
about
I'll work with Simon to investigate the runtime, but would welcome any
ideas on further speeding up cafe4.
An update on this: with the help of Alex I tracked down the problem (an
integer overflow bug in GHC's memory allocator), and his program now
runs to completion.
So this was about
On Sat, Jun 19, 2010 at 8:46 AM, Claus Reinke claus.rei...@talk21.com
wrote:
I put the simple version at
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=26329#a26329
This one displays much better performance with DList + Writer.Strict
than List + StrictWriter so I guess it's not too surprising
I'm interested in situations where you think fundeps work
and type families don't. Reason: no one knows how to make
fundeps work cleanly with local type constraints (such as GADTs).
If you think you have such as case, do send me a test case.
Do you have a wiki page somewhere collecting
This seems like an example of list-chauvinism -- what Chris Okasaki
calls a communal blind spot of the FP community in Breadth-First
Numbering: Lessons from a Small Exercise in Algorithm Design --
http://www.eecs.usma.edu/webs/people/okasaki/icfp00.ps
Thanks for sharing; this was an
I have below duplicate code, but i don't know how to use TH instance code.
-- duplicate code start
--
instance Variable PageType where
toVariant = toVariant . show
fromVariant x = fmap (\v - read v :: PageType) $ fromVariant x
If
If you go this route, I will shamelessly promote hothasktags instead
of ghci. It generates proper tags for qualified imports.
What do you mean by proper here?
I think Luke means that if you use qualified names then hothasktags can
give you better location information than current ghci ctags.
I put the simple version at
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=26329#a26329
This one displays much better performance with DList + Writer.Strict
than List + StrictWriter so I guess it's not too surprising. However,
*something* is still generating a lot of lag
Some lag is to be
If you want to use cool languages, you may have to get a cool job. I
know: it's easy to say and harder to accomplish.
Most functional languages (e.g. Lisp, Haskell, ...) have a challenging
time in industry since they require some savvy with multiple levels of
higher abstractions and some
I'll work with Simon to investigate the runtime, but would welcome any
ideas on further speeding up cafe4.
Just a wild guess, but those foldWithKeys make me nervous.
The result is strict, the step function tries to be strict, but if
you look at the code for Data.IntMap.foldr, it doesn't really
..ghci is able to generate the tagsfiles for you. This allows you to
jump to definitions of identifiers.
If you go this route, I will shamelessly promote hothasktags instead
of ghci. It generates proper tags for qualified imports.
What do you mean by proper here? GHCi has the information
As others have pointed out, you can't go from operation to
representation,
but you can pair operations and expressions with their representations.
This idea is also implemented in my little 'repr' package:
http://hackage.haskell.org/package/repr
And probably more completely/comfortably!-)
I have been experimenting some more with environments for lab work for
an FP intro course. One thing students tend to have difficulty with in
the initial labs are the error messages including type classes, or any
kind of more general type than they expected. I am trying to work around
this, by
Thanks Stephen--that was related to my original question, about using HP
with Cygwin. The answer seems to be No!--you must use MSYS (for real
work).
The short version:
- Cygwin provides commandline tools, compilers and libraries
- MSYS provides commandline tools for the MinGW compilers and
of
the Haskell tools won't work when launched from Cygwin Bash.
Chris
-Original Message-
From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Claus Reinke
Sent: 08 June 2010 09:02
To: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] HP/Cygwin and Curl
If I have a problem where I have to select from a set of operations,
how
would I print the result?
Example: If I can chose from (x+y), (x*y), (x^2+y)...
and I feed them all into my problem solver
and it finds that (x*y) is right, how can I print that string?
As others have pointed out,
The approach is so simple and trivial that it must have occurred to
people a hundred times over. Yet I do not find any other examples of
this. Whenever I google for church encoding the examples don't go beyond
church numerals.
Am I googling for the wrong keywords?
You might find Typing
All my code, whether neat or not so neat is still way too concrete, too
direct.
I think the correct answer is one should try to find abstractions and
not code straight down to the point. Which to me is still a really tough
one, I have to admit.
Taking this cue, since you've raised it before,
I am trying to improve the error reporting in my sendfile library, and I
know I can find out the current file name and line number with something
like this:
{-# LANGUAGE CPP #-}
main = putStrLn (__FILE__ ++ : ++ show __LINE__)
This outputs:
test.hs:2
Unfortunately, if your file is in a
At last year's Haskell Symposium, it was announced that we would change
the Haskell Prime process to make it less monolithic.
..
In the coming weeks we'll be refining proposals in preparation for
Haskell 2010.
Given the incremental nature of the new standards, would it be
useful to switch
For example, Clojure lacks proper tail recrusion optimization due to
some missing functionality in the JVM. But does anybody know the
details?
|Basically, the JVM lacks a native ability to do tail calls. It does
|not have an instruction to remove/replace a stack frame without
|executing
JVM 7 has tail calls,
Source, please? JSR-292 seems the most likely candidate so far,
and its draft doesn't seem to mention tail calls yet. As of March
this year, the people working on tail calls for mlvm [1], which
seems to be the experimentation ground for this, did not seem to
expect any
It's too bad that indexes are `Int` instead of `Word` under
the hood. Why is `Int` used in so many places where it is
semantically wrong? Not just here but also in list indexing...
Indices/offsets can only be positive and I can't see any good
reason to waste half the address space -- yet we
one thing that isn't so good is that we lack a library of GHC-related
papers. ideally, i just have to add a link to some GHC/Papers#GC that
contains everything ever published about this topic.
http://haskell.org/haskellwiki/Research_papers#Categories
I've heard that many Haskellers know HaRe only as a rumour. It has
been many years since the original project finished, and HaRe hasn't
been maintained for quite some time, so just pointing to the sources
isn't quite the right answer.
The sources are still available, and build with GHC 6.8.3
I (too) often find myself writing code such as this:
if something
then putStrLn howdy there!
else if somethingElse
then putStrLn howdy ho!
else ...
1. recognize something odd. done.
2. look for improvements. good.
3. define suitable abstractions for your special case
4.
It is not possible to write a modifyIORef that *doesn't* leak memory!
Why? Or can one read about it somewhere?
Possibly, Don meant that 'modifyIORef' is defined in a way that
does not allow to enforce evaluation of the result of the modification
function (a typical problem with fmap-style
I was recently trying to figure out if there was a way, at runtime, to do
better strictness analysis for polymorphic HOFs, for which the strictness of
some arguments might depend on the strictness of the strictness of function
types that are passed as arguments [1]. As an example, consider foldl.
who needs this kind of documentation?
http://hackage.haskell.org/packages/archive/tfp/0.2/doc/html/Types-Data-Num-Decimal-Literals.html
The code below is shown under 'Source' links
in that documentation. I don't understand it,
but it seems everything is generated automatically.
What should the
I am learning to use cabal for my code.
Just when I start, I met a question, is there an easy way to find
out what packages my code depends?
If you've managed to get your code to compile,
ghc --show-iface Main.hi
is perhaps the easiest way (ghc --make and ghci will also report
package
A much better idea than making sum strict, would simply be to add a
sum'.
Even better to abstract over strictness, to keep a lid on code duplication?
{-# LANGUAGE TypeOperators #-}
sum = foldlS ($) (+) 0
sum' = foldlS ($!) (+) 0
-- identity on constructors of t (from a),
|What you describe is exactly how I would *want* things to work. It's
|nice to hear my wishes echoed from a user perspective. :-)
actually, I was describing how things seem to work right now.
| Only MultiParamTypeClasses does (and neither extension is needed in the
| module defining 'f', if 'T'
{-# LANGUAGE MultiParamTypeClasses #-}
module A where
class Foo a b where foo :: a - b
instance Foo Bool Int where
foo True = 1
foo False = 0
module B where
import A
bar :: (Foo a b) = [a] - [b]
bar = map foo
I can load B.hs into GHCi and call bar
I've written a multi-threaded Haskell program that I'm trying to
debug. Basically what's happening is the program runs for a while, and
then at some point one of the threads goes crazy and spins the CPU
while allocating memory; this proceeds until the system runs out of
available memory. I can't
One thing that wasn't available when this discussion was last active
is 'mapException' (btw, similar to 'catch'/'catches', a 'mapExceptions'
would be useful).
so for mere traces, dynamic seems to be the choice (with an option of
pseudo-cbv or the real dynamic stack).
I don't know what
From what I understand, the current best practices are to build your
package dependencies like so:
ParsecMyMonadT
MyMonadT_Parsec -- orphan instances go here
ProjectPackage
This does mean splitting up your project into three packages, but
decouples the orphan instance into its own package
| bar :: (C T) = T
| *Main :t bar
|
| interactive:1:0:
| No instance for (C T)
| arising from a use of `bar' at interactive:1:0-2
| Possible fix: add an instance declaration for (C T)
| In the expression: bar
I'm not sure where that comes from, but it does seem to be an
1 - 100 of 958 matches
Mail list logo