Am Dienstag, den 14.09.2010, 13:31 -0600 schrieb Jonathan Geddes:
Wow, I had no idea there were so many record packages!
The trouble is that only one of them (i.e., mine) is categorized under
“Records” on Hackage.
Best wishes,
Wolfgang
___
Wow, I had no idea there were so many record packages! This indicates a
couple things to me: a) Haskell is very flexible. b) I'm not the only one
who things the built-in record system isn't perfect.
Digging a bit deeper, it looks like some of the record-related ghc
extensions might also be
On 15 September 2010 04:31, Jonathan Geddes geddes.jonat...@gmail.com wrote:
Wow, I had no idea there were so many record packages! This indicates a
couple things to me: a) Haskell is very flexible. b) I'm not the only one
who things the built-in record system isn't perfect.
Digging a bit
On Tue, Sep 14, 2010 at 1:31 PM, Jonathan Geddes
geddes.jonat...@gmail.com wrote:
With these extensions, couldn't I write the following?
someUpdate :: MyRecord - MyRecord
someUpdate myRecord@(MyRecord{..}) = let
{ field1 = f field1
, field2 = g field2
, field3 = h filed3
} in
Am Samstag, den 11.09.2010, 11:21 -0600 schrieb Jonathan Geddes:
I know that record updates is a topic that has become a bit of a dead
horse, but here I go anyway:
I find that most of the record updates I read and write take the form
someUpdate :: MyRecord - MyRecord
someUpdate myRecord =
For completeness, using fclabels (yet another record package) you can write it
like this:
{-# LANGUAGE TemplateHaskell #-}
module Records where
import Data.Record.Label
data MyRecord = MyRecord { _field1 :: String, _field2 :: Int, _field3 :: Bool
}
$(mkLabels [''MyRecord])
I know that record updates is a topic that has become a bit of a dead
horse, but here I go anyway:
I find that most of the record updates I read and write take the form
someUpdate :: MyRecord - MyRecord
someUpdate myRecord = myRecord
{ field1 = f $ field1 myRecord
, field2 = g $ field2
Jonathan Geddes schrieb:
I know that record updates is a topic that has become a bit of a dead
horse, but here I go anyway:
I find that most of the record updates I read and write take the form
someUpdate :: MyRecord - MyRecord
someUpdate myRecord = myRecord
{ field1 = f $ field1
On Sat, Sep 11, 2010 at 11:53 AM, Henning Thielemann
schlepp...@henning-thielemann.de wrote:
Jonathan Geddes schrieb:
I know that record updates is a topic that has become a bit of a dead
horse, but here I go anyway:
I find that most of the record updates I read and write take the form
On 11 September 2010 18:21, Jonathan Geddes geddes.jonat...@gmail.com wrote:
someUpdate :: MyRecord - MyRecord
someUpdate myRecord = myRecord
{ field1 = f $ field1 myRecord
, field2 = g $ field2 myRecord
, field3 = h $ filed3 myRecord
}
Applicatively, using no additional
On Sat, 11 Sep 2010, Jonathan Geddes wrote:
On Sat, Sep 11, 2010 at 11:53 AM, Henning Thielemann
data-accessor and similar packages may become your friends.
data-accessor allows you to write:
someUpdate =
(field1 ^: f) .
(field2 ^: g) .
(field3 ^: h)
data-accessor is a pretty cool
On Sat, 11 Sep 2010, Stephen Tetley wrote:
On 11 September 2010 18:21, Jonathan Geddes geddes.jonat...@gmail.com wrote:
someUpdate :: MyRecord - MyRecord
someUpdate myRecord = myRecord
{ field1 = f $ field1 myRecord
, field2 = g $ field2 myRecord
, field3 = h $ filed3 myRecord
On 11 September 2010 20:45, Henning Thielemann
lemm...@henning-thielemann.de wrote:
It uses the Applicative instance for functions.
Yep - I meant that, but somehow didn't write it, then pressed the send button...
___
Haskell-Cafe mailing list
I've seen a couple of package being announced that provide first class
labels, and other packages already existed for this (Grapefruit
Record, HList, Accessor, ...)
Regarding this, I have a question about the performance of multiple
composed field updates. Maybe an example.
Suppose I have a
The first thing I would do i is verify that the compiler is not
already doing this.
On Sun, Sep 6, 2009 at 7:50 AM, Peter Verswyvelenbugf...@gmail.com wrote:
I've seen a couple of package being announced that provide first class
labels, and other packages already existed for this (Grapefruit
Use Haskell records:
defaultWindowDescription= WindowDescription {title=, size=(0,0) ..}
Many modifications can be fused in a single statement. for example:
newWindowDescription= defaultWindowDescription{itle= Haskell ; size=
(640,480),background= Blue}
2009/9/6 Derek Elkins
Yes of course Haskell records do this, but these updates are not first class.
But this kind of fusion seems rather general.
I haven't checked if the compiler already does it.
On Sun, Sep 6, 2009 at 9:19 PM, Alberto G. Coronaagocor...@gmail.com wrote:
Use Haskell records:
17 matches
Mail list logo