Re: [Haskell-cafe] ANN: Portackage - a hackage portal

2012-04-26 Thread Andrew Seniuk
Somewhat lighter, using summarised module lists. A more sophistocated
UI with per-column filtering is in the works. I invite your comments.

Andrew

On Thu, Apr 26, 2012 at 4:05 PM, Andrew Seniuk  wrote:
> Hello,
>
> This is to announce a provisional webpage to summarise hackage.haskell.org.
>
> http://www.fremissant.net/portackage
>
> It is a lot of data, so will be a bit slow to load. Columns can be
> sorted by clicking the headers, but this will also take some seconds
> on a typical client. The initial sort is by module name.  Clicking a
> table row links to the project page on hackage.
>
> Although I believe this is a complete list of all packages/modules in
> hackage, it is probably still buggy, so if you see anything amiss
> please let me know. Also, a subsequent version in the near future will
> update automatically based on the
> http://hackage.haskell.org/packages/archive/recent.rss RSS feed, but
> for now it's based on a recent snapshot. Haskell code which prepares
> the page will be released after a few more days testing and
> refinement.
>
> Some previous work [1] provided a list of all modules, but is not
> being maintained, and I was unable to rearouse the author's interest.
>
> Feature requests and suggestions are welcome!
>
> Kind Reg'ds,
> Andrew Seniuk
>
> [1] http://folk.ntnu.no/hammar/explore-hackage/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Correspondence between libraries and modules

2012-04-26 Thread Gregg Lebovitz

On 4/24/2012 11:44 PM, wren ng thornton wrote:
To pick another similar namespacing issue, consider the problem of 
Google Code. In Google Code there's a single namespace for projects, 
and the Google team spends a lot of effort on maintaining that 
namespace and resolving conflicts. (I know folks who've worked in the 
lab next door to that team. So, yes, they do spend a lot of work on 
it.) Whereas if you consider BitBucket or GitHub, each user is given a 
separate project namespace, and therefore the only thing that has to 
be maintained is the user namespace--- which has to be done anyways in 
order to deal with logins. The model of Google Code, SourceForge, and 
Java all assume that projects and repositories are scarce resources. 
Back in the day that may have been true (or may not), but today it is 
clearly false. Repos are cheap and everyone has a dozen side projects.


Actually, I like the idea of combining an assigned User name with the 
repo name as the namespace. We already have login names for haskell.org, 
why not use those. I agree that it is not an end all, but it would be a 
start. My top level namespace would be Org.Haskell.Glebovitz. It is 
democratic and it identifies the code by the repoand the user the 
created it. If someone else decided to use their github id then it their 
modules would be org.github.username or org.github.project. Of course 
people can choose to ignore the namespace common practice, but they can 
do that anyway.




If you look at the case of Perl and CPAN, there's the same old story: 
universal authority. Contrary to Java, CPAN does very much actively 
police (or rather, vett) the namespace. However, this extreme level of 
policing requires a great deal of work and serves to drive away a 
great many developers from publishing their code on CPAN.


I'm not as familiar with the innards of how various Linux distros 
manage things, but they're also tasked with the additional burden of 
needing to pull in stuff from places like CPAN, Hackage, etc. Because 
of that, their namespace situation seems quite different from that of 
Hackage or CPAN on their own. I do know that Debian at least (and 
presumably the others as well) devote a great deal of manpower to all 
this.


Yes, but that goes back to my comments about upstream and downstream. 
Hackage can try to solve the problem for itself, but eventually someone 
is going to put together a distribution, whether it be ubuntu, or 
Microsoft and they will have to sort out the name collisions for their 
packages and modules. If we have a good naming scheme to start with, it 
will make the downstream problem a bit easier. Even so, they will 
probably change it anyways. I know that ubuntu and fedora take different 
approaches to packaging. When I try to use a package like Qt on these 
different platforms, I have to figure out which package contains which 
library.




So we have (1) the Java model where there are rules that noone 
follows; (2) the Google Code, CPAN, and Linux distro model of devoting 
a great deal of community resources to maintaining the rules; and (3) 
the BitBucket, GitHub, Hackage model of having few institutionalized 
rules and leaving it to social factors. The first option buys us 
nothing over the last, excepting a false sense of security and the 
ability to alienate private open-source developers.



I think my combo of formalized namespace and social rules would work 
best here.  The problem is that we do have module collisions because the 
namespace is too simple. Right now it is not an issue because the 
community is not huge. Eventually it will be a problem if Haskell 
popularity grows.


There is no technical solution to this problem, at least not any used 
by the communities you cite. The only solutions on offer require a 
great deal of human effort, which is always a 
social/political/economic matter. The only technical avenues I see are 
ways of making the problem less problematic, such as GitHub and 
BitBucket distinguishing the user namespace from each user's project 
namespace, such as the -XPackageImports extension (which is 
essentially the same as GitHub/BitBucket), or such as various ideas 
about using tree-grafting to rearrange the module namespace on a 
per-project basis thereby allowing clients to resolve the conflicts 
rather than requiring a global solution. I'm quite interested in that 
last one, though I don't have any time for it in the foreseeable future.


There probably is a technical solution, but no one is going to discover 
it and build it anytime soon. dI think we all agree that a centralized 
global solution is out. No one would want to manage it. I do think the 
repo.username namespace has potential. The problem is that informal 
social convention works if the community is small. Once it starts to 
grow it has to be codified to some degree.




___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/

[Haskell-cafe] ANN: HandsomeSoup-0.3: CSS selectors for HXT

2012-04-26 Thread aditya bhargava
*Homepage:* http://egonschiele.github.com/HandsomeSoup
*On Hackage:* http://hackage.haskell.org/package/HandsomeSoup

*Blurb:*

HandsomeSoup is the library I wish I had when I started parsing HTML in
Haskell.
It is built on top of HXT and adds a few functions that make is easier to
work with HTML.
Most importantly, it adds CSS selectors to HXT. The goal of HandsomeSoup is
to be a complete CSS2 parser for HXT (it is very close to this right now).



-- 
adit.io
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-26 Thread Sjoerd Visscher

On Apr 26, 2012, at 9:34 PM, Tillmann Rendel wrote:
>> 
>>   class Unfoldable t where
>> unfold :: Unfolder f =>  f a ->  f (t a)
> 
> Just to be sure: That's not a generalization of Data.List.unfoldr, or is it 
> somehow?

Yes, it is. unfoldr is quite specifically tailored to lists, so it doesn't work 
well generically. I did include it in the package, but it does a breadth-first 
search for the first value that has exactly enough positions to store the 
elements ('a's), and there might not be one.

> 
>> Different unfolders provide different ways of generating values, for example:
>>  - Random values
>>  - Enumeration of all values (depth-first or breadth-first)
>>  - Convert from a list
>>  - An implementation of QuickCheck's arbitrary should also be possible 
>> (still working on that)
> 
> Can this be extended to provide a single API that allows testing à la 
> SmallCheck, LazySmallCheck and/or QuickCheck without duplicating properties 
> or instances?


Well, the idea is to unify all ways of unfolding (i.e. all ways of generating 
values). So those parts of the checkers could use the same API, but there's a 
lot more to checking than that.

By the way, I uploaded 0.5.0 a few hours ago, which contains a generic 
arbitrary implementation.

greetings,
--
Sjoerd Visscher
https://github.com/sjoerdvisscher/blog






___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: Portackage - a hackage portal

2012-04-26 Thread Andrew Seniuk
Should be fixed in that respect now, thanks again for pointing it out.

On Thu, Apr 26, 2012 at 4:23 PM, Andrew Seniuk  wrote:
> Jonathan,
>
> On Thu, Apr 26, 2012 at 4:13 PM, Jonathan Daugherty  wrote:
>>> Although I believe this is a complete list of all packages/modules in
>>> hackage, it is probably still buggy, so if you see anything amiss
>>> please let me know.
>>
>> It might not be showing the most recent releases of everything.  As an
>> example, it shows a much older version of my vty-ui library (1.0) and
>> its metadata, instead of the latest version, 1.5.  As a result the
>> version, module list, description, homepage, etc., are not current.
>
> Thank-you, I'd realised this issue but forgot to address it. It is
> due to a false assumption on my part that the .cabal entries in the
> 00-index.tar file were in increasing version order.
>
> I'll address this problem today.
>
> Cheers,
> Andrew

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: Portackage - a hackage portal

2012-04-26 Thread Andrew Seniuk
Jonathan,

On Thu, Apr 26, 2012 at 4:13 PM, Jonathan Daugherty  wrote:
>> Although I believe this is a complete list of all packages/modules in
>> hackage, it is probably still buggy, so if you see anything amiss
>> please let me know.
>
> It might not be showing the most recent releases of everything.  As an
> example, it shows a much older version of my vty-ui library (1.0) and
> its metadata, instead of the latest version, 1.5.  As a result the
> version, module list, description, homepage, etc., are not current.

Thank-you, I'd realised this issue but forgot to address it. It is
due to a false assumption on my part that the .cabal entries in the
00-index.tar file were in increasing version order.

I'll address this problem today.

Cheers,
Andrew

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Portackage - a hackage portal

2012-04-26 Thread Andrew Seniuk
Hello,

This is to announce a provisional webpage to summarise hackage.haskell.org.

http://www.fremissant.net/portackage

It is a lot of data, so will be a bit slow to load. Columns can be
sorted by clicking the headers, but this will also take some seconds
on a typical client. The initial sort is by module name.  Clicking a
table row links to the project page on hackage.

Although I believe this is a complete list of all packages/modules in
hackage, it is probably still buggy, so if you see anything amiss
please let me know. Also, a subsequent version in the near future will
update automatically based on the
http://hackage.haskell.org/packages/archive/recent.rss RSS feed, but
for now it's based on a recent snapshot. Haskell code which prepares
the page will be released after a few more days testing and
refinement.

Some previous work [1] provided a list of all modules, but is not
being maintained, and I was unable to rearouse the author's interest.

Feature requests and suggestions are welcome!

Kind Reg'ds,
Andrew Seniuk

[1] http://folk.ntnu.no/hammar/explore-hackage/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-26 Thread Roman Cheplyaka
* Tillmann Rendel  [2012-04-26 21:34:21+0200]
> Hi,
> 
> Sjoerd Visscher wrote:
> >Just as there's a Foldable class, there should also be an Unfoldable class. 
> >This package provides one:
> >
> >   class Unfoldable t where
> > unfold :: Unfolder f =>  f a ->  f (t a)
> 
> Just to be sure: That's not a generalization of Data.List.unfoldr, or
> is it somehow?

It seems to be -- see
https://github.com/sjoerdvisscher/unfoldable/blob/master/src/Data/Unfoldable.hs#L84

(although that is much more complicated than Data.List.unfoldr)

-- 
Roman I. Cheplyaka :: http://ro-che.info/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-26 Thread Tillmann Rendel

Hi,

Sjoerd Visscher wrote:

Just as there's a Foldable class, there should also be an Unfoldable class. 
This package provides one:

   class Unfoldable t where
 unfold :: Unfolder f =>  f a ->  f (t a)


Just to be sure: That's not a generalization of Data.List.unfoldr, or is 
it somehow?



Different unfolders provide different ways of generating values, for example:
  - Random values
  - Enumeration of all values (depth-first or breadth-first)
  - Convert from a list
  - An implementation of QuickCheck's arbitrary should also be possible (still 
working on that)


Can this be extended to provide a single API that allows testing à la 
SmallCheck, LazySmallCheck and/or QuickCheck without duplicating 
properties or instances?


  Tillmann

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: unfoldable-0.4.0

2012-04-26 Thread Roman Cheplyaka
This is also quite similar to what we have in SmallCheck:
https://github.com/feuerbach/smallcheck/blob/master/Test/SmallCheck/Series.hs

Not sure how to exploit this, though.

* Sjoerd Visscher  [2012-04-26 00:32:28+0200]
> I am pleased to announce the 5th version of the unfoldable package. (This is 
> the first announcement, you didn't miss anything.)
> http://hackage.haskell.org/package/unfoldable-0.4.0
> 
> Just as there's a Foldable class, there should also be an Unfoldable class. 
> This package provides one:
> 
>   class Unfoldable t where
> unfold :: Unfolder f => f a -> f (t a)
> 
> Writing instances of Unfoldable is similar to writing Traversable instances. 
> For example, given a data type
> 
>   data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
> 
> a suitable instance would be
> 
>   instance Unfoldable Tree where
> unfold fa = choose
>   [ pure Empty
>   , Leaf <$> fa
>   , Node <$> unfold fa <*> fa <*> unfold fa
>   ]
> 
> The choose function comes from the Unfolder class:
> 
>   class Applicative f => Unfolder f where
> choose :: [f x] -> f x
> 
> (If f is an Alternative instance, choose is simply Data.Foldable.asum.)
> 
> Different unfolders provide different ways of generating values, for example:
>  - Random values
>  - Enumeration of all values (depth-first or breadth-first)
>  - Convert from a list
>  - An implementation of QuickCheck's arbitrary should also be possible (still 
> working on that)
> 
> Some examples can be found in the examples directory in the github repo:
> https://github.com/sjoerdvisscher/unfoldable
> 
> Ideas and comments are welcome!
> 
> greetings,
> Sjoerd

-- 
Roman I. Cheplyaka :: http://ro-che.info/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Printing call site for partial functions

2012-04-26 Thread Joachim Breitner
Hi,

Am Mittwoch, den 25.04.2012, 18:36 +0300 schrieb Michael Snoyman:
> I'm sure there are many better ways to approach the problem, and I
> can't speak to the complexity of implementation within GHC. I *can*
> say, however, that this would have saved me a lot of time in the
> example I gave above, and I'd bet many Haskellers have similar
> stories. This could be a huge debugging win across the board.

using TH (which I only reluctantly advocate for general usage) you can
get good location information behaviour, see
http://hackage.haskell.org/packages/archive/stm-stats/0.2.0.0/doc/html/Control-Concurrent-STM-Stats.html#v:trackThisSTM
(and its source) for one example. One would use this approach maybe with
http://hackage.haskell.org/packages/archive/safe/0.3.3/doc/html/Safe.html#v:headNote

Greetings,
Joachim


-- 
Joachim Breitner
  e-Mail: m...@joachim-breitner.de
  Homepage: http://www.joachim-breitner.de
  Jabber-ID: nome...@joachim-breitner.de


signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Annotations in abstract syntax tree

2012-04-26 Thread José Pedro Magalhães
Hi Romildo,

If I understand correctly, you now want to add annotations to
mutually-recursive datatypes. The annotations package supports that.
Section 8 of our paper [1] gives an example of how to do that, and also
Chapter 6 of Martijn's MSc thesis [2].

Let me know if these references do not answer your question.


Cheers,
Pedro

[1] http://www.dreixel.net/research/pdf/gss.pdf
[2] http://martijn.van.steenbergen.nl/projects/Selections.pdf

On Thu, Apr 26, 2012 at 10:07,  wrote:

> Hello.
>
> I need to annotate abstract syntax tree with additional information in a
> compiler.
>
> Using the Annotations package[1] I have written the following small
> program:
>
>  import Annotations.F.Annotated
>  import Annotations.F.Fixpoints
>
>  data ExprF r
>= Num Double
>| Var String
>| Add r r
>| Sub r r
>| Mul r r
>| Div r r
>deriving (Eq,Show)
>
>  type BareExpr = Fix ExprF
>
>  e :: BareExpr
>  e = In (Mul (In (Num 5))
>  (In (Add (In (Var "x"))
>   (In (Num 8)
>
>
>  type ValExpr = Fix (Ann Double ExprF)
>
>  type Memory = [(String,Double)]
>
>  eval :: Memory -> BareExpr -> ValExpr
>  eval _ (In (Num x))   = In (Ann x (Num x))
>  eval m (In (Var x))   = let y = case lookup x m of
>Just k -> k
>Nothing -> 0
>  in In (Ann y (Var x))
>  eval m (In (Add x y)) = op m (+) Add x y
>  eval m (In (Sub x y)) = op m (-) Sub x y
>  eval m (In (Mul x y)) = op m (*) Mul x y
>  eval m (In (Div x y)) = op m (/) Div x y
>
>  op m f k x y = let x'@(In (Ann v1 _)) = eval m x
> y'@(In (Ann v2 _)) = eval m y
> in In (Ann (f v1 v2) (k x' y'))
>
>
> With these definitions we can represent simple arithmetic expressions
> and we can also evaluate them, annotating each node in the abstract
> syntax tree with its corresponding value.
>
> Now I want to add statements to this toy language. One statement may be
> a print statement containing an expression whose value is to be printed,
> an assign statement containing an identifier and an expression, or a
> compound statement containing two statements to be executed in sequence.
>
> How the data types for statements can be defined?
>
> How a function to execute an statement anotating its node with the
> corresponding state (memory plus output) after its execution can be
> defined?
>
> Without annotations the type of statements could be:
>
>  data Stm
>= PrintStm Expr
>| AssignStm String Expr
>| CompoundStm Stm Stm
>
> How to enable annotations in this case? Note that Stm uses both Expr and
> Stm.
>
>
> [1]  http://hackage.haskell.org/package/Annotations
>
>
> Romildo
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Printing call site for partial functions

2012-04-26 Thread Michael Snoyman
On Wed, Apr 25, 2012 at 7:28 PM, Ozgur Akgun  wrote:
> Hi,
>
> On 25 April 2012 16:36, Michael Snoyman  wrote:
>>
>>    Prelude.head: empty list
>
>
> Recent versions of GHC actually generate a very helpful stack trace, if the
> program is compiled with profiling turned on and run with -xc.
>
> See: http://community.haskell.org/~simonmar/slides/HIW11.pdf
> (Ironically titled "Prelude.head: empty list")
>
> HTH,
> Ozgur
>

I certainly think that stack traces are going to be a powerful
debugging tool, and I'm looking forward to using them. But I think
this feature would be useful in and of itself. I'm presuming it won't
be the default to have stack traces turned on due to performance
overhead (is that a faulty assumption?). This feature would be
available for all builds and give you a very high amount of useful
information- though not quite as much as a stack trace- without any
(serious) performance impact.

Michael

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Annotations in abstract syntax tree

2012-04-26 Thread j . romildo
Hello.

I need to annotate abstract syntax tree with additional information in a
compiler.

Using the Annotations package[1] I have written the following small
program:

  import Annotations.F.Annotated
  import Annotations.F.Fixpoints

  data ExprF r
= Num Double
| Var String
| Add r r
| Sub r r
| Mul r r
| Div r r
deriving (Eq,Show)

  type BareExpr = Fix ExprF

  e :: BareExpr
  e = In (Mul (In (Num 5))
  (In (Add (In (Var "x"))
   (In (Num 8)


  type ValExpr = Fix (Ann Double ExprF)

  type Memory = [(String,Double)]

  eval :: Memory -> BareExpr -> ValExpr
  eval _ (In (Num x))   = In (Ann x (Num x))
  eval m (In (Var x))   = let y = case lookup x m of
Just k -> k
Nothing -> 0
  in In (Ann y (Var x))
  eval m (In (Add x y)) = op m (+) Add x y
  eval m (In (Sub x y)) = op m (-) Sub x y
  eval m (In (Mul x y)) = op m (*) Mul x y
  eval m (In (Div x y)) = op m (/) Div x y

  op m f k x y = let x'@(In (Ann v1 _)) = eval m x
 y'@(In (Ann v2 _)) = eval m y
 in In (Ann (f v1 v2) (k x' y'))


With these definitions we can represent simple arithmetic expressions
and we can also evaluate them, annotating each node in the abstract
syntax tree with its corresponding value.

Now I want to add statements to this toy language. One statement may be
a print statement containing an expression whose value is to be printed,
an assign statement containing an identifier and an expression, or a
compound statement containing two statements to be executed in sequence.

How the data types for statements can be defined?

How a function to execute an statement anotating its node with the
corresponding state (memory plus output) after its execution can be
defined?

Without annotations the type of statements could be:

  data Stm
= PrintStm Expr
| AssignStm String Expr
| CompoundStm Stm Stm

How to enable annotations in this case? Note that Stm uses both Expr and Stm.


[1]  http://hackage.haskell.org/package/Annotations


Romildo

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Printing call site for partial functions

2012-04-26 Thread Simon Marlow

On 25/04/2012 17:28, Ozgur Akgun wrote:
> Hi,
>
> On 25 April 2012 16:36, Michael Snoyman  > wrote:
>
> Prelude.head: empty list
>
>
> Recent versions of GHC actually generate a very helpful stack trace, if
> the program is compiled with profiling turned on and run with -xc.

Right.  Also don't forget to add -fprof-auto.

There's an API to get access to the stack trace too:

http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.5.0.0/GHC-Stack.html

> See: http://community.haskell.org/~simonmar/slides/HIW11.pdf
> (Ironically titled "Prelude.head: empty list")

A more recent talk about this with more details is here:

http://community.haskell.org/~simonmar/Stack-traces.pdf


Cheers,
Simon


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Printing call site for partial functions

2012-04-26 Thread Simon Peyton-Jones
Tristan Allwood got quite a long way with this a couple of years ago.
http://research.microsoft.com/en-us/um/people/simonpj/papers/stack-trace/DebugTraces.pdf

But not enough to finish it off! The paper describes the tricky points... Simon 
M is more of an expert than I.

Moreover the work Simon has done on improving profiling is relevant too.

Simon

| -Original Message-
| From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-
| boun...@haskell.org] On Behalf Of Evan Laforge
| Sent: 25 April 2012 17:08
| To: Michael Snoyman
| Cc: Haskell Cafe
| Subject: Re: [Haskell-cafe] Printing call site for partial functions
| 
| > And then have the compiler automatically include (optional) package
| > name, module name, and line number where `headContext` was called. How
| > about we borrow a bit from rewrite rules, and have a pragma such as:
| >
| >    {-# WITH_CONTEXT head headContext #-}
| 
| This seems similar to the SRCLOC_ANNOTATE pragma supported by jhc.
| 
| I'd love to have this feature.  I'd just like to point out it's not just
| useful for partial functions like 'head', but also for logging and "expected"
| exceptions like Left.  It's also extremely useful for tests, when I get
| "check failed: 3 /= 4" it's really important to see filename and line number.
| 
| There are various hacks out there to get this, but they all involve
| annotating the call sites with some magic, either an 'assert' (and then
| runtime overhead on every function that uses it) or a TH splice (and then you
| have to turn TH on in every module).  I have literally thousands of lines of
| tests that would all need an extra boilerplate argument.
| 
| I implemented a preprocessor that is effectively like SRCLOC_ANNOTATE and it
| works ok for me, but it's not a good general solution because it's hardcoded
| to certain symbols and slows down compilation too much.
|  And being specific to my app of course it wouldn't help in your case
| :)
| 
| But it won't happen unless one of us few people who care about it just goes
| and implements it.  I don't think it's much of a priority with others.
| 
| ___
| Haskell-Cafe mailing list
| Haskell-Cafe@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe