Re: [Haskell-cafe] JavaScript (SpiderMonkey, V8, etc) embedded in GHC?

2012-11-10 Thread Claus Reinke
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

Re: How do I build GHC 7.6 from source?

2012-09-20 Thread Claus Reinke
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

Re: [Haskell-cafe] Reddy on Referential Transparency

2012-07-27 Thread Claus Reinke
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,

Re: [Haskell-cafe] Need inputs for a Haskell awareness presentation

2012-06-01 Thread Claus Reinke
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 -

Re: [Haskell-cafe] Hierarchical tracing for debugging laziness

2012-01-25 Thread Claus Reinke
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

Re: Records in Haskell

2011-11-08 Thread Claus Reinke
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

Re: Records in Haskell

2011-11-07 Thread Claus Reinke
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

Re: [Haskell-cafe] How to speedup generically parsing sum types?

2011-11-03 Thread Claus Reinke
* 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

Re: [Haskell-cafe] What library package fulfills these requirements?

2011-10-28 Thread Claus Reinke
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

Re: [Haskell-cafe] Message

2011-10-22 Thread Claus Reinke
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

Re: [Haskell-cafe] which tags program should I use?

2011-09-26 Thread Claus Reinke
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

Re: [Haskell-cafe] Deciding equality of functions.

2011-04-10 Thread Claus Reinke
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

Re: [GHC] #4510: No links will be generated to these packages:base-4.3.0.0

2011-04-07 Thread Claus Reinke
#4510: No links will be generated to these packages: base-4.3.0.0 -+-- Reporter: claus |Owner: igloo Type: bug | Status: infoneeded Priority: high |

Re: [Haskell-cafe] why are trading/banking industries seriouslyadopting FPLs???

2011-03-25 Thread Claus Reinke
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

Re: [Haskell-cafe] Byte Histogram

2011-02-05 Thread Claus Reinke
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

Re: Bug in undecidable instances?

2011-02-01 Thread Claus Reinke
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

Re: trac ticket spam

2011-01-31 Thread Claus Reinke
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

trac ticket spam

2011-01-28 Thread Claus Reinke
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

Re: [Haskell-cafe] Denotational semantics for the lay man.

2011-01-17 Thread Claus Reinke
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

Re: [Haskell-cafe] Needed: A repeatable process for installing GHC on Windows

2011-01-15 Thread Claus Reinke
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

Re: RFC: migrating to git

2011-01-12 Thread Claus Reinke
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

Re: RFC: migrating to git

2011-01-12 Thread Claus Reinke
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

Re: RFC: migrating to git

2011-01-12 Thread Claus Reinke
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

Re: [Haskell] More work to be done re: haskell.org move?

2010-12-14 Thread Claus Reinke
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

Re: [Haskell] haskell.org migration complete

2010-12-09 Thread Claus Reinke
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.

Re: [Haskell-cafe] dot-ghci files

2010-12-09 Thread Claus Reinke
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 ___

Re: [Haskell-cafe] OverloadedStrings mixed with type classes leads toboilerplate type signatures

2010-12-05 Thread Claus Reinke
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)

Re: [Haskell] haskell.org migration complete

2010-12-02 Thread Claus Reinke
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

Re: [Haskell-cafe] Conditional compilation for different versionsof GHC?

2010-12-01 Thread Claus Reinke
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

Re: [Haskell] haskell.org downtime: Tuesday Nov 30th

2010-11-25 Thread Claus Reinke
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

Re: Using the GHC API: pretty printing with qualified names

2010-11-18 Thread Claus Reinke
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

Re: Using the GHC API: pretty printing with qualified names

2010-11-17 Thread Claus Reinke
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

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-11 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: change in overlapping instance behavior between GHC 6.12 and GHC 7 causes compilation failure

2010-11-09 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: change in overlapping instance behavior between GHC 6.12 and GHC 7 causes compilation failure

2010-11-09 Thread Claus Reinke
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

Re: [Haskell-cafe] http://functionalley.eu

2010-11-06 Thread Claus Reinke
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

Re: [Haskell-cafe] Reference for technique wanted

2010-11-05 Thread Claus Reinke
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

Re: [Haskell-cafe] Reference for technique wanted

2010-11-04 Thread Claus Reinke
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

Re: [Haskell-cafe] Non-hackage cabal source

2010-11-04 Thread Claus Reinke
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

Re: [Haskell-cafe] Reference for technique wanted

2010-11-03 Thread Claus Reinke
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

Re: [Haskell-cafe] Reference for technique wanted

2010-11-02 Thread Claus Reinke
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

[Haskell-cafe] non-hackage cabal repos? unpacking non-repo package tarballs?

2010-11-02 Thread Claus Reinke
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:

Re: [Haskell-cafe] Reference for technique wanted

2010-11-01 Thread Claus Reinke
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

Re: [Haskell-cafe] Edit Hackage

2010-11-01 Thread Claus Reinke
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

Re: [Haskell-cafe] who's in charge?

2010-10-29 Thread Claus Reinke
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,

Re: [Haskell-cafe] Need programming advice for Network ProtocolParsing

2010-10-27 Thread Claus Reinke
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

[Haskell-cafe] Haddock API and .haddock interface files questions

2010-10-26 Thread Claus Reinke
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:

Re: [Haskell-cafe] Bug in HTTP (bad internal error handling)

2010-10-16 Thread Claus Reinke
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

Re: ANNOUNCE: GHC 7.0.1 Release Candidate 1

2010-09-28 Thread Claus Reinke
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

Re: GHCi 6.12.3 stdout redirection works for :type, but not for :info

2010-09-22 Thread Claus Reinke
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

Re: GHCi 6.12.3 stdout redirection works for :type, but not for :info

2010-09-22 Thread Claus Reinke
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

GHCi 6.12.3 stdout redirection works for :type, but not for :info

2010-09-20 Thread Claus Reinke
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

Re: Collecting all external names in a module

2010-09-18 Thread Claus Reinke
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

Re: [Haskell-cafe] A new cabal odissey: cabal-1.8 breaking its ownneck by updating its dependencies

2010-09-17 Thread Claus Reinke
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

Re: Réf. : [Haskell-cafe] Re: circular imports

2010-09-07 Thread Claus Reinke
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

Re: [Haskell-cafe] what's the best environment for haskell work?

2010-08-06 Thread Claus Reinke
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

Re: [Haskell-cafe] Haddock anchors

2010-07-15 Thread Claus Reinke
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

Re: [Haskell-cafe] Debugging cause of indefinite thread blocking

2010-07-07 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: checking types with type families

2010-07-03 Thread Claus Reinke
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

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Claus Reinke
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,

Re: [Haskell-cafe] Re: checking types with type families

2010-07-02 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: checking types with type families

2010-07-02 Thread Claus Reinke
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

Re: heap profiling

2010-07-01 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: Mining Twitter data in Haskell and Clojure

2010-06-28 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: Mining Twitter data in Haskell and Clojure

2010-06-24 Thread Claus Reinke
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

Re: heap profiling

2010-06-23 Thread Claus Reinke
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

Re: [Haskell-cafe] checking types with type families

2010-06-23 Thread Claus Reinke
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

Re: [Haskell-cafe] Huffman Codes in Haskell

2010-06-23 Thread Claus Reinke
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

Re: [Haskell-cafe] TH instance code.

2010-06-22 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: How to browse code written by others

2010-06-20 Thread Claus Reinke
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.

Re: heap profiling

2010-06-19 Thread Claus Reinke
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

Re: [Haskell-cafe] What is Haskell unsuitable for?

2010-06-18 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: Mining Twitter data in Haskell and Clojure

2010-06-17 Thread Claus Reinke
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

Re: [Haskell-cafe] How to browse code written by others

2010-06-15 Thread Claus Reinke
..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

Re: [Haskell-cafe] How to Show an Operation?

2010-06-14 Thread Claus Reinke
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!-)

Re: Unexpected NoImplicitPrelude behaviour in GHCi (bug?)

2010-06-10 Thread Claus Reinke
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

Re: [Haskell-cafe] HP/Cygwin and Curl

2010-06-08 Thread Claus Reinke
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

Re: [Haskell-cafe] HP/Cygwin and Curl

2010-06-08 Thread Claus Reinke
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

Re: [Haskell-cafe] How to Show an Operation?

2010-06-07 Thread Claus Reinke
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,

Re: [Haskell-cafe] Chuch encoding of data structures in Haskell

2010-05-27 Thread Claus Reinke
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

Re: [Haskell-cafe] Re: How do you rewrite your code?

2010-03-04 Thread Claus Reinke
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,

Re: [Haskell-cafe] Questions about haskell CPP macros

2009-07-13 Thread Claus Reinke
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

Re: Announcing the new Haskell Prime process, and Haskell 2010

2009-07-07 Thread Claus Reinke
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

Re: [Haskell-cafe] Haskell on JVM

2009-06-26 Thread Claus Reinke
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

Re: [Haskell-cafe] Haskell on JVM

2009-06-26 Thread Claus Reinke
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

Re: [Haskell-cafe] Error in array index.

2009-06-25 Thread Claus Reinke
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

Re: Re[2]: wiki page on GHC GC

2009-06-24 Thread Claus Reinke
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

[Haskell-cafe] HaRe (the Haskell Refactorer) in action - short screencast

2009-06-22 Thread Claus Reinke
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

Re: [Haskell-cafe] Code walking off the right edge of the screen

2009-06-21 Thread Claus Reinke
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.

Re: [Haskell-cafe] IORef memory leak

2009-06-19 Thread Claus Reinke
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

Re: [Haskell-cafe] Runtime strictness analysis for polymorphic HOFs?

2009-06-15 Thread Claus Reinke
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.

Re: [Haskell-cafe] Re: Documentation on hackage

2009-06-15 Thread Claus Reinke
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

Re: [Haskell-cafe] How to know the build dependencies?

2009-06-14 Thread Claus Reinke
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

Re: [Haskell-cafe] curious about sum

2009-06-14 Thread Claus Reinke
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),

Re: [Haskell-cafe] Re: FlexibleContexts and FlexibleInstances

2009-06-11 Thread Claus Reinke
|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'

Re: [Haskell-cafe] Re: FlexibleContexts and FlexibleInstances

2009-06-11 Thread Claus Reinke
{-# 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

Re: [Haskell-cafe] Debugging misbehaving multi-threaded programs

2009-06-11 Thread Claus Reinke
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

Re: Should exhaustiveness testing be on by default?

2009-06-07 Thread Claus Reinke
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

Re: [Haskell-cafe] Monad transformer responsibilities

2009-06-05 Thread Claus Reinke
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

Re: [Haskell-cafe] Monad transformer responsibilities

2009-06-05 Thread Claus Reinke
| 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   2   3   4   5   6   7   8   9   10   >