Re: [Haskell-cafe] GADT and instance deriving

2013-05-27 Thread Richard Eisenberg
I don't yet see a problem with the strongly-typed approach.

Following the code I posted previously, for your deriv function, you would need 
sommething like the following:

---
deriv :: (HList indeps -> Tensor result) -> (HList (DerivIndeps indeps result) 
-> Tensor (DerivResult indeps result))

type family DerivIndeps (indeps :: [Nat]) (result :: Nat) :: [Nat]
type family DerivResult (indeps :: [Nat]) (result :: Nat) :: Nat
---

If you haven't come across them before, type families are essentially 
type-level functions. See here: 
http://www.haskell.org/haskellwiki/GHC/Type_familiesOnce upon a time, I 
earned a degree in physics and have actually taught multivariable calculus, but 
those days are long gone and my memory pages giving the exact definitions you 
need are buried under many more pages of type theory. Nevertheless, I'm sure 
that the types you need should be easily derivable given the inputs. Using type 
families in this way is often necessary when using GADTs and strongly-typed 
interfaces.

Overloading operators should be possible using type classes. For example:

instance Addable (Tensor n) (Tensor n) where
  (+) = …

You can use functional dependencies *or* type families/associated types (type 
families and associated types are almost two names for the same thing) for the 
output type. I prefer type families over functional dependencies, because I 
think type families use a syntax like function application and I find them 
easier to think about. But, either will work for you here.

As for your question whose answer was "Template Haskell", I have to agree with 
that answer. Haskell gives you no direct access to the names of your variables, 
so you can't have any decisions made based on a variable name. So, if you want 
your names to be significant, you have to use Template Haskell, which involves 
essentially writing programs to produce Haskell code. In your case, though, I 
think that approach is overkill, and it's probably best just to be a little 
redundant in your code (i.e. name a variable `s` and have a string `"s"` 
nearby).

I hope this helps!
Richard

On May 26, 2013, at 1:20 PM, TP wrote:

> Hi Tillmann and Richard,
> 
> Thanks for your answers.
> 
> I have tried to analyze the code snippets you proposed.
> I've tried to transpose your examples to what I need, but it is not easy.
> 
> The problem I see with putting the list of independent variables (*) at the 
> type level is that at some time in my code I want for instance to perform 
> formal mathematical operations, for example I want a function "deriv" that 
> takes f(x(t),y(t),z(t)) as input, and returns
> 
> df/dt = ∂f/∂x*dx/dt + ∂f/∂y*dy/dt + ∂f/∂z*dz/dt
> 
> If the list of dependencies is encoded at the type level, I don't see how to 
> produce the previous output from the knowledge of "f(x(t),y(t),z(t))". You 
> understand that what I want to do is some type of basic Computer Algebra 
> System library.
> 
> Moreover, I want overloading for infix functions as '*', '/', '⋅' (scalar 
> product), × (vector product) etc., that is why I have used typeclasses (see 
> the code I showed in my previous post). For example, for the time being I 
> will restrict myself to scalar product between vector and vector, vector and 
> dyadic, dyadic and vector (a dyadic is a tensor of order 2, a matrix if you 
> prefer). So I have three instances for scalar product '⋅'. I don't see how 
> to combine this idea of overloading or derivation function with what you 
> proposed. But I have perhaps missed something.
> 
> Thanks,
> 
> TP
> 
> (*): That is to say the list of tensors of which one tensor depends, e.g. 
> [t,r] for E(t,r), or simply [x,y,z] for f(x(t),y(t),z(t)) where x, y, and z 
> themselves are scalars depending on a scalar t). In the test file of my 
> library, my code currently looks like:
> 
> -
> type Scalar = Tensor Zero
> type Vector = Tensor One
> [...]
> let s = (t "s" []) :: Scalar
> let v = (t "v" [i s]) :: Vector
> let c1 = v + v
> let c2 = s + v⋅v
> -
> 
> t is a smart constructor taking a string str and a list of independent 
> variables, and makes a (Tensor order) of name str.
> 
> So in the example above, s is a scalar that depends on nothing (thus it is 
> an independent variable), v is a vector that depends on s (i is a smart 
> constructor that wraps s into a Box constructor, such that I can put all 
> independent variables in an heterogeneous list).
> c1 is the sum of v and v, i.e. is equal to 2*v.
> c2 is the sum of s and v scalar v.
> If I try to write:
> 
> let c3 = s + v
> 
> I will obtain a compilation error, because adding a scalar and a vector has 
> no meaning.
> 
> Is there some way to avoid typeable in my case?
> 
> Moreover, if I wanted to avoid the String in the first argument of my smart 
> constructor "t", such that
> 
> let s = (t []) :: Scalar
> 
> constructs an independent Scalar of name "s", googling on the topic seems to 
> indicated that I am compelled to use "

[Haskell-cafe] Call for Papers IFL 2013

2013-05-27 Thread publicityifl
Hello,

Please, find below the first call for papers for IFL 2013.
Please forward these to anyone you think may be interested.
Apologies for any duplicates you may receive.

best regards,
Jurriaan Hage
Publicity Chair of IFL

CALL FOR PAPERS

25th SYMPOSIUM ON IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES - IFL 
2013

RADBOUD UNIVERSITY NIJMEGEN, THE NETHERLANDS
ACM In-Cooperation / ACM SIGPLAN

AUGUST 28 - 30 2013

"Landgoed Holthurnsche Hof"

http://ifl2013.cs.ru.nl



We are proud to announce that the 25th edition of the IFL series returns to its 
roots at 
the Radboud University Nijmegen in the Netherlands. The symposium is held from 
28th 
to 30th of August 2013.

Scope
-
The goal of the IFL symposia is to bring together researchers actively engaged 
in the 
implementation and application of functional and function-based programming 
languages. 
IFL 2013 will be a venue for researchers to present and discuss new ideas and 
concepts, 
work in progress, and publication-ripe results related to the implementation 
and 
application of functional languages and function-based programming. 

Following the IFL tradition, IFL 2013 will use a post-symposium review process 
to 
produce the formal proceedings which will be published in the ACM Digital 
Library. All 
participants of IFL 2013 are invited to submit either a draft paper or an 
extended 
abstract describing work to be presented at the symposium. At no time may work 
submitted 
to IFL be simultaneously submitted to other venues; submissions must adhere to 
ACM SIGPLAN's republication policy:

http://www.sigplan.org/Resources/Policies/Republication

The submissions will be screened by the program committee chair to make sure 
they are 
within the scope of IFL, and will appear in the draft proceedings distributed 
at the 
symposium. Submissions appearing in the draft proceedings are not peer-reviewed 
publications. Hence, publications that appear only in the draft proceedings do 
not 
count as publication for the ACM SIGPLAN republication policy. After the 
symposium, 
authors will be given the opportunity to incorporate the feedback from 
discussions at 
the symposium and will be invited to submit a revised full article for the 
formal 
review process. From the revised submissions, the program committee will select 
papers 
for the formal proceedings considering their correctness, novelty, originality, 
relevance, significance, and clarity. 

Invited Speaker
---
Lennart Augustsson, currently employed by the Standard Chartered Bank, 
well-known for 
his work on Haskell, parallel Haskell, Cayenne, and Bluespec, is the invited 
speaker of 
IFL 2013. He will be talking about practical applications of functional 
programming. 

Submission Details
--
Submission deadline draft papers:  July 31 
Notification of acceptance for presentation:   August 2 
Early registration deadline:   August 7
Late registration deadline:August 14 
Submission deadline for pre-symposium proceedings: August 21
25th IFL Symposium:August 28-30 
Submission deadline for post-symposium proceedings:November 11
Notification of acceptance for post-symposium proceedings: December 18
Camera-ready version for post-symposium proceedings:   February 3 2014 

Prospective authors are encouraged to submit papers or extended abstracts to be 
published in the draft proceedings and to present them at the symposium. All 
contributions must be written in English. Papers must adhere to the standard 
ACM two 
columns conference format. For the pre-symposium proceedings we adopt a 'weak' 
page limit
of 12 pages. For the post-symposium proceedings the page limit of 12 pages is 
firm. A 
suitable document template for LaTeX can be found at: 

http://www.acm.org/sigs/sigplan/authorInformation.htm

Papers are to be submitted via the conference's EasyChair submission page: 

https://www.easychair.org/conferences/?conf=ifl2013

Topics
--
IFL welcomes submissions describing practical and theoretical work as well as 
submissions
describing applications and tools in the context of functional programming. If 
you are 
not sure whether your work is appropriate for IFL 2013, please contact the PC 
chair at 
ri...@cs.ru.nl. Topics of interest include, but are not limited to:  

•  language concepts
•  type systems, type checking, type inferencing
•  compilation techniques
•  staged compilation
•  run-time function specialization
•  run-time code generation
•  partial evaluation
•  (abstract) interpretation
•  metaprogramming
•  generic programming
•  automatic program generation
•  array processing
•  concurrent/parallel programming
•  concurrent/parallel program execution
•  embedded systems
•  web applications
•  (embedded) domain specific languages
•  security
•  novel memory management techniques
•  run-time

[Haskell-cafe] hackage update brigade (was Re: ANNOUNCE: new bridge! (prelude-prime))

2013-05-27 Thread Evan Laforge
> Yes, it would break code.  Probably a lot of code.

So of course I volunteer to fix my code, but that's not much help,
since it's a small minority of the code on hackage.  So that made me
think, maybe we should organize a kind of hackage community service
brigade, which, when the time is right, would spring into action.
They would download sections of hackage, update the code, and send
patches to the maintainers.  Then they'd keep track of which packages
actually applied the patch, and that could go on an "update status"
page.

I'd sign up for that.

Of course, package maintainers might prefer to do the change
themselves, or more likely may be incommunicado.  But the presence of
a small army of organized volunteers waiting to update code might
reduce friction to make necessary changes, and would take the weight
off the shoulders of the few who wind up doing it anyway when a new
ghc comes out.

If people think this is a good idea, I volunteer to do the setup.  I
guess this means a short doc describing the process, and then a place
where volunteers can sign up, and then keep the volunteer list up to
date.

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


[Haskell-cafe] ANNOUNCE: haskell-packages-0.1

2013-05-27 Thread Roman Cheplyaka
I am happy to announce the first release of haskell-packages.

  http://haskell-suite.github.io/haskell-packages/

There are two cases when you may need haskell-packages: if you are writing a
Haskell compiler (or any tool that processes Haskell source code, such as a
static analyzer), or if you want to integrate with an existing Haskell compiler
that uses haskell-packages.

## Writing a compiler

If you are writing a compiler, you typically want to integrate it with Cabal, to
be able to build ordinary Haskell packages.

If you go the hard way, this involves:

1. **Parsing command line parameters**. Sounds easy — just take a list of files 
to
compile. In reality you also need to handle package ids and package dbs, CPP
options (`-DFOO=1`), language extension flags (`-XRankNTypes`) etc.

To integrate with Cabal, you also need to tell it the list of installed
packages, supported languages and extensions etc.

2. Actual **integration with Cabal** means understanding how Cabal works and
hard-coding support for your compiler. And then getting it accepted and
waiting for the next Cabal release.

You may pretend that you are GHC or other compiler that is already supported
by Cabal. It might work, but often it won't, for various reasons. Also,
GHC's command line protocol is quite complex.

3. **Package management**. You need to implement a package db mechanism, which 
would
let you to keep track of installed packages. Then you'd have to implement a
`ghc-pkg`-like tool to manage those databases, for both Cabal and your 
users.

**Or**, you can simply use this library!

It already has command line options parsing, Cabal support, and package
management. All you need to do is to provide the function to do actual
compilation and tell a couple of other things about your compiler. See
the `Distribution.HaskellSuite.Compiler` module for details.

## Using other compilers

Some compilers produce artifacts that you may want to use. A good example is the
`gen-iface` compiler from haskell-names which generates an *interface* for each
module — the set of all named entities (functions, types, classes) that are
exported by that module. This information can be then used either by other
compilers, or by tools like IDEs.

Assuming the compiler uses haskell-packages and exports its database type, it's
very easy to use its artifacts. See `Distribution.HaskellSuite.Packages` for
package resolution and `Distribution.HaskellSuite.Modules` for module
resolution.

## Installation

Note that haskell-packages uses (yet unreleased) haskell-src-exts 1.14. Get it
[here][hse].

It doesn't matter what Cabal version you use together with haskell-packages, but
if you want to invoke a haskell-packages compiler from Cabal (see
[Usage](#usage)), you need to build our [fork of Cabal][Cabal]. Eventually it
will be merged into Cabal.

[hse]: https://github.com/haskell-suite/haskell-src-exts
[Cabal]: https://github.com/feuerbach/Cabal

## Usage

To compile a Haskell package using a haskell-packages tool:

cabal install --haskell-suite -w $TOOL

where `$TOOL` may be either a full path to the compiler, or just an executable
name if it's in `$PATH`.

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


Re: [Haskell-cafe] hackage update brigade (was Re: ANNOUNCE: new bridge! (prelude-prime))

2013-05-27 Thread Clark Gaebel
I'd be down for helping update packages when the time comes.
On May 27, 2013 12:08 PM, "Evan Laforge"  wrote:

> > Yes, it would break code.  Probably a lot of code.
>
> So of course I volunteer to fix my code, but that's not much help,
> since it's a small minority of the code on hackage.  So that made me
> think, maybe we should organize a kind of hackage community service
> brigade, which, when the time is right, would spring into action.
> They would download sections of hackage, update the code, and send
> patches to the maintainers.  Then they'd keep track of which packages
> actually applied the patch, and that could go on an "update status"
> page.
>
> I'd sign up for that.
>
> Of course, package maintainers might prefer to do the change
> themselves, or more likely may be incommunicado.  But the presence of
> a small army of organized volunteers waiting to update code might
> reduce friction to make necessary changes, and would take the weight
> off the shoulders of the few who wind up doing it anyway when a new
> ghc comes out.
>
> If people think this is a good idea, I volunteer to do the setup.  I
> guess this means a short doc describing the process, and then a place
> where volunteers can sign up, and then keep the volunteer list up to
> date.
>
> ___
> 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] hackage update brigade (was Re: ANNOUNCE: new bridge! (prelude-prime))

2013-05-27 Thread Tom Ellis
On Mon, May 27, 2013 at 02:10:28PM -0400, Clark Gaebel wrote:
> I'd be down for helping update packages when the time comes.

As am I, for what it's worth.

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


[Haskell-cafe] Hackage Update Brigade

2013-05-27 Thread Alexander Solla
As per recent discussions, I'm making a list of volunteers who are willing
to pick up some slack in Hackage package maintenance, so that we can submit
an amendment to the Haskell Prime Committee's ticket 113 (
http://hackage.haskell.org/trac/haskell-prime/ticket/113)

I think that showing that people are willing to pick up missing package
maintainer's slack will alleviate the concern of breaking lots of code by
refactoring the monad/applicative/functor hierarchy.  Code will be broken,
but publicly available packages can be fixed by the community during a
"staging" period.  To that end, I have made a Google Form to collect some
volunteer information.  If you are interested in helping, please visit:

https://docs.google.com/forms/d/1o4B8CEE_42u9f-sgmu2t5iSEvm0cq6-um6g_fHJt6GE/viewform
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell-Cafe Digest, Vol 117, Issue 40

2013-05-27 Thread Diego Saa-temp


Sent from my Verizon Wireless 4G LTE smartphone

 Original Message 
Subject: Haskell-Cafe Digest, Vol 117, Issue 40
From: "haskell-cafe-requ...@haskell.org" 
Date: Mon, 27-May-2013 06:00
To: "haskell-cafe@haskell.org" 
CC:


Send Haskell-Cafe mailing list submissions to
haskell-cafe@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/haskell-cafe
or, via email, send a message with subject or body 'help' to
haskell-cafe-requ...@haskell.org

You can reach the person managing the list at
haskell-cafe-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Haskell-Cafe digest..."


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


Re: [Haskell-cafe] Interfacing Java/Haskell

2013-05-27 Thread Manuel M T Chakravarty
CJ van den Berg :
> I have successfully written Java/Haskell programs using the Java
> Native Interface. You can find my JNI to Haskell binding library at
> https://github.com/neurocyte/foreign-jni. I am primarily using it to
> write Android Apps with Haskell,

Just out of curiosity, have you got any complete apps that you built that way? 
Are they in the Google Store?

Manuel


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


Re: [Haskell-cafe] Hackage Update Brigade

2013-05-27 Thread Conrad Parker
On 28 May 2013 05:29, Alexander Solla  wrote:
> As per recent discussions, I'm making a list of volunteers who are willing
> to pick up some slack in Hackage package maintenance, so that we can submit
> an amendment to the Haskell Prime Committee's ticket 113
> (http://hackage.haskell.org/trac/haskell-prime/ticket/113)
>
> I think that showing that people are willing to pick up missing package
> maintainer's slack will alleviate the concern of breaking lots of code by
> refactoring the monad/applicative/functor hierarchy.  Code will be broken,
> but publicly available packages can be fixed by the community during a
> "staging" period.  To that end, I have made a Google Form to collect some
> volunteer information.  If you are interested in helping, please visit:
>
> https://docs.google.com/forms/d/1o4B8CEE_42u9f-sgmu2t5iSEvm0cq6-um6g_fHJt6GE/viewform
>
>

For that proposal, there is also an informal github group for updating
unmaintained packages,
which anyone willing is welcome to join:

https://github.com/haskell-pkg-janitors

cheers,

Conrad.

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


[Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-05-27 Thread Edward Kmett
We've worked our way through the project approval process for another year.
This year we accepted 9 projects for haskell.org in general and are hosting
2 additional projects for darcs as an umbrella organization.

haskell.org:

* Parallelise 'cabal build' by Mikhail Glushenkov, mentored by Johan Tibell
* Extending GHC to support building modules in parallel by Patrick Palka,
mentored by Thomas Schilling
* Communicating with mobile devices by Marcos Pividori, mentored by Michael
Snoyman
* Improve Haddock Markup and Capabilities by Fūzetsu, mentored by Simon
Hengel
* Haskell Qt Binding Generator by Zhengliang Feng, mentored by Carter
Schonwald with help from Ian-Woo Kim
* Improve the feedback of the cabal-install dependency solver by Martin
Ruderer, mentored by Andres Löh
* Interactive-diagrams and a paste site with the ability for dynamic
rendering of diagrams by Dan Frumin, mentored by Luite Stegeman
* Overloaded record fields for GHC by Adam Gundry, mentored by Simon
Peyton-Jones
* Port Charts to use Diagrams by Jan Bracker, mentored by Tim Docker

darcs:

* Better record command for darcs by José Neder, mentored by Gillaume
Hoffmann
* Enhancing Darcsden by BSRK Aditya, mentored by Ganesh Sittampalam

Students have from now through Jun 16th to get up to speed and get to know
their mentors.

And while the summer of code officially starts on Jun 17th, keep in mind
that the mid-term evaluations aren't that much farther behind, starting
July 29th, so you'll want to hit the ground running.

If you put in a project proposal and it wasn't accepted and/or you would
like feedback, please feel free to email me or contact me on the
#haskell-gsoc channel on irc.freenode.net. We received more proposals than
slots this year, and so we were forced to make a few hard decisions.
Shachaf Ben-Kiki is helping out as this year's backup administrator and he
should also be able to help out with administrivia or questions as well.

I'd like to thank everyone for participating in the selection process and I
think we can look forward to another excellent summer of code!

Edward Kmett
haskell.org Google Summer of Code Administrator
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Haskell Platform 2013.2.0.0

2013-05-27 Thread Mark Lentczner
On behalf of the Haskell Platform team, I'm happy to announce the release of

Haskell Platform 2013.2.0.0
*featuring*
GHC 7.6.3
52 packages
650+ public modules
4 tools

*New packages this release:*
attoparsec
case-insensitive
hashable
unordered-containers
*and a major upgrade to*
OpenGL and GLUT

Get it now:

Download Haskell Platform 
— for Windows 
— for Mac OS X 
— for Linux  (distributions
updating soon)

*N.B.: You will likely need to explicitly re-fresh those links when
visiting in your browser - those pages tend to get cached for very long
periods of time.*


— Mark "platform wrangler" Lentczner
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe