[Haskell] PROPOSAL: Record field type inference

2014-06-03 Thread John Meacham
This is also available as html at

http://repetae.net/computer/jhc/record_inference.html

Record Type Inference
=

An extension to the named field mechanism that will greatly enhance the
utility of them when combined with the existing `DisambiguateRecordFields`,
`RecordPuns`, and `RecordWildCards`.

The proposal is to allow the types of record fields to be inferred by the
normal type inference engine. It would look like

 {.haskell}
data Rec = Rec {fieldA,fieldB,fieldC}

f Rec { .. } = Rec { .. } where
fieldA = True
fieldB = 4


This would infer the types `Bool`, `Int`, and `forall a . a` for the fields of
the record constructor and `f :: Rec -> Rec` for f. For the purposes of type
checking the fields are treated as monomorphic and not generalized but
defaulted like normal after typechecking the module. Other than infering the
types of the record fields, the records have the normal syntax. The extensions
`RecordPuns`, `RecordWildCards` and `DisambiguateRecordFields` will be enabled
when record field inference is enabled.

Selector functions will not be created for infered records, as in, the names
are field labels and not functions. This means they do not share a namespace
with functions and do not conflict with each other. Multiple records may have
the same field names in the same module. This means the following is fine.

 {.haskell}
data Rec1 = Rec1 {input, withFoo, withoutFoo }
data Rec2 = Rec2 {input, withBar, withoutBar }

f Rec1 { .. } = case input of
[] -> Rec1 { .. }
(x:xs) -> if hasFoo x
then Rec1 { withFoo = x:withFoo, .. }
else Rec1 { withoutFoo = x:withoutFoo, .. }


Possible extensions
---

### as-pattern disambiguation

In order to make the disambiguation of record fields more useful without
relying on the type checker for disambiguation, We can declare that variables
explicitly bound to a constsructor in a pattern match use that constructor to
disambiguate fields for operations on the variable. This is a purely syntactic
transformation that can happen before typechecking. It can be used as follows.

 {.haskell}
-- use the input bound by a Rec1 to update the input bound by a Rec2
f r1@Rec1 { input } r2@Rec2 {} = case input of
xs | any hasBar xs = f r1 { input = [] } r2 { input }


### Field label inference

It is concievable that we may want to infer the fields themselves of a record,
as in:

 {.haskell}
-- infer that R has the field labels bob and susan
data R = R { ..}
f x@R {bob} = R {susan = bob}


In order to implement this, a pass through the file will collect every field
label that is used with an explicit R constructor and treat the record as if
it were declared with those names as infered fields.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Core libraries committee seeking self-nominations

2014-06-03 Thread Edward Kmett
The first year of the Haskell Core Libraries Committee
 is winding
down, and we are seeking self-nominations to replace two outgoing committee
members.

Doug Beardsley and Brent Yorgey have offered to be the first two members of
the committee to have their slots come up for renewal.

To nominate yourself, please send an email to
core-libraries-commit...@haskell.org by June 30th and include any
information that you think will help us reach a decision.

The core libraries committee acts as the collective maintainer of many
packages that glue together the Haskell Platform, but which otherwise do
not have an individual maintainer. See Library Submissions
 for more details
about which packages fall to the committee for maintenance.

As we are now talking on more of the implementation effort for the
Applicative-Monad Proposal, bringing Foldable and Traversable into Prelude,
performing active maintenance on vector, etc., you should be forewarned
that these are becoming increasingly active positions now that GHC 7.8 has
shipped and we are ramping up for more active participation in the GHC
release process.

Regards,
Edward Kmett
Haskell Core Libraries Committee Chair
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ICFP 2014 Student Volunteer Programme

2014-06-03 Thread David Van Horn
[With apologies for cross-posting]
Please forward this to anyone who may be interested!

ICFP Student Volunteer Programme
http://icfpconference.org/icfp2014/sv.html

We are looking for student volunteers to help with the running of ICFP
2014 in Gothenburg, Sweden. If you are a student (part-time,
full-time, undergraduate, masters or PhD), and would like free
registration in exchange for helping out, please consider applying!

As a student volunteer, you will receive the following:

* Free conference registration, including workshops and electronic proceedings
* Free lunches and refreshments during breaks.
* Free conference banquet ticket and access to student-only social events.
* An ICFP 2014 Student Volunteers T-shirt.

In return you will be expected to help with the running of the
conference. Possible jobs include assisting with technical sessions,
workshops, tutorials and panels and helping at the registration desk.

Please note that student volunteers are responsible for their own
travel arrangements and accommodation.

You should be available for at least three full days between 31st of
August and the 6th of September 2014 in order to offer 16 hours of
volunteering work. Note that we will prioritise students who will be
available the full week. Naturally presentations etc. at workshops and
technical sessions take precedence.

Application Deadline: 15th June 2014
Initial Acceptance and Reserve List announcement: 30th June 2014

For more information, and instructions on how to apply, please see the
student volunteer information page at
http://icfpconference.org/icfp2014/sv.html.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell