[Haskell] Deadline extension for FARM 2018 (now July 8) - Workshop on Functional Art, Music, Modelling, and Design

2018-06-28 Thread Brent Yorgey
 or
expertise related to the FARM theme. Examples may include but are not
restricted to:

- art projects in need of realization
- existing software or hardware that may benefit from functional programming
- unfinished projects in need of inspiration

Calls for collaboration should be in plain text, HTML or Markdown
format, and not exceed 5000 words. A call for collaboration should be
clearly marked as such, by prepending Call for Collaboration: to the
title.

Calls for collaboration will be published on the FARM website.

Authors take note
=

The official publication date is the date the proceedings are made
available in the ACM Digital Library. This date may be up to two weeks
prior to the first day of your conference. The official publication
date affects the deadline for any patent filings related to published
work.

All presentations at FARM 2018 will be recorded. Permission to publish
the resulting video (in all probability on YouTube, along with the
videos of ICFP itself and the other ICFP-colocated events) will be
requested on-site.

Questions
=

If you have any questions about what type of contributions that might
be suitable, or anything else regarding submission or the workshop
itself, please contact the organisers at:

  farm-2...@functional-art.org

Workshop Organization


Brent Yorgey (general chair)
Donya Quick  (program chair)
Tom Murphy   (performance chair)

Program Committee
=

Heinrich Apfelmus (self-employed)
Chuck Jee Chau (Hong Kong University of Science and Technology, Hong Kong)
Brian Heim (Yale, USA)
Can Ince (ince.io)
Chris Martens (NC State University, USA)
Eduardo Miranda (University of Plymouth, UK)
Ivan Perez Dominguez (University of Nottingham, UK)
Iris Ren (Utrecht University, Netherlands)
Henning Thielemann (self-employed)
Didier Verna (EPITA, France)
Dan Winograd-Cort (Target, USA)
Halley Young (University of Pennsylvania, USA)

Code of Conduct
===

FARM adheres to ICFP 2018's Code of Conduct:

http://icfp18.sigplan.org/attending/code-of-conduct
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] Final CFP: Workshop on Type-driven Development (TyDe '17)

2017-06-06 Thread Brent Yorgey
There's still time to submit an extended abstract!  See below.



 CALL FOR PAPERS

 2nd Workshop on Type-Driven Development (TyDe '17)
  3 September 2017, Oxford, UK

  http://tydeworkshop.org/2017


# Goals of the workshop

The workshop on Type-Driven Development aims to show how static type
information may be used effectively in the development of computer
programs. Co-located with ICFP, this workshop brings together leading
researchers and practitioners who are using or exploring types as a
means of program development.

We welcome all contributions, both theoretical and practical, on a
range of topics including:

-   dependently typed programming;
-   generic programming;
-   design and implementation of programming languages, exploiting types
 in novel ways;
-   exploiting typed data, data dependent data, or type providers;
-   static and dynamic analyses of typed programs;
-   tools, IDEs, or testing tools exploiting type information;
-   pearls, being elegant, instructive examples of types used in the
 derivation, calculation, or construction of programs.

# Invited speaker

Andrew Kennedy, Facebook, UK

# Program Committee

-   Nada Amin, EPFL, Switzerland
-   Ana Bove, Chalmers University of Technology, Sweden
-   Patricia Johann, Appalachian State University, US
-   Yukiyoshi Kameyama, University of Tsukuba, Japan
-   Sam Lindley, The University of Edinburgh, UK (co-chair)
-   Limin Jia, CMU, US
-   Assia Mahboubi, INRIA Saclay, France
-   Liam O’Connor, University of New South Wales, Australia
-   Nicolas Oury, Jane Street, UK
-   Jennifer Paykin, University of Pennsylvania, US
-   Paula Severi, University of Leicester, UK
-   Tarmo Uustalu, Tallinn University of Technology, Estonia
-   Jeremy Yallop, University of Cambridge, UK
-   Brent Yorgey, Hendrix College, US (co-chair)

# Proceedings and Copyright

We plan to have formal proceedings, published by the ACM. Accepted
papers will be included in the ACM Digital Library. Authors must grant
ACM publication rights upon acceptance, but may retain copyright if they
wish. Authors are encouraged to publish auxiliary material with their
paper (source code, test data, and so forth). The proceedings will be
freely available for download from the ACM Digital Library from one week
before the start of the conference until two weeks after the conference.

# Submission details

Submissions should fall into one of two categories:

-   Regular research papers (12 pages)
-   Extended abstracts (2 pages)

The bibliography will not be counted against the page limits for
either category.

Regular research papers are expected to present novel and interesting
research results, and will be included in the formal
proceedings. Extended abstracts should report work in progress that
the authors would like to present at the workshop. Extended abstracts
will be distributed to workshop attendees but will not be published in
the formal proceedings.

We welcome submissions from PC members (with the exception of the two
co-chairs), but these submissions will be held to a higher standard.

Submission is handled through HotCRP:

   https://icfp-tyde17.hotcrp.com/

All submissions should be in portable document format (PDF) and
formatted using the ACM SIGPLAN style guidelines:

   http://www.sigplan.org/Resources/Author/

*Note* that the ACM SIGPLAN style guidelines have changed from
previous years! In particular, submissions should use the new
‘acmart’ format and the two-column ‘sigplan’ subformat (not to be
confused with the one-column ‘acmlarge’ subformat!).

Extended abstracts must be submitted with the label 'Extended
abstract' clearly in the title.

# Important Dates

-   Regular paper deadline: Wednesday, 24th May, 2017
-   Extended abstract deadline: Wednesday, 7th June, 2017
-   Author notification: Wednesday, 28th June, 2017
-   Deadline for camera ready version: Saturday, 15th July, 2017
-   Workshop: Sunday, 3rd September, 2017

# Travel Support

Student attendees with accepted papers can apply for a SIGPLAN PAC grant
to help cover travel expenses. PAC also offers other support, such as
for child-care expenses during the meeting or for travel costs for
companions of SIGPLAN members with physical disabilities, as well as for
travel from locations outside of North America and Europe. For details
on the PAC program, see its web page:

   http://www.sigplan.org/PAC/
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] 2nd CFP: Workshop on Type-driven Development (TyDe '17)

2017-05-04 Thread Brent Yorgey

CALL FOR PAPERS

2nd Workshop on Type-Driven Development (TyDe '17)
 3 September 2017, Oxford, UK

 http://tydeworkshop.org/2017


# Goals of the workshop

The workshop on Type-Driven Development aims to show how static type
information may be used effectively in the development of computer
programs. Co-located with ICFP, this workshop brings together leading
researchers and practitioners who are using or exploring types as a
means of program development.

We welcome all contributions, both theoretical and practical, on a
range of topics including:

-   dependently typed programming;
-   generic programming;
-   design and implementation of programming languages, exploiting types
in novel ways;
-   exploiting typed data, data dependent data, or type providers;
-   static and dynamic analyses of typed programs;
-   tools, IDEs, or testing tools exploiting type information;
-   pearls, being elegant, instructive examples of types used in the
derivation, calculation, or construction of programs.

# Invited speaker

Andrew Kennedy, Facebook, UK

# Program Committee

-   Nada Amin, EPFL, Switzerland
-   Ana Bove, Chalmers University of Technology, Sweden
-   Patricia Johann, Appalachian State University, US
-   Yukiyoshi Kameyama, University of Tsukuba, Japan
-   Sam Lindley, The University of Edinburgh, UK (co-chair)
-   Limin Jia, CMU, US
-   Assia Mahboubi, INRIA Saclay, France
-   Liam O’Connor, University of New South Wales, Australia
-   Nicolas Oury, Jane Street, UK
-   Jennifer Paykin, University of Pennsylvania, US
-   Paula Severi, University of Leicester, UK
-   Tarmo Uustalu, Tallinn University of Technology, Estonia
-   Jeremy Yallop, University of Cambridge, UK
-   Brent Yorgey, Hendrix College, US (co-chair)

# Proceedings and Copyright

We plan to have formal proceedings, published by the ACM. Accepted
papers will be included in the ACM Digital Library. Authors must grant
ACM publication rights upon acceptance, but may retain copyright if they
wish. Authors are encouraged to publish auxiliary material with their
paper (source code, test data, and so forth). The proceedings will be
freely available for download from the ACM Digital Library from one week
before the start of the conference until two weeks after the conference.

# Submission details

Submissions should fall into one of two categories:

-   Regular research papers (12 pages)
-   Extended abstracts (2 pages)

The bibliography will not be counted against the page limits for
either category.

Regular research papers are expected to present novel and interesting
research results, and will be included in the formal
proceedings. Extended abstracts should report work in progress that
the authors would like to present at the workshop. Extended abstracts
will be distributed to workshop attendees but will not be published in
the formal proceedings.

We welcome submissions from PC members (with the exception of the two
co-chairs), but these submissions will be held to a higher standard.

Submission is handled through HotCRP:

  https://icfp-tyde17.hotcrp.com/

All submissions should be in portable document format (PDF) and
formatted using the ACM SIGPLAN style guidelines:

  http://www.sigplan.org/Resources/Author/

*Note* that the ACM SIGPLAN style guidelines have changed from
previous years! In particular, submissions should use the new
‘acmart’ format and the two-column ‘sigplan’ subformat (not to be
confused with the one-column ‘acmlarge’ subformat!).

Extended abstracts must be submitted with the label 'Extended
abstract' clearly in the title.

# Important Dates

-   Regular paper deadline: Wednesday, 24th May, 2017
-   Extended abstract deadline: Wednesday, 7th June, 2017
-   Author notification: Wednesday, 28th June, 2017
-   Deadline for camera ready version: Saturday, 15th July, 2017
-   Workshop: Sunday, 3rd September, 2017

# Travel Support

Student attendees with accepted papers can apply for a SIGPLAN PAC grant
to help cover travel expenses. PAC also offers other support, such as
for child-care expenses during the meeting or for travel costs for
companions of SIGPLAN members with physical disabilities, as well as for
travel from locations outside of North America and Europe. For details
on the PAC program, see its web page:

  http://www.sigplan.org/PAC/
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] CFP: Workshop on Type-driven Development (TyDe '17)

2017-04-04 Thread Brent Yorgey

CALL FOR PAPERS

2nd Workshop on Type-Driven Development (TyDe '17)
 3 September 2017, Oxford, UK

 http://tydeworkshop.org/2017


# Goals of the workshop

The workshop on Type-Driven Development aims to show how static type
information may be used effectively in the development of computer
programs. Co-located with ICFP, this workshop brings together leading
researchers and practitioners who are using or exploring types as a
means of program development.

We welcome all contributions, both theoretical and practical, on a
range of topics including:

-   dependently typed programming;
-   generic programming;
-   design and implementation of programming languages, exploiting types
in novel ways;
-   exploiting typed data, data dependent data, or type providers;
-   static and dynamic analyses of typed programs;
-   tools, IDEs, or testing tools exploiting type information;
-   pearls, being elegant, instructive examples of types used in the
derivation, calculation, or construction of programs.

# Invited speaker

Andrew Kennedy, Facebook, UK

# Program Committee

-   Nada Amin, EPFL, Switzerland
-   Ana Bove, Chalmers University of Technology, Sweden
-   Patricia Johann, Appalachian State University, US
-   Yukiyoshi Kameyama, University of Tsukuba, Japan
-   Sam Lindley, The University of Edinburgh, UK (co-chair)
-   Limin Jia, CMU, US
-   Assia Mahboubi, INRIA Saclay, France
-   Liam O’Connor, University of New South Wales, Australia
-   Nicolas Oury, Jane Street, UK
-   Jennifer Paykin, University of Pennsylvania, US
-   Paula Severi, University of Leicester, UK
-   Tarmo Uustalu, Tallinn University of Technology, Estonia
-   Jeremy Yallop, University of Cambridge, UK
-   Brent Yorgey, Hendrix College, US (co-chair)

# Proceedings and Copyright

We plan to have formal proceedings, published by the ACM. Accepted
papers will be included in the ACM Digital Library. Authors must grant
ACM publication rights upon acceptance, but may retain copyright if they
wish. Authors are encouraged to publish auxiliary material with their
paper (source code, test data, and so forth). The proceedings will be
freely available for download from the ACM Digital Library from one week
before the start of the conference until two weeks after the conference.

# Submission details

Submissions should fall into one of two categories:

-   Regular research papers (12 pages)
-   Extended abstracts (2 pages)

The bibliography will not be counted against the page limits for
either category.

Regular research papers are expected to present novel and interesting
research results, and will be included in the formal
proceedings. Extended abstracts should report work in progress that
the authors would like to present at the workshop. Extended abstracts
will be distributed to workshop attendees but will not be published in
the formal proceedings.

We welcome submissions from PC members (with the exception of the two
co-chairs), but these submissions will be held to a higher standard.

Submission is handled through HotCRP:

  https://icfp-tyde17.hotcrp.com/

All submissions should be in portable document format (PDF) and
formatted using the ACM SIGPLAN style guidelines:

  http://www.sigplan.org/Resources/Author/

*Note* that the ACM SIGPLAN style guidelines have changed from
previous years!  In particular, submissions should use the new
'acmart' format and 'sigplan' subformat.

Extended abstracts must be submitted with the label 'Extended
abstract' clearly in the title.

# Important Dates

-   Regular paper deadline: Wednesday, 24th May, 2017
-   Extended abstract deadline: Wednesday, 7th June, 2017
-   Author notification: Wednesday, 28th June, 2017
-   Deadline for camera ready version: Saturday, 15th July, 2017
-   Workshop: Sunday, 3rd September, 2017

# Travel Support

Student attendees with accepted papers can apply for a SIGPLAN PAC grant
to help cover travel expenses. PAC also offers other support, such as
for child-care expenses during the meeting or for travel costs for
companions of SIGPLAN members with physical disabilities, as well as for
travel from locations outside of North America and Europe. For details
on the PAC program, see its web page:

  http://www.sigplan.org/PAC/
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: confusing type error

2014-12-05 Thread Brent Yorgey
I think Richard is referring to The function ‘f2’ is applied to three
arguments,
but its type ‘Int - Float - Char - Bool’ has only three.  Note
applied to three ... but ... only three.   Here n = three.

-Brent

On Fri, Dec 5, 2014 at 9:55 AM, Dr. ÉRDI Gergő ge...@erdi.hu wrote:

 But it says `expected Char - Bool, got Char - m Bool', note the `m' type
 constructor in the second one. So it's not `n' vs. `n'.
 On Dec 5, 2014 10:50 PM, Richard Eisenberg e...@cis.upenn.edu wrote:

 The reason I said That's a bug! so confidently is because of the
 expected n but got n part. Even if everything else is OK, we need to fix
 that one bit.

 And I tend to agree about using heuristics to report better error
 messages in the presence of instantiating a type variable with (-). I've
 been caught and confused by that, too.

 Richard

 On Dec 4, 2014, at 4:23 PM, Evan Laforge qdun...@gmail.com wrote:

  On Thu, Dec 4, 2014 at 12:59 PM, migmit mig...@gmail.com wrote:
  It tries to get `m Bool` by applying f1 to three arguments: 0, 0, and
 'a'. Now, since `f2` has the type `Int - Float - n Bool`, where `n` is of
 kind `* - *` (and an instance of `Monad` class, but it's not yet the time
 to look for instances), we have `f2 0 :: Float - n Bool` and `f2 0 0 :: n
 Bool`. Since that is applied to 'a', Haskell deduces that the last type
 should be something like `Char - Something` — or, equivalently, `(-) Char
 Something`. Therefore, it can see that `n` is in fact `(-) Char` and
 `Something` is `Bool`. Therefore, `f2 0 0 'a' :: Bool`. But it is expecting
 `m Bool`, not `Bool` — which is exactly what an error message says.
 
  Right, that's what I suspected was happening.  The confusion arrises
  because it guesses that 'm' should be (-), and that deduction then
  leads to a dead-end.  But when it reports the problem, it uses its
  guessed 'm', rather that backing up to the declared value.
 
  But surely always backing up to the declared unspecialized value is no
  good either, because then you get vague errors.  All the compiler
  knows is that when it simplifies as far as it can, it winds up with a
  /= b, it doesn't know that I would have been surprised by its path a
  few steps back.
 
  But arity errors are common, and intentionally instantiating a prefix
  type constructor like 'm a' as (-) is probably much less common.  So
  perhaps there could be a heuristic that treats (-) specially and
  includes an extra clause in the error if it unified a type variable to
  (-)?
 
  I suspect the expected n but got n error is also due to the same
  thing, it counts arrows on one side but inferred arrows on the other?
  Or something?  In any case, it seems like the two sides are counting
  inconsistently.
  ___
  Glasgow-haskell-users mailing list
  Glasgow-haskell-users@haskell.org
  http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 

 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: confusing type error

2014-12-04 Thread Brent Yorgey
Int - Float - Char - Bool  *is* in fact a valid type for f2, since ((-)
Char) is a Monad. However, I agree the error message is confusing,
especially the expected n, but got n part.

-Brent

On Thu, Dec 4, 2014 at 1:50 PM, Evan Laforge qdun...@gmail.com wrote:

 I recently got a confusing error msg, and reduced it to a small case:

 f1 :: Monad m = m Bool
 f1 = f2 0 0 'a'

 f2 :: Monad m = Int - Float - m Bool
 f2 = undefined

 From this, it's clear that f2 is being given an extra Char argument it
 didn't ask for.  However, the error msg (ghc 7.8.3) is:

 Couldn't match type ‘m Bool’ with ‘Bool’
 Expected type: Char - m Bool
   Actual type: Char - Bool
 Relevant bindings include f1 :: m Bool (bound at Bug.hs:4:1)
 The function ‘f2’ is applied to three arguments,
 but its type ‘Int - Float - Char - Bool’ has only three
 In the expression: f2 0 0 'a'
 In an equation for ‘f1’: f1 = f2 0 0 'a'

 The confusing part is that 'f2' was applied to three arguments, but
 it's type has only three.  It includes the Char in expected and actual
 types, and implies that the type of 'f2' includes the Char.  So I took
 quite a while to realize that the type of 'f2' in fact *didn't* expect
 a Char (and had an 'm'), so that the but its type is *not* in fact
 its declared type.

 I suppose it infers a type for 'f2' based on its use, and that then
 becomes the actual type, but it seems less confusing if it picked
 the declared type of 'f2' as its actual type.  Perhaps this is working
 as intended, but it it is confusing!  Especially the part about
 expected three but got three.

 Ideally I'd like to see too many arguments or at least expected
 (Char - m Bool) but actually 'm Bool'.  Actually I'd expect the
 other way: expected 'm Bool' but got (Char - m Bool)' but I think
 ghc has always done it backwards from how I expect.  It looks like
 it's substituting (-) for 'm', so maybe it's one of those things
 where ((-) a) is also a monad.
 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] Short survey re: use of haskell.org funds to drive development -- please help!

2014-03-04 Thread Brent Yorgey
The haskell.org committee is trying to figure out how to use some of
its newfound power (the Power of Collecting Money) to best benefit the
open-source Haskell community.  You can help us by filling out a very
short survey (it should only take you about 5 minutes):

  
https://docs.google.com/forms/d/1rEobhHwFpjzPnra9L1TmrozWNFFyAVNPmdUMCcT--3Q/viewform

Please do fill it out, especially if you have opinions about what
parts of the Haskell open-source world need more work, and could
benefit by having some people paid to work on them.

Thanks!

-Brent, for the haskell.org committee
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: Diagrams 1.0

2014-01-17 Thread Brent Yorgey
 bugs [35]. Submit
your cool examples for inclusion in the gallery [36] or your cool code
for inclusion in the diagrams-contrib [37] package.

[34] http://groups.google.com/group/diagrams-discuss
[35] http://github.com/diagrams/
[36] http://projects.haskell.org/diagrams/gallery.html
[37] http://hackage.haskell.org/package/diagrams%2Dcontrib


Happy diagramming!

Brought to you by the diagrams team:

-   Daniel Bergey
-   Jeff Rosenbluth
-   Ryan Yates
-   Brent Yorgey

with contributions from:

-   Jan Bracker
-   Conal Elliott
-   Daniil Frumin
-   Sam Griffin
-   Niklas Haas
-   Peter Hall
-   Claude Heiland-Allen
-   Deepak Jois
-   John Lato
-   Felipe Lessa
-   Chris Mears
-   Ian Ross
-   Carlos Scheidegger
-   Vilhelm Sjöberg
-   Michael Sloan
-   Jim Snavely
-   Luite Stegeman
-   Kanchalai Suveepattananont
-   Michael Thompson
-   Scott Walck

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


Re: [Haskell-cafe] type constructor section for (- Bool), _not_ ((-) Bool)

2013-09-03 Thread Brent Yorgey
On Tue, Sep 03, 2013 at 11:33:46AM +, AntC wrote:
 I'm probably being dumb, but Hoogle nor the wiki are helping me.
 
 I want an instance and type improvement constraint of the form
 
 instance (f ~ (- Bool)) = C Foo (f b) where ...
 
 The first arg to C is driving type improvement, for example:
 
 instance (f ~ []) = C Bar (f b) where ...
 
 (The real instances are more complex, and involve overlap, of course.)
 
 I'm trying to write a section to get the improved type (b - Bool), 
 but (- Bool) or ((- Bool) b) is invalid syntax.

There is no operator section syntax for types.  Moreover, this is not
just an issue of syntax: it is impossible to partially apply a type
constructor to anything other than its first argument, because there
is no type-level lambda.

 This is valid, but wrong: ((-) Bool) b  -- gives (Bool - b).
 
 I could do:
 
 data FlipFun b  -- abstract
 instance (f ~ FlipFun) = C Foo (f b) where ...
 
 And a type function inside the class to generate the type.
 But then I'd have to apply the type function for all instances,
 and in most places it'd be id.

That's the only way to do it that I know of.

-Brent

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


Re: [Haskell-cafe] One-element tuple

2013-08-16 Thread Brent Yorgey
On Fri, Aug 16, 2013 at 01:35:22AM +, AntC wrote:
 There's an annoying inconsistency:
 
 (CustId 47, CustName Fred, Gender Male)  -- threeple
 (CustId 47, CustName Fred)-- twople
 --  (CustId 47)-- oneple not!
 () -- nople
 
 (That is, it's annoying if you're trying to make typeclass instances for 
 extensible/contractable tuples. Yes, I know I could use HLists.)
 
 I'm not happy with either approach I've tried:
 
 data Oneple a = Oneple a   -- (or newtype)
 (Oneple $ CustId 47)   -- too verbose
 
 type Oneple a = [a]
 [CustId 47]  -- at least looks bracket-y
 
 What do you do?

This is what the OneTuple package is for:

  http://hackage.haskell.org/package/OneTuple

-Brent

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


[Haskell-cafe] Call for Participation: Workshop on Functional Art, Music, Modeling and Design

2013-08-08 Thread Brent Yorgey
==
  FARM 2013: Call for Participation

  ACM SIGPLAN Workshop on Functional Art, Music, Modeling and Design
  Boston, Massachusetts, USA
  28th September, 2013 (directly after ICFP)

  http://www.cis.upenn.edu/~byorgey/farm13/
==

The functional programming community is largely interested in writing
beautiful programs. This workshop is intended to gather researchers and
practitioners interested in writing beautiful programs that generate
beautiful artifacts. Such artifacts may include visual art, music, 3D
sculptures, animations, GUIs, video games, physical models,
architectural models, choreographies for dance, poetry, and even
physical objects such as VLSI layouts, GPU configurations, or mechanical
engineering designs.

The goal of FARM is to gather together researchers, practitioners, and
educators in this interdisciplinary field, as well as anyone else with
even a casual interest in the area. We wish to share ideas, look for
common ground, and encourage more activity. We also hope to legitimize
work in the field and facilitate potential collaboration among the
participants.

Registration


Deadline for early registration: 22 August 2013

  https://regmaster3.com/2013conf/ICFP13/register.php

This is the registration site for ICFP 2013 and all the affiliated
workshops including FARM 2013.

Accepted papers and demonstrations
--

-   Samuel Aaron and Alan F. Blackwell. From Sonic Pi to Overtone:
Creative Musical Experiences with Domain-Specific and Functional
Languages
-   Henrik Bäärnhielm, Mikael Vejdemo-Johansson and Daniel Sundström.
Using Haskell as DSL for controlling immersive media experiences
(Demo)
-   Guillaume Baudart, Louis Mandel and Marc Pouzet. Programming Mixed
Music in ReactiveML
-   Jean Bresson, Raphael Foulon and Marco Stroppa. Reduction as a
Transition Controller for Sound Synthesis Events
-   Kelsey D'Souza. PySTEMM - A STEM Learning Tool for Exploring and
Building Executable Concept Models (Demo)
-   Andy Gill and Brent A. Yorgey. Functional active animation (Demo)
-   Jason Hemann and Eric Holk. Visualizing the Turing Tarpit
-   Paul Hudak. Euterpea: From Signals to Symphonies (Demo)
-   David Janin, Florent Berthaut, Myriam Desainte-Catherine, Yann
Orlarey and Sylvain Salvati. The T-Calculus : towards a structured
programing of (musical) time and space
-   David Janin and Florent Berthaut. LiveTuiles for tiled composition
of audio patterns (Demo)
-   Thomas Jordan. Spontaneous Musical Explorations of Visible Symmetric
Structures (Demo)
-   Hendrik Vincent Koops, José Pedro Magalhães and W. Bas de Haas. A
Functional Approach To Automatic Melody Harmonisation
-   José Pedro Magalhães, Bas De Haas, Gijs Bekenkamp, Dion ten Heggeler
and Tijmen Ruizendaal. Chordify: Chord Transcription for the Masses
(Demo)
-   Donya Quick and Paul Hudak. Grammar-Based Automated Music
Composition in Haskell
-   Chung‐chieh Shan and Dylan Thurston. Braiding in circles (Demo)

Workshop Organization
-

Workshop Chair: Paul Hudak
Program Chair: Conal Elliott
Publicity Chair: Brent Yorgey

Program Committee
-

-   Daniel Cukier (AgileAndArt)
-   Conal Elliott (Tabula) (chair)
-   Kathleen Fisher (Tufts University)
-   Richard Gabriel (IBM Research)
-   George Giorgidze (University of Tübingen)
-   Paul Hudak (Yale University)
-   José Pedro Magalhães (University of Oxford)
-   Alex McLean (University of Leeds)
-   John Peterson (Western State Colorado University)
-   Michael Sperber (Active Group)
-   Henning Thielemann (Martin-Luther-Universität Halle-Wittenberg)
-   Brent Yorgey (University of Pennsylvania)

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


Re: [Haskell-cafe] Do combinatorial algorithms have a matroid strucutre XOR non-matroid structure?

2013-07-14 Thread Brent Yorgey
On Thu, Jul 11, 2013 at 03:39:02PM -0700, KC wrote:
 I ask this on this mailing list because there are quite a few
 mathematically oriented people here.

If you accept the Law of Excluded Middle, everything either has a
matroid structure, or not.  On the other hand, if you do not accept
it, then there may be some combinatorial algorithms which have neither
(because we have not found a matroid structure, or proved one does not
exist).  Either way, I do not understand the point of your question.

-Brent

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


Re: [Haskell-cafe] Music / MIDI help

2013-07-10 Thread Brent Yorgey
Maybe Euterpea?

http://haskell.cs.yale.edu/euterpea/download/

On Wed, Jul 10, 2013 at 08:20:08AM -0700, Mark Lentczner wrote:
 I'm a little lost in the bewildering array of music packages for Haskell,
 and need some help.
 
 I'm looking to recreate one of my algorithmic music compositions from the
 1980s. I can easily code the logic in Haskell.
 
 I'm looking for a the right set of packages and SW so that I can:
 a) generate short sequences and play them immediately, preferrably in ghci,
 -- but 'runHaskell Foo.hs | barPlayer' would be acceptable
 2) generate MIDI files
 
 I'm on OS X.
 
 So far what I've found is: Haskore, the midi package, and the jack package
 - and then I'd need some MIDI software synth for the Mac, and Jack based
 patcher Or perhaps I want SuperCollider, and the Haskell bindings - but
 that seems rather low level for my needs here (I don't really need to patch
 together my instruments, and I don't want to have re-write the whole timing
 framework from scratch.)
 
 So - What's a quick easy path here?
 
 - Mark

 ___
 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] Open Source project suitable for 2-3 persons this fall?

2013-07-09 Thread Brent Yorgey
On Thu, Jul 04, 2013 at 05:26:59PM +0200, Anders Bech Mellson wrote:
 Is there any project that needs working this fall which could be used as a
 university project?
 
 I am in the university (M.Sc. in software development),
 so I am mainly looking for project ideas (preferably concrete ones).
 
 We are 2-3 students that have ~10 hours pr week for 3 months to work on a
 project.
 
 Is there a listing somewhere with project ideas for contributing to the
 Haskell community?

I am a bit late, but there are quite a few things that could be done
for the diagrams project [1].  Some project ideas are at [2], and more
can be found on the bug tracker [3].

[1] http://projects.haskell.org/diagrams/
[2] http://www.haskell.org/haskellwiki/Diagrams/Projects
[3] https://github.com/diagrams/diagrams-lib/issues?state=open

-Brent

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


[Haskell] Call for Demo Proposals: Workshop on Functional Art, Music, Modeling and Design

2013-07-03 Thread Brent Yorgey
Hi all,

Below is the call for demonstration proposals for FARM 2013.  Please
forward to anyone who might be interested -- apologies if you receive
multiple copies!

Brent Yorgey
publicity chair for FARM 2013


==
  FARM 2013: Call for Demo Proposals

  ACM SIGPLAN Workshop on Functional Art, Music, Modeling and Design
  Boston, Massachusetts, USA
  28th September, 2013 (directly after ICFP)

  http://www.cis.upenn.edu/~byorgey/farm13/
==


Do you enjoy writing beautiful code to produce beautiful artifacts? Have
something cool to show off at the intersection of functional programming
and visual art, music, sound, modeling, visualization, or design?

FARM 2013 is seeking proposals for 10-20 minute demonstrations to be
given during the workshop. For example, a demonstration could consist of
a short tutorial, an exhibition of some work, or even a livecoding
performance. Slots for demonstrations will be shorter than slots for
accepted papers, and will not be published as part of the formal
proceedings, but can be a great way to show off interesting work and get
feedback from other workshop participants. A demonstration slot could be
a particularly good way to get feedback on work-in-progress.

Scope
-

The functional programming community is largely interested in writing
beautiful programs. This workshop is intended to gather researchers and
practitioners interested in writing beautiful programs that generate
beautiful artifacts. Such artifacts may include visual art, music, 3D
sculptures, animations, GUIs, video games, physical models,
architectural models, choreographies for dance, poetry, and even
physical objects such as VLSI layouts, GPU configurations, or mechanical
engineering designs. The framework used need not be purely functional
(“mostly functional” is fine); may be based on abstractions such as
higher-order functions, monads, arrows, or streams; and may be
manifested as a domain specific language or tool. Theoretical
foundations, language design, implementation issues, and applications
are all within the scope of the workshop.

Important dates
---

-   Demonstration proposals due: Wednesday, 31 July 2013, 18:00 EDT
(UTC-4)

-   Author notification: Monday, 5 August 2013

-   Workshop: Saturday, 28 September 2013 (the day after ICFP)

A demo proposal should consist of a 1 page abstract, in PDF format,
explaining the proposed content of the demonstration and why it would be
of interest to the attendees of FARM. Proposals will be judged on
interest and relevance to the stated goals and themes of the workshop.

Submissions can be made via EasyChair at
https://www.easychair.org/conferences/?conf=farm2013.

Organizers
--

Workshop Chair: Paul Hudak
Program Chair: Conal Elliott
Publicity Chair: Brent Yorgey

Program Committee
-

Daniel Cukier (University of São Paulo)
Conal Elliott (Tabula) (chair)
Kathleen Fisher (Tufts University)
Richard Gabriel (IBM Research)
George Giorgidze (University of Tübingen)
Paul Hudak (Yale University)
José Pedro Magalhães (University of Oxford)
Alex McLean (University of Leeds)
John Peterson (Western State Colorado University)
Michael Sperber (Active Group)
Henning Thielemann
Brent Yorgey (University of Pennsylvania)

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


[Haskell-cafe] Call for Demo Proposals: Workshop on Functional Art, Music, Modeling and Design

2013-07-03 Thread Brent Yorgey
Hi all,

Below is the call for demonstration proposals for FARM 2013.  Please
forward to anyone who might be interested -- apologies if you receive
multiple copies!

Brent Yorgey
publicity chair for FARM 2013


==
  FARM 2013: Call for Demo Proposals

  ACM SIGPLAN Workshop on Functional Art, Music, Modeling and Design
  Boston, Massachusetts, USA
  28th September, 2013 (directly after ICFP)

  http://www.cis.upenn.edu/~byorgey/farm13/
==


Do you enjoy writing beautiful code to produce beautiful artifacts? Have
something cool to show off at the intersection of functional programming
and visual art, music, sound, modeling, visualization, or design?

FARM 2013 is seeking proposals for 10-20 minute demonstrations to be
given during the workshop. For example, a demonstration could consist of
a short tutorial, an exhibition of some work, or even a livecoding
performance. Slots for demonstrations will be shorter than slots for
accepted papers, and will not be published as part of the formal
proceedings, but can be a great way to show off interesting work and get
feedback from other workshop participants. A demonstration slot could be
a particularly good way to get feedback on work-in-progress.

Scope
-

The functional programming community is largely interested in writing
beautiful programs. This workshop is intended to gather researchers and
practitioners interested in writing beautiful programs that generate
beautiful artifacts. Such artifacts may include visual art, music, 3D
sculptures, animations, GUIs, video games, physical models,
architectural models, choreographies for dance, poetry, and even
physical objects such as VLSI layouts, GPU configurations, or mechanical
engineering designs. The framework used need not be purely functional
(“mostly functional” is fine); may be based on abstractions such as
higher-order functions, monads, arrows, or streams; and may be
manifested as a domain specific language or tool. Theoretical
foundations, language design, implementation issues, and applications
are all within the scope of the workshop.

Important dates
---

-   Demonstration proposals due: Wednesday, 31 July 2013, 18:00 EDT
(UTC-4)

-   Author notification: Monday, 5 August 2013

-   Workshop: Saturday, 28 September 2013 (the day after ICFP)

A demo proposal should consist of a 1 page abstract, in PDF format,
explaining the proposed content of the demonstration and why it would be
of interest to the attendees of FARM. Proposals will be judged on
interest and relevance to the stated goals and themes of the workshop.

Submissions can be made via EasyChair at
https://www.easychair.org/conferences/?conf=farm2013.

Organizers
--

Workshop Chair: Paul Hudak
Program Chair: Conal Elliott
Publicity Chair: Brent Yorgey

Program Committee
-

Daniel Cukier (University of São Paulo)
Conal Elliott (Tabula) (chair)
Kathleen Fisher (Tufts University)
Richard Gabriel (IBM Research)
George Giorgidze (University of Tübingen)
Paul Hudak (Yale University)
José Pedro Magalhães (University of Oxford)
Alex McLean (University of Leeds)
John Peterson (Western State Colorado University)
Michael Sperber (Active Group)
Henning Thielemann
Brent Yorgey (University of Pennsylvania)

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


Re: [Haskell-cafe] GADTs and pattern matching

2013-06-19 Thread Brent Yorgey
On Wed, Jun 19, 2013 at 11:11:16AM +0100, Francesco Mazzoli wrote:
 At Wed, 19 Jun 2013 10:03:27 + (UTC),
 AntC wrote:
  Hi Francesco, I think you'll find that the 'annoyance' is nothing to do 
  with GADTs. I suggest you take the type signature off of foo1, and see 
  what type ghc infers for it. It isn't :: a - Foo a - Int.
  
  [...]
 
  Yep, that message explains what's going on well enough for me.
 
 Did you read the rest of the code?  That ought to work, because GHC
 infers and uses the type equality (something like ‘v ~ Var v1’) and uses
 it to coerce the ‘x’.
 
 And, surprise surprise, if the argument order is switched, it works!
 
 data Foo v where
 Foo :: forall v. Foo (Maybe v)
 
 foo1 :: Foo a - a - Int
 foo1 Foo Nothing  = undefined
 foo1 Foo (Just x) = undefined

Yes, I was going to suggest switching the argument order before
reading your message.  This is an interesting way in which you can
observe that Haskell does not really have multi-argument functions.
All multi-argument functions are really one-argument functions which
return functions.  So a function of type

  foo1 :: a - (Foo a - Int)

must take something of type a (for *any* choice of a, which the caller
gets to choose) and return a function of type (Foo a - Int).  *Which*
function is returned (e.g. one that tries to pattern match on the Foo)
makes no difference to whether foo1 typechecks.

On the other hand, a function of type

  foo2 :: Foo a - (a - Int)

receives something of type Foo a as an argument.  It may pattern-match
on the Foo a, thus bringing into scope the fact that (a ~ Maybe v).
Now when constructing the output function of type (a - Int) it may
make use of this fact.

-Brent

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


Re: [Haskell-cafe] ANN: Nomyx 0.2 beta, the game where you can change the rules

2013-06-19 Thread Brent Yorgey
This is great fun, more people should come and join us! =)

  http://www.nomyx.net:8000/Nomyx

we are playing game demo3.

-Brent

On Fri, Jun 14, 2013 at 05:57:57PM +0200, Corentin Dupont wrote:
 Hello everybody!
 Here it comes, the second beta release [1] of Nomyx, the only game where
 You can change the rules!!
 This is an implementation of a Nomic [2] game in Haskell (I believe the
 first complete implementation of a Nomic game on a computer). In a
 Nomyxgame you can change the rules of the game itself while playing
 it. The
 players can submit new rules or modify existing ones, thus completely
 changing the behaviour of the game through time. The rules are managed and
 interpreted by the computer. They must be written in the Nomyx language,
 which is a subset of Haskell.
 
 At the beginning, the initial rules are describing:
 - how to add new rules and change existing ones. For example a unanimity
 vote is necessary to have a new rule accepted.
 - how to win the game. For example you win the game if you have 5 rules
 accepted.
 But of course even that can be changed!
 
 Here is a video introduction and first tutorial of the game:
 http://vimeo.com/58265498
 The game is running here: www.nomyx.net:8000/Nomyx
 I have set up a forum where players can learn about Nomyx and discuss the
 rules they intend to propose: www.nomyx.net/forum
 The example file gives a lot of examples of rules that you can submit:
 www.nomyx.net:8000/src/Language/Nomyx/Examples.hs
 
 Changes from V0.1:
 - new login system: you can now login with your Google, Yahoo, Live
 Journal, Myspace, OpenId or Facebook accounts (thanks to
 happstack-authenticate)!
 - new DSL for voting (see below)
 - styling: rule code colorized, better settings and help
 - use cookies to store the user ID (as suggested on this mailing list)
 - new error system to handle exceptions in rules (with ErrorT)
 - use lenses
 
 I set up a little DSL to create elections (elect one of the players for a
 special role) or referendums (a yes/no question).
 You create in one line within Nomyx an vote with unanimity or majority, a
 quorum and different ballot systems. See here:
 http://www.nomyx.net/forum/viewtopic.php?f=3t=1518
 
 Let's test it! If you are interested, please go to this forum thread and
 we'll set up a small team to start a match!
 http://www.nomyx.net/forum/viewtopic.php?f=4t=1517
 The demo game is running here: www.nomyx.net:8000/Nomyx then select game
 demo2.
 As the first player of the game, I changed the initial unanimity vote to a
 simple majority, with a minimum of 2 players voting. Having your new rules
 accepted will be easy!
 Let's see who will win :)
 
 Cheers,
 Corentin
 
 [1] http://hackage.haskell.org/package/Nomyx
 [2] www.nomic.net

 ___
 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] GADTs and pattern matching

2013-06-19 Thread Brent Yorgey
Good point.  I stand corrected.

-Brent

On Wed, Jun 19, 2013 at 11:42:23AM -0300, Felipe Almeida Lessa wrote:
 Brent, maybe I'm misunderstanding what you're saying, but I don't
 think that the order of the arguments is playing any role here besides
 defining the order in which the pattern matches are desugared.
 
 To illustrate,
 
   -- This does work
   foo1' :: a - Foo a - Int
   foo1' m Foo = case m of
   Nothing - undefined
   Just _  - undefined
 
 Despite having the same type as foo1, foo1' does work because now I've
 pattern matched on the GADT first.  As soon as I do that, its equality
 constraint of (a ~ Maybe v) enters into scope of the case branches.
 
 Cheers,
 
 On Wed, Jun 19, 2013 at 7:59 AM, Brent Yorgey byor...@seas.upenn.edu wrote:
  On Wed, Jun 19, 2013 at 11:11:16AM +0100, Francesco Mazzoli wrote:
  At Wed, 19 Jun 2013 10:03:27 + (UTC),
  AntC wrote:
   Hi Francesco, I think you'll find that the 'annoyance' is nothing to do
   with GADTs. I suggest you take the type signature off of foo1, and see
   what type ghc infers for it. It isn't :: a - Foo a - Int.
  
   [...]
  
   Yep, that message explains what's going on well enough for me.
 
  Did you read the rest of the code?  That ought to work, because GHC
  infers and uses the type equality (something like ‘v ~ Var v1’) and uses
  it to coerce the ‘x’.
 
  And, surprise surprise, if the argument order is switched, it works!
 
  data Foo v where
  Foo :: forall v. Foo (Maybe v)
 
  foo1 :: Foo a - a - Int
  foo1 Foo Nothing  = undefined
  foo1 Foo (Just x) = undefined
 
  Yes, I was going to suggest switching the argument order before
  reading your message.  This is an interesting way in which you can
  observe that Haskell does not really have multi-argument functions.
  All multi-argument functions are really one-argument functions which
  return functions.  So a function of type
 
foo1 :: a - (Foo a - Int)
 
  must take something of type a (for *any* choice of a, which the caller
  gets to choose) and return a function of type (Foo a - Int).  *Which*
  function is returned (e.g. one that tries to pattern match on the Foo)
  makes no difference to whether foo1 typechecks.
 
  On the other hand, a function of type
 
foo2 :: Foo a - (a - Int)
 
  receives something of type Foo a as an argument.  It may pattern-match
  on the Foo a, thus bringing into scope the fact that (a ~ Maybe v).
  Now when constructing the output function of type (a - Int) it may
  make use of this fact.
 
  -Brent
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 
 
 -- 
 Felipe.
 
 ___
 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: Remove Enum from Float and Double

2013-06-18 Thread Brent Yorgey
On Wed, Jun 12, 2013 at 07:47:22AM +, harry wrote:
 Tillmann Rendel rendel@... writes:
 
  In general, I would be against removing features just because they are 
  confusing for beginners. I don't think that's a good design principle 
  for a language that is primarily targeted at professional programmers 
  and computer scientists.
 
 They're confusing to beginners because they don't have consistent or
 sensible semantics. That should bother the professional programmers and
 computer scientists too!

Sure, but in fact it's the entire Enum class which doesn't have a
consistent or sensible semantics, not just some particular instances.

-Brent

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


[Haskell-cafe] Second Call for Papers: Workshop on Functional Art, Music, Modeling, and Design (colocated with ICFP)

2013-05-22 Thread Brent Yorgey
Please submit something to FARM --- the deadline is fast approaching!

==
  FARM 2013: Call for Papers

  ACM SIGPLAN Workshop on Functional Art, Music, Modeling and Design
  Boston, Massachusetts, USA
  28th September, 2013 (directly after ICFP)

  http://www.cis.upenn.edu/~byorgey/farm13/
==

Scope
-

The functional programming community is largely interested in writing
beautiful programs. This workshop is intended to gather researchers and
practitioners interested in writing beautiful programs that generate
beautiful artifacts. Such artifacts may include visual art, music, 3D
sculptures, animations, GUIs, video games, physical models,
architectural models, choreographies for dance, poetry, and even
physical objects such as VLSI layouts, GPU configurations, or mechanical
engineering designs. The framework used need not be purely functional
(“mostly functional” is fine); may be based on abstractions such as
higher-order functions, monads, arrows, or streams; and may be
manifested as a domain specific language or tool. Theoretical
foundations, language design, implementation issues, and applications
are all within the scope of the workshop.

Important dates
---

  - Submissions due: Friday, 14 June 2013, 23:59 UTC-11 (American Samoa
time [1])

  - Author notification: Thursday, 11 July 2013

  - Final papers due: Thursday, 25 July 2013

  - Workshop: Saturday, 28 September 2013 (the day after ICFP)

[1] 
http://www.timeanddate.com/worldclock/fixedtime.html?msg=FARM+submissions+dueiso=20130614T2355p1=1033

Proceedings
---

There will be a formal proceedings published by ACM Press. Accepted
papers will be included in the ACM Digital Library; see
http://authors.acm.org/main.cfm for information on the options available
to authors. Authors are also encouraged to submit auxiliary material for
publication along with their paper (source code, data, videos, images,
etc.); authors retain all rights to the auxiliary material.

Submission details
--

We solicit submissions in two categories:

  - Full papers. A full paper is limited to 12 pages, and will be
evaluated according to its relevance, correctness, significance,
originality, and clarity. It should explain its contributions,
identify what has been accomplished, explain why it is significant,
and compare it with previous work.

  - Aesthetic applications. An aesthetic application paper is limited
to 6 pages, and will be judged primarily on the effective and
elegant use of FP to generate aesthetic artifacts (though the
criteria for full papers are still relevant).

Submitted papers should be in portable document format (PDF), formatted
using the ACM SIGPLAN style guidelines. The text should be in a 9-point
font in two columns.

Submissions can be made via EasyChair at

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

Organizers
--

Workshop Chair: Paul Hudak
Program Chair: Conal Elliott
Publicity Chair: Brent Yorgey

Program Committee
-

Daniel Cukier (University of São Paulo)
Conal Elliott (Tabula) (chair)
Kathleen Fisher (Tufts University)
Richard Gabriel (IBM Research)
George Giorgidze (University of Tübingen)
Paul Hudak (Yale University)
José Pedro Magalhães (University of Oxford)
Alex McLean (University of Leeds)
John Peterson (Western State Colorado University)
Michael Sperber (Active Group)
Henning Thielemann
Brent Yorgey (University of Pennsylvania)

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


Re: [Haskell-cafe] Yi Google summer of code project

2013-04-23 Thread Brent Yorgey
Generally, for a successful proposal you need to already find someone
who is willing to mentor the project.

Honestly, I do not think working on Yi would make for a very strong
proposal.  It is definitely a cool piece of software, and definitely
worth working on, but it does not have a very large userbase and so
the benefit of this project to the Haskell community would be small.

-Brent

On Mon, Apr 22, 2013 at 02:12:02PM -0400, Gmail wrote:
 Hello again,
 
 I forgot to ask if I need to find myself a mentor or one will be
 assigned to me by haskell.org?
 
 Many thanks,
 
 Bastien
 
 On 4/21/13 5:57 PM, Bastien Jacot-Guillarmod wrote:
 Hello,
 
 I'm interested in doing some improvments on the Yi editor for my Google
 summer of code by implementing a completion pop up list for any buffer and a
 smart completion for haskell.
 
 But I don't really know if this kind of project could be acceptable, for the
 following reason:
 
 1) Should a GSoC project be mostly a working experience or also a learning
 one? I am not the most seasoned haskell programmer, but I really which to
 dive into a real-life project in this language.
 
 2) Is it too long, too small? I don't have too many years of programmation
 in haskell behind me even if I have done some functionnal programming in
 other languages (Scala most of the time), hence I don't want to take
 something that will be overwhelming.
 
 3) is Yi associated with haskell.org or it is not possible to have a project
 on Yi while being mentored by haskell?
 
 Thanks for your insight!
 
 Regards,
 Bastien Jacot-Guillarmod, 3rd CS bachelor student at EPFL (Lausanne)
 
 
 
 
 --
 View this message in context: 
 http://haskell.1045720.n5.nabble.com/Yi-Google-summer-of-code-project-tp5729090.html
 Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
 
 ___
 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

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


Re: [Haskell-cafe] Haskell compilation errors break the complexity encapsulation on DSLs

2013-04-23 Thread Brent Yorgey
On Tue, Apr 23, 2013 at 12:49:59PM +0200, Alberto G. Corona  wrote:
 Hi
 
 I ever was worried about the barrier that the complexity of the Haskell
 errors impose to users of DSLs. Many DSLs look so simple that even someone
 without knowledge of Haskell can make use of them for some domains.
 
 However when the program is compiled then al the monsters of the
 deep appear in the surface: polymorphisms, undefined instances, type errors
 reported in a line produced by a type assumption in another,  etc. This is
 a problem for an industrial use of Haskell in the large scale. For obvious
 reasons.

Indeed.  For example, in my experience this is a big problem for diagrams.

 
 
 The question: Is it possible to develop a GHC extension that attach (or
 prepend) such an explanation to the ghc error?
 
 Or any other alternative that carry out the same functionality.

Surely it is possible.  I have wanted this too.  I guess the majority
of the work would just be in coming up with a good, general design
which is useful but not too difficult to implement.  If anyone wanted
to undertake such a project I would be happy to contribute some ideas.

-Brent

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


Re: [Haskell-cafe] Unbound: rebind and unrebind

2013-04-22 Thread Brent Yorgey
Hi Eric,

On Sun, Apr 14, 2013 at 10:57:43AM -0700, Eric Dobson wrote:
 I am working at reimplementing the library Unbound to understand how
 it works. One issue I have come up with is that an equation that I
 thought held true doesn't. The equation is: Forall e::Rebind a b, e
 `aeq` (uncurry rebind . unrebind $ e) = True. That is that spliting
 the binding of a rebind and then adding it back should be the
 identity. The issue is that Rebind does not freshen its pattern
 variables on unrebind, because it assumes that a higher level unbind
 already did that if required. But I believe this is not sufficient as
 there is not necesarily a higher level Bind to be ubound as shown by
 this program:

You're right that you *can* write a program involving a Rebind without
a higher level Bind.  But you *should not*.  This is explained in the
documentation [1] and in the paper [2]. Briefly, there are two classes of types,
term types and pattern types.  You should only use term types to
represent data in your programs.  Rebind constructs a pattern type,
and as such should only be used in the context of an enclosing Bind.
It would be much nicer if we were able to track this distinction
directly in Haskell's type system and somehow prevent users from using
pattern types directly, but we do not know of a way to do this.

-Brent

[1] 
http://hackage.haskell.org/packages/archive/unbound/0.4.1.1/doc/html/Unbound-LocallyNameless.html#g:4

[2] Stephanie Weirich, Brent A. Yorgey, and Tim Sheard. Binders
Unbound. ICFP'11, September 2011, Tokyo,
Japan. http://www.cis.upenn.edu/~byorgey/papers/binders-unbound.pdf.

 
 {-# LANGUAGE TemplateHaskell, UndecidableInstances,
   FlexibleInstances, MultiParamTypeClasses #-}
 module Main where
 
 import Unbound.LocallyNameless
 
 data Exp = Var (Name Exp) deriving Show
 $(derive [''Exp])
 
 instance Alpha Exp
 
 instance Subst Exp Exp where
isvar (Var x) = Just (SubstName x)
 
 x :: Name Exp
 x = string2Name x
 
 y :: Name Exp
 y = string2Name y
 
 
 rebindPass :: Alpha a = Rebind Exp a - Rebind Exp a
 rebindPass = (uncurry rebind . unrebind)
 
 main :: IO ()
 main = do
   let rebound = (rebind (Var y) (Embed (Var x)))
   print $ rebound
   let substed = subst x (Var y) rebound
   print $ substed
   print $ unrebind substed
   print $ rebindPass substed
 
 Which outputs:
 Var y {Var x}
 Var y {Var y}
 (Var y,{Var y})
 Var y {Var 0@0}
 
 If the equation holds true then the second and fourth lines should be
 identical but they are not. Can someone explain why this is the
 correct behavior or if the implementation is incorrect?
 
 ___
 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


[Haskell-cafe] Call for Papers: Workshop on Functional Art, Music, Modeling, and Design (colocated with ICFP)

2013-04-17 Thread Brent Yorgey
==
  FARM 2013: Call for Papers

  ACM SIGPLAN Workshop on Functional Art, Music, Modeling and Design
  Boston, Massachusetts, USA
  28th September, 2013 (directly after ICFP)

  http://www.cis.upenn.edu/~byorgey/farm13/
==

Scope
-

The functional programming community is largely interested in writing
beautiful programs. This workshop is intended to gather researchers and
practitioners interested in writing beautiful programs that generate
beautiful artifacts. Such artifacts may include visual art, music, 3D
sculptures, animations, GUIs, video games, physical models,
architectural models, choreographies for dance, poetry, and even
physical objects such as VLSI layouts, GPU configurations, or mechanical
engineering designs. The framework used need not be purely functional
(“mostly functional” is fine); may be based on abstractions such as
higher-order functions, monads, arrows, or streams; and may be
manifested as a domain specific language or tool. Theoretical
foundations, language design, implementation issues, and applications
are all within the scope of the workshop.

Important dates
---

  - Submissions due: Friday, 14 June 2013, 23:59 UTC-11 (American Samoa
time [1])

  - Author notification: Thursday, 11 July 2013

  - Final papers due: Thursday, 25 July 2013

  - Workshop: Saturday, 28 September 2013 (the day after ICFP)

[1] 
http://www.timeanddate.com/worldclock/fixedtime.html?msg=FARM+submissions+dueiso=20130614T2355p1=1033

Proceedings
---

There will be a formal proceedings published by ACM Press. Accepted
papers will be included in the ACM Digital Library; see
http://authors.acm.org/main.cfm for information on the options available
to authors. Authors are also encouraged to submit auxiliary material for
publication along with their paper (source code, data, videos, images,
etc.); authors retain all rights to the auxiliary material.

Submission details
--

We solicit submissions in two categories:

  - Full papers. A full paper is limited to 12 pages, and will be
evaluated according to its relevance, correctness, significance,
originality, and clarity. It should explain its contributions,
identify what has been accomplished, explain why it is significant,
and compare it with previous work.

  - Aesthetic applications. An aesthetic application paper is limited
to 6 pages, and will be judged primarily on the effective and
elegant use of FP to generate aesthetic artifacts (though the
criteria for full papers are still relevant).

Submitted papers should be in portable document format (PDF), formatted
using the ACM SIGPLAN style guidelines. The text should be in a 9-point
font in two columns.

Submissions can be made via EasyChair at

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

Organizers
--

Workshop Chair: Paul Hudak
Program Chair: Conal Elliott
Publicity Chair: Brent Yorgey

Program Committee
-

Daniel Cukier (AgileAndArt)
Conal Elliott (Tabula) (chair)
Kathleen Fisher (Tufts University)
Richard Gabriel (IBM Research)
George Giorgidze (University of Tübingen)
Paul Hudak (Yale University)
José Pedro Magalhães (University of Oxford)
Alex McLean (ICSRiM)
John Peterson (Western State Colorado University)
Michael Sperber (Active Group)
Henning Thielemann (Martin-Luther-Universität Halle-Wittenberg)
Brent Yorgey (University of Pennsylvania)

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


Re: [Haskell-cafe] [Haskell] ANN: adobe-swatch-exchange-0.1.0.0

2013-04-04 Thread Brent Yorgey
(Redirecting follow-up to haskell-cafe)

Very cool!  I have been hoping someone will find a way to integrate
kuler.adobe.com with diagrams, and this will help a lot. =)

  https://github.com/diagrams/diagrams-lib/issues/77

-Brent

On Wed, Apr 03, 2013 at 06:49:34PM -0500, Jeremy Shaw wrote:
 I am pleased to annouce the release of adobe-swatch-exchange 0.1.0.0.
 
 My primary motivation in writing this is to make it easier to download
 color swatches from http://kuler.adobe.com/ and test them on my site.
 Though, perhaps there is already a great way of doing this and I
 didn't look hard enough.
 
 But, the end result is we can now read and write .ASE files in Haskell
 and convert them to .css. So that probably opens up some new
 possibilities.
 
 I have provided both a library and an executable.
 
 I have also used this as a way to test the waters with github,
 
 https://github.com/stepcut/ase2css
 
 I heard putting things on github will get me all sorts of
 contributors. I suggest someone start with haddock comments. ;)
 
 Cheers!
 - jeremy
 
 ___
 Haskell mailing list
 hask...@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell

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


Re: [Haskell-cafe] cabal install pandoc

2013-03-31 Thread Brent Yorgey
On Fri, Mar 29, 2013 at 08:05:47AM -0230, Roger Mason wrote:
 Thank you for your response.  'ghc-pkg check' shows some problems:
 
 http://pastebin.ca/2344794
 
 On 03/28/2013 08:01 PM, Patrick Wheeler wrote:
 So I printed off the requirements for pandoc on a empty ghc-7.6.2
 install you can find it at:
 http://hpaste.org/84794
 
 I do not see any odd package versions listed in what you posted so far.
 
 No promise I will be able to help afterwards but it might help to
 see the full log, and then again with verbosity turned on. So
 seperate pastes for:
 
 * `cabal install pandoc --dry-run`
 * `cabal install pandoc --dry-run --verbose=2`
 * `cabal install pandoc --dry-run --verbose=3`
 
 You might also want to run a `ghc-pkg check` to check to see if
 your packages are consistent/unbroken.
 
 
 'ghc-pkg check' shows some problems:
 
 http://pastebin.ca/2344794
 

It looks like your entire Haskell Platform installation is completely
hosed.  Sad to say, but I think your best bet is to simply reinstall
the Haskell Platform.

-Brent

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


Re: Allowing (Char ~ Bool = Void)?

2013-03-26 Thread Brent Yorgey
On Sun, Mar 24, 2013 at 10:49:24AM -0400, Richard Eisenberg wrote:
 Though I've never run into the problem Shachaf mentions, this certainly seems 
 useful. However, when testing Shachaf's code, I get the same error that I get 
 when writing an impossible branch of a case statement. I imagine that the 
 same code in GHC powers both scenarios, so any change would have to be 
 careful to preserve the case-branch behavior, which (I think) is useful.
 
 Perhaps a general solution to this problem is to have some new term
 construct contra (supply a better name please!) that can be used
 only when there is an inconsistent equality in the context but can
 typecheck at any type. With contra, we could allow impossible case
 branches, because now there would be something sensible to put
 there. This would be an alternate effective solution to
 long-standing bug #3927, which is about checking exhaustiveness of
 case matches.

+1 for contra.  Alternative name suggestions: 'exfalso', 'shazam',
'pizza'.

-Brent



 
 On Mar 24, 2013, at 5:16 AM, Shachaf Ben-Kiki shac...@gmail.com wrote:
 
  Is there a good reason that GHC doesn't allow any value of type (Char
  ~ Bool = Void), even undefined?
  
  There are various use cases for this. It's allowed indirectly, via
  GADT pattern matches -- foo :: Is Char Bool - Void; foo x = case x
  of {} (with EmptyCase in HEAD) -- but not directly.
  
  One thing this prevents, for instance, is CPSifying GADTs:
  
 data Foo a = a ~ Char = A | a ~ Bool = B -- valid
 newtype Bar a = Bar { runBar :: forall r. (a ~ Char = r) - (a ~
  Bool = r) - r } -- unusable
  
  Trying to use a type like the latter in practice runs into problems
  quickly because one needs to provide an absurd value of type (Char ~
  Bool = r), which is generally impossible (even if we're willing to
  cheat with ⊥!). It seems that this sort of thing should be doable.
  
 Shachaf
  
  ___
  Glasgow-haskell-users mailing list
  Glasgow-haskell-users@haskell.org
  http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
  
 
 
 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Enumerating functions at runtime

2013-03-24 Thread Brent Yorgey
On Sat, Mar 23, 2013 at 08:26:52PM -0700, Luke Evans wrote:
 I'm curious about using Haskell for metaprogramming.
 
 It looks like I can dynamically compile, load and run some Haskell with the 
 plugins package.  Actually I've briefly tried this and it seems to work for 
 some simple cases at least.
 Now I would like to be able to enumerate precompiled public functions in 
 modules that I might use as building blocks in such dynamic compilation.  So 
 far I'm not seeing anything that does this directly.
 Can anyone provide some pointers?
 
 If it's just not possible to introspect on compiled modules, then I suppose I 
 could use external metadata of my own, or even perhaps haddock info if it 
 exists, to attempt to generate this info.  Clearly though, that's nowhere 
 near as good as extracting the info from something the compiler built 
 directly.

I have no idea how it works, but I'm pretty sure yi does this ---
e.g. if you hit M-x (when in emacs emulation mode) and then
tab-complete, you see a list of all the available functions.  Maybe
you want to take a look at the yi source code and see how they do it.

-Brent

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


Re: [Haskell-cafe] Excercise on tagless final interpreters

2013-03-21 Thread Brent Yorgey
On Thu, Mar 21, 2013 at 11:32:21AM +0100, matteo vezzola wrote:
 I'm playing with tagless final interpreters reading [1], using a very simple 
 language:
 
  class Ints repr where
  int :: Integer - repr Integer
  (.+.) :: repr Integer - repr Integer - repr Integer
  (.*.) :: repr Integer - repr Integer - repr Integer
  (.-.) :: repr Integer - repr Integer
  (.=.) :: repr Integer - repr Integer - repr Bool
 
  newtype P repr t = P { unP :: Bool - repr t }
  instance Ints repr = Ints (P repr) where
  int n = P $ \ s - if s then int n else (.-.) (int n)
  (.-.) n = P $ unP n . not
  n .+. m = P $ \ s - unP n s .+. unP m s

  n .*. m = P $ \ s - unP n s .*. unP m s
  n .=. m = P $ \ s - unP n s .=. unP m s

Incidentally, these last two lines seem wrong.  It is not the case
that -(n*m) = (-n)*(-m) or that  n = m  iff  (-n) = (-m).

-Brent

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


Re: [Haskell-cafe] A question about data declaration

2013-03-21 Thread Brent Yorgey
On Thu, Mar 21, 2013 at 06:18:46PM +0530, C K Kashyap wrote:
 Hi,
 
 I have a situation where I need to define a data type T such that
 
 data T = C1 Int | C2 Char | C3 T
 
 However, I want to enforce a constraint that C3 only allows (C2 Char) and
 not (C1 Int). That is

If C3 should only be able to hold a C2 Char, then why have it hold a T
at all?  i.e. why not

  data T = C1 Int | C2 Char | C3 Char

but I suppose your real problem is probably more complicated, in which
case I would recommend using a GADT as others have suggested.

-Brent

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


Re: [Haskell-cafe] Open-source projects for beginning Haskell students?

2013-03-11 Thread Brent Yorgey
On Mon, Mar 11, 2013 at 11:50:38AM -0700, Ben wrote:
 
 On Mar 11, 2013, at 11:26 AM, Jason Dagit wrote:
 
  Myself and several of my friends would find it useful to have a plotting 
  library that we can use from ghci to quickly/easily visualize data. 
  Especially if that data is part of a simulation we are toying with. 
  Therefore, this proposal is for: A gnuplot-, matlab- or plotinum-like 
  plotting API (that uses diagrams as the backend?). The things to emphasize:
* Easy to install: No gtk2hs requirement. Preferably just pure haskell 
  code and similar for any dependencies. Must be cross platform.
* Frontend: graphs should be easy to construct; customizability is not as 
  important
* Backend: options for generating static images are nice, but for the use 
  case we have in mind also being able to render in a window from ghci is 
  very valuable. (this could imply something as purely rendering to 
  JuicyPixels and I could write the rendering code)
   
  * What I would hope from you is a willingness to exchange email and/or
chat with the student(s) over the course of the project, to give
them a bit of guidance/mentoring.  I am certainly willing to help on
that front, but of course I probably don't know much about your
particular project.
  
  I am willing/able to take on the mentoring aspect :)
 
 i second this, but with a different emphasis.  i would like a ggplot2-type 
 DSL for generating graphs, for data analysis and exploration.  i agree with :
 
 * it would be great to have no gtk2hs / cairo requirement.  (i guess this 
 means text rendering in the diagrams-svg backend needs to be solved.)  i 
 guess in the near-term, this is less important to me -- having a proper 
 plotting DSL at all is an important start.
 
 * frontend : graphs should be easy to construct, but having some flexibility 
 is important.  the application here is being able to explore statistical 
 data, with slicing, grouping, highlighting, faceting, etc.
 
 * backend : static images are enough for me, interactive is a plus.  most 
 importantly : it should be fast enough to work pleasantly with large 
 datasets.  ggplot2 is pretty awesome but kills my machine, routinely.

Not to throw cold water on these ideas (which sound fantastic!), but
the scope of this sounds more like a GSoC project than something a
beginner could accomplish in 10-15 hours in the space of a few weeks.
I'm looking not for project ideas but for small, concrete
contributions they could make to existing open source projects.

-Brent

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


Re: [Haskell-cafe] Trouble installing and using Chart/cairo on windows 7

2013-03-04 Thread Brent Yorgey
On Sun, Mar 03, 2013 at 05:38:02PM -0800, bri...@aracnet.com wrote:
 On Sun, 3 Mar 2013 19:58:37 -0500
 Brent Yorgey byor...@seas.upenn.edu wrote:
 
  
  Good access to fonts and font metrics is the kicker.  Otherwise I'd
  say to switch to using diagrams as a backend, hence getting a whole
  bunch of actual backends for free.  I would love to see development of
  some good Haskell font packages -- maybe it would even make a good
  GSoC project?  Unfortunately I don't know enough about it to even know
  what would be involved, or how much work it would be.
  
 
 I assume that to use diagram the font package would have to be a vector font 
 system, or could bit-mapped fonts be used ?

A vector font system would be ideal, as then you could go crazy
turning glyphs into paths and doing whatever the heck you want with
them using the diagrams framework.  However, bit-mapped fonts could be
used too (as long as there is a backend to support them), it would
just be less useful.

-Brent

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


Re: [Haskell-cafe] Trouble installing and using Chart/cairo on windows 7

2013-03-04 Thread Brent Yorgey
On Mon, Mar 04, 2013 at 02:30:55PM -0800, bri...@aracnet.com wrote:
 On Mon, 4 Mar 2013 17:27:29 -0500
 Brent Yorgey byor...@seas.upenn.edu wrote:
 
  On Sun, Mar 03, 2013 at 05:38:02PM -0800, bri...@aracnet.com wrote:
   On Sun, 3 Mar 2013 19:58:37 -0500
   Brent Yorgey byor...@seas.upenn.edu wrote:
   

Good access to fonts and font metrics is the kicker.  Otherwise I'd
say to switch to using diagrams as a backend, hence getting a whole
bunch of actual backends for free.  I would love to see development of
some good Haskell font packages -- maybe it would even make a good
GSoC project?  Unfortunately I don't know enough about it to even know
what would be involved, or how much work it would be.

   
   I assume that to use diagram the font package would have to be a vector 
   font system, or could bit-mapped fonts be used ?
  
  A vector font system would be ideal, as then you could go crazy
  turning glyphs into paths and doing whatever the heck you want with
  them using the diagrams framework.  However, bit-mapped fonts could be
  used too (as long as there is a backend to support them), it would
  just be less useful.
  
 
 yes - seems to me that vector fonts are definitely the way to go.
 
 it seems like this problem has to already have a solution.  maybe all that's 
 needed is a font importer which understands some, already established, vector 
 font  representation.
 

Well, there is the SVGFonts package:

  http://hackage.haskell.org/package/SVGFonts

I don't have a good sense of how widely supported this representation
is, or how easy it is to convert between it and other font
representations.

-Brent

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


Re: [Haskell-cafe] Trouble installing and using Chart/cairo on windows 7

2013-03-03 Thread Brent Yorgey
On Sun, Mar 03, 2013 at 09:22:15PM +0100, Arnaud Bailly wrote:
 Hello,
 I am trying to install timeplot and splot on a windows 7 host, using
 Haskell platform 2012.2.0.0, and I have troubles installing HSChart.
 
 First difficulties were installing cairo, which requires Gtk+ libraries and
 headers. I installed those using a Gtk+-bundle, first in c:\Program Files\.
 I had to move to d:\soft (eg. a directory without spaces) to be able to
 install cairo.
 
 Then I tried to install Chart and at first failed with a cryptic 'Exit
 Failure 1' error from cabal. I succeeded when I redirected cabal output to
 a file, eg: cabal install  out 21 whereas a plain 'cabal install' failed.
 
 Then I managed to install splot and timeplot. I then tried to use Chart to
 draw a simple chart, following
 http://hackage.haskell.org/packages/archive/Chart/0.16/doc/html/Graphics-Rendering-Chart-Simple.htmland
 it hang forever with a CPU at 100%.

No idea if it's related, but hanging forever with the CPU at 100%
reminds me of this:

  http://code.google.com/p/diagrams/issues/detail?id=71

Unfortunately, GTK + cairo are notoriously difficult to install on
OSX and Windows.

-Brent

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


Re: [Haskell-cafe] Trouble installing and using Chart/cairo on windows 7

2013-03-03 Thread Brent Yorgey
On Mon, Mar 04, 2013 at 11:26:23AM +1100, Tim Docker wrote:
 On 04/03/13 07:22, Arnaud Bailly wrote:
 Then I managed to install splot and timeplot. I then tried to use
 Chart to draw a simple chart, following 
 http://hackage.haskell.org/packages/archive/Chart/0.16/doc/html/Graphics-Rendering-Chart-Simple.html
 and it hang forever with a CPU at 100%.
 
 As the author of the Chart library, I'm sorry to say I don't know.
 Chart is developed under linux, and I do occasional testing under
 osx, but I don't use windows at all. Chart is a pure haskell library
 sitting over cairo, so it is most likely a cairo problem rather than
 a chart one, but I realise this doesn't help you.
 
 Do the examples that come with the haskell binding to cairo work for you?
 
 Windows and gtk continues to be problematic for many users. I'd love
 to see an alternative backend for the chart library, but I would need
 a graphics API that installs easily under windows, osx and linux, and
 provides good access to fonts and font metrics. Any suggestions?

Good access to fonts and font metrics is the kicker.  Otherwise I'd
say to switch to using diagrams as a backend, hence getting a whole
bunch of actual backends for free.  I would love to see development of
some good Haskell font packages -- maybe it would even make a good
GSoC project?  Unfortunately I don't know enough about it to even know
what would be involved, or how much work it would be.

-Brent

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


Re: [Haskell-cafe] Split and substitution using regex-pcre

2013-02-28 Thread Brent Yorgey
On Fri, Mar 01, 2013 at 08:30:20AM +1300, Alistair Bayley wrote:
 You cannot bend the split package to your needs?
 http://hackage.haskell.org/packages/archive/split/0.2.1.2/doc/html/Data-List-Split.html
 
 Some combination of splitWhen and a pcre-based predicate?

This won't work; splitWhen operates only on single list elements, not
on substrings.

-Brent

 On 24 February 2013 22:44, Simon Marechal si...@banquise.net wrote:
 
  I could not find the perl-equivalents of these functions on Hackage, so
  I quickly wrote mine. Code is there:
 
  https://github.com/bartavelle/pcre-utils
 
  It should behave like perl (not really tested actually), and do strange
  things like :
 
   splitCompile a b
  Right [b]
   splitCompile a baaa
  Right [b]
 
  This will go on Hackage as I need it for the language-puppet package,
  but I am interested in comments, especially concerning the namespaces:
  * is the name of this package OK ?
  * is the name of the package OK ?
  * should I work with the regex-pcre maintainer to try to merge it ?
 
 
  ___
  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


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


Re: [Haskell-cafe] cabal install ghc-mod installs 3 years old version

2013-02-25 Thread Brent Yorgey
On Sun, Feb 24, 2013 at 02:33:55PM +, Niklas Hambüchen wrote:
 You are right, my ghc-7.4.2 was broken in ghc-pkg list; I fixed the
 problem by killing my .cabal folder (as so often).

Surely you mean by killing your .ghc folder?  I do not see what effect
killing your .cabal folder could possibly have on broken packages.

-Brent

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


Re: [Haskell-cafe] Type checking the content of a string

2013-02-23 Thread Brent Yorgey
On Fri, Feb 22, 2013 at 06:44:06PM +0100, Corentin Dupont wrote:
 Hi all,
 I have a program able to read another program as a string, and interpret it
 (using Hint).
 I'd like to make unit tests, so I have a file Test.hs containing a serie
 of test programs as strings.
 However, how could I be sure that these test program are syntactically
 valid, at compile time?

If you just want to check whether a program is syntactically valid,
you can use the haskell-src-exts package to parse it.  If you also
want to do some type checking you can try the haskell-type-exts
package.

-Brent

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


Re: missing mtl (which exists) when installing filemanip package

2013-01-10 Thread Brent Yorgey
On Thu, Jan 10, 2013 at 10:34:19AM -0500, HP Wei wrote:
 
 I did the following:
   download filemanip-0.3.6.2.tar.gz
   tar xvf ...
   cd filemanip-0.3.6.2
   runhaskell Setup configure --prefix=$HOME/ghc
 
   -- it tells me
   Setup: At least the following dependencies are missing:
   mtl -any, unix-compat -any

This is because by default, 'runhaskell Setup configure' tries to
install things in the global package DB, and those packages are
installed in the local package DB so it cannot use them.

One solution is to pass '--user' to runhaskell Setup configure.

HOWEVER, these days you should not call Setup directly.  Instead, use
the cabal-install tool (which comes with the Haskell platform).  So
you should just be able to say

  cabal install filemanip

instead of downloading it manually and calling Setup.

-Brent

 
 So, I did the following:
download unix-compat-0.4.1.0.tar.gz
tar xvf ...
cd unix-compat-0.4.1.0
runhaskell Setup configure --prefix=$HOME/ghc
runhaskell Setup build
runhaskell Setup install
 
   -- under $HOME/ghc/lib
   I see unix-compat-0.4.1.0/ that was newly added by the Setup
   processes.
 
   -- under $HOME/ghc/lib
   I also see mtl-2.0.1.0/
   This was there already before the above operations.
 
 Then, I went back
cd filemanip-0.3.6.2
runhaskell Setup configure --prefix=$HOME/ghc
 
-- it tells me
Setup: At least the following dependencies are missing:
mtl -any
 
 Question:
why can't $HOME/ghc/lib/mtl-2.0.1.0/
be recognized during the above Setup configure ??
 
What do I need to do ?
 
 thanks
 HP
 
 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Fundeps and type equality

2012-12-26 Thread Brent Yorgey
I don't think that's true (though a few minutes of searching has not
yet turned up anything describing the original motivation for data
families).  Sometimes you really do want to construct a family of new
data types, instead of just mapping to existing ones.  I think
everyone agrees that using data families as a stand-in for injective
type families is a kludgy hack.

-Brent

On Wed, Dec 26, 2012 at 09:19:56PM +0200, Roman Cheplyaka wrote:
 I presume that injectivity of type families is the sole reason why data
 families exist.
 
 Roman
 
 * Conal Elliott co...@conal.net [2012-12-26 10:23:46-0800]
  Hi Iavor,
  
  Thanks much for the explanation.
  
  Before this experiment with FDs, I was using a type family. I tried
  switching to FDs, because I wanted the compiler to know that the family is
  injective in order to assist type-checking. Can we declare type families to
  be injective? Now I see that I ran into a similar problem almost two years
  ago:
  http://haskell.1045720.n5.nabble.com/Injective-type-families-td3385084.html.
  I guess the answer is still no, judging by this ticket:
  http://hackage.haskell.org/trac/ghc/ticket/6018 .
  
  -- Conal
  
  
  On Tue, Dec 25, 2012 at 6:47 PM, Iavor Diatchki 
  iavor.diatc...@gmail.comwrote:
  
   Hello Conal,
  
   GHC implementation of functional dependencies is incomplete: it will use
   functional dependencies during type inference (i.e., to determine the
   values of free type variables), but it will not use them in proofs, which
   is what is needed in examples like the one you posted.  The reason some
   proving is needed is that the compiler needs to figure out that for each
   instantiation of the type `ta` and `tb` will be the same (which, of 
   course,
   follows directly from the FD on the class).
  
   As far as I understand, the reason that GHC does not construct such proofs
   is that it can't express them in its internal proof language (System FC).
It seems to me that it should be fairly straight-forward to extend FC to
   support this sort of proof, but I have not been able to convince folks 
   that
   this is the case.  I could elaborate, if there's interest.
  
   In the mean time, the way forward would probably be to express the
   dependency using type families, which I find tends to be more verbose but,
   at present, is better supported in GHC.
  
   Cheers,
   -Iavor
   PS: cc-ing the GHC users' list, as there was some talk of closing the
   ghc-bugs list, but I am not sure if the transition happened yet.
  
  
  
  
  
   On Tue, Dec 25, 2012 at 6:15 PM, Conal Elliott co...@conal.net wrote:
  
   I ran into a simple falure with functional dependencies (in GHC 7.4.1):
  
class Foo a ta | a - ta
   
foo :: (Foo a ta, Foo a tb, Eq ta) = ta - tb - Bool
foo = (==)
  
   I expected that the `a - ta` functional dependency would suffice to
   prove that `ta ~ tb`, but
  
   Pixie/Bug1.hs:9:7:
   Could not deduce (ta ~ tb)
   from the context (Foo a ta, Foo a tb, Eq ta)
 bound by the type signature for
foo :: (Foo a ta, Foo a tb, Eq ta) = ta - tb -
   Bool
 at Pixie/Bug1.hs:9:1-10
 `ta' is a rigid type variable bound by
  the type signature for
foo :: (Foo a ta, Foo a tb, Eq ta) = ta - tb - Bool
  at Pixie/Bug1.hs:9:1
 `tb' is a rigid type variable bound by
  the type signature for
foo :: (Foo a ta, Foo a tb, Eq ta) = ta - tb - Bool
  at Pixie/Bug1.hs:9:1
   Expected type: ta - tb - Bool
 Actual type: ta - ta - Bool
   In the expression: (==)
   In an equation for `foo': foo = (==)
   Failed, modules loaded: none.
  
   Any insights about what's going wrong here?
  
   -- Conal
  
   ___
   Glasgow-haskell-bugs mailing list
   glasgow-haskell-b...@haskell.org
   http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
  
  
  
 
  ___
  Glasgow-haskell-users mailing list
  Glasgow-haskell-users@haskell.org
  http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 
 
 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-15 Thread Brent Yorgey
On Sat, Dec 15, 2012 at 08:13:44AM +0100, Petr P wrote:
 This is strange, I thought that cpphs should be specified in
 build-tools:, not in build-depends:.
 
 http://www.haskell.org/cabal/users-guide/developing-packages.html#build-information
 
 
 Best regards,
 Petr

Presumably the reason to list it in build-depends instead of
build-tools is that in the latter case cabal will not automatically
install it as a dependency.  But you are right that this is a strange
situation, since if it is being used only as a preprocessor,
semantically it ought to be listed in build-tools.

-Brent

 2012/12/13 Michael Snoyman mich...@snoyman.com
 
 
 
 
  On Thu, Dec 13, 2012 at 9:51 PM, Daniel Trstenjak 
  daniel.trsten...@gmail.com wrote:
 
 
  On Thu, Dec 13, 2012 at 08:40:09PM +0200, Michael Snoyman wrote:
   If you have a commercial use for cpphs, and feel the terms of the (L)GPL
   are too onerous, you have the option of distributing unmodified binaries
   (only, not sources) under the terms of a different licence (see
   LICENCE-commercial).
 
  I think that depedencies to binaries, like cpphs, should be treated
  differently than depedencies to libraries, because using a (L)GPL-ed
  binary mostly hasn't any implications for a commercial user and
  also for the output of a (L)GPL-ed binary usually the (L)GPL doesn't
  apply.
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 
  In the case of cpphs, there's no way to determine that we're using it as a
  library or an executable, since it's just listed in the build-depends.
 
  Michael
 
  ___
  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


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


[Haskell] ANN: diagrams-0.6

2012-12-11 Thread Brent Yorgey
I am pleased to announce the release of version 0.6 of diagrams [1], a
full-featured framework and embedded domain-specific language for
declarative drawing. Check out the gallery [2] for examples of what it
can do! [3,4]

[1] http://projects.haskell.org/diagrams  
[2] http://projects.haskell.org/diagrams/gallery.html  
[3] http://mathlesstraveled.com/2012/11/05/more-factorization-diagrams/  
[4] http://projects.haskell.org/diagrams/gallery/PythagoreanTree.html  

Highlights of this release include:

-   Diagrams now comes with a native-Haskell SVG backend [5] by default.
If you were holding off on trying diagrams because you couldn't
install cairo, you no longer have an excuse!

-   Proper support for subdiagrams: previous versions of diagrams-core
had a mechanism for associating names with a pair of a location and
an envelope. Now, names are associated with actual subdiagrams
(including their location and envelope, along with all the other
information stored by a diagram). This enables cool techniques like
constructing a diagram in order to position its subelements and then
taking it apart again, or constructing animations via keyframing.

-   Traces: in addition to an envelope, each diagram now stores a
trace, which is like an embedded raytracer: given any ray
(represented by a base point and a vector), the trace computes the
closest point of intersection with the diagram along the ray. This
is useful for determining points on the boundary of a diagram, e.g.
when drawing arrows between diagrams.

-   The core data structure underlying diagrams has been completely
refactored and split out into its own separate package, dual-tree
[6].

-   Support for GHC 7.6.

-   Many more new features, bug fixes, and improvements! See the release
notes [7] for complete details, and the diagrams wiki [8] for help
migrating from 0.5 to 0.6.

[5] http://hackage.haskell.org/package/diagrams%2Dsvg  
[6] http://hackage.haskell.org/package/dual%2Dtree  
[7] http://projects.haskell.org/diagrams/releases.html  

Try it out
--

For the truly impatient:

cabal install diagrams

Diagrams is supported under GHC 7.0 through 7.6, with the exception that
the cairo and gtk backends do not build under GHC 7.0 (but the SVG
backend does), and the gtk backend does not build under GHC 7.6.

To get started with diagrams, read the quick tutorial [9], which will
introduce you to the fundamentals of the framework.

For those who are less impatient and want to really dig in and use the
power features, read the user manual [10].

[8] http://www.haskell.org/haskellwiki/Diagrams/Migrate0.6  
[9] http://projects.haskell.org/diagrams/tutorial/DiagramsTutorial.html  
[10] http://projects.haskell.org/manual/diagrams-manual.html  

Get involved


Subscribe to the project mailing list [11], and/or come hang out in the
#diagrams IRC channel on freenode.org for help and discussion. Make some
diagrams. Fix some bugs [12]. Submit your cool examples for inclusion in
the gallery [13] or your cool code for inclusion in the diagrams-contrib
[14] package!

[11] http://groups.google.com/group/diagrams-discuss  
[12] http://github.com/diagrams/  
[13] http://projects.haskell.org/diagrams/gallery.html  
[14] http://hackage.haskell.org/package/diagrams%2Dcontrib

Happy diagramming!

Brought to you by the diagrams team:

-   Michael Sloan
-   Ryan Yates
-   Brent Yorgey

with contributions from:

-   Sam Griffin
-   Niklas Haas
-   Peter Hall
-   Claude Heiland-Allen
-   Deepak Jois
-   John Lato
-   Felipe Lessa
-   Chris Mears
-   Ian Ross
-   Vilhelm Sjöberg
-   Jim Snavely
-   Luite Stegeman
-   Kanchalai Suveepattananont
-   Michael Thompson
-   Scott Walck

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


[Haskell-cafe] ANN: diagrams-0.6

2012-12-11 Thread Brent Yorgey
I am pleased to announce the release of version 0.6 of diagrams [1], a
full-featured framework and embedded domain-specific language for
declarative drawing. Check out the gallery [2] for examples of what it
can do! [3,4]

[1] http://projects.haskell.org/diagrams  
[2] http://projects.haskell.org/diagrams/gallery.html  
[3] http://mathlesstraveled.com/2012/11/05/more-factorization-diagrams/  
[4] http://projects.haskell.org/diagrams/gallery/PythagoreanTree.html  

Highlights of this release include:

-   Diagrams now comes with a native-Haskell SVG backend [5] by default.
If you were holding off on trying diagrams because you couldn't
install cairo, you no longer have an excuse!

-   Proper support for subdiagrams: previous versions of diagrams-core
had a mechanism for associating names with a pair of a location and
an envelope. Now, names are associated with actual subdiagrams
(including their location and envelope, along with all the other
information stored by a diagram). This enables cool techniques like
constructing a diagram in order to position its subelements and then
taking it apart again, or constructing animations via keyframing.

-   Traces: in addition to an envelope, each diagram now stores a
trace, which is like an embedded raytracer: given any ray
(represented by a base point and a vector), the trace computes the
closest point of intersection with the diagram along the ray. This
is useful for determining points on the boundary of a diagram, e.g.
when drawing arrows between diagrams.

-   The core data structure underlying diagrams has been completely
refactored and split out into its own separate package, dual-tree
[6].

-   Support for GHC 7.6.

-   Many more new features, bug fixes, and improvements! See the release
notes [7] for complete details, and the diagrams wiki [8] for help
migrating from 0.5 to 0.6.

[5] http://hackage.haskell.org/package/diagrams%2Dsvg  
[6] http://hackage.haskell.org/package/dual%2Dtree  
[7] http://projects.haskell.org/diagrams/releases.html  

Try it out
--

For the truly impatient:

cabal install diagrams

Diagrams is supported under GHC 7.0 through 7.6, with the exception that
the cairo and gtk backends do not build under GHC 7.0 (but the SVG
backend does), and the gtk backend does not build under GHC 7.6.

To get started with diagrams, read the quick tutorial [9], which will
introduce you to the fundamentals of the framework.

For those who are less impatient and want to really dig in and use the
power features, read the user manual [10].

[8] http://www.haskell.org/haskellwiki/Diagrams/Migrate0.6  
[9] http://projects.haskell.org/diagrams/tutorial/DiagramsTutorial.html  
[10] http://projects.haskell.org/manual/diagrams-manual.html  

Get involved


Subscribe to the project mailing list [11], and/or come hang out in the
#diagrams IRC channel on freenode.org for help and discussion. Make some
diagrams. Fix some bugs [12]. Submit your cool examples for inclusion in
the gallery [13] or your cool code for inclusion in the diagrams-contrib
[14] package!

[11] http://groups.google.com/group/diagrams-discuss  
[12] http://github.com/diagrams/  
[13] http://projects.haskell.org/diagrams/gallery.html  
[14] http://hackage.haskell.org/package/diagrams%2Dcontrib

Happy diagramming!

Brought to you by the diagrams team:

-   Michael Sloan
-   Ryan Yates
-   Brent Yorgey

with contributions from:

-   Sam Griffin
-   Niklas Haas
-   Peter Hall
-   Claude Heiland-Allen
-   Deepak Jois
-   John Lato
-   Felipe Lessa
-   Chris Mears
-   Ian Ross
-   Vilhelm Sjöberg
-   Jim Snavely
-   Luite Stegeman
-   Kanchalai Suveepattananont
-   Michael Thompson
-   Scott Walck

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


Re: [Haskell-cafe] Maintainer of fixpoint

2012-12-06 Thread Brent Yorgey
On Wed, Dec 05, 2012 at 08:22:32PM +0100, Petr P wrote:
Dear Haskellers,
 
 I've made some minor improvements of fixpoint package 
 http://hackage.haskell.org/package/fixpoint. I tried to contact the
 original maintainer twice, but without success. The package hasn't been
 updated for 4 years. How should I proceed? Should I start a new fork of the
 package? Or is there a way how to take over an orphaned package?
 
   Thanks for help,
   Petr Pudlak

I should also point out that I think the (much more recent)
recursion-schemes package implements everything in 'fixpoint' and a
lot more besides.

-Brent

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


Re: [Haskell-cafe] Design of a DSL in Haskell

2012-12-03 Thread Brent Yorgey
(Sorry, forgot to reply to the list initially; see conversation below.)

On Mon, Dec 03, 2012 at 03:49:00PM +0100, Joerg Fritsch wrote:
 Brent,

 I believe that inside the do-block (that basically calls my
 interpreter) I cannot call any other Haskell function that are not
 recognized by my parser and interpreter.

This seems to just require some sort of escape mechanism for
embedding arbitrary Haskell code into your language.  For example a
primitive

  embed :: a - CWMWL a

(assuming CWMWL is the name of your monad).  Whether this makes sense,
how to implement embed, etc. depends entirely on your language and
interpreter.  

However, as you imply below, this may or may not be possible depending
on the type a.  In that case I suggest making embed a type class method.
Something like

  class Embeddable a where
embed :: a - CWMWL a

I still get the feeling, though, that I have not really understood
your question.

 I am also trying to learn how I could preserve state from one line
 of code of my DSL to the next. I understand that inside the
 interpreter one would use a combination of the state monad and the
 reader monad, but could not find any non trivial example.

Yes, you can use the state monad to preserve state from one line to
the next.  I am not sure what you mean by using a combination of state
and reader monads.  There is nothing magical about the combination.
You would use state + reader simply if you had some mutable state as
well as some read-only configuration to thread through your
interpreter.

xmonad is certainly a nontrivial example but perhaps it is a bit *too*
nontrivial.  If I think of any other good examples I'll let you know.

-Brent

 
 
 On Dec 3, 2012, at 1:23 PM, Brent Yorgey wrote:
 
  On Sun, Dec 02, 2012 at 03:01:46PM +0100, Joerg Fritsch wrote:
  This is probably a very basic question.
  
  I am working on a DSL that eventuyally would allow me to say:
  
  import language.cwmwl
  main = runCWMWL $ do
 eval (isFib::, 1000, ?BOOL)
  
  I have just started to work on the interpreter-function runCWMWL and I 
  wonder whether it is possible to escape to real Haskell somehow (and how?) 
  either inside ot outside the do-block.
  
  I don't think I understand the question.  The above already *is* real
  Haskell.  What is there to escape?
  
  I thought of providing a defautl-wrapper for some required prelude
  functions (such as print) inside my interpreter but I wonder if
  there are more elegant ways to co-loacate a DSL and Haskell without
  falling back to being a normal library only.
  
  I don't understand this sentence either.  Can you explain what you are
  trying to do in more detail?
  
  -Brent
 
 

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


Re: lambda case

2012-11-30 Thread Brent Yorgey
Oh, PLEASE people.  Let's not have another round of bikeshedding about
this AFTER the feature is already implemented!

-Brent

On Fri, Nov 30, 2012 at 01:25:27PM +0100, Herbert Valerio Riedel wrote:
 Jon Fairbairn jon.fairba...@cl.cam.ac.uk writes:
 
 [...]
 
  “\case” complicates lambda, using “of” simply breaks “case … of …”
  into two easily understood parts.
 
 Just some observation (I'm rather late to the lambda-case discussion, so
 this might have been already pointed out previously):
 
 if the reserved keyword 'of' was to take the place of '\case', shouldn't
 then
 
   'case' exp
 
 w/o the 'of' { alts }-part become a separately valid expression (with
 'case' essentially meaning 'flip ($)') to really break it up into two
 independent parts? Then 'case exp of { alts }' wouldn't be a special
 form anymore, but would just result from combining 'case' and 'of';
 
 'case' wouldn't even need to be a reserved keyword (and thus the grammar
 could be simplified), if it wasn't for the current grammar which
 requires to isolate a \case-expression by using () or $, consider e.g.:
 
   {-# LANGUAGE LambdaCase #-}
   
   import System.Environment
   
   case' :: b - (b - c) - c
   case' = flip ($)
   
   main = do
 s - getArgs
   
 case' s $ \case  -- image '\case' was actually '\of' or 'of'
   [x] - putStrLn (Hello  ++ x)
   _   - putStrLn wrong number of arguments given
 
 
 just my 2¢
 
 cheers,
   hvr
 
 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-30 Thread Brent Yorgey
On Fri, Nov 30, 2012 at 02:33:54AM +0100, Ben Franksen wrote:
 Brent Yorgey wrote:
  On Thu, Nov 29, 2012 at 03:52:58AM +0100, Ben Franksen wrote:
  Tony Morris wrote:
   As a side note, I think a direct superclass of Functor for Monad is not
   a good idea, just sayin'
   
   class Functor f where
 fmap :: (a - b) - f a - f b
   
   class Functor f = Apply f where
 (*) :: f (a - b) - f a - f b
   
   class Apply f = Bind f where
 (=) :: (a - f b) - f a - f b
   
   class Apply f = Applicative f where
 unit :: a - f a
   
   class (Applicative f, Bind f) = Monad f where
   
   Same goes for Comonad (e.g. [] has (=) but not counit)
   ... and again for Monoid, Category, I could go on...
  
  Hi Tony
  
  even though I dismissed your mentioning this on the Haskell' list, I do 
 have 
  to admit that the proposal has a certain elegance. However, before I buy 
  into this scheme, I'd like to see some striking examples for types with 
  natural (or at least useful) Apply and Bind instances that cannot be made 
  Applicative resp. Monad. 
  
  Try writing an Applicative instances for (Data.Map.Map k).  It can't
  be done, but the Apply instance is (I would argue) both natural and 
 useful.
 
 I see. So there is one example. Are there more? I'd like to get a feeling 
 for the abstraction and this is hard if there is only a single example.

Any data type which admits structures of arbitrary but *only finite*
size has a natural zippy Apply instance but no Applicative (since
pure would have to be an infinite structure).  The Map instance I
mentioned above falls in this category.  Though I guess I'm having
trouble coming up with other examples, but I'm sure some exist.  Maybe
Edward knows of other examples.

-Brent

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


Re: [Haskell-cafe] lambda case

2012-11-30 Thread Brent Yorgey
Oh, PLEASE people.  Let's not have another round of bikeshedding about
this AFTER the feature is already implemented!

-Brent

On Fri, Nov 30, 2012 at 01:25:27PM +0100, Herbert Valerio Riedel wrote:
 Jon Fairbairn jon.fairba...@cl.cam.ac.uk writes:
 
 [...]
 
  “\case” complicates lambda, using “of” simply breaks “case … of …”
  into two easily understood parts.
 
 Just some observation (I'm rather late to the lambda-case discussion, so
 this might have been already pointed out previously):
 
 if the reserved keyword 'of' was to take the place of '\case', shouldn't
 then
 
   'case' exp
 
 w/o the 'of' { alts }-part become a separately valid expression (with
 'case' essentially meaning 'flip ($)') to really break it up into two
 independent parts? Then 'case exp of { alts }' wouldn't be a special
 form anymore, but would just result from combining 'case' and 'of';
 
 'case' wouldn't even need to be a reserved keyword (and thus the grammar
 could be simplified), if it wasn't for the current grammar which
 requires to isolate a \case-expression by using () or $, consider e.g.:
 
   {-# LANGUAGE LambdaCase #-}
   
   import System.Environment
   
   case' :: b - (b - c) - c
   case' = flip ($)
   
   main = do
 s - getArgs
   
 case' s $ \case  -- image '\case' was actually '\of' or 'of'
   [x] - putStrLn (Hello  ++ x)
   _   - putStrLn wrong number of arguments given
 
 
 just my 2¢
 
 cheers,
   hvr
 
 ___
 Glasgow-haskell-users mailing list
 glasgow-haskell-us...@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 

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


Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-29 Thread Brent Yorgey
On Thu, Nov 29, 2012 at 03:52:58AM +0100, Ben Franksen wrote:
 Tony Morris wrote:
  As a side note, I think a direct superclass of Functor for Monad is not
  a good idea, just sayin'
  
  class Functor f where
fmap :: (a - b) - f a - f b
  
  class Functor f = Apply f where
(*) :: f (a - b) - f a - f b
  
  class Apply f = Bind f where
(=) :: (a - f b) - f a - f b
  
  class Apply f = Applicative f where
unit :: a - f a
  
  class (Applicative f, Bind f) = Monad f where
  
  Same goes for Comonad (e.g. [] has (=) but not counit)
  ... and again for Monoid, Category, I could go on...
 
 Hi Tony
 
 even though I dismissed your mentioning this on the Haskell' list, I do have 
 to admit that the proposal has a certain elegance. However, before I buy 
 into this scheme, I'd like to see some striking examples for types with 
 natural (or at least useful) Apply and Bind instances that cannot be made 
 Applicative resp. Monad. 

Try writing an Applicative instances for (Data.Map.Map k).  It can't
be done, but the Apply instance is (I would argue) both natural and useful.

 Also, it is not clear to me what laws should hold 
 for them.

http://hackage.haskell.org/package/semigroupoids defines all of these
and specifies laws, presumably derived in a principled way.

-Brent

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


Re: [Haskell-cafe] delete http://www.haskell.org/haskellwiki/Haskell_IDE

2012-11-28 Thread Brent Yorgey
On Wed, Nov 28, 2012 at 07:08:16PM +0200, Roman Beslik wrote:
 Hi. There is more verbose page
 http://www.haskell.org/haskellwiki/IDEs . I registered on
 http://www.haskell.org/haskellwiki/ , but have not found the Delete
 Page command, wiki software help pages, or feedback channel, so I'm
 writing here.

Deleting pages is rather drastic and not enabled for normal users.  It
is probably not a good idea anyway -- what if there are other pages
that link to it?  Just delete all the content and replace it with a
redirect to the IDEs page.

-Brent

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


Re: [Haskell-cafe] cabal configure cabal build cabal install

2012-11-25 Thread Brent Yorgey
On Sun, Nov 25, 2012 at 06:09:26PM -0500, Albert Y. C. Lai wrote:
 
 If you begin with cabal configure, the correct idiom is:
 
 cabal configure [flags]
 cabal build
 [cabal haddock, if you want]
 cabal copy
 cabal register

Even this does not do the same thing as 'cabal install', because it
does not download and install any dependencies (whereas 'cabal
install' does).

-Brent

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


Re: [Haskell-cafe] Taking over ghc-core

2012-11-16 Thread Brent Yorgey
On Fri, Nov 16, 2012 at 03:25:35PM -0500, Jay Sulzberger wrote:
 
 
 On Fri, 16 Nov 2012, Carter Schonwald carter.schonw...@gmail.com wrote:
 
 how would ghc-core enable targetting core for Agda?
 
 
 On Wed, Nov 14, 2012 at 6:32 PM, Andreas Abel andreas.a...@ifi.lmu.dewrote:
 
 Excellent!
 
 With ghc-core being maintained again, we can start thinking about
 compiling Agda to core instead of hs.
 
 Andreas
 
 I would like to be able to take the textual version of Core
 output by GHC and use that text as input to the next stage of
 compilation.
 
 oo--JS.

Note that the ghc-core package only does pretty-printing of GHC core.
Whether GHC can parse a textual representation of GHC core (like Jay
and, presumably, Andreas want) is unrelated to the ghc-core package.

-Brent

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


Re: [Haskell-cafe] local type denotation

2012-11-14 Thread Brent Yorgey
Turn on the ScopedTypeVariables extension (e.g. by putting {-#
LANGUAGE ScopedTypeVariables #-} at the top of your file), and add an
explicit 'forall a.' to the type signature of f.

-Brent

On Wed, Nov 14, 2012 at 04:03:57PM +0400, Serge D. Mechveliani wrote:
 Please,
 how to correctly set an explicit type for a local value in the body of 
 a polymorphic function?
 
 Example (tested under  ghc-7.6.1):
 
   data D a = D1 a | D2 a (a - a)
 
   f :: Eq a = D a - a
   f (D1 x)   = x
   f (D2 x g) = let -- y :: Eq a = a
y = g x
in  if x == y then x else g y
 
   main = putStr $ shows (f (D2 (1 :: Int) succ)) \n

 
 This is compiled byghc --make Main
 
 Now I need, for a certain reason, to explicitly set the type for  y  in 
 `let',  with the meaning: 
 this very `a' which is in the signature for  f
 (and I think that this type Haskell assignes to  y  in  y = g x).
 
 I need to declare this type in a separate line:  y :: what ever it is.
 
 Both  `y :: a'  and  `y :: Eq a = a'  are not compiled.
 
 Please, copy the answer to  mech...@botik.ru
 
 Thanks,
 
 --
 Sergei
 
 ___
 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] Teaching Haskell @ MOOCs like Coursera or Udacity

2012-10-23 Thread Brent Yorgey
On Thu, Oct 18, 2012 at 11:49:08PM +0530, niket wrote:
 I am a novice in Haskell but I would love to see the gurus out here
 teaching Haskell on MOOCs like Coursera or Udacity.
 
 Dr Martin Odersky is doing it for Scala here:
 https://www.coursera.org/course/progfun
 
 I would love to see Haskell growing on such new platforms!

Just as a counterpoint, putting together a MOOC is a *ton* of work,
with (in my opinion) not much benefit for a topic like Haskell where
it is already possible to access lots of quality instructional
materials online.  I would rather see Haskell gurus put their time and
effort into producing more awesome code (or into curating existing
instructional materials).

Just my 2c.

-Brent

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


Re: [Haskell-cafe] Explicitly passing an argument to an arrow

2012-10-03 Thread Brent Yorgey
On Wed, Oct 03, 2012 at 10:41:25AM +0200, Alfredo Di Napoli wrote:
 Hello everyone,
 
 sorry for the dumb question but I'm wrapping my head around arrow just from
 this morning.
 Consider this toy function to swap argument of a tuple:
 
 swapA' :: (Arrow a) = a ((b,c), (b,c)) (c,b)
 swapA' = swapFirst  swapSecond
   where
 swapFirst  = first $ arr snd
 swapSecond = second $ arr fst
 
 
 It works but requires to pass a tuple of tuple, namely ((b,c), (b,c)).
 How can I explicitly pass my tuple of tuple to swapFirst so I can simply
 invoke
 
 swapA' (1,2)
 
 
 and get the correct result?

Like this?

  swapA' = dup  swapFirst  swapSecond
where
  dup = id  id
  ...

I'm afraid I'm not confident I really understand your question,
however, so if that doesn't answer it, try asking again!

-Brent

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


[Haskell] ANN: New wiki page and mailing list for combinatorics and Haskell

2012-09-24 Thread Brent Yorgey
Quite a while ago there was a mailing list thread where the idea was
brought up of creating a mailing list for those interested in
combinatorics in the setting of Haskell.

Well, I've finally gotten around to it.  If you're interested in
(probably extremely low-traffic) discussion and announcements relating
to doing combinatorics in Haskell (computing combinatorial/
number-theoretic functions; exhaustive or random generation of
combinatorial objects; type algebra; etc.), please join!  

  http://projects.haskell.org/cgi-bin/mailman/listinfo/combinatorics

There is also a wiki page for collecting information here:

  http://www.haskell.org/haskellwiki/Combinatorics

-Brent

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


[Haskell-cafe] ANN: New wiki page and mailing list for combinatorics and Haskell

2012-09-24 Thread Brent Yorgey
Quite a while ago there was a mailing list thread where the idea was
brought up of creating a mailing list for those interested in
combinatorics in the setting of Haskell.

Well, I've finally gotten around to it.  If you're interested in
(probably extremely low-traffic) discussion and announcements relating
to doing combinatorics in Haskell (computing combinatorial/
number-theoretic functions; exhaustive or random generation of
combinatorial objects; type algebra; etc.), please join!  

  http://projects.haskell.org/cgi-bin/mailman/listinfo/combinatorics

There is also a wiki page for collecting information here:

  http://www.haskell.org/haskellwiki/Combinatorics

-Brent

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


Re: [Haskell-cafe] guards in applicative style

2012-09-12 Thread Brent Yorgey
Lorenzo is correct, but actually for the wrong reason. =) The *type*
of guard is a historical accident, and the fact that it requires
MonadPlus doesn't really tell us anything.  Let's take a look at its
implementation:

  guard   :: (MonadPlus m) = Bool - m ()
  guard True  =  return ()
  guard False =  mzero

'return' is not specific to Monad; we could just as well use 'pure'.
'mzero' is a method of 'MonadPlus' but there is no reason we can't use
'empty' from the 'Alternative' class.  So we could define

  guardA :: Alternative f = Bool - f ()
  guardA True  = pure ()
  guardA False = empty

(As another example, consider the function 'sequence :: Monad m = [m
a] - m [a]'.  Actually this function does not need Monad at all, it
only needs Applicative.)

However, guardA is not as useful as guard, and it is not possible to
do the equivalent of the example shown using a list comprehension with
a guard.  The reason is that whereas monadic computations can make use
of intermediate computed values to decide what to do next, Applicative
computations cannot.  So there is no way to generate values for x and
y and then pass them to 'guardA' to do the filtering.  guardA can only
be used to conditionally abort an Applicative computation using
information *external* to the Applicative computation; it cannot
express a condition on the intermediate values computed by the
Applicative computation itself.

-Brent

On Wed, Sep 12, 2012 at 03:52:03PM +0100, Lorenzo Bolla wrote:
 I'm no expert at all, but I would say no.
 guard type is:
 guard :: MonadPlus m = Bool - m ()
 
 and MonadPlus is a monad plus (ehm...) mzero and mplus
 (http://en.wikibooks.org/wiki/Haskell/MonadPlus).
 On the other hand Applicative is less than a monad
 (http://www.haskell.org/haskellwiki/Applicative_functor), therefore
 guard as is cannot be defined.
 
 But, in your specific example, with lists, you can always use filter:
 filter (uncurry somePredicate) ((,) $ list1 * list2 (somePredicate ???))
 
 hth,
 L.
 
 
 On Wed, Sep 12, 2012 at 3:40 PM, felipe zapata tifonza...@gmail.com wrote:
 
  Hi Haskellers,
 
  Suppose I have two list and I want to calculate
  the cartesian product between the two of them,
  constrained to a predicate.
  In List comprehension notation is just
 
  result = [ (x, y) | x - list1, y -list2, somePredicate x y ]
 
  or in monadic notation
 
  result = do
   x - list1
   y - list2
   guard (somePredicate x y)
  return $ (x,y)
 
  Then I was wondering if we can do something similar using an applicative 
  style
 
  result = (,) $ list1 * list2 (somePredicate ???)
 
  The question is then,
  there is a way for defining a guard in applicative Style?
 
  Thanks in advance,
 
  Felipe Zapata.
 
 
 
  ___
  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

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


Re: [Haskell-cafe] package categories

2012-09-08 Thread Brent Yorgey
On Sat, Sep 08, 2012 at 11:04:34AM +0400, Sergey Mironov wrote:
 Hello list. Do we have a guideline for selecting correct category for
 a package being developed? I'd like to choose between Web.MyLib and
 Network.MyLib. Or probably just MyLib if I feel ambitious?
 Sergey.

MyLib is discouraged.  I'm sure either Web.MyLib or Network.MyLib
would be fine.  I don't know of any guidelines.

-Brent

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


Re: [Haskell-cafe] ANNOUNCE: grid-1.1

2012-09-06 Thread Brent Yorgey
On Thu, Sep 06, 2012 at 09:42:19AM +, Amy de Buitléir wrote:
 I'm happy to announce a new package called grid:
 
 http://hackage.haskell.org/package/grid
 https://github.com/mhwombat/grid/wiki (wiki)

Looks neat!  By the way, the URLs within the Haddock documentation are
formatted improperly (because Haddock interprets the forward slashes
as italic markers).  You should place the URLs within angle brackets
like http://github.com/foo/bar and Haddock will turn them into real
clickable links.

-Brent

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


Re: [Haskell-cafe] Cabal install fails due to recent HUnit

2012-08-27 Thread Brent Yorgey
On Mon, Aug 27, 2012 at 10:52:59AM -0700, Bryan O'Sullivan wrote:
 On Mon, Aug 27, 2012 at 9:57 AM, Erik Hesselink hessel...@gmail.com wrote:
 
  I'm seeing this again, on abstract-deque-0.1.6. Ross, can you fix it again?
 
 
 Hang on a second.
 
 The reason you're seeing build breakage is that the .cabal files of the
 broken packages were edited in-place without communicating with any of the
 package authors.
 
 I understand that the collective intentions around this were good, but by
 fixing things without telling anyone, package maintainers have no way to
 know that anything has happened. Now we are seeing the problem begin to
 recur as people issue new releases that don't incorporate those changes.

For the record, abstract-deque was neither one of the packages fixed
previously, nor does its .cabal file even contain a test section at
all, much less one with a conditional.  So if cabal-install-0.10 is
failing to read it, it is because of some different problem.  But I
agree with Bryan in principle that we need a more principled approach.

-Brent

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


Re: [Haskell-cafe] explicit annotations on kind polymorphism for data types

2012-08-24 Thread Brent Yorgey
Correct.  I just meant that you can use a lowercase x or a
lowercase chi (χ).  Any lowercase characters (as defined by Unicode)
can be used as identifiers.

-Brent

On Thu, Aug 23, 2012 at 11:09:41AM -0400, dude wrote:
 Not in 7.4.2, correct?
 
 --
 dude
 
 On 08/22/2012 09:58 AM, Brent Yorgey wrote:
 I believe in the paper it is actually a lowercase Greek chi (χ), which
 should work too. ;)
 
 -Brent
 
 On Wed, Aug 22, 2012 at 08:15:48AM +0200, José Pedro Magalhães wrote:
 Nope, but it should work on 7.6 (also on the release candidate).
 The 'X' should be lowercase, though, like type variables.
 
 
 Cheers,
 Pedro
 
 On Wed, Aug 22, 2012 at 12:01 AM, dude d...@methodeutic.com wrote:
 
 Hello All:
 
 I'm working through Giving Haskell a Promotion.
 
 Section 2.4 presents an explicitly annotated data type declaration similar
 to the following:
 
 data EqRefl (a::X)(b::X) where
Refl :: forall X. forall (a::X). EqRefl a a
 
 Has this been implemented in GHC 7.4.2?
 
 7.8.3 in the GHC User Guide leads me to believe it has not.
 
 --
 dude
 
 __**_
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 
 
 
 -- 
 --
 dude
 
 
 ___
 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] model theory for type classes

2012-08-23 Thread Brent Yorgey
On Thu, Aug 23, 2012 at 01:25:39PM +0100, Patrick Browne wrote:
 
If there is no model expansion could it be because of the constructor
discipline, which only allows variables, and constructors in the LHS
argument patterns.

Indeed, a variable name as a pattern on the LHS of a function
definition has nothing to do with any names which might be in scope.
It is simply a pattern which matches anything.  I am not sure what (if
anything) this says about model expansions.

constant::Int
constant = (1::Int)
fun1::Int - Int
fun1 (constant::Int) = 8

fun1 returns 8 for all inputs.  The fact that fun1's definition uses
the name 'constant' which happens to have the same name as something
in scope is irrelevant.  For example, this is precisely the same as the above:

constant :: Int
constant = 1
fun1 :: Int - Int
fun1 foo = 8

-Brent

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


Re: [Haskell-cafe] explicit annotations on kind polymorphism for data types

2012-08-22 Thread Brent Yorgey
I believe in the paper it is actually a lowercase Greek chi (χ), which
should work too. ;)

-Brent

On Wed, Aug 22, 2012 at 08:15:48AM +0200, José Pedro Magalhães wrote:
 Nope, but it should work on 7.6 (also on the release candidate).
 The 'X' should be lowercase, though, like type variables.
 
 
 Cheers,
 Pedro
 
 On Wed, Aug 22, 2012 at 12:01 AM, dude d...@methodeutic.com wrote:
 
  Hello All:
 
  I'm working through Giving Haskell a Promotion.
 
  Section 2.4 presents an explicitly annotated data type declaration similar
  to the following:
 
  data EqRefl (a::X)(b::X) where
Refl :: forall X. forall (a::X). EqRefl a a
 
  Has this been implemented in GHC 7.4.2?
 
  7.8.3 in the GHC User Guide leads me to believe it has not.
 
  --
  dude
 
  __**_
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe
 

 ___
 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] Platform Versioning Policy: upper bounds are not our friends

2012-08-20 Thread Brent Yorgey
On Thu, Aug 16, 2012 at 06:07:06PM -0400, Joey Adams wrote:
 On Wed, Aug 15, 2012 at 3:38 PM, Bryan O'Sullivan b...@serpentine.com wrote:
  I propose that the sense of the recommendation around upper bounds in the
  PVP be reversed: upper bounds should be specified only when there is a known
  problem with a new version of a depended-upon package.
 
 I, too, agree.  Here is my assortment of thoughts on the matter.
 
 Here's some bad news: with cabal 1.14 (released with Haskell Platform
 2012.2), cabal init defaults to bounds like these:
 
   build-depends:   base ==4.5.*, bytestring ==0.9.*,
   http-types ==0.6.*

I'm not sure why you think this is bad news.  I designed this to
conform exactly to the current PVP.  If the PVP is changed then I will
update cabal init to match.

-Brent

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


Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-16 Thread Brent Yorgey
On Thu, Aug 16, 2012 at 05:30:07PM +0300, Yitzchak Gale wrote:
 
 For actively maintained packages, I think the
 problem is that package maintainers don't find
 out promptly that an upper bound needs to be
 bumped. One way to solve that would be a
 simple bot that notifies the package maintainer
 as soon as an upper bound becomes out-of-date.

This already exists:

  http://packdeps.haskellers.com/
 
-Brent

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


Re: [Haskell-cafe] hGetContents Illegal byte sequence / ghc-pkg

2012-08-11 Thread Brent Yorgey
On Sat, Aug 11, 2012 at 12:13:45PM +0100, Benjamin Edwards wrote:
 Hello café,
 
 I have a program that is crashing, and I have no idea why:
 
 module Main
   where
 
 import System.Process (readProcessWithExitCode)
 
 
 main :: IO ()
 main = do _ - readProcessWithExitCode ghc-pkg [describe, hoopl] 
   putStrLn Should never get here
 
 this is using the process package from hackage. The program crashes with
 
 minimal-test: fd:5: hGetContents: invalid argument (invalid byte sequence)
 minimal-test: thread blocked indefinitely in an MVar operation
 
 inspecting the source of readProcessWithExitCode yields an obvious
 explanation to the MVar problem, but I don't understand why hGetContents is
 so offended.

The 'invalid argument' error from hGetContents indicates that a wrong
encoding is being assumed.  I don't know enough about how
putStr/hGetContents decide on an encoding, but in any case it works
for me (that is, it prints Should never get here).  The likely
sticking point is that one of the authors of hoopl, João Dias, has a
name which contains U+00E3: LATIN SMALL LETTER A WITH TILDE.

Try doing  

  ghc-pkg describe hoopl  hoopl.txt
  file hoopl.txt

to get an indication of what encoding is being used, or manually take
a look at the bytes being generated using

  ghc-pkg describe hoopl | hexdump -C

I don't know what the solution is but at least this should give some
additional information.

-Brent

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


Re: [Haskell-cafe] [Haskell] ALife category

2012-08-02 Thread Brent Yorgey
On Thu, Aug 02, 2012 at 01:50:50PM +, Amy de Buitléir wrote:
 I'm developing a framework for artificial life experiments that I would like 
 to
 make available on Hackage eventually. I've read all the guidance and 
 proposals I
 could find for where to place packages in the hierarchy:
 
 http://www.haskell.org/haskellwiki/Hierarchical_module_names
 http://www.cs.york.ac.uk/fp/libraries/layout.html
 http://www.cs.york.ac.uk/fp/libraries/layoutSM.html
 
 I've also examined the current hierarchy of modules:
 
 http://hackage.haskell.org/packages/archive/pkg-list.html
 
 The current hierarchy has a top-level AI category, so it would seem logical to
 me to add a top-level ALife category and put my package under that. But 
 perhaps
 it would be best not to start a new top-level category? I could put my package
 under AI, because my framework does support the use of AI, and wouldn't look 
 too
 out of place with the other packages there.

(Moving the discussion to haskell-cafe; haskell@haskell is generally
for announcements and such.)

It seems to me that you might be confusing two separate things.
Cabal packages may list one or more categories, which are used to
group packages on the main list of packages:
http://hackage.haskell.org/package/ .  In general, I would say that
you should avoid creating a new top-level category.

Hierarchical module names are something different.  The 'Category'
specified in the .cabal file does NOT have to be the same as the first
component of your module names (though for many packages it is).  For
example, it would be perfectly fine to specify 'AI' as the category,
and then have module names like

  ALife.Foo

and so on.

-Brent

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


Re: [Haskell] Spam on the Haskell wiki

2012-07-31 Thread Brent Yorgey
So it looks like email confirmation for new accounts and ReCAPTCHA for
new links are both enabled, but clearly spam is still a problem.  Are
there any additional measures we can take to cut down on spam?

For the record, if we need to move to a manual approval process for
new accounts, I would be willing to help.

-Brent

On Sat, Jul 14, 2012 at 08:39:30PM -0400, Gwern Branwen wrote:
 I recently moved, and when I returned to the Internet a few days
 later, I was greeted with several hundred spam pages in Recent
 Changes. The torrent of spam has not let up, and I estimate that I
 have blocked 3-500 accounts and deleted as many pages. (I blocked
 another 5 or so while composing this email.) Certainly the deletion
 and block logs are long enough:
 
 - 
 http://www.haskell.org/haskellwiki/index.php?title=Special%3ALogtype=deleteuser=page=
 - 
 http://www.haskell.org/haskellwiki/index.php?title=Special:Ipblocklistlimit=500
 
 I have asked Ashley Yakeley to turn on additional anti-spam measures,
 but he has not been active on the wiki since January
 (http://www.haskell.org/haskellwiki/Special:Contributions/Ashley_Y
 http://www.haskell.org/haskellwiki/index.php?title=Special:Loguser=Ashley_Y),
 and has not replied to my talk messages or accompanying emails.
 
 I had to do this single-handedly as there are no other administrators.
 This took up a good chunk of today and yesterday, and the spam is
 continuing. I cannot handle it much longer: it's incredibly tedious
 and using up far more time than I have to give it. Measures need to be
 taken:
 
 1. Email confirmation needs to be checked that Ashley did in fact
 enable it. I suspect he did not, since I also administrate the
 LessWrong wiki - which I know for certain has email confirmation is
 enabled - is being attacked by the same spammers (similar or identical
 templates  spam) but at a much reduced scale.
 2. Additional administrators must be created. I suggest:
 
 - dons
 - Magnus Therning
 - Neil Mitchell
 - byorgey
 - Henk-Jan van Tuyl
 
 I am sure there are others who can be trusted.
 3. Additional bureaucrats should be created. I suggest myself.
 4. ReCAPTCHA enabled for 'edits adding new, unrecognized external
 links' - which is all of the spam. Further reading:
 http://www.mediawiki.org/wiki/Manual:Combating_spam 
 http://www.mediawiki.org/wiki/Anti-spam_features
 5. if Ashley is inactive, his account may be a security risk. The
 English Wikipedia now removes administrator bits after a year of
 inactivity; we should consider a similar policy.
 
 None of these can be taken by myself, as I am neither a sysadmin on
 Haskell.org nor a bureaucrat on the wiki.
 
 If none of these steps are taken and spam continues to remain a
 problem in 2 months (15 September 2012), I will cease patrolling
 Recent Changes. I no longer have the time or patience.
 
 -- 
 gwern
 http://www.gwern.net

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


Re: [Haskell-cafe] how to select random elements of a Data.Set?

2012-07-20 Thread Brent Yorgey
On Fri, Jul 20, 2012 at 01:24:57PM +, jwaldmann wrote:
 Dear all,
 
 how would I quickly select an element of a Set (as in Data.Set)
 uniformly at random? 
 
 Via the API, this can only be done in linear time? (via toList)
 If I could access the tree structure, 
 then of course it could be logarithmic.

If you had access to the Set constructors, this would be very easy, as
each node caches a size.  Unfortunately there does not appear to be
any way to do this in sub-linear time via the exposed API, because
there is no way to directly access the subtrees.

I wonder about the wisdom of exporting a function like

  -- | Partition a set into two approximately equal-sized subsets.
  --   If @divide s == (s1,s2)@, then 
  -- * @s1 `intersect` s2 == empty@
  -- * @s1 `union` s2 == s@
  -- * The sizes of @s1@ and @s2@ differ by at most a constant factor
  --   (currently, 3).
  divide :: Set a - (Set a, Set a)

which would give you enough to implement what you want, without
breaking the Set abstraction.  (However, even though technically it
doesn't break any abstraction, it still smells somewhat
implementation-dependent...)

-Brent

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


Re: [Haskell-cafe] How to add constraint to .cabal?

2012-07-19 Thread Brent Yorgey
On Thu, Jul 19, 2012 at 09:37:52AM +0800, Magicloud Magiclouds wrote:
 Hi,
   Say I have a package that only appends
 --constraint=template-haskell==2.7.0.0
 --constraint=warp-tls==1.2.1 could I install it. Now I want to
 release the package, then how could I have these constraint into the
 .cabal so the user would not get troubled?

Using the build-depends field.  See
http://www.haskell.org/cabal/users-guide/developing-packages.html#build-information

-Brent

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


Re: [Haskell-cafe] Adding to the haskell wiki

2012-07-16 Thread Brent Yorgey
On Mon, Jul 16, 2012 at 02:00:46PM +0200, Nathan Hüsken wrote:
 Hey,
 
 I have been a passive member of the haskell community for quite some
 time now. I have benefit from the community a lot through the mailing
 list, the haskell webpage and other channels. Thanks for all that!
 
 Now I am trying to give a little bit back, and I started a blog about
 writing javascript games in haskell using UHC and haste.
 I am not an expert in haskell nor javascript, but I am collecting
 information from various sources and put it together in the blog so that
 others with a similar goal my have a smoother start.
 
 Writing a blog is one thing, but of course I also want people who are
 interested in the topic to find it.
 
 Never being an active member of the community, I wonder if I should do.
 I guess I should add it to the haskellwiki. But I am unsure where.
 It certainly falls in the games category, but the page only lists game
 projects.
 
 The blog can be found here: http://jshaskell.blogspot.de/

If you want people to find your blog, a better idea is to have it
added to the Planet Haskell blog aggregator. [1] Then write blog posts
which are interesting enough that people will post them to the Haskell
reddit.  I doubt putting a link to your blog on the Haskell wiki will
make much difference, though you are certainly welcome to of course.

[1] http://planet.haskell.org/

-Brent

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


Re: [Haskell] Spam on the Haskell wiki

2012-07-15 Thread Brent Yorgey
On Mon, Jul 16, 2012 at 12:03:49AM +0200, Henk-Jan van Tuyl wrote:
 On Sun, 15 Jul 2012 02:39:30 +0200, Gwern Branwen gwe...@gmail.com wrote:
 
 2. Additional administrators must be created. I suggest:
 
 - dons
 - Magnus Therning
 - Neil Mitchell
 - byorgey
 - Henk-Jan van Tuyl
 
 I am willing to do administrator tasks.
 
 
 4. ReCAPTCHA enabled for 'edits adding new, unrecognized external
 links' - which is all of the spam.
 
 This is already enabled.

I am also willing to do administrator tasks, and can confirm that the
ReCAPTCHA for edits adding external links is indeed enabled, since in
the course of editing the Typeclassopedia and Diagrams wiki (both
hosted on the Haskell wiki) I often add external links.

-Brent

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


Re: [Haskell-cafe] Best way to build a GHC backend?

2012-07-09 Thread Brent Yorgey
On Sun, Jul 08, 2012 at 09:21:08AM -0600, Jonathan Geddes wrote:
 I agree that the Raison d'être for a .NET or JVM backend is interop.
 Perhaps that's not worth the effort of an entirely new backend. JavaScript
 is a different beast, however.  I said before:
 
 From my point of view, languages that cannot run on one of the 3
  aforementioned platforms will become irrelevant. (with the exception of
 C,
  of course).
 
 I'll take that one step further and say that for web applications it is
 becoming increasingly difficult to justify using a language that WILL NOT
 run both client and server. JavaScript (with NodeJS), Clojure (with
 ClojureScript), and Dart are just a few examples.
 
 I really believe that with a solid JavaScript backend, Haskell would be an
 ideal web application language. Am I alone in that belief? What can I do to
 get the ball rolling on that?

I should point out that the ball already IS rolling -- ranging from
EDSLs that compile to JavaScript [1,2] to macro systems [3] to more
serious full-featured efforts [4,5].  There's even a wiki page listing
all these and more [6].  The yesod developers share your view that
Haskell would benefit from some sort of JavaScript backend; see [7] as
well as the ensuing discussion on Reddit [8]. See also Elm [9], which
compiles to HTML+CSS+JavaScript and has some Haskell integration [10].

Rather than trying to start yet another effort, what about
contributing to one of these ongoing ones?

-Brent

[1] http://www.ittc.ku.edu/csdlblog/?p=88
[2] http://www.ittc.ku.edu/csdl/fpg/node/125
[3] http://www.haskell.org/haskellwiki/JMacro
[4] http://uu-computerscience.github.com/uhc-js/
[5] https://github.com/ghcjs/ghcjs
[6] http://www.haskell.org/haskellwiki/The_JavaScript_Problem
[7] http://www.yesodweb.com/blog/2012/04/client-side
[8] 
http://www.reddit.com/r/haskell/comments/sm72n/client_side_yesod_an_frpinspired_approach/
[9] http://elm-lang.org/
[10] 
http://www.reddit.com/r/haskell/comments/uugne/announcing_elm_02_haskell_integration_yesod/

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


Re: [Haskell-cafe] combining predicates, noob question

2012-07-09 Thread Brent Yorgey
On Sat, Jul 07, 2012 at 09:42:01PM -0300, Sebastián Krynski wrote:
 Ok , thanks for the answers, I understand now what  liftM2 does.
  In this case would it be silly to  use  combinerPred (and maybe a newType
  Predicate a = a - Bool) for the sake of readability or shoud I stick with
 a - Bool  and  liftM2?

No, not silly.  Use whatever you find most readable.

-Brent




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


Re: [Haskell-cafe] combining predicates, noob question

2012-07-06 Thread Brent Yorgey
On Fri, Jul 06, 2012 at 03:17:54PM -0300, Felipe Almeida Lessa wrote:
 On Fri, Jul 6, 2012 at 2:11 PM, Sebastián Krynski skryn...@gmail.com wrote:
  As I was using predicates (a - bool) , it appeared the need for combining
  them with a boolean operator (bool - bool - bool)  in order to get a new
  predicate
  combining the previous two. So I wrote my function combinerPred (see code
  below). While I think this is JUST ok, i'm feeling a monad in the air.
   So.. where is the monad?
 
  combinerPred ::  (a - Bool)  - (a - Bool) - (Bool - Bool - Bool) -
  (a - Bool)
  combinerPred pred1 pred2 op = \x - op (pred1 x) (pred2 x)
 
 That's the `(-) a` monad:
 
   import Control.Applicative
 
   combinerPred ::  (a - Bool)  - (a - Bool) - (Bool - Bool -
 Bool) - (a - Bool)
   combinerPred pred1 pred2 op = op $ pred1 * pred2

By the way, I find it more natural to make 'op' the first argument,
because it is more useful to partially apply combinerPred to an
operation that it is to some predicates.  Also, in that case
combinerPred is simply liftA2:

  import Control.Applicative

  combinerPred :: (Bool - Bool - Bool) - (a - Bool) - (a - Bool) - (a - 
Bool)
  combinerPred = liftA2

-Brent

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


Re: [Haskell] ANNOUNCE: GHC version 7.4.2

2012-06-10 Thread Brent Yorgey
Thanks for the release!  One quick question -- the release notes say

  A bug in dependency analysis of type declarations in the presence
  of type families (#5826) has been fixed.

However, #5826 seems to be about something entirely different
(something about the user guide).  Does anyone know the actual ticket
being referred to?  I'd like to read it in more detail but haven't
been able to find it.

thanks,
-Brent

On Sun, Jun 10, 2012 at 08:20:18PM +0100, Paolo Capriotti wrote:
=
 The (Interactive) Glasgow Haskell Compiler -- version 7.4.2
=
 
 The GHC Team is pleased to announce a new patchlevel release of GHC.
 This release contains a number of bugfixes relative to 7.4.1, so we
 recommend upgrading.
 
 The release notes are here:
 
   http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/release-7-4-2.html
 
 How to get it
 ~
 
 The easy way is to go to the web page, which should be self-explanatory:
 
 http://www.haskell.org/ghc/
 
 We supply binary builds in the native package format for many
 platforms, and the source distribution is available from the same
 place.
 
 Packages will appear as they are built - if the package for your
 system isn't available yet, please try again later.
 
 
 Background
 ~~
 
 Haskell is a standard lazy functional programming language.
 
 GHC is a state-of-the-art programming suite for Haskell.  Included is
 an optimising compiler generating good code for a variety of
 platforms, together with an interactive system for convenient, quick
 development.  The distribution includes space and time profiling
 facilities, a large collection of libraries, and support for various
 language extensions, including concurrency, exceptions, and foreign
 language interfaces (C, whatever).  GHC is distributed under a
 BSD-style open source license.
 
 A wide variety of Haskell related resources (tutorials, libraries,
 specifications, documentation, compilers, interpreters, references,
 contact information, links to research groups) are available from the
 Haskell home page (see below).
 
 
 On-line GHC-related resources
 ~~
 
 Relevant URLs on the World-Wide Web:
 
 GHC home page  http://www.haskell.org/ghc/
 GHC developers' home page  http://hackage.haskell.org/trac/ghc/
 Haskell home page  http://www.haskell.org/
 
 
 Supported Platforms
 ~~~
 
 The list of platforms we support, and the people responsible for them,
 is here:
 
http://hackage.haskell.org/trac/ghc/wiki/Contributors
 
 Ports to other platforms are possible with varying degrees of
 difficulty.  The Building Guide describes how to go about porting to a
 new platform:
 
 http://hackage.haskell.org/trac/ghc/wiki/Building
 
 
 Developers
 ~~
 
 We welcome new contributors.  Instructions on accessing our source
 code repository, and getting started with hacking on GHC, are
 available from the GHC's developer's site run by Trac:
 
   http://hackage.haskell.org/trac/ghc/
 
 
 Mailing lists
 ~
 
 We run mailing lists for GHC users and bug reports; to subscribe, use
 the web interfaces at
 
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
 
 There are several other haskell and ghc-related mailing lists on
 www.haskell.org; for the full list, see
 
 http://www.haskell.org/mailman/listinfo/
 
 Some GHC developers hang out on #haskell on IRC, too:
 
 http://www.haskell.org/haskellwiki/IRC_channel
 
 Please report bugs using our bug tracking system.  Instructions on
 reporting bugs can be found here:
 
 http://www.haskell.org/ghc/reportabug
 
 ___
 Haskell mailing list
 hask...@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] class instances for kinds with finite ty constrs, does this make sense?

2012-06-08 Thread Brent Yorgey
On Thu, Jun 07, 2012 at 07:32:45PM +0100, ex falso wrote:
 
 we always have to put the class restriction (TupleLength l) there,
 even though all possible type constructors of [*] have a TupleLength
 instance defined!

Yes, and this is a feature, for at least two reasons.

First: to the extent that Haskell's type system corresponds to a
logic, it corresponds to a constructive one.  Types/propositions are
inhabited/proved by explicit terms/evidence. But this request (and
[1]) essentially boil down to a desire for double negation
elimination: if there *can't* *not* be a certain instance, then the
compiler should infer that there *is* one.  This seems weird to me
(though perhaps I've just drunk too much of the constructivism
kool-aid).

Second, on a more practical level, the ability to omit class
constraints like this would make reasoning about types much more
non-local and difficult, since a type like

  foo :: Bar a - Baz

may or may not implicitly expand to something like

  foo :: SomeClass a = Bar a - Baz

(which could have important implications for things like inlining,
sharing, etc. -- cf the monomorphism restriction), but figuring out
whether it does or not requires knowing (a) the definition of Bar and
all the instances that are in scope, and (b) whether or not
SomeClass's methods ever get called from foo (or anything it calls,
recursively).  I'd much rather explicitly write the SomeClass
constraint if I want it, and be guaranteed that it won't be added if I
don't.

In summary, these constraints may be superfluous in a strictly
logical sense, but (a) not in the kind of logic that Haskell uses, and
(b) the pain and suffering caused by removing them would far outweigh
the tiny bit of typing that would be saved.

-Brent

[1] 
http://haskell.1045720.n5.nabble.com/Data-Kinds-and-superfluous-in-my-opinion-constraints-contexts-td5689436.html

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


Re: [Haskell-cafe] Restricted Monad question

2012-06-04 Thread Brent Yorgey
On Mon, Jun 04, 2012 at 11:35:20AM +0200, Ismael Figueroa Palet wrote:
 Hi, I was wondering about defining a restricted monad, and found out this
 blog post: http://blog.omega-prime.co.uk/?p=127
 
 In GHC 7.4.1 still the recommended way is using the rmonad package,
 right?

You can do it however you want, I don't think there's really a
recommended way.  But using the rmonad package is certainly more
convenient.

 I guess the tricks with ConstraintKinds explained in the blog are used for
 internal implementation of RMonad?

No, the rmonad package has been around since long before the
ConstraintKinds extension was even conceived.

-Brent

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


Re: [Haskell-cafe] Installation of the New Haskell Platform

2012-06-04 Thread Brent Yorgey
On Mon, Jun 04, 2012 at 11:04:36AM -0400, Victor Miller wrote:
 Before I install it (on on Mac OS X Lion) is there anything, manually, that
 I need to do in order to keep all of the cabal packages that I've
 installed, or are the reinstalled automatically?

Neither.  If you install a new version of GHC, you must reinstall any
cabal packages you want, because they must be recompiled with the new
GHC.

Note that cabal-install does have a special command

  cabal install world

which (IIUC) is supposed to help automate this process, although I
can't vouch for it since I have never tried it.

-Brent

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


Re: [Haskell-cafe] Formalisation for types of monads

2012-05-24 Thread Brent Yorgey
On Wed, May 23, 2012 at 09:24:06AM +0200, Ertugrul Söylemez wrote:
 Yves Parès yves.pa...@gmail.com wrote:
 
   Note about []:  Don't even mention foldl.  The folding
   combinator for lists is foldr, period.
 
  Yes, I do agree. I came to this when I realized foldr gave the church
  encoding of a list.
 
 Not only that.  The foldr combinator has an identity fold and implements
 actual structural recursion.

That's pretty much what a Church encoding is.  Though I agree it's
probably best not to mention the phrase Church encoding to beginning
students.

-Brent

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


Re: [Haskell-cafe] cool tools

2012-05-21 Thread Brent Yorgey
On Thu, May 17, 2012 at 03:05:22PM +0100, Chris Dornan wrote:
 I have been playing around with the latest cabal-install (0.14.0) and it is
 working really nicely. Having unpacked a cabal bundle you can now type
 'cabal install' inside the root and it will work everything out as if you
 had asked to install directly from the repo -- very nice.

I should point out that cabal-install has actually had this feature
for a long time.  Which of course in no way detracts from your point
(quite the opposite, in fact).

-Brent

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


Re: [Haskell-cafe] Learn you

2012-05-02 Thread Brent Yorgey
I am curious how the title was translated.  Of course, the English
title Learn You a Haskell for Great Good uses intentionally
ungrammatical/unidiomatic English for humorous effect.  Is the
Japanese title also ungrammatical/unidiomatic Japanese?  Or do
Japanese speakers not find that humorous?

-Brent

On Wed, May 02, 2012 at 03:59:18PM +0900, Kazu Yamamoto wrote:
 Hello cafe,
 
 Translating Learn You a Haskell for Great Good into Japanese was
 finished and will be published on 22 May. I guess it's worth watching
 its cover page:
 
   
 http://www.amazon.co.jp/%E3%81%99%E3%81%94%E3%81%84Haskell%E3%81%9F%E3%81%AE%E3%81%97%E3%81%8F%E5%AD%A6%E3%81%BC%E3%81%86-Miran-Lipova%C4%8Da/dp/4274068854
 
 There are two translators: Tanaka is the author of peggy and Muranushi is
 the author of Monadius.
 
 Regards,
 
 --Kazu
 
 ___
 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] Multi-site haddock documentation with proper links?

2012-04-25 Thread Brent Yorgey
It is possible.  I have done it for 
  
  http://projects.haskell.org/diagrams/doc/index.html

But it is not fun, and it took me several days of work (spread over
two weeks) to figure out the proper magic incantations to get
everything to work properly.  I really ought to write up a blog post
with instructions; I'll try to do that soon.

-Brent

On Tue, Apr 24, 2012 at 08:34:53PM -0400, Ryan Newton wrote:
 Hello cafe,
 
 For various reasons, some packages don't build documentation on hackage:
 
http://hackage.haskell.org/package/accelerate
 
 Therefore I want to locally install documentation for a set of packages
 like this and host them on a separate website.  I want all of these ~ten
 packages' haddock documentation to be properly interlinked with eachother,
 but also to link to Hackage for types and classes defined in other modules.
 
 Is this possible?  Hackage haddocks are all interlinked, but that is simply
 because hackage is one giant local install, right?
 
 If it's not possible (and it seems not) do any haddock devs have pointers
 on how to implement this?
 
 Thanks,
   -Ryan
 
 P.S.  Someone recommended to me the following simple hack -- just use sed
 to rewrite the links after haddock generates the html.  I think I'll do
 that for the time being unless someone has a better suggestion.

 ___
 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: default instance for IsString

2012-04-22 Thread Brent Yorgey
I do not think this is a bug.  Since type classes are open, GHC does
not do any reasoning of the form X is the only instance in scope, so
I will pick that one.  Other instances could be added at any time
(perhaps in other modules).  In this particular instance, GHC has no
reason to choose the Text instance other than the fact that it is the
only instance in scope -- that is, type inference is not enough to
determine that the Text instance should be chosen.

However, I do agree that it would be nice to have a mechanism for
specifying default instances for arbitrary (user-defined) type
classes.

-Brent

On Sat, Apr 21, 2012 at 09:55:32PM -0700, Greg Weber wrote:
 This is a better demonstration of the issue. I am going to open a GHC
 bug report, as I can't see how this behavior is desirable.
 
 
 {-# LANGUAGE OverloadedStrings #-}
 import Data.Text as T
 
 classNoDefault a  where noDefault :: a - Text
 instance NoDefault T.Text where noDefault = id
 
 main = print (noDefault Hello!)
 
 default.hs:7:15:
 Ambiguous type variable `a0' in the constraints:
   (NoDefault a0) arising from a use of `noDefault'
  at default.hs:7:15-23
   (Data.String.IsString a0) arising from the literal `Hello!'
 at default.hs:7:25-32
 Probable fix: add a type signature that fixes these type variable(s)
 In the first argument of `print', namely `(noDefault Hello!)'
 In the expression: print (noDefault Hello!)
 In an equation for `main': main = print (noDefault Hello!)
 
 
 On Sat, Apr 21, 2012 at 7:51 PM, Greg Weber g...@gregweber.info wrote:
  my actual use case looks more like this:
 
  {-# LANGUAGE OverloadedStrings #-}
  {-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
 
  import Data.Text as T
 
  class ShowT a where
    showT :: a - String
 
  instance ShowT T.Text where
    showT = show
 
  instance ShowT String where
    showT = show
 
  main = print (showT Hello!)
 
     Ambiguous type variable `a0' in the constraints:
       (ShowT a0) arising from a use of `showT' at default.hs:16:15-19
       (Data.String.IsString a0) arising from the literal `Hello!'
 
 
  So I actually want to define a default instance for a typeclass I
  define that uses isString instances.
 
 
 
  On Sat, Apr 21, 2012 at 6:24 PM, Daniel Peebles pumpkin...@gmail.com 
  wrote:
  I think it'll be hard to do that without putting Text in base, which I'm 
  not
  sure anyone wants to do.
 
  Dan
 
  On Sat, Apr 21, 2012 at 8:20 PM, Greg Weber g...@gregweber.info wrote:
 
  I would like to default IsString to use the Text instance to avoid
  ambiguous type errors.
  I see defaulting capability is available for Num. Is there any way to
  do this for IsString?
 
  Thanks,
  Greg Weber
 
  ___
  Glasgow-haskell-users mailing list
  Glasgow-haskell-users@haskell.org
  http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 
 
 
 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
 

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell] ANN: cabal-install-0.14.0

2012-04-17 Thread Brent Yorgey
 selecting cabal-install-0.10.2 (source) and discarding Cabal-1.1.6, ...

Notice it's trying to reinstall the version of cabal-install that you
already have.

After doing 'cabal update', I get

  [byorgey@LVN513-9:~]$ cabal list cabal-install
  * cabal-install
  Synopsis: The command-line interface for Cabal and Hackage.
  Default available version: 0.10.2
  Installed versions: [ Unknown ]
  Homepage: http://www.haskell.org/cabal/
  License:  BSD3

Notice it lists Default available version: 0.10.2.  Maybe this
version of cabal-install is listed as preferred somehow?  I.e. it
seems you have to specify the new version of cabal-install explicitly.

cabal install cabal-install-0.14.0  works fine for me.

-Brent


On Tue, Apr 17, 2012 at 10:13:31AM -0700, Johan Tibell wrote:
 First, congratulations on the release.
 
 Unfortunately I ran into a problem that's not obvious to me:
 
 $ cabal install -v3 Cabal cabal-install
 searching for ghc in path.
 found ghc at /usr/bin/ghc
 (/usr/bin/ghc,[--numeric-version])
 /usr/bin/ghc is version 7.4.1
 looking for tool ghc-pkg near compiler in /usr/bin
 found ghc-pkg in /usr/bin/ghc-pkg
 (/usr/bin/ghc-pkg,[--version])
 /usr/bin/ghc-pkg is version 7.4.1
 (/usr/bin/ghc,[--supported-languages])
 (/usr/bin/ghc,[--info])
 Reading installed packages...
 (/usr/bin/ghc-pkg,[dump,--global,-v0])
 (/usr/bin/ghc-pkg,[dump,--user,-v0])
 (/usr/bin/ghc,[--print-libdir])
 Reading available packages...
 Resolving dependencies...
 applying constraint base 'installed' which excludes base-3.0.3.1,
 base-3.0.3.2, base-4.0.0.0, base-4.1.0.0, base-4.2.0.0, base-4.2.0.1,
 base-4.2.0.2, base-4.3.0.0, base-4.3.1.0, base-4.4.0.0, base-4.4.1.0 and
 base-4.5.0.0
 applying constraint ghc-prim 'installed'
 excluding syb-0.1.0.2 (it cannot be configured)
 excluding syb-0.1.0.3 (it cannot be configured)
 excluding syb-0.2 (it cannot be configured)
 excluding syb-0.2.1 (it cannot be configured)
 excluding syb-0.2.2 (it cannot be configured)
 excluding syb-0.3 (it cannot be configured)
 excluding syb-0.3.1 (it cannot be configured)
 excluding syb-0.3.2 (it cannot be configured)
 excluding syb-0.3.3 (it cannot be configured)
 excluding syb-0.3.4 (it cannot be configured)
 excluding syb-0.3.5 (it cannot be configured)
 excluding unix-2.4.0.0 (it cannot be configured)
 excluding unix-2.4.0.1 (it cannot be configured)
 excluding unix-2.4.0.2 (it cannot be configured)
 excluding unix-2.4.1.0 (it cannot be configured)
 excluding unix-2.4.2.0 (it cannot be configured)
 excluding unix-2.5.0.0 (it cannot be configured)
 excluding directory-1.0.1.0 (it cannot be configured)
 excluding directory-1.0.1.1 (it cannot be configured)
 excluding directory-1.0.1.2 (it cannot be configured)
 excluding directory-1.1.0.0 (it cannot be configured)
 excluding directory-1.1.0.1 (it cannot be configured)
 excluding QuickCheck-1.2.0.0 (it cannot be configured)
 excluding text-0.11.1.0 (it cannot be configured)
 excluding text-0.11.1.1 (it cannot be configured)
 excluding text-0.11.1.2 (it cannot be configured)
 excluding text-0.11.1.3 (it cannot be configured)
 excluding text-0.11.1.5 (it cannot be configured)
 excluding text-0.11.1.6 (it cannot be configured)
 excluding text-0.11.1.7 (it cannot be configured)
 excluding text-0.11.1.8 (it cannot be configured)
 excluding text-0.11.1.9 (it cannot be configured)
 excluding Cabal-1.4.0.0 (it cannot be configured)
 excluding Cabal-1.4.0.1 (it cannot be configured)
 excluding Cabal-1.4.0.2 (it cannot be configured)
 excluding network-2.2.1.8 (it cannot be configured)
 excluding network-2.2.1.9 (it cannot be configured)
 excluding network-2.2.1.10 (it cannot be configured)
 excluding network-2.2.3 (it cannot be configured)
 excluding network-2.2.3.1 (it cannot be configured)
 excluding network-2.3 (it cannot be configured)
 excluding network-2.3.0.1 (it cannot be configured)
 excluding network-2.3.0.2 (it cannot be configured)
 excluding network-2.3.0.3 (it cannot be configured)
 excluding network-2.3.0.4 (it cannot be configured)
 excluding network-2.3.0.5 (it cannot be configured)
 excluding network-2.3.0.6 (it cannot be configured)
 excluding network-2.3.0.7 (it cannot be configured)
 excluding HTTP-3001.1.3 (it cannot be configured)
 excluding HTTP-3001.1.4 (it cannot be configured)
 excluding HTTP-3001.1.5 (it cannot be configured)
 excluding HTTP-4000.0.8 (it cannot be configured)
 excluding HTTP-4000.0.9 (it cannot be configured)
 excluding HTTP-4000.0.10 (it cannot be configured)
 excluding HTTP-4000.1.0 (it cannot be configured)
 excluding HTTP-4000.1.1 (it cannot be configured)
 excluding HTTP-4000.1.2 (it cannot be configured)
 excluding HTTP-4000.2.0 (it cannot be configured)
 excluding HTTP-4000.2.1 (it cannot be configured)
 excluding split-0.1.3 (it cannot be configured)
 excluding split-0.1.4 (it cannot be configured)
 excluding split-0.1.4.1 (it cannot be configured)
 excluding zlib-0.2 (it cannot be configured)
 excluding cabal-install-0.5.0 (it 

Re: [Haskell-cafe] is the evaluation order deterministic when using applicative with IO

2012-03-16 Thread Brent Yorgey
On Fri, Mar 16, 2012 at 12:30:13PM +0100, Twan van Laarhoven wrote:
 
 If you want to avoid the side effects of boolTest2 when boolTest1
 returns true, you will need to implement a monadic or, something like
 
 orM ma mb = do
 a - ma
 if a then return True else mb

Note also that it is *not possible* to have this short-circuiting
behavior using only Applicative.  The structure of an Applicative
computation is always fixed up front, and cannot depend on
intermediate values.

-Brent

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


[Haskell-cafe] Open-source projects for beginning Haskell students?

2012-03-16 Thread Brent Yorgey
Hi everyone,

I am currently teaching a half-credit introductory Haskell class for
undergraduates.  This is the second time I've taught it.  The last
time, for their final project I gave them the option of contributing
to an open-source project; a couple groups took me up on it and I
think it ended up being a modest success.

So I'd like to do it again this time around, and am looking for
particular projects I can suggest to them.  Do you have an open-source
project with a few well-specified tasks that a relative beginner (see
below) could reasonably make a contribution towards in the space of
about four weeks? I'm aware that most tasks don't fit that profile,
but even complex projects usually have a few simple-ish tasks that
haven't yet been done just because no one has gotten around to it
yet.

If you have any such projects, I'd love to hear about it!  

Here are a few more details:

* The students will be working on the projects from approximately the
  end of this month through the end of April.

* By relative beginner I mean someone familiar with the material
  listed here: http://www.cis.upenn.edu/~cis194/lectures.html and just
  trying to come to terms with Applicative and Monad.  They definitely
  do not know much if anything about optimization/profiling, GADTs,
  the mtl, or Haskell-programming-in-the-large.  (Although part of the
  point of the project is to teach them a bit about
  programming-in-the-(medium/large)).

* What I would hope from you is a willingness to exchange email and/or
  chat with the student(s) over the course of the project, to give
  them a bit of guidance/mentoring.  I am certainly willing to help on
  that front, but of course I probably don't know much about your
  particular project.

thanks!
-Brent

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


Re: Bug with unicode characters in file names

2012-03-13 Thread Brent Yorgey
On Tue, Mar 13, 2012 at 06:06:49PM +0100, Volker Wysk wrote:
 
 I'm sending this to glasgow-haskell-users instead of glasgow-haskell-bugs, 
 because the latter does not seem to accept my messages. I receive nothing, 
 neither the message in the mailing list, nor any error message.

As I understand it, the glasgow-haskell-bugs list is for receiving
information about bugs, not for reporting them.  Information on how to
report bugs can be found here:

http://hackage.haskell.org/trac/ghc/wiki/ReportABug

-Brent

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] ANNOUNCE: diagrams 0.5

2012-03-09 Thread Brent Yorgey
I am pleased to announce the release of version 0.5 of diagrams [1], a
full-featured framework and embedded domain-specific language for
declarative drawing. Check out the gallery [2] for examples of what it
can do!

[1] http://projects.haskell.org/diagrams
[2] http://projects.haskell.org/diagrams/gallery.html


Highlights of this release include:

-   A new diagrams-contrib [3] package of user-contributed modules,
which so far contains code for tree drawing, Apollonian gaskets,
planar tilings, wrapped layout, and turtle graphics.

-   Experimental support for animation, built on top of the new active
[4] library.

-   Numerous small additions and improvements, including more general
rounded rectangle shapes and better text support.

-   Much better performance in some common situations, such as laying
out a very long list of diagrams using 'cat' and related
combinators.

-   Added support for GHC 7.4.

See the release notes [5] for complete details, and the diagrams wiki
[6] for help migrating code from 0.4 to 0.5 (changes should be minimal).

[3] http://hackage.haskell.org/package/diagrams%2Dcontrib
[4] http://hackage.haskell.org/package/active
[5] http://projects.haskell.org/diagrams/releases.html
[6] http://www.haskell.org/haskellwiki/Diagrams/Migrate0.5


Try it out
--

For the truly impatient:

cabal install gtk2hs-buildtools
cabal install diagrams

Diagrams is supported under GHC 6.12, 7.0, 7.2, and 7.4. However,
getting cairo to build can be tricky on some platforms; see the
diagrams wiki [8] for more information and workarounds regarding
specific platforms. (A new native SVG backend is in the works,
targeted for the 0.6 release.)

To get started with diagrams, read the quick tutorial [9], which will
introduce you to the fundamentals of the framework.

For those who are even less impatient but want to really dig in and use
the power features, read the user manual [10].

[7]  http://projects.haskell.org/gtk2hs/development/#development
[8]  http://www.haskell.org/haskellwiki/Diagrams
[9]  http://projects.haskell.org/diagrams/tutorial/DiagramsTutorial.html
[10] http://projects.haskell.org/diagrams/manual/diagrams-manual.html


Get involved


Subscribe to the project mailing list [11], and/or come hang out in
the #diagrams IRC channel on freenode.org for help and
discussion. Make some diagrams. Fix some bugs [12]. Submit your cool
examples for inclusion in the gallery or your cool code for inclusion
in the diagrams-contrib package!

[11] http://groups.google.com/group/diagrams-discuss
[12] http://code.google.com/p/diagrams/issues/list


Happy diagramming!

Brought to you by the diagrams team:

-   Peter Hall
-   Ian Ross
-   Michael Sloan
-   Ryan Yates
-   Brent Yorgey

with contributions from:

-   Sam Griffin
-   Claude Heiland-Allen
-   John Lato
-   Vilhelm Sjoberg
-   Luite Stegeman
-   Kanchalai Suveepattananont
-   Scott Walck


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


[Haskell-cafe] ANNOUNCE: diagrams 0.5

2012-03-09 Thread Brent Yorgey
I am pleased to announce the release of version 0.5 of diagrams [1], a
full-featured framework and embedded domain-specific language for
declarative drawing. Check out the gallery [2] for examples of what it
can do!

[1] http://projects.haskell.org/diagrams
[2] http://projects.haskell.org/diagrams/gallery.html


Highlights of this release include:

-   A new diagrams-contrib [3] package of user-contributed modules,
which so far contains code for tree drawing, Apollonian gaskets,
planar tilings, wrapped layout, and turtle graphics.

-   Experimental support for animation, built on top of the new active
[4] library.

-   Numerous small additions and improvements, including more general
rounded rectangle shapes and better text support.

-   Much better performance in some common situations, such as laying
out a very long list of diagrams using 'cat' and related
combinators.

-   Added support for GHC 7.4.

See the release notes [5] for complete details, and the diagrams wiki
[6] for help migrating code from 0.4 to 0.5 (changes should be minimal).

[3] http://hackage.haskell.org/package/diagrams%2Dcontrib
[4] http://hackage.haskell.org/package/active
[5] http://projects.haskell.org/diagrams/releases.html
[6] http://www.haskell.org/haskellwiki/Diagrams/Migrate0.5


Try it out
--

For the truly impatient:

cabal install gtk2hs-buildtools
cabal install diagrams

Diagrams is supported under GHC 6.12, 7.0, 7.2, and 7.4. However,
getting cairo to build can be tricky on some platforms; see the
diagrams wiki [8] for more information and workarounds regarding
specific platforms. (A new native SVG backend is in the works,
targeted for the 0.6 release.)

To get started with diagrams, read the quick tutorial [9], which will
introduce you to the fundamentals of the framework.

For those who are even less impatient but want to really dig in and use
the power features, read the user manual [10].

[7]  http://projects.haskell.org/gtk2hs/development/#development
[8]  http://www.haskell.org/haskellwiki/Diagrams
[9]  http://projects.haskell.org/diagrams/tutorial/DiagramsTutorial.html
[10] http://projects.haskell.org/diagrams/manual/diagrams-manual.html


Get involved


Subscribe to the project mailing list [11], and/or come hang out in
the #diagrams IRC channel on freenode.org for help and
discussion. Make some diagrams. Fix some bugs [12]. Submit your cool
examples for inclusion in the gallery or your cool code for inclusion
in the diagrams-contrib package!

[11] http://groups.google.com/group/diagrams-discuss
[12] http://code.google.com/p/diagrams/issues/list


Happy diagramming!

Brought to you by the diagrams team:

-   Peter Hall
-   Ian Ross
-   Michael Sloan
-   Ryan Yates
-   Brent Yorgey

with contributions from:

-   Sam Griffin
-   Claude Heiland-Allen
-   John Lato
-   Vilhelm Sjoberg
-   Luite Stegeman
-   Kanchalai Suveepattananont
-   Scott Walck


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


Re: [Haskell] Displaying trees in Haskell

2012-03-08 Thread Brent Yorgey
On Thu, Mar 08, 2012 at 03:13:13PM +, John Lato wrote:
  From: Luana Fagarasan luana_0...@yahoo.com
 
  Hello,
 
  I am quite new to Haskell and I am seeking the best way to
  display trees graphically when using Haskell. I have looked on
  the web, but am still not clear!
 
 IMHO Haskell is a good language for this sort of task; there are
 several graphics libraries that I would consider fairly mature and
 reliable.  I have a project that uses diagrams
 (http://hackage.haskell.org/package/diagrams) to draw a tree; the code
 is:

I should also point out that there will be a new release of diagrams
very soon (perhaps even later today), which includes a simple
tree-drawing module.  It may not do everything you might want but I'm
keen on extending it with additional tree layout algorithms.

-Brent

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


Re: [Haskell-cafe] The (!) operation

2012-03-08 Thread Brent Yorgey
On Thu, Mar 08, 2012 at 07:53:48PM +0100, Christopher Done wrote:
 On 8 March 2012 18:32, Anthony Cowley acow...@seas.upenn.edu wrote:
  Perhaps Data.Key meets your needs?
 
  http://hackage.haskell.org/packages/archive/keys/2.1.2/doc/html/Data-Key.html
 
 Ah, perhaps indeed. Thanks!
 
 On 8 March 2012 19:12, Francesco Mazzoli f...@mazzo.li wrote:
  The type signature that you wrote is very generic and doesn't help in
  introducing effects while retrieving the indexed value, which I imagine is
  what you wanted to do.
 
 Because Maybe is already a monad and it's nice to fail in the monad of
 choice, e.g. if I'm in the list monad I get empty list instead, or if
 I'm in the Result monad from JSON it'll fail in there. ‘Course fail
 is suboptimal and MonadError might be better.

Monads have nothing to do with failure.  Instead of Monad you would
want to use something like MonadZero or MonadError.  However, these
are also suboptimal because in monads which carry extra information
about the failure (i.e. anything other than [] or Maybe), the lookup
function now has to make up an error message, when it almost certainly
it doesn't know enough to give a good one.  This is why the use of
Maybe is encouraged: Maybe is the *initial* instance of MonadZero, so
you can map from it to failure in whatever monad you happen to be
using.  Instead of being an annoyance this is encouraged style,
because in doing the conversion *you* get to pick a meaningful error
message.  For example

  fromMaybe (throwError WidgetNotFound) (lookup foo blah)

or

  fromMaybe (Left Missing wurble specification: flozz) (lookup foo blah)

-Brent

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


Re: [Haskell-cafe] FreeSect -- generalised sections syntax extension

2012-03-04 Thread Brent Yorgey
On Sat, Mar 03, 2012 at 10:37:10PM -0500, Ras Far wrote:
 letters correspond to grammar, words, or meaning.  So we've got love,
 too (Aramaic word “Abba” = love of God or so...)

Not quite, it's a familiar/intimate form of father, cf English
papa, dada or daddy.

-Brent

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


Re: Error while installing new packages with GHC 7.4.1

2012-02-29 Thread Brent Yorgey
On Wed, Feb 29, 2012 at 08:02:11PM -0500, Albert Y. C. Lai wrote:
 
 It is possible to fish the output of cabal install --dry-run -v3
 hoogle for why array-0.3.0.3 is brought in. It really is fishing,
 since the output is copious and of low information density. Chinese
 idiom: needle in ocean (haystack is too easy). Example:
 
 selecting hoogle-4.2.8 (hackage) and discarding Cabal-1.1.6, 1.2.1,
 1.2.2.0,
 1.2.3.0, 1.2.4.0, 1.4.0.0, 1.4.0.1, 1.4.0.2, 1.6.0.1, 1.6.0.2, 1.6.0.3,
 1.14.0, blaze-builder-0.1, case-insensitive-0.1,
 
 We see that selecting hoogle-4.2.8 causes ruling out Cabal 1.14.0
 
 Similarly, the line for selecting Cabal-1.12.0 mentions ruling out
 array-0.4.0.0

I wonder about the possibility of making a simple tool to parse the
output of cabal install -v3 and visualize/organize it in some sort of
way to make this process easier.  What might such
visualization/organization look like?

-Brent

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Does somebody know about these functions?

2012-02-28 Thread Brent Yorgey
On Tue, Feb 28, 2012 at 06:06:25PM +0100, Johan Holmquist wrote:
 
 inter :: (a - a - b) - [a] - [b]
 inter f [] = []
 inter f l  = map (uncurry f) $ zip l (tail l)

I've never seen this function defined anywhere, but it looks nice.

 withPair :: (a' - b' - c) - (a - a') - (b - b') - (a,b) - c
 withPair f fa fb (a,b) = fa a `f` fb b

Note that

  withPair f g h === uncurry f . (g *** h)

although using withPair is probably nicer (it certainly involves fewer
parentheses).

-Brent

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


Re: [Haskell-cafe] Using multiplate to get free variables from a syntax tree

2012-02-24 Thread Brent Yorgey
On Thu, Feb 23, 2012 at 01:18:22PM -0800, Matt Brown wrote:
 Hi all,
 
 I'm reading the haskellwiki article on multiplate. Is it possible to
 modify the getVariablesPlate example to return the free variables?
 One idea I had is to store an environment in a reader monad, and use
 local to update the environment at a let expression.  Couldn't figure
 it out, though.  Any ideas?

Hi Matt,

I am not very familiar with Multiplate, but from what I can see it
doesn't seem like this will work.  The code for traversing Let looks
like

  Let $ decl child d * expr child e

The call to 'decl child d' can certainly have some sort of
side-effects which can influence the processing of e -- but
intuitively it seems to me there is no way to *localize* the effects
only to e; it will also affect everything processed afterwards.

If you really do want to compute free variables (not just test the
limits of Multiplate), you may be interested in taking a look at
Unbound:

  http://hackage.haskell.org/package/unbound

-Brent

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


Re: Holes in GHC

2012-02-13 Thread Brent Yorgey
On Sun, Feb 12, 2012 at 02:55:40PM +0100, Andres Löh wrote:
 Hi Thijs.
 
 Sorry if this has been discussed before.
 
 In my opinion, the main advantage of Agda goals is not that the type
 of the hole itself is shown, but that you get information about all
 the locally defined identifiers and their types in the context of the
 hole.

Being able to see the available context is indeed a big advantage, but
even just seeing the type of the hole is really helpful -- I would
certainly use this feature if it were available in Haskell.  And we
have to start somewhere, don't we?  There is certainly no reason we
can't later *add* ways of extracting information about the context of
a hole.

 as others have indicated, it can relatively easily be simulated
 already.

I don't think this is true.  The wiki page includes a discussion of
the current methods for simulating holes and their (substantial)
disadvantages.  In order to be useful it seems to me that it must be
possible to

  (1) obtain the inferred type of a hole
  (2) while still allowing the enclosing module to type check.

As far as I know, none of the existing solutions satisfy (2).

-Brent


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] how to print out intermediate results in a recursive function?

2012-02-04 Thread Brent Yorgey
On Sat, Feb 04, 2012 at 12:23:07PM -0600, Qi Qi wrote:
 Hello,
 
 I have a question;how can I print out the intermediate number lists in a
 mergesort recursive function like the following one.
 
 merge [] ys = ys
 merge xs [] = xs
 merge (x:xs) (y:ys) = if x = y
   then x : merge xs (y:ys)
   else y : merge (x:xs) ys
 
 mergesort [] = []
 mergesort [x] = [x]
 mergesort xs = let (as, bs) = splitAt (length xs `quot` 2) xs
in merge (mergesort as) (mergesort bs)
 
 main = do
print $ mergesort [5,4,3,2,1]
   
 
 In the main function, it only prints out the final number list. But I'd
 like to print out the number lists in every recursive level. How can I
 do that? Thanks.

For visualizing intermediate steps for the purpose of
debugging, there is also the very nice hood package:

  http://hackage.haskell.org/package/hood

-Brent

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


  1   2   3   4   5   6   7   >